| | |
| | | AND t2.device_type = 7 |
| | | LEFT JOIN pole t3 ON t3.id = t2.pole_id |
| | | <where> |
| | | <if test="keyword != null and keyword != ''"> |
| | | AND t3.pole_name LIKE CONCAT(CONCAT('%', #{keyword}), '%') |
| | | OR t1.device_serial LIKE CONCAT(CONCAT('%', #{keyword}), '%') |
| | | OR t1.note LIKE CONCAT(CONCAT('%', #{keyword}), '%') |
| | | OR t3.pole_code LIKE CONCAT(CONCAT('%', #{keyword}), '%') |
| | | <if test="list != null"> |
| | | t1.device_serial IN |
| | | <foreach collection="list" open="(" close=")" separator="," item="deviceCode"> |
| | | #{deviceCode} |
| | | </foreach> |
| | | </if> |
| | | <if test="bindingState != 2"> |
| | | AND t1.binding_state = #{bindingState} |
| | |
| | | <if test="equipmentState != 2"> |
| | | AND t1.equipment_state = #{equipmentState} |
| | | </if> |
| | | <if test="userid != null"> |
| | | AND (t3.user_id = #{userid} OR t3.client_id = #{userid}) |
| | | </if> |
| | | </where> |
| | | </select> |
| | | <select id="listMonitorDeviceSerial" resultType="java.lang.String"> |
| | | SELECT device_serial FROM monitor; |
| | | SELECT |
| | | device_serial |
| | | FROM |
| | | monitor t1 |
| | | LEFT JOIN pole_binding t2 ON t1.device_serial = t2.device_code |
| | | AND t2.device_type = 7 |
| | | LEFT JOIN pole t3 ON t3.id = t2.pole_id |
| | | <where> |
| | | <if test="userid != null"> |
| | | AND (t3.user_id = #{userid} OR t3.client_id = #{userid}) |
| | | </if> |
| | | <if test="keyword != null and keyword != ''"> |
| | | AND ( t3.pole_name LIKE CONCAT(CONCAT('%', #{keyword}), '%') |
| | | OR t1.device_serial LIKE CONCAT(CONCAT('%', #{keyword}), '%') |
| | | OR t1.note LIKE CONCAT(CONCAT('%', #{keyword}), '%') |
| | | OR t3.pole_code LIKE CONCAT(CONCAT('%', #{keyword}), '%')) |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | </mapper> |