|
|
@@ -8,217 +8,219 @@
|
|
8
|
8
|
<select id="selectPersonalEffectiveSeizureCount" resultType="java.lang.Long">
|
|
9
|
9
|
SELECT IFNULL(SUM(isi.quantity), 0)
|
|
10
|
10
|
FROM item_seizure_record isr
|
|
11
|
|
- LEFT JOIN item_seizure_items isi ON isr.id = isi.record_id
|
|
|
11
|
+ LEFT JOIN item_seizure_items isi ON isr.id = isi.record_id
|
|
12
|
12
|
WHERE isr.inspect_user_id = #{userId}
|
|
13
|
13
|
AND isr.seizure_time >= #{startTime}
|
|
14
|
14
|
AND isr.seizure_time <= #{endTime}
|
|
15
|
|
- AND isr.process_status = '3' -- 已归档状态
|
|
|
15
|
+ AND isr.process_status = '3' -- 已归档状态
|
|
16
|
16
|
</select>
|
|
17
|
17
|
|
|
18
|
18
|
<!-- 个人故意隐匿查获数量 -->
|
|
19
|
19
|
<select id="selectPersonalWillfulConcealmentCount" resultType="java.lang.Long">
|
|
20
|
20
|
SELECT IFNULL(SUM(isi.quantity), 0)
|
|
21
|
21
|
FROM item_seizure_record isr
|
|
22
|
|
- LEFT JOIN item_seizure_items isi ON isr.id = isi.record_id
|
|
|
22
|
+ LEFT JOIN item_seizure_items isi ON isr.id = isi.record_id
|
|
23
|
23
|
WHERE isr.inspect_user_id = #{userId}
|
|
24
|
24
|
AND isr.seizure_time >= #{startTime}
|
|
25
|
25
|
AND isr.seizure_time <= #{endTime}
|
|
26
|
26
|
AND isi.is_active_concealment = 1
|
|
27
|
|
- AND isr.process_status = '3' -- 已归档状态
|
|
|
27
|
+ AND isr.process_status = '3' -- 已归档状态
|
|
28
|
28
|
</select>
|
|
29
|
29
|
|
|
30
|
30
|
<!-- 个人移交公安查获数量 -->
|
|
31
|
31
|
<select id="selectPersonalReferToPoliceCount" resultType="java.lang.Long">
|
|
32
|
32
|
SELECT IFNULL(SUM(isi.quantity), 0)
|
|
33
|
33
|
FROM item_seizure_record isr
|
|
34
|
|
- LEFT JOIN item_seizure_items isi ON isr.id = isi.record_id
|
|
|
34
|
+ LEFT JOIN item_seizure_items isi ON isr.id = isi.record_id
|
|
35
|
35
|
WHERE isr.inspect_user_id = #{userId}
|
|
36
|
36
|
AND isr.seizure_time >= #{startTime}
|
|
37
|
37
|
AND isr.seizure_time <= #{endTime}
|
|
38
|
38
|
AND isi.handling_method = 'TRANSFER_TO_AIRPORT_POLICE'
|
|
39
|
|
- AND isr.process_status = '3' -- 已归档状态
|
|
|
39
|
+ AND isr.process_status = '3' -- 已归档状态
|
|
40
|
40
|
</select>
|
|
41
|
41
|
|
|
42
|
42
|
<!-- 组织有效查获总量 -->
|
|
43
|
43
|
<select id="selectOrgEffectiveSeizureCount" resultType="com.sundot.airport.item.domain.portrait.SeizureStats">
|
|
44
|
|
- SELECT
|
|
45
|
|
- IFNULL(SUM(isi.quantity), 0) AS totalCount,
|
|
46
|
|
- COUNT(DISTINCT isr.inspect_user_id) AS count
|
|
|
44
|
+ SELECT
|
|
|
45
|
+ IFNULL(SUM(isi.quantity), 0) AS totalCount,
|
|
|
46
|
+ COUNT(DISTINCT isr.inspect_user_id) AS count
|
|
47
|
47
|
FROM item_seizure_record isr
|
|
48
|
48
|
LEFT JOIN item_seizure_items isi ON isr.id = isi.record_id
|
|
49
|
|
- WHERE
|
|
50
|
|
- <choose>
|
|
|
49
|
+ WHERE
|
|
|
50
|
+ <choose>
|
|
51
|
51
|
<when test="userType.name() == 'TEAM'">isr.inspect_team_id = #{deptId}</when>
|
|
52
|
52
|
<when test="userType.name() == 'DEPARTMENT'">isr.inspect_department_id = #{deptId}</when>
|
|
53
|
53
|
<when test="userType.name() == 'STATION'">isr.inspect_station_id = #{deptId}</when>
|
|
54
|
54
|
<otherwise>isr.inspect_team_id = #{deptId}</otherwise>
|
|
55
|
|
- </choose>
|
|
56
|
|
- AND isr.seizure_time >= #{startTime}
|
|
57
|
|
- AND isr.seizure_time <= #{endTime}
|
|
58
|
|
- AND isr.process_status = '3' -- 已归档状态
|
|
|
55
|
+ </choose>
|
|
|
56
|
+ AND isr.seizure_time >= #{startTime}
|
|
|
57
|
+ AND isr.seizure_time <= #{endTime}
|
|
|
58
|
+ AND isr.process_status = '3' -- 已归档状态
|
|
59
|
59
|
</select>
|
|
60
|
60
|
|
|
61
|
61
|
<!-- 组织故意隐匿查获总量 -->
|
|
62
|
62
|
<select id="selectOrgWillfulConcealmentCount" resultType="com.sundot.airport.item.domain.portrait.SeizureStats">
|
|
63
|
|
- SELECT
|
|
64
|
|
- IFNULL(SUM(isi.quantity), 0) AS totalCount,
|
|
65
|
|
- COUNT(DISTINCT isr.inspect_user_id) AS count
|
|
|
63
|
+ SELECT
|
|
|
64
|
+ IFNULL(SUM(isi.quantity), 0) AS totalCount,
|
|
|
65
|
+ COUNT(DISTINCT isr.inspect_user_id) AS count
|
|
66
|
66
|
FROM item_seizure_record isr
|
|
67
|
67
|
LEFT JOIN item_seizure_items isi ON isr.id = isi.record_id
|
|
68
|
|
- WHERE
|
|
69
|
|
- <choose>
|
|
|
68
|
+ WHERE
|
|
|
69
|
+ <choose>
|
|
70
|
70
|
<when test="userType.name() == 'TEAM'">isr.inspect_team_id = #{deptId}</when>
|
|
71
|
71
|
<when test="userType.name() == 'DEPARTMENT'">isr.inspect_department_id = #{deptId}</when>
|
|
72
|
72
|
<when test="userType.name() == 'STATION'">isr.inspect_station_id = #{deptId}</when>
|
|
73
|
73
|
<otherwise>isr.inspect_team_id = #{deptId}</otherwise>
|
|
74
|
|
- </choose>
|
|
75
|
|
- AND isr.seizure_time >= #{startTime}
|
|
76
|
|
- AND isr.seizure_time <= #{endTime}
|
|
77
|
|
- AND isi.is_active_concealment = 1
|
|
78
|
|
- AND isr.process_status = '3' -- 已归档状态
|
|
|
74
|
+ </choose>
|
|
|
75
|
+ AND isr.seizure_time >= #{startTime}
|
|
|
76
|
+ AND isr.seizure_time <= #{endTime}
|
|
|
77
|
+ AND isi.is_active_concealment = 1
|
|
|
78
|
+ AND isr.process_status = '3' -- 已归档状态
|
|
79
|
79
|
</select>
|
|
80
|
80
|
|
|
81
|
81
|
<!-- 组织移交公安查获总量 -->
|
|
82
|
82
|
<select id="selectOrgReferToPoliceCount" resultType="com.sundot.airport.item.domain.portrait.SeizureStats">
|
|
83
|
|
- SELECT
|
|
84
|
|
- IFNULL(SUM(isi.quantity), 0) AS totalCount,
|
|
85
|
|
- COUNT(DISTINCT isr.inspect_user_id) AS count
|
|
|
83
|
+ SELECT
|
|
|
84
|
+ IFNULL(SUM(isi.quantity), 0) AS totalCount,
|
|
|
85
|
+ COUNT(DISTINCT isr.inspect_user_id) AS count
|
|
86
|
86
|
FROM item_seizure_record isr
|
|
87
|
87
|
LEFT JOIN item_seizure_items isi ON isr.id = isi.record_id
|
|
88
|
|
- WHERE
|
|
89
|
|
- <choose>
|
|
|
88
|
+ WHERE
|
|
|
89
|
+ <choose>
|
|
90
|
90
|
<when test="userType.name() == 'TEAM'">isr.inspect_team_id = #{deptId}</when>
|
|
91
|
91
|
<when test="userType.name() == 'DEPARTMENT'">isr.inspect_department_id = #{deptId}</when>
|
|
92
|
92
|
<when test="userType.name() == 'STATION'">isr.inspect_station_id = #{deptId}</when>
|
|
93
|
93
|
<otherwise>isr.inspect_team_id = #{deptId}</otherwise>
|
|
94
|
|
- </choose>
|
|
95
|
|
- AND isr.seizure_time >= #{startTime}
|
|
96
|
|
- AND isr.seizure_time <= #{endTime}
|
|
97
|
|
- AND isi.handling_method = 'TRANSFER_TO_AIRPORT_POLICE'
|
|
98
|
|
- AND isr.process_status = '3' -- 已归档状态
|
|
|
94
|
+ </choose>
|
|
|
95
|
+ AND isr.seizure_time >= #{startTime}
|
|
|
96
|
+ AND isr.seizure_time <= #{endTime}
|
|
|
97
|
+ AND isi.handling_method = 'TRANSFER_TO_AIRPORT_POLICE'
|
|
|
98
|
+ AND isr.process_status = '3' -- 已归档状态
|
|
99
|
99
|
</select>
|
|
100
|
100
|
|
|
101
|
101
|
<!-- 组织有效查获总量 - 班组级别 -->
|
|
102
|
102
|
<select id="selectTeamEffectiveSeizureCount" resultType="com.sundot.airport.item.domain.portrait.SeizureStats">
|
|
103
|
|
- SELECT
|
|
104
|
|
- IFNULL(SUM(isi.quantity), 0) AS totalCount,
|
|
105
|
|
- COUNT(DISTINCT isr.inspect_user_id) AS count
|
|
|
103
|
+ SELECT IFNULL(SUM(isi.quantity), 0) AS totalCount,
|
|
|
104
|
+ COUNT(DISTINCT isr.inspect_user_id) AS count
|
|
106
|
105
|
FROM item_seizure_record isr
|
|
107
|
|
- LEFT JOIN item_seizure_items isi ON isr.id = isi.record_id
|
|
|
106
|
+ LEFT JOIN item_seizure_items isi
|
|
|
107
|
+ ON isr.id = isi.record_id
|
|
108
|
108
|
WHERE isr.inspect_team_id = #{teamId}
|
|
109
|
109
|
AND isr.seizure_time >= #{startTime}
|
|
110
|
110
|
AND isr.seizure_time <= #{endTime}
|
|
111
|
|
- AND isr.process_status = '3' -- 已归档状态
|
|
|
111
|
+ AND isr.process_status = '3' -- 已归档状态
|
|
112
|
112
|
</select>
|
|
113
|
113
|
|
|
114
|
114
|
<!-- 组织有效查获总量 - 科室级别 -->
|
|
115
|
|
- <select id="selectDepartmentEffectiveSeizureCount" resultType="com.sundot.airport.item.domain.portrait.SeizureStats">
|
|
116
|
|
- SELECT
|
|
117
|
|
- IFNULL(SUM(isi.quantity), 0) AS totalCount,
|
|
118
|
|
- COUNT(DISTINCT isr.inspect_user_id) AS count
|
|
|
115
|
+ <select id="selectDepartmentEffectiveSeizureCount"
|
|
|
116
|
+ resultType="com.sundot.airport.item.domain.portrait.SeizureStats">
|
|
|
117
|
+ SELECT IFNULL(SUM(isi.quantity), 0) AS totalCount,
|
|
|
118
|
+ COUNT(DISTINCT isr.inspect_user_id) AS count
|
|
119
|
119
|
FROM item_seizure_record isr
|
|
120
|
|
- LEFT JOIN item_seizure_items isi ON isr.id = isi.record_id
|
|
|
120
|
+ LEFT JOIN item_seizure_items isi
|
|
|
121
|
+ ON isr.id = isi.record_id
|
|
121
|
122
|
WHERE isr.inspect_department_id = #{departmentId}
|
|
122
|
123
|
AND isr.seizure_time >= #{startTime}
|
|
123
|
124
|
AND isr.seizure_time <= #{endTime}
|
|
124
|
|
- AND isr.process_status = '3' -- 已归档状态
|
|
|
125
|
+ AND isr.process_status = '3' -- 已归档状态
|
|
125
|
126
|
</select>
|
|
126
|
127
|
|
|
127
|
128
|
<!-- 组织有效查获总量 - 站点级别 -->
|
|
128
|
129
|
<select id="selectStationEffectiveSeizureCount" resultType="com.sundot.airport.item.domain.portrait.SeizureStats">
|
|
129
|
|
- SELECT
|
|
130
|
|
- IFNULL(SUM(isi.quantity), 0) AS totalCount,
|
|
131
|
|
- COUNT(DISTINCT isr.inspect_user_id) AS count
|
|
|
130
|
+ SELECT IFNULL(SUM(isi.quantity), 0) AS totalCount,
|
|
|
131
|
+ COUNT(DISTINCT isr.inspect_user_id) AS count
|
|
132
|
132
|
FROM item_seizure_record isr
|
|
133
|
|
- LEFT JOIN item_seizure_items isi ON isr.id = isi.record_id
|
|
|
133
|
+ LEFT JOIN item_seizure_items isi
|
|
|
134
|
+ ON isr.id = isi.record_id
|
|
134
|
135
|
WHERE isr.inspect_station_id = #{stationId}
|
|
135
|
136
|
AND isr.seizure_time >= #{startTime}
|
|
136
|
137
|
AND isr.seizure_time <= #{endTime}
|
|
137
|
|
- AND isr.process_status = '3' -- 已归档状态
|
|
|
138
|
+ AND isr.process_status = '3' -- 已归档状态
|
|
138
|
139
|
</select>
|
|
139
|
140
|
|
|
140
|
141
|
<!-- 组织故意隐匿查获总量 - 班组级别 -->
|
|
141
|
142
|
<select id="selectTeamWillfulConcealmentCount" resultType="com.sundot.airport.item.domain.portrait.SeizureStats">
|
|
142
|
|
- SELECT
|
|
143
|
|
- IFNULL(SUM(isi.quantity), 0) AS totalCount,
|
|
144
|
|
- COUNT(DISTINCT isr.inspect_user_id) AS count
|
|
|
143
|
+ SELECT IFNULL(SUM(isi.quantity), 0) AS totalCount,
|
|
|
144
|
+ COUNT(DISTINCT isr.inspect_user_id) AS count
|
|
145
|
145
|
FROM item_seizure_record isr
|
|
146
|
|
- LEFT JOIN item_seizure_items isi ON isr.id = isi.record_id
|
|
|
146
|
+ LEFT JOIN item_seizure_items isi
|
|
|
147
|
+ ON isr.id = isi.record_id
|
|
147
|
148
|
WHERE isr.inspect_team_id = #{teamId}
|
|
148
|
149
|
AND isr.seizure_time >= #{startTime}
|
|
149
|
150
|
AND isr.seizure_time <= #{endTime}
|
|
150
|
151
|
AND isi.is_active_concealment = 1
|
|
151
|
|
- AND isr.process_status = '3' -- 已归档状态
|
|
|
152
|
+ AND isr.process_status = '3' -- 已归档状态
|
|
152
|
153
|
</select>
|
|
153
|
154
|
|
|
154
|
155
|
<!-- 组织故意隐匿查获总量 - 科室级别 -->
|
|
155
|
|
- <select id="selectDepartmentWillfulConcealmentCount" resultType="com.sundot.airport.item.domain.portrait.SeizureStats">
|
|
156
|
|
- SELECT
|
|
157
|
|
- IFNULL(SUM(isi.quantity), 0) AS totalCount,
|
|
158
|
|
- COUNT(DISTINCT isr.inspect_user_id) AS count
|
|
|
156
|
+ <select id="selectDepartmentWillfulConcealmentCount"
|
|
|
157
|
+ resultType="com.sundot.airport.item.domain.portrait.SeizureStats">
|
|
|
158
|
+ SELECT IFNULL(SUM(isi.quantity), 0) AS totalCount,
|
|
|
159
|
+ COUNT(DISTINCT isr.inspect_user_id) AS count
|
|
159
|
160
|
FROM item_seizure_record isr
|
|
160
|
|
- LEFT JOIN item_seizure_items isi ON isr.id = isi.record_id
|
|
|
161
|
+ LEFT JOIN item_seizure_items isi
|
|
|
162
|
+ ON isr.id = isi.record_id
|
|
161
|
163
|
WHERE isr.inspect_department_id = #{departmentId}
|
|
162
|
164
|
AND isr.seizure_time >= #{startTime}
|
|
163
|
165
|
AND isr.seizure_time <= #{endTime}
|
|
164
|
166
|
AND isi.is_active_concealment = 1
|
|
165
|
|
- AND isr.process_status = '3' -- 已归档状态
|
|
|
167
|
+ AND isr.process_status = '3' -- 已归档状态
|
|
166
|
168
|
</select>
|
|
167
|
169
|
|
|
168
|
170
|
<!-- 组织故意隐匿查获总量 - 站点级别 -->
|
|
169
|
171
|
<select id="selectStationWillfulConcealmentCount" resultType="com.sundot.airport.item.domain.portrait.SeizureStats">
|
|
170
|
|
- SELECT
|
|
171
|
|
- IFNULL(SUM(isi.quantity), 0) AS totalCount,
|
|
172
|
|
- COUNT(DISTINCT isr.inspect_user_id) AS count
|
|
|
172
|
+ SELECT IFNULL(SUM(isi.quantity), 0) AS totalCount,
|
|
|
173
|
+ COUNT(DISTINCT isr.inspect_user_id) AS count
|
|
173
|
174
|
FROM item_seizure_record isr
|
|
174
|
|
- LEFT JOIN item_seizure_items isi ON isr.id = isi.record_id
|
|
|
175
|
+ LEFT JOIN item_seizure_items isi
|
|
|
176
|
+ ON isr.id = isi.record_id
|
|
175
|
177
|
WHERE isr.inspect_station_id = #{stationId}
|
|
176
|
178
|
AND isr.seizure_time >= #{startTime}
|
|
177
|
179
|
AND isr.seizure_time <= #{endTime}
|
|
178
|
180
|
AND isi.is_active_concealment = 1
|
|
179
|
|
- AND isr.process_status = '3' -- 已归档状态
|
|
|
181
|
+ AND isr.process_status = '3' -- 已归档状态
|
|
180
|
182
|
</select>
|
|
181
|
183
|
|
|
182
|
184
|
<!-- 组织移交公安查获总量 - 班组级别 -->
|
|
183
|
185
|
<select id="selectTeamReferToPoliceCount" resultType="com.sundot.airport.item.domain.portrait.SeizureStats">
|
|
184
|
|
- SELECT
|
|
185
|
|
- IFNULL(SUM(isi.quantity), 0) AS totalCount,
|
|
186
|
|
- COUNT(DISTINCT isr.inspect_user_id) AS count
|
|
|
186
|
+ SELECT IFNULL(SUM(isi.quantity), 0) AS totalCount,
|
|
|
187
|
+ COUNT(DISTINCT isr.inspect_user_id) AS count
|
|
187
|
188
|
FROM item_seizure_record isr
|
|
188
|
|
- LEFT JOIN item_seizure_items isi ON isr.id = isi.record_id
|
|
|
189
|
+ LEFT JOIN item_seizure_items isi
|
|
|
190
|
+ ON isr.id = isi.record_id
|
|
189
|
191
|
WHERE isr.inspect_team_id = #{teamId}
|
|
190
|
192
|
AND isr.seizure_time >= #{startTime}
|
|
191
|
193
|
AND isr.seizure_time <= #{endTime}
|
|
192
|
194
|
AND isi.handling_method = 'TRANSFER_TO_AIRPORT_POLICE'
|
|
193
|
|
- AND isr.process_status = '3' -- 已归档状态
|
|
|
195
|
+ AND isr.process_status = '3' -- 已归档状态
|
|
194
|
196
|
</select>
|
|
195
|
197
|
|
|
196
|
198
|
<!-- 组织移交公安查获总量 - 科室级别 -->
|
|
197
|
199
|
<select id="selectDepartmentReferToPoliceCount" resultType="com.sundot.airport.item.domain.portrait.SeizureStats">
|
|
198
|
|
- SELECT
|
|
199
|
|
- IFNULL(SUM(isi.quantity), 0) AS totalCount,
|
|
200
|
|
- COUNT(DISTINCT isr.inspect_user_id) AS count
|
|
|
200
|
+ SELECT IFNULL(SUM(isi.quantity), 0) AS totalCount,
|
|
|
201
|
+ COUNT(DISTINCT isr.inspect_user_id) AS count
|
|
201
|
202
|
FROM item_seizure_record isr
|
|
202
|
|
- LEFT JOIN item_seizure_items isi ON isr.id = isi.record_id
|
|
|
203
|
+ LEFT JOIN item_seizure_items isi
|
|
|
204
|
+ ON isr.id = isi.record_id
|
|
203
|
205
|
WHERE isr.inspect_department_id = #{departmentId}
|
|
204
|
206
|
AND isr.seizure_time >= #{startTime}
|
|
205
|
207
|
AND isr.seizure_time <= #{endTime}
|
|
206
|
208
|
AND isi.handling_method = 'TRANSFER_TO_AIRPORT_POLICE'
|
|
207
|
|
- AND isr.process_status = '3' -- 已归档状态
|
|
|
209
|
+ AND isr.process_status = '3' -- 已归档状态
|
|
208
|
210
|
</select>
|
|
209
|
211
|
|
|
210
|
212
|
<!-- 组织移交公安查获总量 - 站点级别 -->
|
|
211
|
213
|
<select id="selectStationReferToPoliceCount" resultType="com.sundot.airport.item.domain.portrait.SeizureStats">
|
|
212
|
|
- SELECT
|
|
213
|
|
- IFNULL(SUM(isi.quantity), 0) AS totalCount,
|
|
214
|
|
- COUNT(DISTINCT isr.inspect_user_id) AS count
|
|
|
214
|
+ SELECT IFNULL(SUM(isi.quantity), 0) AS totalCount,
|
|
|
215
|
+ COUNT(DISTINCT isr.inspect_user_id) AS count
|
|
215
|
216
|
FROM item_seizure_record isr
|
|
216
|
|
- LEFT JOIN item_seizure_items isi ON isr.id = isi.record_id
|
|
|
217
|
+ LEFT JOIN item_seizure_items isi
|
|
|
218
|
+ ON isr.id = isi.record_id
|
|
217
|
219
|
WHERE isr.inspect_station_id = #{stationId}
|
|
218
|
220
|
AND isr.seizure_time >= #{startTime}
|
|
219
|
221
|
AND isr.seizure_time <= #{endTime}
|
|
220
|
222
|
AND isi.handling_method = 'TRANSFER_TO_AIRPORT_POLICE'
|
|
221
|
|
- AND isr.process_status = '3' -- 已归档状态
|
|
|
223
|
+ AND isr.process_status = '3' -- 已归档状态
|
|
222
|
224
|
</select>
|
|
223
|
225
|
|
|
224
|
226
|
</mapper>
|