From 5097bf3234b98ada92b6608de0e656da3e272572 Mon Sep 17 00:00:00 2001
From: shenyijian <1178253012@qq.com>
Date: Mon, 24 Jun 2024 17:23:26 +0800
Subject: [PATCH] 湖北水库:施工:审批详情排序、待办列表过滤

---
 skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sg/mapper/SgProgressReportMapper.xml |   23 +++++++++++++++++------
 1 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sg/mapper/SgProgressReportMapper.xml b/skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sg/mapper/SgProgressReportMapper.xml
index 318f8b9..4236c95 100644
--- a/skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sg/mapper/SgProgressReportMapper.xml
+++ b/skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sg/mapper/SgProgressReportMapper.xml
@@ -30,11 +30,14 @@
         select * from  SG_PROGRESS_REPORT report where id = #{id}
     </select>
     <select id="queryList" resultType="cn.gistack.sm.sg.VO.SgProgressReportVO">
-        SELECT
-        report.*,
+        SELECT distinct
+        report.id,
+        report.program_name,
+        report.gx_step_name,
+        report."STATUS",
         de.device_name,
         de.device_type,
-        userR.approval_status,
+       <!-- userR.approval_status, -->
         dict."DICT_VALUE" as typeName
         FROM
         ywxt.SG_PROGRESS_REPORT report
@@ -43,17 +46,25 @@
         LEFT JOIN ywxt.sg_report_user userR ON report.id = userR.report_id
         WHERE
         1 = 1
-        AND userR.is_his = 0
+       <!-- AND userR.is_his = 0 -->
         <if test="dto.userId != null and dto.userId != ''">
             and userR.user_id = #{dto.userId}
         </if>
         <if test="dto.approvalStatus != null and dto.approvalStatus != 3">
-            and userR.approval_status = #{dto.approvalStatus}
+        <if test="dto.approvalStatus != null and dto.approvalStatus ==0">
+            and userR.approval_status = 0
+        </if>
+        <if test="dto.approvalStatus != null and dto.approvalStatus ==1">
+           and userR.approval_status != 0
+        </if>
             AND userR.approval_order != 0
         </if>
         <choose >
             <when test="dto.approvalStatus != null and dto.approvalStatus == 0">
-                and report.audit_person = #{dto.userId}
+                and report.audit_person = #{dto.userId} and (report."STATUS" = 0 or report."STATUS" = 1)
+            </when>
+            <when test="dto.approvalStatus != null and dto.approvalStatus == 1">
+               and report."STATUS" != 0
             </when>
             <when test="dto.approvalStatus != null and dto.approvalStatus == 3">
                 and report.report_user = #{dto.userId}

--
Gitblit v1.9.3