| | |
| | | <select id="listLed" resultType="com.sandu.ximon.dao.domain.PoleLightemitEntity"> |
| | | SELECT |
| | | t1.*, t2.pole_id as streetlight_id, |
| | | t3.pole_name as streetlight_name, t3.id |
| | | t3.pole_name as streetlight_name, t3.id |
| | | FROM |
| | | pole_lightemit t1 |
| | | LEFT JOIN pole_binding t2 ON t1.lightemit_control_code = t2.device_code |
| | |
| | | LEFT JOIN pole t3 ON t3.id = t2.pole_id |
| | | <where> |
| | | <if test="keyword != null and keyword != ''"> |
| | | AND t1.lightemit_name LIKE CONCAT(CONCAT('%', #{keyword}), '%') |
| | | AND (t1.lightemit_name LIKE CONCAT(CONCAT('%', #{keyword}), '%') |
| | | OR t1.lightemit_control_code LIKE CONCAT(CONCAT('%', #{keyword}), '%') |
| | | OR t1.lightemit_id LIKE CONCAT(CONCAT('%', #{keyword}), '%') |
| | | OR t1.lightemit_id LIKE CONCAT(CONCAT('%', #{keyword}), '%')) |
| | | </if> |
| | | <if test="userid != null"> |
| | | AND (t3.user_id = #{userid} OR t3.client_id = #{userid}) |
| | |
| | | AND t3.lightemit_control_code = #{lightemitControlCode} |
| | | </if> |
| | | </select> |
| | | <select id="listLedOnBinding" resultType="com.sandu.ximon.dao.domain.PoleLightemitEntity"> |
| | | SELECT |
| | | t1.*, t2.pole_id as streetlight_id, |
| | | t3.pole_name as streetlight_name, t3.id |
| | | FROM |
| | | pole_lightemit t1 |
| | | LEFT JOIN pole_binding t2 ON t1.lightemit_control_code = t2.device_code |
| | | AND t2.device_type = 10 |
| | | LEFT JOIN pole t3 ON t3.id = t2.pole_id |
| | | <where> |
| | | <if test="keyword != null and keyword != ''"> |
| | | AND (t1.lightemit_name LIKE CONCAT(CONCAT('%', #{keyword}), '%') |
| | | OR t1.lightemit_control_code LIKE CONCAT(CONCAT('%', #{keyword}), '%')) |
| | | </if> |
| | | <if test="userid != null"> |
| | | AND (t3.user_id = #{userid} OR t3.client_id = #{userid}) |
| | | </if> |
| | | </where> |
| | | </select> |
| | | </mapper> |