From 5799ca158c43e9c74a7a7eeb88a0b03a02513a68 Mon Sep 17 00:00:00 2001
From: kaiyu <404897439@qq.com>
Date: Mon, 02 Nov 2020 14:45:43 +0800
Subject: [PATCH] 修改平均风向SQL语句
---
src/main/resources/mapper/AQIMapper.xml | 33 +++++++++++++++++++++++++++++++++
1 files changed, 33 insertions(+), 0 deletions(-)
diff --git a/src/main/resources/mapper/AQIMapper.xml b/src/main/resources/mapper/AQIMapper.xml
index 38f06db..ffddfca 100644
--- a/src/main/resources/mapper/AQIMapper.xml
+++ b/src/main/resources/mapper/AQIMapper.xml
@@ -12,4 +12,37 @@
#{code}
)
</insert>
+
+ <select id="getO3" resultType="java.util.Map">
+ select DATE_FORMAT(time, #{typeFormat}) time,
+ ifnull(aqi_json->'$.O3C',aqi_json->'$.O3') 'O3'
+ from hangzhou_aqi
+ where city_code=#{cityCode}
+ and DATE_FORMAT(time, #{typeFormat}) in
+ <foreach collection="times" open="(" separator="," close=")" item="time">
+ #{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