2021与蓝度共同重构项目,服务端
liuhaonan
2022-10-21 0a30812acaa26ebe654340f7e749a6801b63b194
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
36
<?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.AirEquipmentNongGengMapper">
 
    <resultMap id="BaseResultMap" type="com.sandu.ximon.dao.domain.AirEquipmentNongGeng">
            <id property="id" column="id" jdbcType="BIGINT"/>
            <result property="mac" column="mac" jdbcType="VARCHAR"/>
            <result property="type" column="type" jdbcType="VARCHAR"/>
            <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
    </resultMap>
 
    <sql id="Base_Column_List">
        id,mac,type,
        create_time
    </sql>
    <select id="listAirEquipmentByIds" resultType="com.sandu.ximon.dao.bo.AirEquipmentNongGengBo">
        SELECT
        t1.*, t2.pole_id,
        t3.pole_name
        FROM
        air_equipment_nong_geng t1
        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>
            <if test="keyword != null and keyword != ''">
                AND t3.pole_name LIKE CONCAT(CONCAT('%', #{keyword}), '%')
            </if>
            <if test="userid != null">
                AND (t3.user_id = #{userid} OR t3.client_id = #{userid})
            </if>
        </where>
    </select>
</mapper>