From 81dc94a70de69f45f42b8ca4b702a3a372cf81ac Mon Sep 17 00:00:00 2001
From: lizijie <lzjiiie@163.com>
Date: Tue, 24 May 2022 09:59:07 +0800
Subject: [PATCH] 去除打印
---
src/main/resources/mapper/HistoryHourlyMapper.xml | 24 +++++++++++++++++++-----
1 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/src/main/resources/mapper/HistoryHourlyMapper.xml b/src/main/resources/mapper/HistoryHourlyMapper.xml
index 4f5766c..169573f 100644
--- a/src/main/resources/mapper/HistoryHourlyMapper.xml
+++ b/src/main/resources/mapper/HistoryHourlyMapper.xml
@@ -25,13 +25,13 @@
THEN (ATAN(AVG(json->'$.e18[0]'*SIN((json->'$.e23[0]'/180)*PI()))/AVG(json->'$.e18[0]'*COS((json->'$.e23[0]'/180)*PI())))*180/PI())+180
ELSE (ATAN(AVG(json->'$.e18[0]'*SIN((json->'$.e23[0]'/180)*PI()))/AVG(json->'$.e18[0]'*COS((json->'$.e23[0]'/180)*PI())))*180/PI())+360
END),3) AS '${sensorKey}',
- ROUND(MIN(json->'$.${sensorKey}[1]'),3) AS 'MIN${sensorKey}',
- ROUND(MAX(json->'$.${sensorKey}[2]'),3) AS 'MAX${sensorKey}'
+ MIN(json->'$.${sensorKey}[1]') AS 'MIN${sensorKey}',
+ MAX(json->'$.${sensorKey}[2]') AS 'MAX${sensorKey}'
</when>
<otherwise>
- ROUND(AVG(json->'$.${sensorKey}[0]'),3) AS 'AVG${sensorKey}',
- ROUND(MIN(json->'$.${sensorKey}[1]'),3) AS 'MIN${sensorKey}',
- ROUND(MAX(json->'$.${sensorKey}[2]'),3) AS '${sensorKey}'
+ AVG(json->'$.${sensorKey}[0]') AS '${sensorKey}',
+ MIN(json->'$.${sensorKey}[1]') AS 'MIN${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