| | |
| | | t3.light_address AS light_address |
| | | FROM |
| | | light t1 |
| | | LEFT JOIN pole_binding t5 USING ( device_code ) |
| | | LEFT JOIN pole t2 ON t2.id=t5.pole_id |
| | | LEFT JOIN pole_binding t5 ON t1.device_code = t5.device_code |
| | | LEFT JOIN pole t2 ON t2.id=t5.pole_id AND t5.device_type=0 |
| | | LEFT JOIN light_task_pole_relation t3 ON t3.pole_id = t2.id |
| | | LEFT JOIN light_task t4 ON t3.task_id = t4.task_id |
| | | <where> |
| | |
| | | ) |
| | | </if> |
| | | <if test="deviceCode != null and deviceCode!= ''"> |
| | | AND t2.device_code = #{deviceCode} |
| | | AND t1.device_code = #{deviceCode} |
| | | </if> |
| | | </where> |
| | | </select> |