From 4f879df01e855d436c65e1fbdc74f64ce47c901b Mon Sep 17 00:00:00 2001
From: ZhuDongming <773644075@qq.com>
Date: Thu, 30 Apr 2020 16:49:15 +0800
Subject: [PATCH] update小时查询表时判断
---
src/main/resources/mapper/HistoryMapper.xml | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/src/main/resources/mapper/HistoryMapper.xml b/src/main/resources/mapper/HistoryMapper.xml
index 7835d14..4bfc446 100644
--- a/src/main/resources/mapper/HistoryMapper.xml
+++ b/src/main/resources/mapper/HistoryMapper.xml
@@ -216,4 +216,24 @@
AND h.time BETWEEN #{starttime} AND #{endtime}
</select>
+ <!-- ���������sensor������ -->
+ <select id="getCarSensorData" resultType="java.util.LinkedHashMap">
+ SELECT
+ DATE_FORMAT(h.time,'%Y-%m-%d %H:%i:%s') time,
+ <foreach collection="sensorKeys" item="sensorKey" separator=",">
+ h.value->'$.${sensorKey}' as '${sensorKey}'
+ </foreach>
+ FROM
+ history_special as h
+ <where>
+ <if test="mac!=null">
+ and h.mac=#{mac}
+ </if>
+ and h.time >= #{startTime}
+ and h.time <![CDATA[<]]> #{endTime}
+ </where>
+ ORDER BY
+ h.time
+ </select>
+
</mapper>
\ No newline at end of file
--
Gitblit v1.8.0