From e55c8b0a92eb9715edd90c31dfd4de51a47b588b Mon Sep 17 00:00:00 2001
From: liuhaonan <31457034@qq.com>
Date: 星期五, 04 十一月 2022 17:40:08 +0800
Subject: [PATCH] changes

---
 dao/src/main/resources/mapper/AirDataMapper.xml |   67 ++++++++++++++++++++-------------
 1 files changed, 41 insertions(+), 26 deletions(-)

diff --git a/dao/src/main/resources/mapper/AirDataMapper.xml b/dao/src/main/resources/mapper/AirDataMapper.xml
index 889c5c3..b17035e 100644
--- a/dao/src/main/resources/mapper/AirDataMapper.xml
+++ b/dao/src/main/resources/mapper/AirDataMapper.xml
@@ -5,30 +5,32 @@
 <mapper namespace="com.sandu.ximon.dao.mapper.AirDataMapper">
 
     <resultMap id="BaseResultMap" type="com.sandu.ximon.dao.domain.AirData">
-        <id property="id" column="id" jdbcType="BIGINT"/>
-        <result property="deviceMac" column="device_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="DOUBLE"/>
-        <result property="humidity" column="humidity" jdbcType="DOUBLE"/>
-        <result property="windSpeed" column="wind_speed" jdbcType="DOUBLE"/>
-        <result property="windDirection" column="wind_direction" jdbcType="DOUBLE"/>
-        <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="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"/>
-        <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
+            <id property="id" column="id" jdbcType="BIGINT"/>
+            <result property="deviceMac" column="device_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="VARCHAR"/>
+            <result property="humidity" column="humidity" jdbcType="VARCHAR"/>
+            <result property="windSpeed" column="wind_speed" jdbcType="VARCHAR"/>
+            <result property="windDirection" column="wind_direction" jdbcType="VARCHAR"/>
+            <result property="windPower" column="wind_power" jdbcType="VARCHAR"/>
+            <result property="pressure" column="pressure" jdbcType="VARCHAR"/>
+            <result property="lightIntensity" column="light_intensity" jdbcType="VARCHAR"/>
+            <result property="noise" column="noise" jdbcType="VARCHAR"/>
+            <result property="pm25" column="pm25" jdbcType="VARCHAR"/>
+            <result property="pm10" column="pm10" jdbcType="VARCHAR"/>
+            <result property="tsp" column="tsp" jdbcType="VARCHAR"/>
+            <result property="rain" column="rain" jdbcType="VARCHAR"/>
+            <result property="ech2o" column="ech2o" jdbcType="VARCHAR"/>
+            <result property="tvoc" column="tvoc" jdbcType="VARCHAR"/>
+            <result property="co2" column="co2" jdbcType="VARCHAR"/>
+            <result property="so2" column="so2" jdbcType="VARCHAR"/>
+            <result property="no2" column="no2" jdbcType="VARCHAR"/>
+            <result property="co" column="co" jdbcType="VARCHAR"/>
+            <result property="o3" column="o3" jdbcType="VARCHAR"/>
+            <result property="fluoride" column="fluoride" jdbcType="VARCHAR"/>
+            <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+            <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
     </resultMap>
 
     <select id="listAirId" resultType="java.lang.Long">
@@ -43,7 +45,8 @@
         </if>
         <where>
             <if test="keyword != null and keyword != ''">
-                AND t3.pole_name LIKE CONCAT(CONCAT('%', #{keyword}), '%')
+                AND (t3.pole_name LIKE CONCAT(CONCAT('%', #{keyword}), '%')
+                OR t1.device_mac  LIKE CONCAT(CONCAT('%', #{keyword}), '%'))
             </if>
             <if test="userid != null">
                 AND (t3.user_id = #{userid} OR t3.client_id = #{userid})
@@ -80,4 +83,16 @@
         </if>
 
     </select>
-</mapper>
\ No newline at end of file
+    <select id="listAirDataHistory" resultType="com.sandu.ximon.dao.bo.AirDataBo">
+        SELECT
+        t1.*, t2.pole_id,
+        t3.pole_name
+        FROM
+        air_data t1
+        LEFT JOIN pole_binding t2 ON t1.device_mac = t2.device_code
+        AND t2.device_type = 3
+        LEFT JOIN pole t3 ON t3.id = t2.pole_id
+        WHERE  t1.device_mac = #{deviceMac}
+        ORDER BY t1.create_time DESC
+    </select>
+</mapper>

--
Gitblit v1.9.3