2021与蓝度共同重构项目,服务端
liuhaonan
2022-10-21 0a30812acaa26ebe654340f7e749a6801b63b194
dao/src/main/resources/mapper/AirDataNongGengMapper.xml
@@ -46,6 +46,7 @@
        MAX(t1.id) AS air_id
        FROM
        air_data_nong_geng t1
        left join air_equipment_nong_geng t4 on t4.mac = t1.mac
        <if test="keyword != null and keyword != ''">
            LEFT JOIN pole_binding t2 ON t1.mac = t2.device_code
            AND t2.device_type = 11
@@ -55,6 +56,10 @@
            1=1
            <if test="keyword != null and keyword != ''">
                AND t3.pole_name LIKE CONCAT(CONCAT('%', #{keyword}), '%')
                or t1.mac LIKE CONCAT(CONCAT('%', #{keyword}), '%')
            </if>
            <if test="type != null">
                AND t4.type = #{type}
            </if>
            <if test="userid != null">
                AND (t3.user_id = #{userid} OR t3.client_id = #{userid})
@@ -79,5 +84,19 @@
            </foreach>
        </where>
    </select>
    <select id="historyData" resultType="com.sandu.ximon.dao.bo.AirDataNongGengBo"
            parameterType="java.lang.String">
        SELECT t1.*,
               t3.id AS pole_id,
               t3.pole_name
        FROM air_data_nong_geng t1
                 LEFT JOIN air_equipment_nong_geng t4 ON t4.mac = t1.mac
                 LEFT JOIN pole_binding t2 ON t1.mac = t2.device_code
            AND t2.device_type = 11
                 LEFT JOIN pole t3 ON t3.id = t2.pole_id
        WHERE t1.mac = #{mac}
        ORDER BY t1.id DESC
    </select>
</mapper>