From 0a30812acaa26ebe654340f7e749a6801b63b194 Mon Sep 17 00:00:00 2001
From: liuhaonan <31457034@qq.com>
Date: 星期五, 21 十月 2022 16:32:36 +0800
Subject: [PATCH] changes

---
 dao/src/main/resources/mapper/AirDataNongGengMapper.xml |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/dao/src/main/resources/mapper/AirDataNongGengMapper.xml b/dao/src/main/resources/mapper/AirDataNongGengMapper.xml
index bde6712..38a703c 100644
--- a/dao/src/main/resources/mapper/AirDataNongGengMapper.xml
+++ b/dao/src/main/resources/mapper/AirDataNongGengMapper.xml
@@ -46,6 +46,7 @@
         MAX(t1.id) AS air_id
         FROM
         air_data_nong_geng t1
+        left join air_equipment_nong_geng t4 on t4.mac = t1.mac
         <if test="keyword != null and keyword != ''">
             LEFT JOIN pole_binding t2 ON t1.mac = t2.device_code
             AND t2.device_type = 11
@@ -55,6 +56,10 @@
             1=1
             <if test="keyword != null and keyword != ''">
                 AND t3.pole_name LIKE CONCAT(CONCAT('%', #{keyword}), '%')
+                or t1.mac LIKE CONCAT(CONCAT('%', #{keyword}), '%')
+            </if>
+            <if test="type != null">
+                AND t4.type = #{type}
             </if>
             <if test="userid != null">
                 AND (t3.user_id = #{userid} OR t3.client_id = #{userid})
@@ -79,5 +84,19 @@
             </foreach>
         </where>
     </select>
+    <select id="historyData" resultType="com.sandu.ximon.dao.bo.AirDataNongGengBo"
+            parameterType="java.lang.String">
+        SELECT t1.*,
+               t3.id AS pole_id,
+               t3.pole_name
+        FROM air_data_nong_geng t1
+                 LEFT JOIN air_equipment_nong_geng t4 ON t4.mac = t1.mac
+                 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 t1.mac = #{mac}
+        ORDER BY t1.id DESC
+
+    </select>
 
 </mapper>

--
Gitblit v1.9.3