diff --git a/src/main/java/com/zhgd/xmgl/modules/quality/mapper/xml/QualityInspectionRecordMapper.xml b/src/main/java/com/zhgd/xmgl/modules/quality/mapper/xml/QualityInspectionRecordMapper.xml
index f2d4a94f8..99318afa3 100644
--- a/src/main/java/com/zhgd/xmgl/modules/quality/mapper/xml/QualityInspectionRecordMapper.xml
+++ b/src/main/java/com/zhgd/xmgl/modules/quality/mapper/xml/QualityInspectionRecordMapper.xml
@@ -130,6 +130,16 @@
+
+ IFNULL(SUM((CASE WHEN t.status != 2 and t.change_limit_time > now() or t.status = 5 THEN 1 ELSE 0 END)),
+ 0) as rectifiedNumTimely,
+ IFNULL(SUM((CASE WHEN t.status != 2 THEN 1 ELSE 0 END)), 0) as rectifiedNum,
+ IFNULL(SUM((CASE WHEN t.status in (3, 4) and t.change_limit_time < now() THEN 1 ELSE 0 END)), 0)
+ as overTimeRectifiedNum,
+ IFNULL(SUM((CASE WHEN t.status = 2 and t.change_limit_time < now() THEN 1 ELSE 0 END)), 0)
+ as overTimeNotRectifiedNum,
+
+
select tp.*,
round(IFNULL(TRUNCATE(IFNULL(closeNum, 0) / IFNULL(totalNum, 0), 4), 0) * 100,
@@ -572,13 +582,8 @@
round(IFNULL(TRUNCATE(IFNULL(t.rectifiedNumTimely, 0) / IFNULL(totalNum, 0), 4), 0) * 100, 2)
rectifiedNumRatioTimely
from (SELECT count(*) totalNum,
- IFNULL(SUM((CASE WHEN t.status != 2 THEN 1 ELSE 0 END)), 0) rectifiedNum,
- IFNULL(SUM((CASE WHEN t.status != 2 and change_limit_time > now() THEN 1 ELSE 0 END)), 0)
- rectifiedNumTimely,
- IFNULL(SUM((CASE WHEN t.status != 2 and change_limit_time < now() THEN 1 ELSE 0 END)), 0)
- overTimeRectifiedNum,
- IFNULL(SUM((CASE WHEN t.status = 2 and change_limit_time < now() THEN 1 ELSE 0 END)), 0)
- overTimeNotRectifiedNum,
+
+
su.real_name as workerName
from quality_inspection_record t
left join system_user su on su.user_id = t.change_id
@@ -610,24 +615,23 @@
rectifiedNumRatioTimely
from (SELECT count(*) totalNum,
count(*) createDangerNum,
- IFNULL(SUM((CASE WHEN hdir.status != 2 THEN 1 ELSE 0 END)), 0) rectifiedNum,
- IFNULL(SUM((CASE WHEN hdir.status != 2 and change_limit_time > now() THEN 1 ELSE 0 END)), 0)
- rectifiedNumTimely,
+
+
su.real_name as workerName
- from quality_inspection_record hdir
- left join system_user su on su.user_id = hdir.inspect_man_id
+ from quality_inspection_record t
+ left join system_user su on su.user_id = t.inspect_man_id
WHERE record_type = 1
- and hdir.status != 6
+ and t.status != 6
and project_sn = #{param.projectSn}
- and hdir.inspect_time =]]> #{param.inspectTime_begin}
+ and t.inspect_time =]]> #{param.inspectTime_begin}
- and hdir.inspect_time if(LENGTH(#{param.inspectTime_end}) = 10,
+ and t.inspect_time if(LENGTH(#{param.inspectTime_end}) = 10,
CONCAT(DATE_FORMAT(#{param.inspectTime_end}, '%Y-%m-%d'), ' 23:59:59'),
#{param.inspectTime_end})
- group by hdir.inspect_man_id
+ group by t.inspect_man_id
order by rectifiedNum desc) t
@@ -638,9 +642,8 @@
round(IFNULL(TRUNCATE(IFNULL(t.rectifiedNumTimely, 0) / IFNULL(totalNum, 0), 4), 0) * 100, 2)
rectifiedNumRatioTimely
from (SELECT count(*) as totalNum,
- IFNULL(SUM((CASE WHEN t.status != 2 THEN 1 ELSE 0 END)), 0) as rectifiedNum,
- IFNULL(SUM((CASE WHEN t.status != 2 and change_limit_time > now() THEN 1 ELSE 0 END)), 0) as
- rectifiedNumTimely,
+
+
ei.enterprise_name
from quality_inspection_record t
left join enterprise_info ei on ei.id = t.enterprise_id