Преглед изворни кода

巡检统计-问题项统计数量修改为人次维度

chenshudong пре 3 недеља
родитељ
комит
0ac08b03cd
1 измењених фајлова са 51 додато и 11 уклоњено
  1. 51 11
      airport-check/src/main/resources/mapper/check/CheckLargeScreenMapper.xml

+ 51 - 11
airport-check/src/main/resources/mapper/check/CheckLargeScreenMapper.xml

@@ -70,9 +70,11 @@
70
     </select>
70
     </select>
71
 
71
 
72
     <select id="problemDistribution" resultType="com.sundot.airport.check.domain.CheckLargeScreenProblemDto">
72
     <select id="problemDistribution" resultType="com.sundot.airport.check.domain.CheckLargeScreenProblemDto">
73
-        select cpi.category_code_one code, cpi.category_name_one name, count(cpi.id) total
73
+        select cpi.category_code_one code, cpi.category_name_one name, count(cu.id) total
74
         from check_correction cc
74
         from check_correction cc
75
         inner join check_project_item cpi on (cpi.source_id = cc.id and cpi.type = 'CHECK_CORRECTION')
75
         inner join check_project_item cpi on (cpi.source_id = cc.id and cpi.type = 'CHECK_CORRECTION')
76
+        inner join check_user cu on
77
+        (cu.source_id = cpi.id and cu.type = 'PROBLEM_RECTIFICATION_INSPECTION_ITEM_DETAILS')
76
         where 1 = 1
78
         where 1 = 1
77
         <if test="isSelfCheck != null">
79
         <if test="isSelfCheck != null">
78
             and cc.is_self_check=#{isSelfCheck}
80
             and cc.is_self_check=#{isSelfCheck}
@@ -99,9 +101,11 @@
99
         cc.checked_brigade_name deptName,
101
         cc.checked_brigade_name deptName,
100
         cpi.category_code_one code,
102
         cpi.category_code_one code,
101
         cpi.category_name_one name,
103
         cpi.category_name_one name,
102
-        count(cpi.id) total
104
+        count(cu.id) total
103
         from check_correction cc
105
         from check_correction cc
104
         inner join check_project_item cpi on (cpi.source_id = cc.id and cpi.type = 'CHECK_CORRECTION')
106
         inner join check_project_item cpi on (cpi.source_id = cc.id and cpi.type = 'CHECK_CORRECTION')
107
+        inner join check_user cu on
108
+        (cu.source_id = cpi.id and cu.type = 'PROBLEM_RECTIFICATION_INSPECTION_ITEM_DETAILS')
105
         where 1 = 1
109
         where 1 = 1
106
         <if test="isSelfCheck != null">
110
         <if test="isSelfCheck != null">
107
             and cc.is_self_check=#{isSelfCheck}
111
             and cc.is_self_check=#{isSelfCheck}
@@ -128,9 +132,11 @@
128
         cc.checked_department_name deptName,
132
         cc.checked_department_name deptName,
129
         cpi.category_code_one code,
133
         cpi.category_code_one code,
130
         cpi.category_name_one name,
134
         cpi.category_name_one name,
131
-        count(cpi.id) total
135
+        count(cu.id) total
132
         from check_correction cc
136
         from check_correction cc
133
         inner join check_project_item cpi on (cpi.source_id = cc.id and cpi.type = 'CHECK_CORRECTION')
137
         inner join check_project_item cpi on (cpi.source_id = cc.id and cpi.type = 'CHECK_CORRECTION')
138
+        inner join check_user cu on
139
+        (cu.source_id = cpi.id and cu.type = 'PROBLEM_RECTIFICATION_INSPECTION_ITEM_DETAILS')
134
         where 1 = 1
140
         where 1 = 1
135
         <if test="isSelfCheck != null">
141
         <if test="isSelfCheck != null">
136
             and cc.is_self_check=#{isSelfCheck}
142
             and cc.is_self_check=#{isSelfCheck}
@@ -157,9 +163,11 @@
157
         cc.checked_brigade_name deptName,
163
         cc.checked_brigade_name deptName,
158
         cpi.category_code_two code,
164
         cpi.category_code_two code,
159
         cpi.category_name_two name,
165
         cpi.category_name_two name,
160
-        count(cpi.id) total
166
+        count(cu.id) total
161
         from check_correction cc
167
         from check_correction cc
162
         inner join check_project_item cpi on (cpi.source_id = cc.id and cpi.type = 'CHECK_CORRECTION')
168
         inner join check_project_item cpi on (cpi.source_id = cc.id and cpi.type = 'CHECK_CORRECTION')
169
+        inner join check_user cu on
170
+        (cu.source_id = cpi.id and cu.type = 'PROBLEM_RECTIFICATION_INSPECTION_ITEM_DETAILS')
163
         where 1 = 1
171
         where 1 = 1
164
         <if test="isSelfCheck != null">
172
         <if test="isSelfCheck != null">
165
             and cc.is_self_check=#{isSelfCheck}
173
             and cc.is_self_check=#{isSelfCheck}
@@ -189,9 +197,11 @@
189
         cc.checked_department_name deptName,
197
         cc.checked_department_name deptName,
190
         cpi.category_code_two code,
198
         cpi.category_code_two code,
191
         cpi.category_name_two name,
199
         cpi.category_name_two name,
192
-        count(cpi.id) total
200
+        count(cu.id) total
193
         from check_correction cc
201
         from check_correction cc
194
         inner join check_project_item cpi on (cpi.source_id = cc.id and cpi.type = 'CHECK_CORRECTION')
202
         inner join check_project_item cpi on (cpi.source_id = cc.id and cpi.type = 'CHECK_CORRECTION')
203
+        inner join check_user cu on
204
+        (cu.source_id = cpi.id and cu.type = 'PROBLEM_RECTIFICATION_INSPECTION_ITEM_DETAILS')
195
         where 1 = 1
205
         where 1 = 1
196
         <if test="isSelfCheck != null">
206
         <if test="isSelfCheck != null">
197
             and cc.is_self_check=#{isSelfCheck}
207
             and cc.is_self_check=#{isSelfCheck}
@@ -221,9 +231,11 @@
221
         cc.checked_team_name deptName,
231
         cc.checked_team_name deptName,
222
         cpi.category_code_one code,
232
         cpi.category_code_one code,
223
         cpi.category_name_one name,
233
         cpi.category_name_one name,
224
-        count(cpi.id) total
234
+        count(cu.id) total
225
         from check_correction cc
235
         from check_correction cc
226
         inner join check_project_item cpi on (cpi.source_id = cc.id and cpi.type = 'CHECK_CORRECTION')
236
         inner join check_project_item cpi on (cpi.source_id = cc.id and cpi.type = 'CHECK_CORRECTION')
237
+        inner join check_user cu on
238
+        (cu.source_id = cpi.id and cu.type = 'PROBLEM_RECTIFICATION_INSPECTION_ITEM_DETAILS')
227
         where 1 = 1
239
         where 1 = 1
228
         <if test="isSelfCheck != null">
240
         <if test="isSelfCheck != null">
229
             and cc.is_self_check=#{isSelfCheck}
241
             and cc.is_self_check=#{isSelfCheck}
@@ -250,9 +262,11 @@
250
         cc.checked_team_name deptName,
262
         cc.checked_team_name deptName,
251
         cpi.category_code_two code,
263
         cpi.category_code_two code,
252
         cpi.category_name_two name,
264
         cpi.category_name_two name,
253
-        count(cpi.id) total
265
+        count(cu.id) total
254
         from check_correction cc
266
         from check_correction cc
255
         inner join check_project_item cpi on (cpi.source_id = cc.id and cpi.type = 'CHECK_CORRECTION')
267
         inner join check_project_item cpi on (cpi.source_id = cc.id and cpi.type = 'CHECK_CORRECTION')
268
+        inner join check_user cu on
269
+        (cu.source_id = cpi.id and cu.type = 'PROBLEM_RECTIFICATION_INSPECTION_ITEM_DETAILS')
256
         where 1 = 1
270
         where 1 = 1
257
         <if test="isSelfCheck != null">
271
         <if test="isSelfCheck != null">
258
             and cc.is_self_check=#{isSelfCheck}
272
             and cc.is_self_check=#{isSelfCheck}
@@ -281,9 +295,11 @@
281
         select date_format(cc.check_time, '%Y-%m-%d') date,
295
         select date_format(cc.check_time, '%Y-%m-%d') date,
282
         cc.checked_brigade_id id,
296
         cc.checked_brigade_id id,
283
         cc.checked_brigade_name name,
297
         cc.checked_brigade_name name,
284
-        count(cpi.id) total
298
+        count(cu.id) total
285
         from check_correction cc
299
         from check_correction cc
286
         inner join check_project_item cpi on (cpi.source_id = cc.id and cpi.type = 'CHECK_CORRECTION')
300
         inner join check_project_item cpi on (cpi.source_id = cc.id and cpi.type = 'CHECK_CORRECTION')
301
+        inner join check_user cu on
302
+        (cu.source_id = cpi.id and cu.type = 'PROBLEM_RECTIFICATION_INSPECTION_ITEM_DETAILS')
287
         where 1 = 1
303
         where 1 = 1
288
         <if test="isSelfCheck != null">
304
         <if test="isSelfCheck != null">
289
             and cc.is_self_check=#{isSelfCheck}
305
             and cc.is_self_check=#{isSelfCheck}
@@ -312,9 +328,11 @@
312
         select date_format(cc.check_time, '%Y-%m-%d') date,
328
         select date_format(cc.check_time, '%Y-%m-%d') date,
313
         cc.checked_department_id id,
329
         cc.checked_department_id id,
314
         cc.checked_department_name name,
330
         cc.checked_department_name name,
315
-        count(cpi.id) total
331
+        count(cu.id) total
316
         from check_correction cc
332
         from check_correction cc
317
         inner join check_project_item cpi on (cpi.source_id = cc.id and cpi.type = 'CHECK_CORRECTION')
333
         inner join check_project_item cpi on (cpi.source_id = cc.id and cpi.type = 'CHECK_CORRECTION')
334
+        inner join check_user cu on
335
+        (cu.source_id = cpi.id and cu.type = 'PROBLEM_RECTIFICATION_INSPECTION_ITEM_DETAILS')
318
         where 1 = 1
336
         where 1 = 1
319
         <if test="isSelfCheck != null">
337
         <if test="isSelfCheck != null">
320
             and cc.is_self_check=#{isSelfCheck}
338
             and cc.is_self_check=#{isSelfCheck}
@@ -343,9 +361,11 @@
343
         select date_format(cc.check_time, '%Y-%m-%d') date,
361
         select date_format(cc.check_time, '%Y-%m-%d') date,
344
         cc.checked_team_id id,
362
         cc.checked_team_id id,
345
         cc.checked_team_name name,
363
         cc.checked_team_name name,
346
-        count(cpi.id) total
364
+        count(cu.id) total
347
         from check_correction cc
365
         from check_correction cc
348
         inner join check_project_item cpi on (cpi.source_id = cc.id and cpi.type = 'CHECK_CORRECTION')
366
         inner join check_project_item cpi on (cpi.source_id = cc.id and cpi.type = 'CHECK_CORRECTION')
367
+        inner join check_user cu on
368
+        (cu.source_id = cpi.id and cu.type = 'PROBLEM_RECTIFICATION_INSPECTION_ITEM_DETAILS')
349
         where 1 = 1
369
         where 1 = 1
350
         <if test="isSelfCheck != null">
370
         <if test="isSelfCheck != null">
351
             and cc.is_self_check=#{isSelfCheck}
371
             and cc.is_self_check=#{isSelfCheck}
@@ -388,6 +408,9 @@
388
         then 'OVER_TIME_UNFINISHED'
408
         then 'OVER_TIME_UNFINISHED'
389
         else 'OTHER' end type
409
         else 'OTHER' end type
390
         from check_correction cc
410
         from check_correction cc
411
+        inner join check_project_item cpi on (cpi.source_id = cc.id and cpi.type = 'CHECK_CORRECTION')
412
+        inner join check_user cu on
413
+        (cu.source_id = cpi.id and cu.type = 'PROBLEM_RECTIFICATION_INSPECTION_ITEM_DETAILS')
391
         where 1 = 1
414
         where 1 = 1
392
         <if test="isSelfCheck != null">
415
         <if test="isSelfCheck != null">
393
             and cc.is_self_check=#{isSelfCheck}
416
             and cc.is_self_check=#{isSelfCheck}
@@ -429,6 +452,9 @@
429
         then 'OVER_TIME_UNFINISHED'
452
         then 'OVER_TIME_UNFINISHED'
430
         else 'OTHER' end type
453
         else 'OTHER' end type
431
         from check_correction cc
454
         from check_correction cc
455
+        inner join check_project_item cpi on (cpi.source_id = cc.id and cpi.type = 'CHECK_CORRECTION')
456
+        inner join check_user cu on
457
+        (cu.source_id = cpi.id and cu.type = 'PROBLEM_RECTIFICATION_INSPECTION_ITEM_DETAILS')
432
         where 1 = 1
458
         where 1 = 1
433
         <if test="isSelfCheck != null">
459
         <if test="isSelfCheck != null">
434
             and cc.is_self_check=#{isSelfCheck}
460
             and cc.is_self_check=#{isSelfCheck}
@@ -470,6 +496,9 @@
470
         then 'OVER_TIME_UNFINISHED'
496
         then 'OVER_TIME_UNFINISHED'
471
         else 'OTHER' end type
497
         else 'OTHER' end type
472
         from check_correction cc
498
         from check_correction cc
499
+        inner join check_project_item cpi on (cpi.source_id = cc.id and cpi.type = 'CHECK_CORRECTION')
500
+        inner join check_user cu on
501
+        (cu.source_id = cpi.id and cu.type = 'PROBLEM_RECTIFICATION_INSPECTION_ITEM_DETAILS')
473
         where 1 = 1
502
         where 1 = 1
474
         <if test="isSelfCheck != null">
503
         <if test="isSelfCheck != null">
475
             and cc.is_self_check=#{isSelfCheck}
504
             and cc.is_self_check=#{isSelfCheck}
@@ -511,6 +540,9 @@
511
         then 'OVER_TIME_UNFINISHED'
540
         then 'OVER_TIME_UNFINISHED'
512
         else 'OTHER' end type
541
         else 'OTHER' end type
513
         from check_correction cc
542
         from check_correction cc
543
+        inner join check_project_item cpi on (cpi.source_id = cc.id and cpi.type = 'CHECK_CORRECTION')
544
+        inner join check_user cu on
545
+        (cu.source_id = cpi.id and cu.type = 'PROBLEM_RECTIFICATION_INSPECTION_ITEM_DETAILS')
514
         where 1 = 1
546
         where 1 = 1
515
         <if test="isSelfCheck != null">
547
         <if test="isSelfCheck != null">
516
             and cc.is_self_check=#{isSelfCheck}
548
             and cc.is_self_check=#{isSelfCheck}
@@ -552,10 +584,12 @@
552
         cr.checker_name userName,
584
         cr.checker_name userName,
553
         count(distinct cr.id) checkOrderCount,
585
         count(distinct cr.id) checkOrderCount,
554
         count(distinct cc.id) rectificationOrderCount,
586
         count(distinct cc.id) rectificationOrderCount,
555
-        count(distinct cpi.id) unqualifiedProjectCount
587
+        count(distinct cu.id) unqualifiedProjectCount
556
         from check_record cr
588
         from check_record cr
557
         left join check_correction cc on cc.check_record_id = cr.id
589
         left join check_correction cc on cc.check_record_id = cr.id
558
         left join check_project_item cpi on (cpi.source_id = cc.id and cpi.type = 'CHECK_CORRECTION')
590
         left join check_project_item cpi on (cpi.source_id = cc.id and cpi.type = 'CHECK_CORRECTION')
591
+        left join check_user cu on
592
+        (cu.source_id = cpi.id and cu.type = 'PROBLEM_RECTIFICATION_INSPECTION_ITEM_DETAILS')
559
         where 1 = 1
593
         where 1 = 1
560
         and cr.task_code in
594
         and cr.task_code in
561
         <foreach item="item" collection="list" open="(" separator="," close=")">
595
         <foreach item="item" collection="list" open="(" separator="," close=")">
@@ -592,6 +626,8 @@
592
         cc.checked_brigade_name deptName
626
         cc.checked_brigade_name deptName
593
         from check_correction cc
627
         from check_correction cc
594
         inner join check_project_item cpi on (cpi.source_id = cc.id and cpi.type = 'CHECK_CORRECTION')
628
         inner join check_project_item cpi on (cpi.source_id = cc.id and cpi.type = 'CHECK_CORRECTION')
629
+        inner join check_user cu on
630
+        (cu.source_id = cpi.id and cu.type = 'PROBLEM_RECTIFICATION_INSPECTION_ITEM_DETAILS')
595
         where 1 = 1
631
         where 1 = 1
596
         <if test="isSelfCheck != null">
632
         <if test="isSelfCheck != null">
597
             and cc.is_self_check=#{isSelfCheck}
633
             and cc.is_self_check=#{isSelfCheck}
@@ -616,6 +652,8 @@
616
         cc.checked_department_name deptName
652
         cc.checked_department_name deptName
617
         from check_correction cc
653
         from check_correction cc
618
         inner join check_project_item cpi on (cpi.source_id = cc.id and cpi.type = 'CHECK_CORRECTION')
654
         inner join check_project_item cpi on (cpi.source_id = cc.id and cpi.type = 'CHECK_CORRECTION')
655
+        inner join check_user cu on
656
+        (cu.source_id = cpi.id and cu.type = 'PROBLEM_RECTIFICATION_INSPECTION_ITEM_DETAILS')
619
         where 1 = 1
657
         where 1 = 1
620
         <if test="isSelfCheck != null">
658
         <if test="isSelfCheck != null">
621
             and cc.is_self_check=#{isSelfCheck}
659
             and cc.is_self_check=#{isSelfCheck}
@@ -640,6 +678,8 @@
640
         cc.checked_team_name deptName
678
         cc.checked_team_name deptName
641
         from check_correction cc
679
         from check_correction cc
642
         inner join check_project_item cpi on (cpi.source_id = cc.id and cpi.type = 'CHECK_CORRECTION')
680
         inner join check_project_item cpi on (cpi.source_id = cc.id and cpi.type = 'CHECK_CORRECTION')
681
+        inner join check_user cu on
682
+        (cu.source_id = cpi.id and cu.type = 'PROBLEM_RECTIFICATION_INSPECTION_ITEM_DETAILS')
643
         where 1 = 1
683
         where 1 = 1
644
         <if test="isSelfCheck != null">
684
         <if test="isSelfCheck != null">
645
             and cc.is_self_check=#{isSelfCheck}
685
             and cc.is_self_check=#{isSelfCheck}