From 8bfa93e6f92dce08c036766747aa2aba13217280 Mon Sep 17 00:00:00 2001
From: ZhuDongming <773644075@qq.com>
Date: Fri, 16 Aug 2019 11:58:33 +0800
Subject: [PATCH] 删除科学计数转为普通计数方法

---
 src/main/resources/mapper/HistoryMinutelyMapper.xml |   38 ++++++++++++++++++++++++++++++++++++++
 1 files changed, 38 insertions(+), 0 deletions(-)

diff --git a/src/main/resources/mapper/HistoryMinutelyMapper.xml b/src/main/resources/mapper/HistoryMinutelyMapper.xml
index bdcb59e..770c396 100644
--- a/src/main/resources/mapper/HistoryMinutelyMapper.xml
+++ b/src/main/resources/mapper/HistoryMinutelyMapper.xml
@@ -155,4 +155,42 @@
         ORDER BY
         hm.time
     </select>
+
+    <select id="getSensorDataMin" resultType="java.util.LinkedHashMap">
+        SELECT
+        DATE_FORMAT(hm.time,'%Y-%m-%d %H:%i:%s') time,
+        <foreach collection="sensorKeys" item="sensorKey" separator=",">
+            hm.json->'$.${sensorKey}[1]' as '${sensorKey}'
+        </foreach>
+        FROM
+        history_minutely as hm
+        <where>
+            <if test="mac!=null">
+                and hm.mac=#{mac}
+            </if>
+            and hm.time >= #{startTime}
+            and hm.time <![CDATA[<=]]> #{endTime}
+        </where>
+        ORDER BY
+        hm.time
+    </select>
+
+    <select id="getSensorDataMax" resultType="java.util.LinkedHashMap">
+        SELECT
+        DATE_FORMAT(hm.time,'%Y-%m-%d %H:%i:%s') time,
+        <foreach collection="sensorKeys" item="sensorKey" separator=",">
+            hm.json->'$.${sensorKey}[2]' as '${sensorKey}'
+        </foreach>
+        FROM
+        history_minutely as hm
+        <where>
+            <if test="mac!=null">
+                and hm.mac=#{mac}
+            </if>
+            and hm.time >= #{startTime}
+            and hm.time <![CDATA[<=]]> #{endTime}
+        </where>
+        ORDER BY
+        hm.time
+    </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.8.0