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

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

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 70
     </select>
71 71
 
72 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 74
         from check_correction cc
75 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 78
         where 1 = 1
77 79
         <if test="isSelfCheck != null">
78 80
             and cc.is_self_check=#{isSelfCheck}
@@ -99,9 +101,11 @@
99 101
         cc.checked_brigade_name deptName,
100 102
         cpi.category_code_one code,
101 103
         cpi.category_name_one name,
102
-        count(cpi.id) total
104
+        count(cu.id) total
103 105
         from check_correction cc
104 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 109
         where 1 = 1
106 110
         <if test="isSelfCheck != null">
107 111
             and cc.is_self_check=#{isSelfCheck}
@@ -128,9 +132,11 @@
128 132
         cc.checked_department_name deptName,
129 133
         cpi.category_code_one code,
130 134
         cpi.category_name_one name,
131
-        count(cpi.id) total
135
+        count(cu.id) total
132 136
         from check_correction cc
133 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 140
         where 1 = 1
135 141
         <if test="isSelfCheck != null">
136 142
             and cc.is_self_check=#{isSelfCheck}
@@ -157,9 +163,11 @@
157 163
         cc.checked_brigade_name deptName,
158 164
         cpi.category_code_two code,
159 165
         cpi.category_name_two name,
160
-        count(cpi.id) total
166
+        count(cu.id) total
161 167
         from check_correction cc
162 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 171
         where 1 = 1
164 172
         <if test="isSelfCheck != null">
165 173
             and cc.is_self_check=#{isSelfCheck}
@@ -189,9 +197,11 @@
189 197
         cc.checked_department_name deptName,
190 198
         cpi.category_code_two code,
191 199
         cpi.category_name_two name,
192
-        count(cpi.id) total
200
+        count(cu.id) total
193 201
         from check_correction cc
194 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 205
         where 1 = 1
196 206
         <if test="isSelfCheck != null">
197 207
             and cc.is_self_check=#{isSelfCheck}
@@ -221,9 +231,11 @@
221 231
         cc.checked_team_name deptName,
222 232
         cpi.category_code_one code,
223 233
         cpi.category_name_one name,
224
-        count(cpi.id) total
234
+        count(cu.id) total
225 235
         from check_correction cc
226 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 239
         where 1 = 1
228 240
         <if test="isSelfCheck != null">
229 241
             and cc.is_self_check=#{isSelfCheck}
@@ -250,9 +262,11 @@
250 262
         cc.checked_team_name deptName,
251 263
         cpi.category_code_two code,
252 264
         cpi.category_name_two name,
253
-        count(cpi.id) total
265
+        count(cu.id) total
254 266
         from check_correction cc
255 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 270
         where 1 = 1
257 271
         <if test="isSelfCheck != null">
258 272
             and cc.is_self_check=#{isSelfCheck}
@@ -281,9 +295,11 @@
281 295
         select date_format(cc.check_time, '%Y-%m-%d') date,
282 296
         cc.checked_brigade_id id,
283 297
         cc.checked_brigade_name name,
284
-        count(cpi.id) total
298
+        count(cu.id) total
285 299
         from check_correction cc
286 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 303
         where 1 = 1
288 304
         <if test="isSelfCheck != null">
289 305
             and cc.is_self_check=#{isSelfCheck}
@@ -312,9 +328,11 @@
312 328
         select date_format(cc.check_time, '%Y-%m-%d') date,
313 329
         cc.checked_department_id id,
314 330
         cc.checked_department_name name,
315
-        count(cpi.id) total
331
+        count(cu.id) total
316 332
         from check_correction cc
317 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 336
         where 1 = 1
319 337
         <if test="isSelfCheck != null">
320 338
             and cc.is_self_check=#{isSelfCheck}
@@ -343,9 +361,11 @@
343 361
         select date_format(cc.check_time, '%Y-%m-%d') date,
344 362
         cc.checked_team_id id,
345 363
         cc.checked_team_name name,
346
-        count(cpi.id) total
364
+        count(cu.id) total
347 365
         from check_correction cc
348 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 369
         where 1 = 1
350 370
         <if test="isSelfCheck != null">
351 371
             and cc.is_self_check=#{isSelfCheck}
@@ -388,6 +408,9 @@
388 408
         then 'OVER_TIME_UNFINISHED'
389 409
         else 'OTHER' end type
390 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 414
         where 1 = 1
392 415
         <if test="isSelfCheck != null">
393 416
             and cc.is_self_check=#{isSelfCheck}
@@ -429,6 +452,9 @@
429 452
         then 'OVER_TIME_UNFINISHED'
430 453
         else 'OTHER' end type
431 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 458
         where 1 = 1
433 459
         <if test="isSelfCheck != null">
434 460
             and cc.is_self_check=#{isSelfCheck}
@@ -470,6 +496,9 @@
470 496
         then 'OVER_TIME_UNFINISHED'
471 497
         else 'OTHER' end type
472 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 502
         where 1 = 1
474 503
         <if test="isSelfCheck != null">
475 504
             and cc.is_self_check=#{isSelfCheck}
@@ -511,6 +540,9 @@
511 540
         then 'OVER_TIME_UNFINISHED'
512 541
         else 'OTHER' end type
513 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 546
         where 1 = 1
515 547
         <if test="isSelfCheck != null">
516 548
             and cc.is_self_check=#{isSelfCheck}
@@ -552,10 +584,12 @@
552 584
         cr.checker_name userName,
553 585
         count(distinct cr.id) checkOrderCount,
554 586
         count(distinct cc.id) rectificationOrderCount,
555
-        count(distinct cpi.id) unqualifiedProjectCount
587
+        count(distinct cu.id) unqualifiedProjectCount
556 588
         from check_record cr
557 589
         left join check_correction cc on cc.check_record_id = cr.id
558 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 593
         where 1 = 1
560 594
         and cr.task_code in
561 595
         <foreach item="item" collection="list" open="(" separator="," close=")">
@@ -592,6 +626,8 @@
592 626
         cc.checked_brigade_name deptName
593 627
         from check_correction cc
594 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 631
         where 1 = 1
596 632
         <if test="isSelfCheck != null">
597 633
             and cc.is_self_check=#{isSelfCheck}
@@ -616,6 +652,8 @@
616 652
         cc.checked_department_name deptName
617 653
         from check_correction cc
618 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 657
         where 1 = 1
620 658
         <if test="isSelfCheck != null">
621 659
             and cc.is_self_check=#{isSelfCheck}
@@ -640,6 +678,8 @@
640 678
         cc.checked_team_name deptName
641 679
         from check_correction cc
642 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 683
         where 1 = 1
644 684
         <if test="isSelfCheck != null">
645 685
             and cc.is_self_check=#{isSelfCheck}