2021与蓝度共同重构项目,服务端
zhanzhiqin
2022-08-05 fa67baf45a7f92ce1705cef48538f62c80c159b9
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?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.AirEquipmentMapper">
 
    <resultMap id="BaseResultMap" type="com.sandu.ximon.dao.domain.AirEquipment">
            <id property="id" column="id" jdbcType="BIGINT"/>
            <result property="mac" column="mac" jdbcType="VARCHAR"/>
            <result property="airMac" column="air_mac" jdbcType="VARCHAR"/>
            <result property="deviceType" column="device_type" jdbcType="VARCHAR"/>
            <result property="moduleWarmUpStatusFlag" column="module_warm_up_status_flag" jdbcType="VARCHAR"/>
            <result property="temperature" column="temperature" jdbcType="INTEGER"/>
            <result property="humidity" column="humidity" jdbcType="INTEGER"/>
            <result property="windSpeed" column="wind_speed" jdbcType="INTEGER"/>
            <result property="windDirection" column="wind_direction" jdbcType="INTEGER"/>
            <result property="windPower" column="wind_power" jdbcType="INTEGER"/>
            <result property="pressure" column="pressure" jdbcType="INTEGER"/>
            <result property="lightIntensity" column="light_intensity" jdbcType="INTEGER"/>
            <result property="noise" column="noise" jdbcType="INTEGER"/>
            <result property="pm25" column="pm25" jdbcType="INTEGER"/>
            <result property="pm10" column="PM10" jdbcType="INTEGER"/>
            <result property="tsp" column="tsp" jdbcType="INTEGER"/>
            <result property="rain" column="rain" jdbcType="INTEGER"/>
            <result property="so2" column="so2" jdbcType="INTEGER"/>
            <result property="ech2o" column="ech2o" jdbcType="INTEGER"/>
            <result property="no2" column="no2" jdbcType="INTEGER"/>
            <result property="tvoc" column="tvoc" jdbcType="INTEGER"/>
            <result property="co" column="co" jdbcType="INTEGER"/>
            <result property="co2" column="co2" jdbcType="INTEGER"/>
            <result property="o3" column="o3" jdbcType="INTEGER"/>
            <result property="fluoride" column="fluoride" jdbcType="INTEGER"/>
            <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
    </resultMap>
 
    <select id="listAirEquipmentByIds" resultType="com.sandu.ximon.dao.bo.AirEquipmentBo">
        SELECT
        t1.*, t2.pole_id,
        t3.pole_name
        FROM
        air_equipment t1
        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
        <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>