From 33d898d8146223184fcaab82a9e16649434a1ab6 Mon Sep 17 00:00:00 2001 From: lizijie <lzjiiie@163.com> Date: Fri, 09 Sep 2022 17:47:54 +0800 Subject: [PATCH] 千灯数据转发bug修改 --- src/main/resources/mapper/HistoryMinutelyMapper.xml | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/resources/mapper/HistoryMinutelyMapper.xml b/src/main/resources/mapper/HistoryMinutelyMapper.xml index d5caab6..27c3c4d 100644 --- a/src/main/resources/mapper/HistoryMinutelyMapper.xml +++ b/src/main/resources/mapper/HistoryMinutelyMapper.xml @@ -12,7 +12,7 @@ </insert> <update id="createHistoryMinutelyTable"> CREATE TABLE IF NOT EXISTS `history_minutely_${yearAndMonth}` ( - `mac` varchar(20) CHARACTER SET latin1 DEFAULT NULL, + `mac` varchar(30) CHARACTER SET latin1 DEFAULT NULL, `time` datetime DEFAULT NULL, `json` json DEFAULT NULL, KEY `_idx_mac` (`mac`) USING BTREE, @@ -35,13 +35,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 '${sensorKey}', - ROUND(MIN(json->'$.${sensorKey}[1]'),3) AS 'MIN${sensorKey}', - ROUND(MAX(json->'$.${sensorKey}[2]'),3) AS 'MAX${sensorKey}' + AVG(json->'$.${sensorKey}[0]') AS '${sensorKey}', + MIN(json->'$.${sensorKey}[1]') AS 'MIN${sensorKey}', + MAX(json->'$.${sensorKey}[2]') AS 'MAX${sensorKey}' </otherwise> </choose> </foreach> -- Gitblit v1.8.0