From dfa813134c05b718c039c432f0fa7be3cc118fd3 Mon Sep 17 00:00:00 2001
From: zhouxiantao <1026371446@qq.com>
Date: Wed, 25 Sep 2024 00:34:47 +0800
Subject: [PATCH] 综合查询-排序

---
 dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/dao/mapper/xml/CaseWindupApplyMapper.xml |   81 ++++++++++++++++++++++++----------------
 1 files changed, 49 insertions(+), 32 deletions(-)

diff --git a/dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/dao/mapper/xml/CaseWindupApplyMapper.xml b/dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/dao/mapper/xml/CaseWindupApplyMapper.xml
index 6c8d2bc..3038f5f 100644
--- a/dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/dao/mapper/xml/CaseWindupApplyMapper.xml
+++ b/dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/dao/mapper/xml/CaseWindupApplyMapper.xml
@@ -299,6 +299,8 @@
         <result property="reason" column="reason"/>
         <result property="opinion" column="opinion"/>
         <result property="process" column="process"/>
+        <result property="auditTime" column="auditTime"/>
+        <result property="auditResult" column="auditResult"/>
     </resultMap>
 
     <!--  首页-待审核条件统计  -->
@@ -321,10 +323,10 @@
     </select>
     <!--  首页-待审核分页查询  -->
     <select id="listMyTaskApplyReview" resultMap="MyTaskApplyReviewResult">
-        SELECT t1.id as windupId, t1.case_task_id as ownerId, t1.case_id as caseId,
+        SELECT t1.id as windupId, t1.case_task_id as ownerId, t1.case_id as caseId, t1.audit_time as auditTime, t1.audit_result_name as auditResult,
         t1.apply_time as turnaroundTime, t1.apply_unit_name as organizingUnit, t1.medi_result_name as mediResult,
                t1.fail_reason as reason, t2.case_level as caseGrade, t2.canal_name as caseSource,
-               t2.case_type_name as caseType, concat(t2.plaintiffs, t2.pagents) as plaintiffs,
+               concat(t2.case_type_first_name, '/' ,t2.case_type_name) as caseType, concat(t2.plaintiffs, t2.pagents) as plaintiffs,
                concat(t2.defendants, t2.dagents) as defendants
         FROM
         dyh_case_windup_apply t1 left join dyh_case_info t2 on t1.case_id = t2.id
@@ -350,46 +352,61 @@
         limit #{page.offset}, #{page.size}
     </select>
 
-    <!--  首页-结案申请条件统计  -->
-    <select id="countMySubmitApplyReview" resultType="java.lang.Long">
+
+    <!-- 工作台-办理中条件查询-条件 -->
+    <sql id="mySubmitApplyReview-where-part">
+        <if test="terms != null">
+            <if test="terms.applyUnitId != null and terms.applyUnitId !=''">
+                and t1.apply_unit_id = #{terms.applyUnitId}
+            </if>
+            <if test="terms.assistUnitId != null and terms.assistUnitId !=''">
+                and t3.assist_unit_id like concat('%', #{terms.assistUnitId}, '%')
+            </if>
+            <if test="terms.auditResult != null and terms.auditResult !=''">
+                and t1.audit_result = #{terms.auditResult}
+            </if>
+            <if test="terms.applyTimeStart != null and terms.applyTimeStart !='' and terms.applyTimeEnd != null and terms.applyTimeEnd !=''">
+                and (DATE_FORMAT(t1.apply_time,'%Y-%m-%d') <![CDATA[ >= ]]> #{terms.applyTimeStart}
+                and DATE_FORMAT(t1.apply_time,'%Y-%m-%d') <![CDATA[ <= ]]> #{terms.applyTimeEnd})
+            </if>
+            <if test="terms.partyName != null and terms.partyName !=''">
+                and concat(t2.plaintiffs, t2.pagents, t2.defendants, t2.dagents) like concat('%', #{terms.partyName}, '%')
+            </if>
+        </if>
+    </sql>
+    <!--  首页-结案申请/已结案条件统计  -->
+    <select id="countMyTaskJa" resultType="java.lang.Long">
         select
         COUNT(t1.id)
         from
         dyh_case_windup_apply t1 left join dyh_case_info t2 on t1.case_id = t2.id
+        left join dyh_case_info_unfold t3 on t3.id = t2.id
         where
-        t1.delete_status = 0
-        and t1.apply_status = #{terms.applyStatus}
-        and t1.apply_unit_id = #{terms.applyUnitId}
-        <if test="terms.timeStart != null and terms.timeStart !='' and terms.timeEnd != null and terms.timeEnd !=''">
-            and (DATE_FORMAT(t1.apply_time,'%Y-%m-%d') <![CDATA[ >= ]]> #{terms.timeStart}
-            and DATE_FORMAT(t1.apply_time,'%Y-%m-%d') <![CDATA[ <= ]]> #{terms.timeEnd})
-        </if>
-        <if test="terms.partyName != null and terms.partyName !=''">
-            and concat(t2.plaintiffs, t2.pagents, t2.defendants, t2.dagents) like concat('%', #{terms.partyName}, '%')
-        </if>
+        t1.apply_status = #{terms.applyStatus}
+        and t2.delete_status = 0
+        <include refid="mySubmitApplyReview-where-part"/>
     </select>
-    <!--  首页-结案申请分页查询  -->
-    <select id="listMySubmitApplyReview" resultMap="MyTaskApplyReviewResult">
-        SELECT t1.id as windupId, t1.case_task_id as ownerId, t1.case_id as caseId, t2.process_name as process,
-        t1.apply_time as turnaroundTime, t2.case_level as caseGrade, t2.canal_name as caseSource, t2.case_type_name as caseType,
-             t1.medi_result_name as mediResult,t1.fail_reason as reason,
-         concat(t2.plaintiffs, t2.pagents) as plaintiffs,
-        concat(t2.defendants, t2.dagents) as defendants,
-        t3.mediator as manager
+    <!--  首页-结案申请/已结案分页查询  -->
+    <select id="listMyTaskJa" resultType="cn.huge.module.cases.domain.dto.FrontPageListJADTO">
+        SELECT
+        t1.id as windupId, t1.case_task_id as ownerId, t1.case_id as caseId,
+        <if test="terms.applyStatus == 0">
+            t1.apply_time as turnaroundTime,
+        </if>
+        <if test="terms.applyStatus == 1">
+            t1.audit_time as turnaroundTime,
+        </if>
+        t1.audit_unit_name as auditUnit, t2.case_level as caseGrade, t2.canal_name as caseSource, concat(t2.case_type_first_name, '/' ,t2.case_type_name) as caseType,
+        t3.mediator as manager, t3.assist_unit_name as cooperatingUnit, t3.mediate_unit_name as organizingUnit,
+        t1.medi_result as mediResult, t1.medi_result_name as mediResultName, t2.status_name as caseStatusName,
+        concat(t2.plaintiffs, t2.pagents) as plaintiffs, concat(t2.defendants, t2.dagents) as defendants
         FROM
         dyh_case_windup_apply t1 left join dyh_case_info t2 on t1.case_id = t2.id
         left join dyh_case_info_unfold t3 on t3.id = t2.id
         where
-        t1.delete_status = 0
-        and t1.apply_status = #{terms.applyStatus}
-        and t1.apply_unit_id = #{terms.applyUnitId}
-        <if test="terms.timeStart != null and terms.timeStart !='' and terms.timeEnd != null and terms.timeEnd !=''">
-            and (DATE_FORMAT(t1.apply_time,'%Y-%m-%d') <![CDATA[ >= ]]> #{terms.timeStart}
-            and DATE_FORMAT(t1.apply_time,'%Y-%m-%d') <![CDATA[ <= ]]> #{terms.timeEnd})
-        </if>
-        <if test="terms.partyName != null and terms.partyName !=''">
-            and concat(t2.plaintiffs, t2.pagents, t2.defendants, t2.dagents) like concat('%', #{terms.partyName}, '%')
-        </if>
+        t1.apply_status = #{terms.applyStatus}
+        and t2.delete_status = 0
+        <include refid="mySubmitApplyReview-where-part"/>
         <if test="page.sort != null">
             <foreach collection="page.sort" item="s" index="index" separator="," open="order by ">
                 isnull(${s.property}), ${s.property} ${s.direction}

--
Gitblit v1.8.0