From a85508278ebdd73b32a92446ff741609ddb7d047 Mon Sep 17 00:00:00 2001
From: liyj <1003249715@qq.com>
Date: Sun, 08 Sep 2024 17:47:53 +0800
Subject: [PATCH] 1、新增对外展示事项进度字段

---
 dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/dao/mapper/xml/CaseInfoMapper.xml |  103 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 102 insertions(+), 1 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 b157a32..c168b50 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
@@ -70,6 +70,8 @@
             <result property="statusName" column="status_name"/>
             <result property="process" column="process"/>
             <result property="processName" column="process_name"/>
+            <result property="infoProcess" column="infoProcess"/>
+            <result property="infoProcessName" column="info_process_name"/>
             <result property="wantUnitId" column="want_unit_id"/>
             <result property="wantUnitName" column="want_unit_name"/>
             <result property="wantUserId" column="want_user_id"/>
@@ -79,8 +81,26 @@
             <result property="createTime" column="create_time"/>
             <result property="updateTime" column="update_time"/>
     </resultMap>
+    <resultMap id="dataResult-all" type="cn.huge.module.cases.domain.dto.CasePageDTO">
+
+    </resultMap>
     <!-- 表 -->
     <sql id='table-name'>dyh_case_info</sql>
+    <sql id="column-part-all">
+        a.id,
+        a.status,
+        a.status_name,
+        a.canal,
+        a.canal_name,
+        a.case_level,
+        a.case_type,
+        a.case_type_name,
+        a.input_unit_id,
+        a.input_unit_name,
+        b.medi_result_name,
+        b.mediate_dept_id,
+        b.mediate_dept_name
+    </sql>
     <!-- 字段 -->
     <sql id="column-part">
         id,
@@ -142,6 +162,8 @@
         status_name,
         process,
         process_name,
+        info_process,
+        info_process_name,
         want_unit_id,
         want_unit_name,
         want_user_id,
@@ -211,6 +233,8 @@
             <if test="entity.statusName != null">status_name = #{entity.statusName},</if>
             <if test="entity.process != null">process = #{entity.process},</if>
             <if test="entity.processName != null">process_name = #{entity.processName},</if>
+            <if test="entity.infoProcess != null">info_process = #{entity.infoProcess},</if>
+            <if test="entity.infoProcessName != null">info_process_name = #{entity.infoProcessName},</if>
             <if test="entity.wantUnitId != null">want_unit_id = #{entity.wantUnitId},</if>
             <if test="entity.wantUnitName != null">want_unit_name = #{entity.wantUnitName},</if>
             <if test="entity.wantUserId != null">want_user_id = #{entity.wantUserId},</if>
@@ -221,9 +245,47 @@
             <if test="entity.updateTime != null">update_time = #{entity.updateTime}</if>
     </sql>
     <!-- 条件 -->
+    <sql id="where-part-all">
+        <if test="terms != null">
+            <if test="terms.status != null and terms.status !=''">
+                and a.status = #{terms.status}
+            </if>
+            <if test="terms.statusName != null and terms.statusName !=''">
+                and a.status_name = #{terms.statusName}
+            </if>
+            <if test="terms.canal != null and terms.canal !=''">
+                and a.canal = #{terms.canal}
+            </if>
+            <if test="terms.canalName != null and terms.canalName !=''">
+                and a.canal_name = #{terms.canalName}
+            </if>
+            <if test="terms.caseLevel != null and terms.caseLevel !=''">
+                and a.case_level = #{terms.caseLevel}
+            </if>
+            <if test="terms.caseType != null and terms.caseType !=''">
+                and a.case_type = #{terms.caseType}
+            </if>
+            <if test="terms.caseTypeName != null and terms.caseTypeName !=''">
+                and a.case_type_name = #{terms.caseTypeName}
+            </if>
+            <if test="terms.inputUnitId != null and terms.inputUnitId !=''">
+                and a.input_unit_id = #{terms.inputUnitId}
+            </if>
+            <if test="terms.inputUnitName != null and terms.inputUnitName !=''">
+                and a.input_unit_name = #{terms.inputUnitName}
+            </if>
+        </if>
+    </sql>
+    <!-- 条件 -->
     <sql id="where-part">
         <if test="terms != null">
             <where>
+                <if test="terms.ids != null and terms.ids.size > 0">
+                    and id in
+                    <foreach collection="terms.id" item="terms.ids" index="index" open="(" separator="," close=")">
+                        #{terms.id}
+                    </foreach>
+                </if>
                 <if test="terms.id != null and terms.id !=''">
                     and id = #{terms.id}
                 </if>
@@ -395,11 +457,23 @@
                 <if test="terms.statusName != null and terms.statusName !=''">
                     and status_name = #{terms.statusName}
                 </if>
+                <if test="terms.processList != null and terms.processList.size > 0">
+                    and process in
+                    <foreach collection="terms.process" item="terms.processList" index="index" open="(" separator="," close=")">
+                        #{terms.process}
+                    </foreach>
+                </if>
                 <if test="terms.process != null and terms.process !=''">
                     and process = #{terms.process}
                 </if>
                 <if test="terms.processName != null and terms.processName !=''">
                     and process_name = #{terms.processName}
+                </if>
+                <if test="terms.infoProcess != null and terms.infoProcess !=''">
+                    and info_process = #{terms.infoProcess}
+                </if>
+                <if test="terms.infoProcessName != null and terms.infoProcessName !=''">
+                    and info_process_name = #{terms.infoProcessName}
                 </if>
                 <if test="terms.wantUnitId != null and terms.wantUnitId !=''">
                     and want_unit_id = #{terms.wantUnitId}
@@ -414,7 +488,7 @@
                     and want_user_name = #{terms.wantUserName}
                 </if>
                 <if test="terms.deleteStatus = null and terms.deleteStatus =''">
-                    and delete_status = '0'
+                    and delete_status = 0
                 </if>
                 <if test="terms.deleteStatus != null and terms.deleteStatus !=''">
                     and delete_status = #{terms.deleteStatus}
@@ -499,4 +573,31 @@
         limit #{page.offset}, #{page.size}
     </select>
 
+
+    <!--  根据条件统计  -->
+    <select id="countTermsAll" resultType="java.lang.Long">
+        select
+        COUNT(1)
+        from
+        dyh_case_info a LEFT JOIN dyh_case_info_unfold b on a.id = b.case_id
+        <include refid="where-part-all"/>
+    </select>
+    <!--  根据条件分页查询  -->
+    <select id="pageTermsAll" resultMap="dataResult-all">
+        SELECT
+        <include refid="column-part-all"/>
+        FROM
+        dyh_case_info a LEFT JOIN dyh_case_info_unfold b on a.id = b.case_id
+        <include refid="where-part-all"/>
+        <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(a.create_time), a.create_time desc
+        </if>
+        limit #{page.offset}, #{page.size}
+    </select>
+
 </mapper> 
\ No newline at end of file

--
Gitblit v1.8.0