From fb53b3101bd5953465a2b35aa543daefb8395247 Mon Sep 17 00:00:00 2001
From: shenyijian <1178253012@qq.com>
Date: Sat, 02 Nov 2024 11:33:11 +0800
Subject: [PATCH] 湖北水库:审批bug解决

---
 skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sg/mapper/SgProjectInfoMapper.xml |   47 +++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 43 insertions(+), 4 deletions(-)

diff --git a/skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sg/mapper/SgProjectInfoMapper.xml b/skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sg/mapper/SgProjectInfoMapper.xml
index 96a0d32..3484c4a 100644
--- a/skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sg/mapper/SgProjectInfoMapper.xml
+++ b/skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sg/mapper/SgProjectInfoMapper.xml
@@ -16,6 +16,24 @@
         LEFT JOIN SJZT_DW."dim_res_info_a" dria ON dria."res_cd" = info.sk_id
         WHERE
         1 =1
+        <if test="dto.selfUnit != null and dto.selfUnit.size>0">
+            and
+            <foreach collection="dto.selfUnit" item="item" index="index" open="(" separator="or" close=")">
+                info.SELF_UNIT Like  CONCAT(CONCAT('%', #{item}), '%')
+            </foreach>
+        </if>
+        <if test="dto.userUnit != null and dto.userUnit.size>0">
+            and
+            <foreach collection="dto.userUnit" item="item" index="index" open="(" separator="or" close=")">
+                info.CONTROL_UNIT Like  CONCAT(CONCAT('%', #{item}), '%')
+            </foreach>
+        </if>
+        <if test="dto.countryUnit != null and dto.countryUnit.size>0">
+            and dria."county_cd" in
+            <foreach collection="dto.countryUnit" item="item" index="index" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
         <if test="dto.projectName != null and dto.projectName != ''">
             and info.project_name like concat( concat ('%',#{dto.projectName}),'%')
         </if>
@@ -488,6 +506,24 @@
     </select>
 
     <sql id="queryBySgCodeS">
+        <if test="dto.selfUnit != null and dto.selfUnit.size>0">
+            and
+            <foreach collection="dto.selfUnit" item="item" index="index" open="(" separator="or" close=")">
+                pro.SELF_UNIT Like  CONCAT(CONCAT('%', #{item}), '%')
+            </foreach>
+        </if>
+        <if test="dto.userUnit != null and dto.userUnit.size>0">
+            and
+            <foreach collection="dto.userUnit" item="item" index="index" open="(" separator="or" close=")">
+                pro.CONTROL_UNIT Like  CONCAT(CONCAT('%', #{item}), '%')
+            </foreach>
+        </if>
+        <if test="dto.countryUnit != null and dto.countryUnit.size>0">
+            and dria."county_cd" in
+            <foreach collection="dto.countryUnit" item="item" index="index" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
         <if test="dto.sgCodeS != null and dto.sgCodeS.size > 0">
             and (dria."province_cd" in
             <foreach collection="dto.sgCodeS" item="id" separator="," open="(" close=")">
@@ -586,10 +622,13 @@
             user_id
         FROM
             "YWXT"."BLADE_USER_DEPT"
-        WHERE
-            dept_id = #{controlUnit}
-
-
+        WHERE 1=1
+        <if test="list != null and list.size>0">
+            and dept_id in
+            <foreach collection="list" item="item" index="index" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
     </select>
     <select id="resList" resultType="cn.gistack.sm.sg.VO.ResVO">
         select dria.* from "SJZT_DW"."dim_res_info_a" dria where 1=1

--
Gitblit v1.9.3