From 56287f4037defafbd3a3bbebd1827fd20a8b91d4 Mon Sep 17 00:00:00 2001
From: heheng <heheng@123456>
Date: 星期一, 06 一月 2025 11:12:05 +0800
Subject: [PATCH] 项目拆单

---
 assess-system/src/main/resources/mapper/AssProjectMapper.xml |   38 ++++++++++++++++++++++++++++++++++++--
 1 files changed, 36 insertions(+), 2 deletions(-)

diff --git a/assess-system/src/main/resources/mapper/AssProjectMapper.xml b/assess-system/src/main/resources/mapper/AssProjectMapper.xml
index 941e57a..4d286f8 100644
--- a/assess-system/src/main/resources/mapper/AssProjectMapper.xml
+++ b/assess-system/src/main/resources/mapper/AssProjectMapper.xml
@@ -78,6 +78,18 @@
         </if>
         <where>
             and p.del_flag = 0
+            <if test="safetyCheck != null and safetyCheck == 0">
+                and p.estimate_type != 33
+            </if>
+            <if test="safetyCheck != null and safetyCheck == 1">
+                and p.estimate_type = 33
+            </if>
+            <if test="unFinish != null and unFinish == 1">
+                and p.report_progress != 14
+            </if>
+            <if test="agencyName != null and agencyName != ''">
+                and a.name=#{agencyName}
+            </if>
             <if test="name != null and name != ''">
                 AND p.name like concat('%', #{name}, '%')
             </if>
@@ -131,7 +143,14 @@
 
     <select id="getProjectByName" resultType="com.gkhy.assess.system.domain.AssProject">
         select id,name from ass_project
-        where name=#{name} and agency_id=#{agencyId} and del_flag=0 limit 1
+        where name=#{name} and agency_id=#{agencyId} and del_flag=0
+        <if test="safetyCheck != null and safetyCheck == 0">
+            and estimate_type != 33
+        </if>
+        <if test="safetyCheck != null and safetyCheck == 1">
+            and estimate_type = 33
+        </if>
+            limit 1
     </select>
 
     <select id="getReportProgress" resultType="java.lang.Integer">
@@ -176,15 +195,30 @@
     </select>
 
     <select id="getProjectCount" resultType="java.lang.Integer">
-        select count(distinct  p.id) from ass_project p
+        select Ifnull(count(distinct  p.id),0) from ass_project p
         <if test="params.lostMaterial != null">
             left join ass_project_material m on m.project_id=p.id
         </if>
+        <if test="agencyName != null and agencyName != ''">
+            left join sys_agency a on a.id=p.agency_id
+        </if>
         <where>
             and p.del_flag=0
+            <if test="safetyCheck != null and safetyCheck == 0">
+                and p.estimate_type != 33
+            </if>
+            <if test="safetyCheck != null and safetyCheck == 1">
+                and p.estimate_type = 33
+            </if>
+            <if test="unFinish != null and unFinish == 1">
+                and p.report_progress != 14
+            </if>
             <if test="agencyId!=null and agencyId!=''">
                 and p.agency_id=#{agencyId}
             </if>
+            <if test="agencyName != null and agencyName != ''">
+                and a.name=#{agencyName}
+            </if>
             <if test="name != null and name != ''">
                 AND p.name like concat('%', #{name}, '%')
             </if>

--
Gitblit v1.9.2