From 48bb075f91c5daf35cff0a16abe1136f132aafb4 Mon Sep 17 00:00:00 2001
From: jinpengyong <jpy123456>
Date: Mon, 28 Sep 2020 15:40:26 +0800
Subject: [PATCH] 不同天气给定不同分数

---
 src/main/resources/mapper/AQIMapper.xml |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/src/main/resources/mapper/AQIMapper.xml b/src/main/resources/mapper/AQIMapper.xml
index 38f06db..48c605f 100644
--- a/src/main/resources/mapper/AQIMapper.xml
+++ b/src/main/resources/mapper/AQIMapper.xml
@@ -12,4 +12,23 @@
         #{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="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>
 </mapper>
\ No newline at end of file

--
Gitblit v1.8.0