2021与蓝度共同重构项目,服务端
zhanzhiqin
2022-06-06 1a29f8b47db7d3a205c278fac36deed6b1ef371f
dao/src/main/resources/mapper/LightPoleHeelingProcessingMapper.xml
@@ -5,26 +5,36 @@
<mapper namespace="com.sandu.ximon.dao.mapper.LightPoleHeelingProcessingMapper">
    <resultMap id="BaseResultMap" type="com.sandu.ximon.dao.domain.LightPoleHeelingProcessing">
            <id property="processingNumber" column="processing_number" jdbcType="BIGINT"/>
            <result property="warningNumber" column="warning_number" jdbcType="BIGINT"/>
            <result property="processingOpinion" column="processing_opinion" jdbcType="VARCHAR"/>
            <result property="processingPerson" column="processing_person" jdbcType="VARCHAR"/>
            <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
            <result property="warningLevel" column="warning_level" jdbcType="INTEGER"/>
            <result property="theXAxis" column="the_x_axis" jdbcType="DOUBLE"/>
            <result property="theYAxis" column="the_y_axis" jdbcType="DOUBLE"/>
            <result property="theZAxis" column="the_z_axis" jdbcType="DOUBLE"/>
            <result property="theXAxisOld" column="the_x_axis_old" jdbcType="DOUBLE"/>
            <result property="theYAxisOld" column="the_y_axis_old" jdbcType="DOUBLE"/>
            <result property="theZAxisOld" column="the_z_axis_old" jdbcType="DOUBLE"/>
            <result property="warningLevelOld" column="warning_level_old" jdbcType="INTEGER"/>
        <id property="processingNumber" column="processing_number" jdbcType="BIGINT"/>
        <result property="mac" column="mac" jdbcType="VARCHAR"/>
        <result property="warningNumber" column="warning_number" jdbcType="BIGINT"/>
        <result property="processingOpinion" column="processing_opinion" jdbcType="VARCHAR"/>
        <result property="processingPerson" column="processing_person" jdbcType="VARCHAR"/>
        <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
        <result property="warningLevel" column="warning_level" jdbcType="INTEGER"/>
        <result property="theXAxis" column="the_x_axis" jdbcType="DOUBLE"/>
        <result property="theYAxis" column="the_y_axis" jdbcType="DOUBLE"/>
        <result property="theZAxis" column="the_z_axis" jdbcType="DOUBLE"/>
        <result property="theXAxisOld" column="the_x_axis_old" jdbcType="DOUBLE"/>
        <result property="theYAxisOld" column="the_y_axis_old" jdbcType="DOUBLE"/>
        <result property="theZAxisOld" column="the_z_axis_old" jdbcType="DOUBLE"/>
        <result property="warningLevelOld" column="warning_level_old" jdbcType="INTEGER"/>
    </resultMap>
    <sql id="Base_Column_List">
        processing_number,warning_number,
        processing_opinion,processing_person,create_time,
        warning_level,the_x_axis,the_y_axis,
        the_z_axis,the_x_axis_old,the_y_axis_old,
        the_z_axis_old,warning_level_old
    </sql>
    <select id="processingDetail" resultType="com.sandu.ximon.dao.domain.LightPoleHeelingProcessing">
        SELECT t1.*, t3.pole_code,
        t3.pole_name
        FROM light_pole_heeling_processing t1
        LEFT JOIN pole_binding t2 ON t1.mac = t2.device_code
        AND t2.device_type = 8
        LEFT JOIN pole t3 ON t3.id = t2.pole_id
        <where>
            <if test="processingNumber != null">
                AND t1.processing_number = #{processingNumber}
            </if>
            <if test="userId != null">
                AND (t3.user_id = #{userId} OR t3.client_id = #{userId})
            </if>
        </where>
    </select>
</mapper>