From e4d5edc13431e3777d4463df4864c6116dc79744 Mon Sep 17 00:00:00 2001
From: zhouxiantao <1026371446@qq.com>
Date: Thu, 17 Oct 2024 19:51:01 +0800
Subject: [PATCH] fix:流转办理已经修改不生效问题,纠纷态势区域权限限制,纠纷态势纠纷类型二级接口

---
 dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/dao/mapper/xml/CaseInfoMapper.xml |   31 +++++++++++++++++++++++++------
 1 files changed, 25 insertions(+), 6 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 ea18c9a..9e1ae38 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
@@ -324,6 +324,15 @@
                 <if test="terms.caseType != null and terms.caseType !=''">
                     and a.case_type = #{terms.caseType}
                 </if>
+                <if test="terms.caseTypeFirst != null and terms.caseTypeFirst !=''">
+                    and a.case_type_first = #{terms.caseTypeFirst}
+                </if>
+                <if test="terms.caseTypeFirstList != null and terms.caseTypeFirstList.size > 0">
+                    and a.case_type_first in
+                    <foreach collection="terms.caseTypeFirstList" item="caseTypeFirst" index="index" open="(" separator="," close=")">
+                        #{caseTypeFirst}
+                    </foreach>
+                </if>
                 <if test="terms.caseTypeName != null and terms.caseTypeName !=''">
                     and a.case_type_name = #{terms.caseTypeName}
                 </if>
@@ -349,17 +358,17 @@
                     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.queProv != null and terms.queProv !=''">
-                    and a.que_prov = #{terms.queProv}
-                </if>
                 <if test="terms.queCity != null and terms.queCity !=''">
-                    and a.que_city = #{terms.queCity}
+                    and ((b.mediate_unit_id is not null and b.mediate_unit_id in (select id from "gzdyh_dev"."dyh_ct_unit" where que_city = #{terms.queCity}))
+                    or (b.mediate_unit_id is null and a.que_city = #{terms.queCity}))
                 </if>
                 <if test="terms.queArea != null and terms.queArea !=''">
-                    and a.que_area = #{terms.queArea}
+                    and ((b.mediate_unit_id is not null and b.mediate_unit_id in (select id from "gzdyh_dev"."dyh_ct_unit" where que_area = #{terms.queArea}))
+                    or (b.mediate_unit_id is null and a.que_area = #{terms.queArea}))
                 </if>
                 <if test="terms.queRoad != null and terms.queRoad !=''">
-                    and a.que_road = #{terms.queRoad}
+                    and ((b.mediate_unit_id is not null and b.mediate_unit_id in (select id from "gzdyh_dev"."dyh_ct_unit" where que_road = #{terms.queRoad}))
+                    or (b.mediate_unit_id is null and a.que_road = #{terms.queRoad}))
                 </if>
                 <if test="terms.isArea != null and terms.isArea !=''">
                     and a.que_city is not null and a.que_area is not null and a.que_road is not null
@@ -881,6 +890,16 @@
         <include refid="where-part-all"/>
     </select>
     <!--  统计分析(类型)  -->
+    <select id="statisticsTypeFirst" resultType="cn.huge.module.cases.domain.dto.CaseStatisticsTypeDTO">
+        SELECT
+        a.case_type_first as caseType,a.case_type_first_name as caseTypeName,count(1) as caseNum
+        FROM
+        dyh_case_info a LEFT JOIN dyh_case_info_unfold b on a.id = b.id
+        <include refid="where-part-all"/>
+        group by a.case_type_first
+    </select>
+
+    <!--  统计分析(类型)  -->
     <select id="statisticsType" resultType="cn.huge.module.cases.domain.dto.CaseStatisticsTypeDTO">
         SELECT
         a.case_type as caseType,a.case_type_name as caseTypeName,count(1) as caseNum

--
Gitblit v1.8.0