From 8fbe4c86d435c2b5a572d9557a4bdb914d06c833 Mon Sep 17 00:00:00 2001 From: ZhuDongming <773644075@qq.com> Date: Fri, 16 Aug 2019 17:20:08 +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