From e282e3bb247adc903e201e85239a504548efa7c6 Mon Sep 17 00:00:00 2001
From: wangwh <2397901735@qq.com>
Date: Tue, 10 Sep 2024 14:26:20 +0800
Subject: [PATCH] 1、修改查询下级所有组织接口 2、首页相关接口

---
 dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/dao/mapper/xml/CaseSuperviseMapper.xml |   61 +++++++++++++++++++++++++++++-
 1 files changed, 58 insertions(+), 3 deletions(-)

diff --git a/dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/dao/mapper/xml/CaseSuperviseMapper.xml b/dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/dao/mapper/xml/CaseSuperviseMapper.xml
index 57334d3..59f64e4 100644
--- a/dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/dao/mapper/xml/CaseSuperviseMapper.xml
+++ b/dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/dao/mapper/xml/CaseSuperviseMapper.xml
@@ -14,6 +14,8 @@
             <result property="id" column="id"/>
             <result property="caseId" column="case_id"/>
             <result property="supContent" column="sup_content"/>
+            <result property="supUnitId" column="sup_unit_id"/>
+            <result property="supUnitName" column="sup_unit_name"/>
             <result property="supUserId" column="sup_user_id"/>
             <result property="supUserName" column="sup_user_name"/>
             <result property="supTime" column="sup_time"/>
@@ -37,6 +39,8 @@
         id,
         case_id,
         sup_content,
+        sup_unit_id,
+        sup_unit_name,
         sup_user_id,
         sup_user_name,
         sup_time,
@@ -57,6 +61,8 @@
     <sql id="set-part">
             <if test="entity.caseId != null">case_id = #{entity.caseId},</if>
             <if test="entity.supContent != null">sup_content = #{entity.supContent},</if>
+            <if test="entity.supUnitId != null">sup_unit_id = #{entity.supUnitId},</if>
+            <if test="entity.supUnitName != null">sup_unit_name = #{entity.supUnitName},</if>
             <if test="entity.supUserId != null">sup_user_id = #{entity.supUserId},</if>
             <if test="entity.supUserName != null">sup_user_name = #{entity.supUserName},</if>
             <if test="entity.supTime != null">sup_time = #{entity.supTime},</if>
@@ -85,6 +91,12 @@
                 </if>
                 <if test="terms.supContent != null and terms.supContent !=''">
                     and sup_content = #{terms.supContent}
+                </if>
+                <if test="terms.supUnitId != null and terms.supUnitId !=''">
+                    and sup_unit_id = #{terms.supUnitId}
+                </if>
+                <if test="terms.supUnitName != null and terms.supUnitName !=''">
+                    and sup_unit_name = #{terms.supUnitName}
                 </if>
                 <if test="terms.supUserId != null and terms.supUserId !=''">
                     and sup_user_id = #{terms.supUserId}
@@ -215,7 +227,7 @@
         from
         <include refid="table-name" />
         where case_id = #{caseId}
-        and delete_status = '0'
+        and delete_status = 0
         and sup_status = #{supStatus}
         and quilt_unit_id = #{quiltUnitId}
     </select>
@@ -227,9 +239,52 @@
         FROM
         <include refid="table-name" />
         where case_id = #{caseId}
-        and delete_status = '0'
+        and delete_status = 0
         and sup_status = #{supStatus}
         and quilt_unit_id = #{quiltUnitId}
+        <if test="page.sort != null">
+            <foreach collection="page.sort" item="s" index="index" separator="," open="order by ">
+                isnull(${s.property}), ${s.property} ${s.direction}
+            </foreach>
+        </if>
+        <if test="page.sort == null">
+            order by isnull(sup_time), sup_time desc
+        </if>
+        limit #{page.offset}, #{page.size}
+    </select>
+
+    <!--  首页督办条件统计  -->
+    <select id="countMyTaskDb" resultType="java.lang.Long">
+        select
+        COUNT(1)
+        from
+            dyh_case_supervise t1 left join dyh_case_info t2 on t1.case_id = t2.id
+        where
+        delete_status = 0
+        and sup_status = #{terms.supStatus}
+        and quilt_unit_id = #{terms.quiltUnitId}
+    </select>
+
+    <!--  首页督办分页查询  -->
+    <select id="pageMyTaskDb" resultMap="dataResult">
+        SELECT
+        t1.sup_time as turnaroundTime, t1.DATEADD(hour, t1.replyTerm, t1.sup_time) as timeLimit, t1.sup_unit_name as organizingUnit,
+        t1.sup_content as opinion, 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.defendants, t2.dagents) as defendants
+        FROM
+        dyh_case_supervise t1 left join dyh_case_info t2 on t1.case_id = t2.id
+        where
+        t1.delete_status = 0
+        and t1.sup_status = #{terms.supStatus}
+        and t1.quilt_unit_id = #{terms.quiltUnitId}
+        <if test="terms.timeStart != null and terms.timeStart !='' and terms.timeEnd != null and terms.timeEnd !=''">
+            and (DATE_FORMAT(t1.create_time,'%Y-%m-%d') <![CDATA[ >= ]]> #{terms.timeStart}
+            and DATE_FORMAT(t1.create_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>
         <if test="page.sort != null">
             <foreach collection="page.sort" item="s" index="index" separator="," open="order by ">
                 isnull(${s.property}), ${s.property} ${s.direction}
@@ -248,7 +303,7 @@
         from
         <include refid="table-name" />
         where
-        delete_status = '0'
+        delete_status = 0
         and sup_status = #{supStatus}
         and quilt_unit_id = #{quiltUnitId}
     </select>

--
Gitblit v1.8.0