| | |
| | | </select> |
| | | |
| | | |
| | | <select id="WaterQualityEquipmentId" resultType="java.lang.Long"> |
| | | SELECT |
| | | MAX(t1.id) AS water_quality_equipment_id |
| | | FROM |
| | | water_quality_equipment t1 |
| | | <if test="keyword != null and keyword != ''"> |
| | | LEFT JOIN pole_binding t2 ON t1.water_quality_equipment_code = t2.device_code |
| | | AND t2.device_type = 4 |
| | | LEFT JOIN pole t3 ON t3.id = t2.pole_id |
| | | </if> |
| | | <where> |
| | | <if test="keyword != null and keyword != ''"> |
| | | AND t3.pole_name LIKE CONCAT(CONCAT('%', #{keyword}), '%') |
| | | </if> |
| | | <if test="clientId != null"> |
| | | AND t3.client_id = #{clientId} |
| | | </if> |
| | | </where> |
| | | GROUP BY |
| | | t1.water_quality_equipment_code |
| | | </select> |
| | | |
| | | <select id="listWaterQualityEquipmentByIds" resultType="com.sandu.ximon.dao.bo.WaterQualityEquipmentBo"> |
| | | SELECT |
| | | t1.*, t2.pole_id, |
| | |
| | | LEFT JOIN pole_binding t2 ON t1.water_quality_equipment_code = t2.device_code |
| | | AND t2.device_type = 4 |
| | | LEFT JOIN pole t3 ON t3.id = t2.pole_id |
| | | |
| | | <where> |
| | | t1.id IN |
| | | <foreach collection="waterQualityEquipmentIdList" open="(" close=")" item="airId" separator=","> |
| | | #{airId} |
| | | </foreach> |
| | | <if test="keyword != null and keyword != ''"> |
| | | AND t3.pole_name LIKE CONCAT(CONCAT('%', #{keyword}), '%') |
| | | </if> |
| | | <if test="clientId != null"> |
| | | AND t3.client_id = #{clientId} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | |
| | | </mapper> |