From 6992aaf0587c09f7c511c1afd12e1519d91363d3 Mon Sep 17 00:00:00 2001
From: cjl <276999030@qq.com>
Date: Thu, 14 Dec 2023 15:38:45 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/cjl' into qa

---
 screen-api/src/main/resources/mapper/HistoryFiveMinutelyMapper.xml |   26 ++++++++++++++++++--------
 1 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/screen-api/src/main/resources/mapper/HistoryFiveMinutelyMapper.xml b/screen-api/src/main/resources/mapper/HistoryFiveMinutelyMapper.xml
index 1acd877..ffb0a1b 100644
--- a/screen-api/src/main/resources/mapper/HistoryFiveMinutelyMapper.xml
+++ b/screen-api/src/main/resources/mapper/HistoryFiveMinutelyMapper.xml
@@ -6,20 +6,30 @@
     <select id="getAreaWindData" resultType="com.moral.api.pojo.dto.Wind.WindData">
         SELECT
         d.longitude AS longitude,
-        d.latitude AS latitude,
+        d.latitude AS latitude,d.mac,
         CASE WHEN
         h.value->'$.a01007' = 0 THEN 0.1 ELSE h.value->'$.a01007' END AS windSpeed,
         h.value->'$.a01008' AS windDir
         FROM history_five_minutely_${timeUnits} h ,
         `device` AS d
-        WHERE d.mac = h.mac
-        AND d.mac IN
-        (SELECT mac FROM device WHERE is_delete = '0' and monitor_point_id IN
-            <foreach item="monitorPointId" collection="monitorPointIds" index="index" open="(" separator="," close=")">
-                #{monitorPointId}
-            </foreach>
-        )
+        WHERE d.is_delete = '0'
+        AND d.mac = h.mac
+        AND d.monitor_point_id IN
+        <foreach item="monitorPointId" collection="monitorPointIds" index="index" open="(" separator="," close=")">
+            #{monitorPointId}
+        </foreach>
         AND h.time = (SELECT max(time) FROM history_five_minutely_${timeUnits})
     </select>
 
+    <select id="listResult" resultType="com.moral.api.entity.HistoryFiveMinutely">
+        SELECT mac,time,value FROM history_five_minutely${table}
+        WHERE (mac = #{mac} AND time BETWEEN #{startDate} AND #{endDate})
+        order by time desc
+    </select>
+    <select id="listResultOne" resultType="com.moral.api.entity.HistoryFiveMinutely">
+        SELECT mac,time,value FROM history_five_minutely${table}
+        WHERE (mac = #{mac})
+        order by time desc
+        limit 1
+    </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.8.0