2021与蓝度共同重构项目,服务端
Van333
2022-12-29 727a69f859060093e685582fa10e5de82dcc138a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.sandu.ximon.dao.mapper.C3mReportErrorMapper">
 
    <resultMap id="BaseResultMap" type="com.sandu.ximon.dao.domain.C3mReportError">
        <id property="c3mErrorId" column="c3m_error_id" jdbcType="BIGINT"/>
        <result property="c3Mac" column="c3_mac" jdbcType="VARCHAR"/>
        <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
        <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
        <result property="errorMsg" column="error_msg" jdbcType="VARCHAR"/>
    </resultMap>
 
    <select id="listReportError" resultType="com.sandu.ximon.dao.bo.C3ReportErrorBo">
        SELECT
        t1.*,
        t4.pole_name as pole_name,
        t4.id as pole_id
        FROM
        c3m_report_error t1
        LEFT JOIN c3m_charging t2 ON t1.c3_mac = t2.c3_mac
        LEFT JOIN pole_binding t3 ON t2.mcu_udid = t3.device_code
        AND t3.device_type = 2
        LEFT JOIN pole t4 ON t4.id = t3.pole_id
        <where>
            <if test="userid != null">
                AND (t4.user_id = #{userid} OR t4.client_id = #{userid})
            </if>
        </where>
    </select>
 
</mapper>