From 691311e750b9d9d28b38862977e347e938155f47 Mon Sep 17 00:00:00 2001 From: ZhuDongming <773644075@qq.com> Date: Fri, 16 Aug 2019 09:40:22 +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