1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
| <?xml version="1.0" encoding="UTF-8"?>
| <!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 *
| from project
| <where>
| is_delete = 0
| <if test="whereSql!=null">
| and ${whereSql}
| </if>
| <if test="secretClass!=null">
| and secret_class <= #{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>
|
|