From c490640493f04e2ed0fc5c4c8fbc92ebdd4d5380 Mon Sep 17 00:00:00 2001
From: xusd <330628789@qq.com>
Date: Tue, 24 Jun 2025 21:06:48 +0800
Subject: [PATCH] Merge branch 'gzdyh_prod'

---
 dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/dao/mapper/xml/CaseInfoMapper.xml |  103 +++++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 87 insertions(+), 16 deletions(-)

diff --git a/dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/dao/mapper/xml/CaseInfoMapper.xml b/dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/dao/mapper/xml/CaseInfoMapper.xml
index 12315b8..69d7b7a 100644
--- a/dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/dao/mapper/xml/CaseInfoMapper.xml
+++ b/dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/dao/mapper/xml/CaseInfoMapper.xml
@@ -411,22 +411,6 @@
                 <if test="terms.mediatorId != null and terms.mediatorId !=''">
                     and b.mediator_id = #{terms.mediatorId}
                 </if>
-                <if test="terms.visitTimeStart != null and terms.visitTimeStart !='' and terms.visitTimeEnd != null and terms.visitTimeEnd !=''">
-                    and (DATE_FORMAT(a.visit_time,'%Y-%m-%d %H:%i:%s') <![CDATA[ >= ]]> #{terms.visitTimeStart}
-                    and DATE_FORMAT(a.visit_time,'%Y-%m-%d %H:%i:%s') <![CDATA[ <= ]]> #{terms.visitTimeEnd})
-                </if>
-                <if test="terms.createStart != null and terms.createStart !='' and terms.createEnd != null and terms.createEnd !=''">
-                    and (DATE_FORMAT(a.create_time,'%Y-%m-%d %H:%i:%s') <![CDATA[ >= ]]> #{terms.createStart}
-                    and DATE_FORMAT(a.create_time,'%Y-%m-%d %H:%i:%s') <![CDATA[ <= ]]> #{terms.createEnd})
-                </if>
-                <if test="terms.closeStart != null and terms.closeStart !='' and terms.closeEnd != null and terms.closeEnd !=''">
-                    and (DATE_FORMAT(b.close_time,'%Y-%m-%d %H:%i:%s') <![CDATA[ >= ]]> #{terms.closeStart}
-                    and DATE_FORMAT(b.close_time,'%Y-%m-%d %H:%i:%s') <![CDATA[ <= ]]> #{terms.closeEnd})
-                </if>
-                <if test="terms.fileStart != null and terms.fileStart !='' and terms.fileEnd != null and terms.fileEnd !=''">
-                    and (DATE_FORMAT(b.file_time,'%Y-%m-%d %H:%i:%s') <![CDATA[ >= ]]> #{terms.fileStart}
-                    and DATE_FORMAT(b.file_time,'%Y-%m-%d %H:%i:%s') <![CDATA[ <= ]]> #{terms.fileEnd})
-                </if>
                 <if test='terms.queCity != null and terms.queCity !="" and terms.statistics != null and terms.areaType == "1"'>
                     and (b.belong_unit_id is not null and c.city = #{terms.queCity}
                     <if test="terms.unitGrades != null and terms.unitGrades.size > 0">
@@ -573,6 +557,25 @@
                 </if>
                 <if test="terms.agreeType != null and terms.agreeType !=''">
                     and b.agree_type = #{terms.agreeType}
+                </if>
+                <if test="terms.systemSource != null and terms.systemSource !=''">
+                    and b.sys_source = #{terms.systemSource}
+                </if>
+                <if test="terms.visitTimeStart != null and terms.visitTimeStart !='' and terms.visitTimeEnd != null and terms.visitTimeEnd !=''">
+                    and (DATE_FORMAT(a.visit_time,'%Y-%m-%d %H:%i:%s') <![CDATA[ >= ]]> #{terms.visitTimeStart}
+                    and DATE_FORMAT(a.visit_time,'%Y-%m-%d %H:%i:%s') <![CDATA[ <= ]]> #{terms.visitTimeEnd})
+                </if>
+                <if test="terms.createStart != null and terms.createStart !='' and terms.createEnd != null and terms.createEnd !=''">
+                    and (a.create_time <![CDATA[ >= ]]> #{terms.createStart}
+                    and a.create_time <![CDATA[ <= ]]> #{terms.createEnd})
+                </if>
+                <if test="terms.closeStart != null and terms.closeStart !='' and terms.closeEnd != null and terms.closeEnd !=''">
+                    and (DATE_FORMAT(b.close_time,'%Y-%m-%d %H:%i:%s') <![CDATA[ >= ]]> #{terms.closeStart}
+                    and DATE_FORMAT(b.close_time,'%Y-%m-%d %H:%i:%s') <![CDATA[ <= ]]> #{terms.closeEnd})
+                </if>
+                <if test="terms.fileStart != null and terms.fileStart !='' and terms.fileEnd != null and terms.fileEnd !=''">
+                    and (DATE_FORMAT(b.file_time,'%Y-%m-%d %H:%i:%s') <![CDATA[ >= ]]> #{terms.fileStart}
+                    and DATE_FORMAT(b.file_time,'%Y-%m-%d %H:%i:%s') <![CDATA[ <= ]]> #{terms.fileEnd})
                 </if>
             </where>
         </if>
@@ -1106,6 +1109,33 @@
         LEFT JOIN dyh_ct_unit c ON b.belong_unit_id = c.id
         <include refid="where-part-all"/>
     </select>
+
+    <!--  统计分析(基础)-统计调解过程  -->
+    <select id="statisticsBaseProcess" resultType="cn.huge.module.cases.domain.dto.CaseStatisticsBaseDTO">
+        SELECT
+        count(1) as totalNum,
+        sum(case when b.medi_result = '22_00025-1' and a.info_process = 3 then 1 else 0 end) as resolveNum,
+        sum(case when a.info_process <![CDATA[ < ]]> 3 then 1 else 0 end) as resolveingNum,
+        sum(case when b.medi_result = '22_00025-2' and a.info_process = 3 then 1 else 0 end) as unResolveNum,
+        sum(case when a.case_level = 1 then 1 else 0 end) as oneLevelNum,
+        sum(case when a.case_level = 2 then 1 else 0 end) as twoLevelNum,
+        sum(case when a.case_level = 3 then 1 else 0 end) as threeLevelNum,
+        sum(case when a.info_process = 2 then 1
+                when a.info_process = 1 then 1   else 0 end) as processNum,
+        sum(case when a.info_process = 3 and b.medi_result = '22_00025-1' then 1 else 0 end) as finishNum,
+        sum(case when a.info_process = 4 then 1 else 0 end) as rejectNum,
+        sum(case when a.info_process = 3 and b.medi_result = '22_00025-2' then 1 else 0 end) as failNum,
+        sum(case when a.canal_second = '22_00003-8' then 1 else 0 end) as bmpcNum,
+        sum(case when a.canal_second = '22_00003-2' then 1 else 0 end) as wgpcNum,
+        sum(case when a.canal_second = '22_00003-1' then 1 else 0 end) as fjwjfNum,
+        sum(case when a.canal_second = '22_00003-7' then 1 else 0 end) as zxjfNum
+        FROM
+        dyh_case_info a
+        inner JOIN dyh_case_info_unfold b on a.id = b.id
+        LEFT JOIN dyh_ct_unit c ON b.belong_unit_id = c.id
+        <include refid="where-part-all"/>
+    </select>
+
     <!--  统计分析(类型)  -->
     <select id="statisticsTypeFirst" resultType="cn.huge.module.cases.domain.dto.CaseStatisticsTypeDTO">
         SELECT
@@ -1440,4 +1470,45 @@
             a.canal_second
     </select>
 
+    <!--  统计分析(基础)  -->
+    <select id="workStatisticsTime" resultType="cn.huge.module.cases.domain.dto.CaseWorkStatisticsTimeDTO">
+        SELECT
+        count(1) as totalNum,
+        sum(case when b.medi_result = '22_00025-1' and a.info_process = 3 then 1 else 0 end) as resolveNum,
+        sum(case when a.info_process <![CDATA[ < ]]> 3 then 1 else 0 end) as resolveingNum,
+        sum(case when b.medi_result = '22_00025-2' and a.info_process = 3 then 1 else 0 end) as unResolveNum,
+        sum(case when a.case_level = 1 then 1 else 0 end) as oneLevelNum,
+        sum(case when a.case_level = 2 then 1 else 0 end) as twoLevelNum,
+        sum(case when a.case_level = 3 then 1 else 0 end) as threeLevelNum,
+        sum(case when a.info_process <![CDATA[ < ]]> 3 then 1 else 0 end) as processNum,
+        sum(case when a.info_process = 3 then 1 else 0 end) as finishNum,
+        <if test='terms.selectTimeType != null and terms.selectTimeType =="1"'>
+            DATE_FORMAT(a.create_time, '%Y-%m-%d') AS dayStr,
+            DATE_FORMAT(a.create_time, '%Y-%m') AS monthStr,
+            DATE_FORMAT(a.create_time, '%Y') AS year_str,
+        </if>
+        <if test='terms.selectTimeType != null and terms.selectTimeType =="2"'>
+            DATE_FORMAT(b.close_time, '%Y-%m-%d') AS dayStr,
+            DATE_FORMAT(b.close_time, '%Y-%m') AS monthStr,
+            DATE_FORMAT(b.close_time, '%Y') AS year_str,
+        </if>
+        sum(case when a.info_process = 4 then 1 else 0 end) as rejectNum
+
+
+        FROM
+        dyh_case_info a
+        inner JOIN dyh_case_info_unfold b on a.id = b.id
+        LEFT JOIN dyh_ct_unit c ON b.belong_unit_id = c.id
+        <include refid="where-part-all"/>
+        <if test='terms.timeType != null and terms.timeType =="3"'>
+            GROUP BY year_str
+        </if>
+        <if test='terms.timeType != null and terms.timeType =="2"'>
+            GROUP BY monthStr
+        </if>
+        <if test='terms.timeType != null and terms.timeType =="1"'>
+            GROUP BY dayStr
+        </if>
+    </select>
+
 </mapper>
\ No newline at end of file

--
Gitblit v1.8.0