From 96d7cf8eb72810dfa5921a585d64b5ce9909d416 Mon Sep 17 00:00:00 2001
From: jinpengyong <jpy123456>
Date: Wed, 16 Dec 2020 16:53:25 +0800
Subject: [PATCH] 北京疾控中心设备掉线报警邮件发送

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

diff --git a/src/main/resources/mapper/AQIMapper.xml b/src/main/resources/mapper/AQIMapper.xml
index 48c605f..34beeb3 100644
--- a/src/main/resources/mapper/AQIMapper.xml
+++ b/src/main/resources/mapper/AQIMapper.xml
@@ -24,6 +24,13 @@
         </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
@@ -31,4 +38,11 @@
         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