|
|
|
@ -286,5 +286,70 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
</where>
|
|
|
|
|
GROUP BY q1.machine_code
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getHFnames" resultType="com.op.quality.domain.QcProCheck">
|
|
|
|
|
select
|
|
|
|
|
alls.machineName,
|
|
|
|
|
alls.machineCode,
|
|
|
|
|
alls.quality,
|
|
|
|
|
ok.okQuality
|
|
|
|
|
from(
|
|
|
|
|
select count(0) quality,
|
|
|
|
|
<if test='chartType =="hf"'>
|
|
|
|
|
q1.machine_code machineCode,
|
|
|
|
|
q1.machine_name machineName
|
|
|
|
|
</if>
|
|
|
|
|
<if test='chartType =="cp"'>
|
|
|
|
|
q1.product_code machineCode,
|
|
|
|
|
q1.product_name machineName
|
|
|
|
|
</if>
|
|
|
|
|
from qc_pro_check q1
|
|
|
|
|
left join pro_order_workorder pow on pow.workorder_code = q1.workorder_code
|
|
|
|
|
<where>
|
|
|
|
|
<if test="workorderCode != null and workorderCode != ''">and q1.workorder_code like concat('%', #{workorderCode}, '%')</if>
|
|
|
|
|
<if test="productCode != null and productCode != ''">and q1.product_code like concat('%', #{productCode}, '%')</if>
|
|
|
|
|
<if test="machineCode != null and machineCode != ''">and q1.machine_code like concat('%', #{machineCode}, '%')</if>
|
|
|
|
|
<if test="createTimeStart != null ">and CONVERT(datetime,q1.create_time) >= #{createTimeStart}</if>
|
|
|
|
|
<if test="createTimeEnd != null ">and #{createTimeEnd} >= CONVERT(datetime,q1.create_time)</if>
|
|
|
|
|
and q1.machine_name LIKE '烘房%'
|
|
|
|
|
<if test="shiftId != null ">and pow.shift_id = #{shiftId}</if>
|
|
|
|
|
</where>
|
|
|
|
|
<if test='chartType =="hf"'>
|
|
|
|
|
group by q1.machine_code, q1.machine_name
|
|
|
|
|
</if>
|
|
|
|
|
<if test='chartType =="cp"'>
|
|
|
|
|
group by q1.product_code, q1.product_name
|
|
|
|
|
</if>
|
|
|
|
|
) alls
|
|
|
|
|
left join (
|
|
|
|
|
select count(0) okQuality,
|
|
|
|
|
<if test='chartType =="hf"'>
|
|
|
|
|
q1.machine_code machineCode,
|
|
|
|
|
q1.machine_name machineName
|
|
|
|
|
</if>
|
|
|
|
|
<if test='chartType =="cp"'>
|
|
|
|
|
q1.product_code machineCode,
|
|
|
|
|
q1.product_name machineName
|
|
|
|
|
</if>
|
|
|
|
|
from qc_pro_check q1
|
|
|
|
|
left join pro_order_workorder pow on pow.workorder_code = q1.workorder_code
|
|
|
|
|
<where>
|
|
|
|
|
<if test="workorderCode != null and workorderCode != ''">and q1.workorder_code like concat('%', #{workorderCode}, '%')</if>
|
|
|
|
|
<if test="productCode != null and productCode != ''">and q1.product_code like concat('%', #{productCode}, '%')</if>
|
|
|
|
|
<if test="machineCode != null and machineCode != ''">and q1.machine_code like concat('%', #{machineCode}, '%')</if>
|
|
|
|
|
<if test="createTimeStart != null ">and CONVERT(datetime,q1.create_time) >= #{createTimeStart}</if>
|
|
|
|
|
<if test="createTimeEnd != null ">and #{createTimeEnd} >= CONVERT(datetime,q1.create_time)</if>
|
|
|
|
|
and q1.machine_name LIKE '烘房%'
|
|
|
|
|
<if test="shiftId != null ">and pow.shift_id = #{shiftId}</if>
|
|
|
|
|
and q1.isqua = '1'
|
|
|
|
|
</where>
|
|
|
|
|
<if test='chartType =="hf"'>
|
|
|
|
|
group by q1.machine_code, q1.machine_name
|
|
|
|
|
</if>
|
|
|
|
|
<if test='chartType =="cp"'>
|
|
|
|
|
group by q1.product_code, q1.product_name
|
|
|
|
|
</if>
|
|
|
|
|
) ok on alls.machineCode = ok.machineCode
|
|
|
|
|
order by alls.machineName
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
</mapper>
|
|
|
|
|