From 3df4f24049c8b3e4c36fde16a67a436ce37f00ad Mon Sep 17 00:00:00 2001
From: JinPengYong <812110275@qq.com>
Date: Sun, 26 Apr 2020 16:18:30 +0800
Subject: [PATCH] Merge branch 'master' of F:\moral\moral\screen_api_v2 with conflicts.

---
 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..b45afab 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 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