From 1772fc5e211f9e9e0ab4cdc6c29b436aac178c2a Mon Sep 17 00:00:00 2001
From: jinlin <jinlin>
Date: 星期五, 23 二月 2024 12:19:55 +0800
Subject: [PATCH] 修改

---
 modules/mainPart/src/main/resources/mapper/project/ProjectDao.xml |  103 +++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 99 insertions(+), 4 deletions(-)

diff --git a/modules/mainPart/src/main/resources/mapper/project/ProjectDao.xml b/modules/mainPart/src/main/resources/mapper/project/ProjectDao.xml
index e905979..e2bf5e8 100644
--- a/modules/mainPart/src/main/resources/mapper/project/ProjectDao.xml
+++ b/modules/mainPart/src/main/resources/mapper/project/ProjectDao.xml
@@ -2,19 +2,114 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 
 <mapper namespace="com.zt.life.modules.project.dao.ProjectDao">
+    <delete id="deleteItem">
+        update ${tableName} set is_delete = 1 where ${fieldName} = ${id}
+    </delete>
 
     <select id="getList" resultType="com.zt.life.modules.project.model.Project">
-        select a.*
-        from project a
+        select *
+        from project
         <where>
-            a.is_delete = 0
+            is_delete = 0
             <if test="whereSql!=null">
                 and ${whereSql}
+            </if>
+            <if test="secretClass!=null">
+                and secret_class &lt;= #{secretClass}
+            </if>
+            <if test="deptId!=null">
+                and biz_dept_id = #{deptId}
+            </if>
+            <if test="tableName!=null and tableName!=''">
+                and id not in (select project_id from ${tableName} where is_delete = 0
+                <if test="pageCode !=null and pageCode !='' ">
+                    and page_code = '${pageCode}'
+                </if>
+                )
+            </if>
+            <if test="tableName =='contract_review' or pageCode =='contract'">
+                and is_contract =1
             </if>
         </where>
         <if test="orderBySql!=null">
             ORDER BY ${orderBySql}
         </if>
     </select>
-
+    <select id="getMyProjectRole" resultType="com.zt.life.modules.project.dto.MyProjectRoleDto">
+        SELECT CASE
+                   WHEN
+                       concat(',', a.project_leader, ',') LIKE concat('%,', #{userId}, ',%') THEN
+                       TRUE
+                   ELSE FALSE
+                   END AS isZrr,
+               CASE
+                   WHEN concat(',', a.project_testers, ',') LIKE concat('%,', #{userId}, ',%') THEN
+                       TRUE
+                   ELSE FALSE
+                   END AS isCsry,
+               CASE
+                   WHEN concat(',', a.project_reviewer, ',') LIKE concat('%,', #{userId}, ',%') THEN
+                       TRUE
+                   ELSE FALSE
+                   END AS isShry,
+               CASE
+                   WHEN concat(',', a.project_configer, ',') LIKE concat('%,', #{userId}, ',%') THEN
+                       TRUE
+                   ELSE FALSE
+                   END AS isPzry,
+               CASE
+                   WHEN EXISTS(SELECT 1
+                               FROM sys_user u,
+                                    sys_role_user ru,
+                                    sys_role r
+                               WHERE u.id = 0
+                                 AND u.DEPT_ID = a.biz_dept_id
+                                 AND r.id = ru.role_id
+                                 and r.code = 'zr'
+                                 AND ru.user_id = ${userId}
+                                 AND u.IS_DELETE = 0
+                                 AND ru.IS_DELETE = 0
+                                 AND r.IS_DELETE = 0
+                       ) THEN
+                       TRUE
+                   ELSE FALSE
+                   END AS isBmld,
+               CASE
+                   WHEN EXISTS(SELECT 1
+                               FROM sys_user u,
+                                    sys_role_user ru,
+                                    sys_role r
+                               WHERE u.id = 0
+                                 AND u.DEPT_ID = a.biz_dept_id
+                                 AND r.id = ru.role_id
+                                 and r.code = 'wpgly'
+                                 AND ru.user_id = ${userId}
+                                 AND u.IS_DELETE = 0
+                                 AND ru.IS_DELETE = 0
+                                 AND r.IS_DELETE = 0
+                       ) THEN
+                       TRUE
+                   ELSE FALSE
+                   END AS isWpgly,
+               CASE
+                   WHEN EXISTS(SELECT 1
+                               FROM sys_user u,
+                                    sys_role_user ru,
+                                    sys_role r
+                               WHERE u.id = 0
+                                 AND u.DEPT_ID = a.biz_dept_id
+                                 AND r.id = ru.role_id
+                                 and r.code = 'zljd'
+                                 AND ru.user_id = ${userId}
+                                 AND u.IS_DELETE = 0
+                                 AND ru.IS_DELETE = 0
+                                 AND r.IS_DELETE = 0
+                       ) THEN
+                       TRUE
+                   ELSE FALSE
+                   END AS isZljdy
+        FROM project a
+        WHERE a.ID = ${projectId}
+          AND a.is_delete = 0
+    </select>
 </mapper>

--
Gitblit v1.9.1