质量bug修复

This commit is contained in:
guoshengxiong 2024-05-13 21:08:25 +08:00
parent 3eff952ad6
commit d271c5c370

View File

@ -130,6 +130,16 @@
</if>
</sql>
<sql id="selectShow">
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 &lt; now() THEN 1 ELSE 0 END)), 0)
as overTimeRectifiedNum,
IFNULL(SUM((CASE WHEN t.status = 2 and t.change_limit_time &lt; now() THEN 1 ELSE 0 END)), 0)
as overTimeNotRectifiedNum,
</sql>
<sql id="selectTotal">
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 &lt; now() THEN 1 ELSE 0 END)), 0)
overTimeRectifiedNum,
IFNULL(SUM((CASE WHEN t.status = 2 and change_limit_time &lt; now() THEN 1 ELSE 0 END)), 0)
overTimeNotRectifiedNum,
<include refid="selectShow">
</include>
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,
<include refid="selectShow">
</include>
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}
<if test="param.inspectTime_begin != null and param.inspectTime_begin != ''">
and hdir.inspect_time <![CDATA[>=]]> #{param.inspectTime_begin}
and t.inspect_time <![CDATA[>=]]> #{param.inspectTime_begin}
</if>
<if test="param.inspectTime_end != null and param.inspectTime_end != ''">
and hdir.inspect_time <![CDATA[<=]]> if(LENGTH(#{param.inspectTime_end}) = 10,
and t.inspect_time <![CDATA[<=]]> if(LENGTH(#{param.inspectTime_end}) = 10,
CONCAT(DATE_FORMAT(#{param.inspectTime_end}, '%Y-%m-%d'), ' 23:59:59'),
#{param.inspectTime_end})
</if>
group by hdir.inspect_man_id
group by t.inspect_man_id
order by rectifiedNum desc) t
</select>
@ -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,
<include refid="selectShow">
</include>
ei.enterprise_name
from quality_inspection_record t
left join enterprise_info ei on ei.id = t.enterprise_id