From 140170b48b50c33dc68558dc7d97ccd65bffbc7d Mon Sep 17 00:00:00 2001
From: zhouxiantao <1026371446@qq.com>
Date: Sat, 21 Jun 2025 15:59:53 +0800
Subject: [PATCH] fix:解纷态势和纠纷台账的调整

---
 dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/dao/mapper/xml/CaseInfoMapper.xml |   62 +++++++++++++++++++++++--------
 1 files changed, 46 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..752227c 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 = #{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

--
Gitblit v1.8.0