2021与蓝度共同重构项目,服务端
fix
zhanzhiqin
2022-01-06 e525cffa5ae93048d0ac1208d100e08bc69a4a3a
dao/src/main/resources/mapper/AirEquipmentMapper.xml
@@ -5,9 +5,9 @@
<mapper namespace="com.sandu.ximon.dao.mapper.AirEquipmentMapper">
    <resultMap id="BaseResultMap" type="com.sandu.ximon.dao.domain.AirEquipment">
            <id property="id" column="id" jdbcType="BIGINT"/>
            <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
            <result property="mac" column="mac" jdbcType="VARCHAR"/>
        <id property="id" column="id" jdbcType="BIGINT"/>
        <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
        <result property="mac" column="mac" jdbcType="VARCHAR"/>
    </resultMap>
    <sql id="Base_Column_List">
@@ -15,28 +15,6 @@
        create_time,user_id,light_pole_id,
        mac
    </sql>
    <select id="listAirEquipmentId" resultType="java.lang.Long">
        SELECT
        MAX(t1.id) AS air_equipment_id
        FROM
        air_equipment t1
        <if test="keyword != null and keyword != ''">
            LEFT JOIN pole_binding t2 ON t1.mac = t2.device_code
            AND t2.device_type = 3
            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.mac
    </select>
    <select id="listAirEquipmentByIds" resultType="com.sandu.ximon.dao.bo.AirEquipmentBo">
        SELECT
@@ -48,10 +26,13 @@
        AND t2.device_type = 3
        LEFT JOIN pole t3 ON t3.id = t2.pole_id
        <where>
            t1.id IN
            <foreach collection="airEquipmentIdList" 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>