From 8ff278ea65cd6e4c649867e8c2b8da62064ab220 Mon Sep 17 00:00:00 2001
From: guoshilong <123456>
Date: Wed, 31 Jan 2024 11:43:58 +0800
Subject: [PATCH] 数据质量明细添加数据来源,添加导出接口。巡查记录返回市区镇

---
 skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/resDataCheck/mapper/QualityManageDetailMapper.xml |  154 ++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 150 insertions(+), 4 deletions(-)

diff --git a/skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/resDataCheck/mapper/QualityManageDetailMapper.xml b/skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/resDataCheck/mapper/QualityManageDetailMapper.xml
index b4197c6..9754f5d 100644
--- a/skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/resDataCheck/mapper/QualityManageDetailMapper.xml
+++ b/skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/resDataCheck/mapper/QualityManageDetailMapper.xml
@@ -10,7 +10,7 @@
             (
                 res_id,rule_id,rule_name,rule_description,create_time,update_time,val,
                 is_gate,eng_scal,is_danger,town_code,town_name,county_code,county_name,city_code,city_name,
-                res_reg_code,res_name,rz,tb_weir_top_elevation,tb_flse_lim_stag,tb_norm_pool_stag,tb_control_z,tb_des_fl_stag,tb_dam_top_elevation,tb_dead_stag,remark
+                res_reg_code,res_name,rz,tb_weir_top_elevation,tb_flse_lim_stag,tb_norm_pool_stag,tb_control_z,tb_des_fl_stag,tb_dam_top_elevation,tb_dead_stag,flag,remark
             )
         select
             distinct
@@ -52,7 +52,13 @@
             c."tb_des_fl_stag",
             h."tb_dam_top_elevation",
             c."tb_dead_stag",
+            case when f."flag" = '老库' THEN '地方平台'
+                 when f."flag" = '物联网' THEN '省级平台'
+                 when f."flag" = '水文' THEN '水文系统'
+                 else ''
+                end as flag,
             ${rule.description} as remark
+
 
             from SJZT_MD."att_res_base" a
 
@@ -100,7 +106,8 @@
             MAX(tb_dam_top_elevation) tb_dam_top_elevation,
             MAX(tb_dead_stag) tb_dead_stag,
             replace(wm_concat(remark),',',';') as remark,
-            MAX(create_time) create_time
+            MAX(create_time) create_time,
+            MAX(flag) flag
         from YWXT.SM_RES_DATA_QUALITY_MANAGE_DETAIL
         where
             1=1
@@ -111,10 +118,10 @@
             AND res_name LIKE CONCAT('%', #{vo.resName},'%')
         </if>
         <if test="vo.startTime != null and vo.startTime != ''">
-            AND DATE_FORMAT(create_time,'%Y-%m-%d')  &gt;= #{vo.startTime}
+            AND create_time  &gt;= #{vo.startTime}
         </if>
         <if test="vo.endTime != null and vo.endTime !='' ">
-            AND DATE_FORMAT(create_time,'%Y-%m-%d') &lt;= #{vo.endTime}
+            AND create_time &lt;= #{vo.endTime}
         </if>
         <if test="vo.engScal != null and vo.engScal != ''">
             and eng_scal = #{vo.engScal}
@@ -131,7 +138,146 @@
         <if test="vo.townCode != null and vo.townCode != ''">
             and town_code= #{vo.townCode}
         </if>
+        <if test="vo.flag != null and vo.flag != ''">
+            and flag= #{vo.flag}
+        </if>
         GROUP BY
             RES_ID
     </select>
+    <select id="getAll" resultType="cn.gistack.sm.resDataCheck.vo.QualityManageDetailVO">
+        SELECT
+        MAX(id) id,
+        RES_ID,
+        MAX(is_gate) is_gate,
+        MAX(eng_scal) eng_scal,
+        MAX(is_danger) is_danger,
+        MAX(town_code) town_code,
+        MAX(town_name) town_name,
+        MAX(county_code)county_code,
+        MAX(county_name)county_name,
+        MAX(city_code) city_code,
+        MAX(city_name) city_name,
+        MAX(res_reg_code) res_reg_code,
+        MAX(res_name) res_name,
+        MAX(rz) rz,
+        MAX(tb_flse_lim_stag) tb_flse_lim_stag,
+        MAX(tb_weir_top_elevation) tb_weir_top_elevation,
+        MAX(tb_norm_pool_stag) tb_norm_pool_stag,
+        MAX(tb_control_z) tb_control_z,
+        MAX(tb_des_fl_stag) tb_des_fl_stag,
+        MAX(tb_dam_top_elevation) tb_dam_top_elevation,
+        MAX(tb_dead_stag) tb_dead_stag,
+        replace(wm_concat(remark),',',';') as remark,
+        MAX(create_time) create_time,
+        MAX(flag) flag
+        from YWXT.SM_RES_DATA_QUALITY_MANAGE_DETAIL
+        where
+        1=1
+        <if test="vo.resId != null and vo.resId != ''">
+            AND res_id = #{vo.resId}
+        </if>
+        <if test="vo.resName != null and vo.resName != ''">
+            AND res_name LIKE CONCAT('%', #{vo.resName},'%')
+        </if>
+        <if test="vo.startTime != null and vo.startTime != ''">
+            AND create_time  &gt;= #{vo.startTime}
+        </if>
+        <if test="vo.endTime != null and vo.endTime !='' ">
+            AND create_time &lt;= #{vo.endTime}
+        </if>
+        <if test="vo.engScal != null and vo.engScal != ''">
+            and eng_scal = #{vo.engScal}
+        </if>
+        <if test="vo.isDanger != null and vo.isDanger != ''">
+            and is_danger = #{vo.isDanger}
+        </if>
+        <if test="vo.cityCode != null and vo.cityCode != ''">
+            and city_code = #{vo.cityCode}
+        </if>
+        <if test="vo.countyCode != null and vo.countyCode != ''">
+            and county_code = #{vo.countyCode}
+        </if>
+        <if test="vo.townCode != null and vo.townCode != ''">
+            and town_code= #{vo.townCode}
+        </if>
+        <if test="vo.flag != null and vo.flag != ''">
+            and flag= #{vo.flag}
+        </if>
+        GROUP BY
+        RES_ID
+    </select>
+
+
+    <select id="exportData" resultType="cn.gistack.sm.resDataCheck.excel.QualityManageDetailExcel">
+    SELECT ROWNUM AS no ,t.* from (
+        SELECT
+        MAX(id) id,
+        RES_ID,
+        MAX(is_gate) is_gate,
+        MAX(eng_scal) eng_scal,
+
+        case when max(is_danger)= 'false' THEN '否'
+        when max(is_danger)= 'true' THEN '是'
+        else ''
+        end as is_danger,
+
+        MAX(town_code) town_code,
+        MAX(town_name) town_name,
+        MAX(county_code)county_code,
+        MAX(county_name)county_name,
+        MAX(city_code) city_code,
+        MAX(city_name) city_name,
+        MAX(res_reg_code) res_reg_code,
+        MAX(res_name) res_name,
+        MAX(rz) rz,
+        MAX(tb_flse_lim_stag) tb_flse_lim_stag,
+        MAX(tb_weir_top_elevation) tb_weir_top_elevation,
+        MAX(tb_norm_pool_stag) tb_norm_pool_stag,
+        MAX(tb_control_z) tb_control_z,
+        MAX(tb_des_fl_stag) tb_des_fl_stag,
+        MAX(tb_dam_top_elevation) tb_dam_top_elevation,
+        MAX(tb_dead_stag) tb_dead_stag,
+        replace(wm_concat(remark),',',';') as remark,
+        MAX(create_time) create_time,
+        MAX(flag) flag
+        from YWXT.SM_RES_DATA_QUALITY_MANAGE_DETAIL
+        where
+        1=1
+        <if test="vo.resId != null and vo.resId != ''">
+            AND res_id = #{vo.resId}
+        </if>
+        <if test="vo.resName != null and vo.resName != ''">
+            AND res_name LIKE CONCAT('%', #{vo.resName},'%')
+        </if>
+        <if test="vo.startTime != null and vo.startTime != ''">
+            AND create_time  &gt;= #{vo.startTime}
+        </if>
+        <if test="vo.endTime != null and vo.endTime !='' ">
+            AND create_time &lt;= #{vo.endTime}
+        </if>
+        <if test="vo.engScal != null and vo.engScal != ''">
+            and eng_scal = #{vo.engScal}
+        </if>
+        <if test="vo.isDanger != null and vo.isDanger != ''">
+            and is_danger = #{vo.isDanger}
+        </if>
+        <if test="vo.cityCode != null and vo.cityCode != ''">
+            and city_code = #{vo.cityCode}
+        </if>
+        <if test="vo.countyCode != null and vo.countyCode != ''">
+            and county_code = #{vo.countyCode}
+        </if>
+        <if test="vo.townCode != null and vo.townCode != ''">
+            and town_code= #{vo.townCode}
+        </if>
+        <if test="vo.flag != null and vo.flag != ''">
+            and flag= #{vo.flag}
+        </if>
+        GROUP BY
+        RES_ID
+
+        ) t
+
+
+    </select>
 </mapper>

--
Gitblit v1.9.3