From 8fb013a6d6707929799e9f7a8a82f311cbca29ae Mon Sep 17 00:00:00 2001
From: jinpengyong <jpy123456>
Date: Wed, 23 Dec 2020 14:47:04 +0800
Subject: [PATCH] update大屏年,月数据查询接口
---
src/main/resources/mapper/HistoryFiveMinutelyMapper.xml | 27 +++++++++++++++++++++++++++
1 files changed, 27 insertions(+), 0 deletions(-)
diff --git a/src/main/resources/mapper/HistoryFiveMinutelyMapper.xml b/src/main/resources/mapper/HistoryFiveMinutelyMapper.xml
index 3c8e2b7..1c6c1fb 100644
--- a/src/main/resources/mapper/HistoryFiveMinutelyMapper.xml
+++ b/src/main/resources/mapper/HistoryFiveMinutelyMapper.xml
@@ -20,4 +20,31 @@
where h.time = #{time}
and h.mac = #{mac}
</select>
+
+ <select id="getFiveMinutesSersorDataByMacsAndTime" resultType="map">
+ SELECT h.mac,h.time,
+ <foreach collection="sensorKeys" separator="," item="sensorKey">
+ json->'$.${sensorKey}' AS '${sensorKey}'
+ </foreach>
+ from history_five_minutely_${yearAndMonth} h
+ where time = #{time} and mac IN
+ <foreach collection="macs" separator="," open="(" close=")" item="mac">
+ #{mac}
+ </foreach>
+ </select>
+
+ <select id="getFiveMinutesDataByMacsAndTimeSolt" resultType="map">
+ select h.mac,h.time,
+ <foreach collection="sensorKeys" separator="," item="sensorKey">
+ json->'$.${sensorKey}' AS '${sensorKey}'
+ </foreach>
+ FROM history_five_minutely_${yearAndMonth} h
+ WHERE mac IN
+ <foreach collection="macs" separator="," open="(" close=")" item="mac">
+ #{mac}
+ </foreach>
+ AND time BETWEEN #{startTime} AND #{endTime}
+ ORDER BY h.time DESC
+ LIMIT #{macNumber}
+ </select>
</mapper>
\ No newline at end of file
--
Gitblit v1.8.0