From 7e25fda3cfb8a7fc785cb6261a888671fb146fbe Mon Sep 17 00:00:00 2001 From: jinpengyong <jpy123456> Date: Wed, 18 Nov 2020 14:13:13 +0800 Subject: [PATCH] 从history获取数据接口更新为从history日表获取 --- src/main/resources/mapper/HistoryHourlyMapper.xml | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/src/main/resources/mapper/HistoryHourlyMapper.xml b/src/main/resources/mapper/HistoryHourlyMapper.xml index 8e819ef..43a663e 100644 --- a/src/main/resources/mapper/HistoryHourlyMapper.xml +++ b/src/main/resources/mapper/HistoryHourlyMapper.xml @@ -100,7 +100,12 @@ </select> <select id="getDataByMacAndTime" resultType="java.util.Map"> - SELECT DATE_FORMAT(`time`,'%Y-%m-%d %H:%i:%s') as `time`,json->'$.${sensor}[0]' as ${sensor} FROM `history_hourly` where `mac`=#{mac} and `time`>=#{startTime} and `time`<#{endTime} + SELECT DATE_FORMAT(`time`,'%Y-%m-%d %H:%i:%s') as `time`, + json->'$.${sensor}[0]' as ${sensor} + FROM `history_hourly` + where `mac`=#{mac} + and `time`>=#{startTime} + and `time`<#{endTime} </select> <select id="getDataByMacAndTime1" resultType="java.util.Map"> SELECT DATE_FORMAT(`time`,'%Y-%m-%d %H:%i:%s') as `time`,json->'$.${sensor}[0]' as ${sensor} FROM `history_hourly` where `mac`=#{mac} and `time`>=#{startTime} and `time`<![CDATA[<]]>#{endTime} -- Gitblit v1.8.0