2021与蓝度共同重构项目,服务端
fix
zhanzhiqin
2022-01-06 e525cffa5ae93048d0ac1208d100e08bc69a4a3a
dao/src/main/resources/mapper/WaterQualityEquipmentMapper.xml
@@ -26,28 +26,6 @@
    </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,
@@ -57,12 +35,16 @@
        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>