2021与蓝度共同重构项目,服务端
chenjiantian
2021-12-17 a0587b1f268b8535ed660fbc521d341d9268340a
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
34
35
<?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.LightReportErrorMapper">
 
    <resultMap id="BaseResultMap" type="com.sandu.ximon.dao.domain.LightReportError">
            <id property="lightReportErrorId" column="light_report_error_id" jdbcType="BIGINT"/>
            <result property="deviceCode" column="device_code" jdbcType="VARCHAR"/>
            <result property="errorCode" column="error_code" jdbcType="INTEGER"/>
            <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
            <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
    </resultMap>
    <resultMap id="listReportError" type="com.sandu.ximon.dao.bo.LightReportErrorBo" extends="BaseResultMap">
        <result property="poleName" column="pole_name" jdbcType="INTEGER"/>
    </resultMap>
 
    <select id="listReportError" resultMap="listReportError">
        SELECT
            t1.*,
            t2.pole_name
        FROM
            light_report_error t1
                LEFT JOIN pole t2 USING ( device_code )
        <where>
            <if test="keyword != null and keyword != ''">
                AND (
                t1.device_code LIKE CONCAT('%', #{keyword},'%')
                OR t2.pole_name LIKE CONCAT('%', #{keyword},'%')
                )
            </if>
        </where>
        ORDER BY t1.light_report_error_id DESC
    </select>
</mapper>