From 54a30a0171c552f9f885ed9f0a90ac53069c4e35 Mon Sep 17 00:00:00 2001
From: lizijie <lzjiiie@163.com>
Date: Tue, 24 Nov 2020 18:10:40 +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..34beeb3 100644
--- a/src/main/resources/mapper/AQIMapper.xml
+++ b/src/main/resources/mapper/AQIMapper.xml
@@ -23,4 +23,26 @@
             #{time}
         </foreach>
     </select>
+
+    <select id="getAqiFromHangzhou" resultType="java.lang.String">
+        select ifnull(aqi_json->'$.${sensorKey}',aqi_json->'$.${sensorKey1}') as '${sensorKey}'
+        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="getAqiFromHistory" resultType="java.lang.String">
+        select value ->'$.${sensorKey}' as '${sensorKey}'
+        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