检修预警柱状图数量统计修改

This commit is contained in:
hongchao 2025-09-05 12:08:02 +08:00
parent 9e2fa8109e
commit b91a5304b4
1 changed files with 15 additions and 22 deletions

View File

@ -264,22 +264,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="getCompletionNotRefunded" resultType="com.bonus.material.push.domain.MachineInfoBean">
select
bp.pro_center as proCenter,
count(bp.pro_id) num,
mt2.type_id as typeId,
count(distinct bp.external_id) num,
sd.dept_name as deptName,
sd.dept_id as deptId
from slt_agreement_info sai
left join bm_agreement_info bai on sai.agreement_id = bai.agreement_id
left join bm_project bp on bai.project_id = bp.pro_id
left join sys_dept sd on bp.imp_unit = sd.dept_id
left join ma_type mt on sai.type_id = mt.type_id
left join ma_type mt2 on mt.parent_id = mt2.type_id
where sai.is_slt = 0 and sai.end_time is null and bp.actual_end_date is not null and bp.pro_center is not null and
<if test="deptName != null">
sd.dept_name = #{deptName}
</if>
GROUP BY sd.dept_id
where sai.is_slt = 0 and sai.end_time is null and bp.actual_end_date is not null and bp.pro_center is not null and bp.external_id is not null
<if test="deptName != null and deptName != ''">
AND sd.dept_name = #{deptName}
</if>
GROUP BY bp.imp_unit
</select>
<select id="getCompletionNotRefundedDetails" resultType="com.bonus.material.push.domain.MachineInfoBean">
select
@ -298,7 +294,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join sys_dept sd on bp.imp_unit = sd.dept_id
left join ma_type mt on sai.type_id = mt.type_id
left join ma_type mt2 on mt.parent_id = mt2.type_id
where sai.status = 0 and bp.actual_end_date is not null
where sai.status = 0 and bp.actual_end_date is not null and bp.actual_end_date is not null and bp.pro_center is not null
<if test="deptId != null">
and sd.dept_id = #{deptId}
</if>
@ -652,18 +648,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="getCompletionNotRefundedSub" resultType="com.bonus.material.push.domain.MachineInfoBean">
select
bp.pro_center as proCenter,
count(bp.pro_id) num,
mt2.type_id as typeId,
sd.dept_name as deptName,
sd.dept_id as deptId
bp.pro_center as proCenter,
count(distinct bp.external_id) num,
sd.dept_name as deptName,
sd.dept_id as deptId
from slt_agreement_info sai
left join bm_agreement_info bai on sai.agreement_id = bai.agreement_id
left join bm_project bp on bai.project_id = bp.pro_id
left join sys_dept sd on bp.imp_unit = sd.dept_id
left join ma_type mt on sai.type_id = mt.type_id
left join ma_type mt2 on mt.parent_id = mt2.type_id
where sai.is_slt = 0 and sai.end_time is null and bp.actual_end_date is not null AND sd.dept_name = #{deptName} and bp.pro_center is not null
left join bm_agreement_info bai on sai.agreement_id = bai.agreement_id
left join bm_project bp on bai.project_id = bp.pro_id
left join sys_dept sd on bp.imp_unit = sd.dept_id
where sai.is_slt = 0 and sai.end_time is null and bp.actual_end_date is not null and sd.dept_name = #{deptName} and bp.pro_center is not null and bp.external_id is not null
GROUP BY bp.pro_center
</select>
<select id="getCompletionNotRefundedDetailsSub" resultType="com.bonus.material.push.domain.MachineInfoBean">