|
@@ -5,24 +5,24 @@
|
5
|
5
|
<update id="updateApply">
|
6
|
6
|
UPDATE ta_issue t
|
7
|
7
|
SET t.apply_type = #{applyType},
|
8
|
|
- t.apply_id = #{applyId}
|
|
8
|
+ t.apply_id = #{applyId}
|
9
|
9
|
WHERE
|
10
|
|
- t.issue_id = #{issueId}
|
|
10
|
+ t.issue_id = #{issueId}
|
11
|
11
|
</update>
|
12
|
12
|
<update id="updateValidateStatus">
|
13
|
13
|
UPDATE ta_issue t
|
14
|
14
|
SET t.validate_status = #{validateStatus}
|
15
|
15
|
WHERE
|
16
|
|
- t.issue_id = #{issueId}
|
|
16
|
+ t.issue_id = #{issueId}
|
17
|
17
|
</update>
|
18
|
18
|
<update id="updateProcess">
|
19
|
19
|
UPDATE ta_issue t
|
20
|
20
|
SET t.process_node = #{processNode},
|
21
|
|
- t.process_status = #{processStatus},
|
22
|
|
- t.update_user = #{userId},
|
23
|
|
- t.update_date = now( )
|
|
21
|
+ t.process_status = #{processStatus},
|
|
22
|
+ t.update_user = #{userId},
|
|
23
|
+ t.update_date = now( )
|
24
|
24
|
WHERE
|
25
|
|
- t.issue_id = #{issueId}
|
|
25
|
+ t.issue_id = #{issueId}
|
26
|
26
|
</update>
|
27
|
27
|
|
28
|
28
|
<update id="removeByIssueId">
|
|
@@ -34,100 +34,128 @@
|
34
|
34
|
|
35
|
35
|
<select id="getPageBy" resultType="com.example.civilizedcity.entity.TaIssue">
|
36
|
36
|
SELECT
|
37
|
|
- *
|
|
37
|
+ *
|
38
|
38
|
FROM
|
39
|
|
- ta_issue t
|
|
39
|
+ ta_issue t
|
40
|
40
|
WHERE
|
41
|
|
- EXISTS (
|
42
|
|
- SELECT
|
43
|
|
- *
|
44
|
|
- FROM
|
45
|
|
- ta_issue_process s ON s.issue_id = t.issue_id
|
46
|
|
- WHERE
|
47
|
|
- ( s.org_id = #{orgId} OR s.next_org = #{orgId} )
|
48
|
|
- AND s.`status` > -1
|
49
|
|
- )
|
50
|
|
- AND t.`status` > -1
|
|
41
|
+ EXISTS (
|
|
42
|
+ SELECT
|
|
43
|
+ *
|
|
44
|
+ FROM
|
|
45
|
+ ta_issue_process s ON s.issue_id = t.issue_id
|
|
46
|
+ WHERE
|
|
47
|
+ ( s.org_id = #{orgId} OR s.next_org = #{orgId} )
|
|
48
|
+ AND s.`status` > -1
|
|
49
|
+ )
|
|
50
|
+ AND t.`status` > -1
|
51
|
51
|
ORDER BY
|
52
|
|
- t.create_date DESC
|
|
52
|
+ t.create_date DESC
|
53
|
53
|
</select>
|
54
|
54
|
<select id="getAllBy" resultType="com.example.civilizedcity.entity.TaIssue">
|
55
|
55
|
SELECT
|
56
|
|
- *
|
|
56
|
+ *
|
57
|
57
|
FROM
|
58
|
|
- ta_issue t
|
|
58
|
+ ta_issue t
|
59
|
59
|
WHERE
|
60
|
|
- t.`status` > -1
|
|
60
|
+ t.`status` > -1
|
61
|
61
|
ORDER BY
|
62
|
|
- t.create_date DESC
|
|
62
|
+ t.create_date DESC
|
63
|
63
|
</select>
|
64
|
64
|
<select id="statMaIndex" resultType="java.util.Map">
|
65
|
65
|
SELECT
|
66
|
|
- count(*) as published_num,
|
67
|
|
- sum(IF(t.process_node = '01', 1, 0)) as unassigned_num,
|
68
|
|
- sum(IF(t.process_node LIKE '02%', 1, 0)) as assigned_num,
|
69
|
|
- sum(IF(t.process_node = '03', 1, 0)) as end_num
|
|
66
|
+ count(*) as published_num,
|
|
67
|
+ sum(IF(t.process_node = '01', 1, 0)) as unassigned_num,
|
|
68
|
+ sum(IF(t.process_node LIKE '02%', 1, 0)) as assigned_num,
|
|
69
|
+ sum(IF(t.process_node = '03', 1, 0)) as end_num
|
70
|
70
|
FROM
|
71
|
|
- ta_issue t
|
|
71
|
+ ta_issue t
|
72
|
72
|
WHERE 1 = 1
|
73
|
|
- <if test="null != userId and userId != ''">
|
74
|
|
- AND t.create_user = #{userId}
|
75
|
|
- </if>
|
76
|
|
- AND t.`status` > - 1
|
|
73
|
+ <if test="null != userId and userId != ''">
|
|
74
|
+ AND t.create_user = #{userId}
|
|
75
|
+ </if>
|
|
76
|
+ AND t.`status` > - 1
|
77
|
77
|
</select>
|
78
|
78
|
<select id="statIssueOrg" resultType="java.util.Map">
|
79
|
79
|
SELECT
|
80
|
|
- UUID_SHORT( ) AS id,
|
81
|
|
- IFNULL( SUM( IF ( t.process_node = '03', 1, 0 ) ), 0 ) AS endNum,
|
82
|
|
- IFNULL( SUM( IF ( TO_DAYS(t.expire_date) >= TO_DAYS(NOW()) AND t.process_node LIKE '02%', 1, 0 ) ), 0 ) AS assignedNum,
|
83
|
|
- IFNULL( SUM( IF ( TO_DAYS(t.expire_date) < TO_DAYS(NOW()) AND t.process_node LIKE '02%', 1, 0 ) ), 0 ) AS expireNum
|
|
80
|
+ UUID_SHORT( ) AS id,
|
|
81
|
+ IFNULL( SUM( IF ( t.process_node = '03', 1, 0 ) ), 0 ) AS endNum,
|
|
82
|
+ IFNULL( SUM( IF ( TO_DAYS(t.expire_date) >= TO_DAYS(NOW()) AND t.process_node LIKE '02%', 1, 0 ) ), 0 ) AS
|
|
83
|
+ assignedNum,
|
|
84
|
+ IFNULL( SUM( IF ( TO_DAYS(t.expire_date) < TO_DAYS(NOW()) AND t.process_node LIKE '02%', 1, 0 ) ), 0 ) AS
|
|
85
|
+ expireNum
|
84
|
86
|
FROM
|
85
|
|
- ta_issue t
|
|
87
|
+ ta_issue t
|
86
|
88
|
WHERE
|
87
|
|
- t.org_id = #{orgId}
|
88
|
|
- AND t.`status` > -1
|
|
89
|
+ t.org_id = #{orgId}
|
|
90
|
+ AND t.`status` > -1
|
89
|
91
|
</select>
|
90
|
92
|
<select id="statIssueType" resultType="com.example.civilizedcity.vo.StatVo">
|
91
|
93
|
SELECT
|
92
|
|
- *
|
|
94
|
+ *
|
93
|
95
|
FROM
|
94
|
|
- (
|
95
|
|
- SELECT
|
96
|
|
- t.`name`,
|
97
|
|
- sum( IF ( s.issue_id IS NULL, 0, 1 ) ) AS `value`
|
98
|
|
- FROM
|
99
|
|
- td_issue_type t
|
100
|
|
- LEFT JOIN ta_issue s ON s.type_id = t.type_id
|
101
|
|
- AND s.`status` > - 1
|
102
|
|
- GROUP BY
|
103
|
|
- t.type_id
|
104
|
|
- ) a
|
|
96
|
+ (
|
|
97
|
+ SELECT
|
|
98
|
+ t.`name`,
|
|
99
|
+ sum( IF ( s.issue_id IS NULL, 0, 1 ) ) AS `value`
|
|
100
|
+ FROM
|
|
101
|
+ td_issue_type t
|
|
102
|
+ LEFT JOIN ta_issue s ON s.type_id = t.type_id
|
|
103
|
+ AND s.`status` > - 1
|
|
104
|
+ GROUP BY
|
|
105
|
+ t.type_id
|
|
106
|
+ ) a
|
105
|
107
|
ORDER BY
|
106
|
|
- a.`value` DESC
|
|
108
|
+ a.`value` DESC
|
107
|
109
|
</select>
|
108
|
110
|
<select id="statIssueLoc" resultType="com.example.civilizedcity.vo.StatVo">
|
109
|
111
|
SELECT
|
110
|
|
- *
|
|
112
|
+ *
|
111
|
113
|
FROM
|
112
|
|
- (
|
113
|
|
- SELECT
|
114
|
|
- t.`name`,
|
115
|
|
- ifnull( s.cnt, 0 ) AS `value`
|
116
|
|
- FROM
|
117
|
|
- td_loc_type t
|
118
|
|
- LEFT JOIN (
|
119
|
|
- SELECT
|
120
|
|
- a.loc_id,
|
121
|
|
- count( 1 ) AS cnt
|
122
|
|
- FROM
|
123
|
|
- ta_issue a
|
124
|
|
- WHERE
|
125
|
|
- a.`status` > - 1
|
126
|
|
- GROUP BY
|
127
|
|
- a.loc_id
|
128
|
|
- ) s ON t.type_id = s.loc_id
|
129
|
|
- ) m
|
|
114
|
+ (
|
|
115
|
+ SELECT
|
|
116
|
+ t.`name`,
|
|
117
|
+ ifnull( s.cnt, 0 ) AS `value`
|
|
118
|
+ FROM
|
|
119
|
+ td_loc_type t
|
|
120
|
+ LEFT JOIN (
|
|
121
|
+ SELECT
|
|
122
|
+ a.loc_id,
|
|
123
|
+ count( 1 ) AS cnt
|
|
124
|
+ FROM
|
|
125
|
+ ta_issue a
|
|
126
|
+ WHERE
|
|
127
|
+ a.`status` > - 1
|
|
128
|
+ GROUP BY
|
|
129
|
+ a.loc_id
|
|
130
|
+ ) s ON t.type_id = s.loc_id
|
|
131
|
+ ) m
|
130
|
132
|
ORDER BY
|
131
|
|
- m.`value` DESC
|
|
133
|
+ m.`value` DESC
|
|
134
|
+ </select>
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+ <select id="expectRubNum" resultType="java.lang.Long">
|
|
138
|
+ SELECT
|
|
139
|
+ COUNT( 1 ) AS rubNum
|
|
140
|
+ FROM
|
|
141
|
+ `ta_issue` s
|
|
142
|
+ WHERE
|
|
143
|
+ s.`status` = 1
|
|
144
|
+ AND s.process_node != '03'
|
|
145
|
+ AND TO_DAYS( s.expire_date ) <
|
|
146
|
+ TO_DAYS( NOW( ) )
|
|
147
|
+ AND s.org_id = #{orgId}
|
|
148
|
+ </select>
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+ <select id="AssignedRubNum" resultType="java.lang.Long">
|
|
152
|
+ SELECT
|
|
153
|
+ COUNT(1) as rubNum
|
|
154
|
+ FROM
|
|
155
|
+ `ta_issue` s
|
|
156
|
+ WHERE
|
|
157
|
+ s.`status` = 1
|
|
158
|
+ AND s.process_node LIKE '01'
|
|
159
|
+ AND s.org_id = #{orgId}
|
132
|
160
|
</select>
|
133
|
161
|
</mapper>
|