From 1c8d100cbf2916b797de1a0fde5c29d132ead593 Mon Sep 17 00:00:00 2001 From: kaiyu <404897439@qq.com> Date: Fri, 20 Nov 2020 18:00:15 +0800 Subject: [PATCH] 增加自动修补数据定时任务 --- src/main/resources/mapper/AQIMapper.xml | 22 ++++++++++++++++++++++ 1 files changed, 22 insertions(+), 0 deletions(-) diff --git a/src/main/resources/mapper/AQIMapper.xml b/src/main/resources/mapper/AQIMapper.xml index 54d35f5..ffddfca 100644 --- a/src/main/resources/mapper/AQIMapper.xml +++ b/src/main/resources/mapper/AQIMapper.xml @@ -23,4 +23,26 @@ #{time} </foreach> </select> + + <select id="getO3ByTime" resultType="java.lang.String"> + select ifnull(aqi_json->'$.O3C',aqi_json->'$.O3') as 'O3' + from hangzhou_aqi + where city_code=#{cityCode} + and DATE_FORMAT(time, #{typeFormat})=#{time} + </select> + + <select id="getAqiByHour" resultType="java.util.Map"> + select DATE_FORMAT(time, '%Y-%m-%d %H:%i:%s') time, + value + from history_aqi_${timeUnits} + where city_code=#{cityCode} + and DATE_FORMAT(time, '%Y%H')=#{yearAndHour} + </select> + + <select id="getO3FromHistory" resultType="java.lang.String"> + select value ->'$.O3C' as 'O3' + from history_aqi_${timeUnits} + where city_code=#{cityCode} + and DATE_FORMAT(time, #{typeFormat})=#{time} + </select> </mapper> \ No newline at end of file -- Gitblit v1.8.0