From 782e84d68779471c0640584678d4c4df3afa80a2 Mon Sep 17 00:00:00 2001 From: 于紫祥_1901 <email@yuzixiang_1910> Date: Mon, 14 Dec 2020 17:29:08 +0800 Subject: [PATCH] 电子屏 --- src/main/resources/mapper/HistoryFiveMinutelyMapper.xml | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/src/main/resources/mapper/HistoryFiveMinutelyMapper.xml b/src/main/resources/mapper/HistoryFiveMinutelyMapper.xml index 3c8e2b7..642d314 100644 --- a/src/main/resources/mapper/HistoryFiveMinutelyMapper.xml +++ b/src/main/resources/mapper/HistoryFiveMinutelyMapper.xml @@ -20,4 +20,16 @@ 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> </mapper> \ No newline at end of file -- Gitblit v1.8.0