| | |
| | | </if> |
| | | </where> |
| | | </select> |
| | | <select id="listLightOnBinding" resultType="com.sandu.ximon.dao.bo.LightBo"> |
| | | SELECT |
| | | t1.*, |
| | | t2.id AS pole_id, |
| | | t2.pole_code, |
| | | t2.pole_name, |
| | | t4.task_name |
| | | FROM |
| | | light t1 |
| | | LEFT JOIN pole t2 USING ( device_code ) |
| | | 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 test="clientId != null"> |
| | | AND (t2.user_id = #{clientId} OR t2.client_id = #{clientId}) |
| | | </if> |
| | | <if test="keyword != null and keyword != ''"> |
| | | AND ( |
| | | t1.device_code LIKE CONCAT('%', #{keyword},'%') |
| | | OR t1.light_id LIKE CONCAT('%', #{keyword},'%') |
| | | ) |
| | | </if> |
| | | </where> |
| | | </select> |
| | | </mapper> |