From 6992aaf0587c09f7c511c1afd12e1519d91363d3 Mon Sep 17 00:00:00 2001
From: cjl <276999030@qq.com>
Date: Thu, 14 Dec 2023 15:38:45 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/cjl' into qa

---
 screen-api/src/main/resources/mapper/CityAqiDailyMapper.xml |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/screen-api/src/main/resources/mapper/CityAqiDailyMapper.xml b/screen-api/src/main/resources/mapper/CityAqiDailyMapper.xml
index 212653b..01e6551 100644
--- a/screen-api/src/main/resources/mapper/CityAqiDailyMapper.xml
+++ b/screen-api/src/main/resources/mapper/CityAqiDailyMapper.xml
@@ -9,4 +9,22 @@
         <result column="value" property="value"/>
     </resultMap>
 
+    <select id="CityAqiDailyMap" resultType="com.moral.api.dto.CityAqiDailyListDTO">
+        SELECT c.city_code, avg(c.value ->'$.AQI')as aqi,avg(c.value ->'$.compositeIndex')
+        as comp,sum(c.value ->'$.compositeIndex') as nums FROM city_aqi_daily c
+        INNER JOIN sys_area s on s.area_code = c.city_code and parent_code = #{cityCode}
+        where 1 =1
+        <if test="type == 1">
+            and c.time <![CDATA[=]]> #{start}
+            GROUP BY c.city_code order by aqi
+        </if>
+        <if test=" type == 2 ">
+            and c.time  <![CDATA[>=]]> #{start} and  c.time <![CDATA[<=]]> #{end}
+            GROUP BY c.city_code order by nums
+        </if>
+        <if test="type == 3 ">
+            and DATE_FORMAT(c.time,'%Y') <![CDATA[>=]]> #{start}
+            GROUP BY c.city_code order by nums
+        </if>
+    </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.8.0