From d8310f6bc609440fa352c0e5a9436c7c78caa287 Mon Sep 17 00:00:00 2001 From: lizijie <lzjiiie@163.com> Date: Mon, 29 Nov 2021 11:09:48 +0800 Subject: [PATCH] Merge branch 'master' of http://blit.7drlb.com:8888/r/screen_job --- src/main/resources/mapper/HistoryHourlyMapper.xml | 18 ++++++++++++++++-- 1 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/main/resources/mapper/HistoryHourlyMapper.xml b/src/main/resources/mapper/HistoryHourlyMapper.xml index f64a1fc..169573f 100644 --- a/src/main/resources/mapper/HistoryHourlyMapper.xml +++ b/src/main/resources/mapper/HistoryHourlyMapper.xml @@ -29,9 +29,9 @@ MAX(json->'$.${sensorKey}[2]') AS 'MAX${sensorKey}' </when> <otherwise> - AVG(json->'$.${sensorKey}[0]') AS 'AVG${sensorKey}', + AVG(json->'$.${sensorKey}[0]') AS '${sensorKey}', MIN(json->'$.${sensorKey}[1]') AS 'MIN${sensorKey}', - MAX(json->'$.${sensorKey}[2]') AS '${sensorKey}' + MAX(json->'$.${sensorKey}[2]') AS 'MAX${sensorKey}' </otherwise> </choose> </foreach> @@ -96,4 +96,18 @@ group by h.time </select> + <select id="selectCountByMac" resultType="java.lang.Integer"> + SELECT count(1) FROM history_hourly + WHERE mac = #{mac} + AND `time` >= #{start} + AND `time` <![CDATA[<]]> #{end} + </select> + + <select id="selectDataByMac" resultType="java.lang.String"> + select + json + from history_hourly + where mac = #{mac} + and `time` = #{time} + </select> </mapper> \ No newline at end of file -- Gitblit v1.8.0