|
|
|
@ -12,40 +12,17 @@
|
|
|
|
|
where dict_type = #{dictType} and status = '0'
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getOverallInfo" resultType="com.op.quality.domain.QcInterface">
|
|
|
|
|
<if test="ymdType == 'yyyy'">
|
|
|
|
|
select SUM(CASE WHEN check_result = 'N' THEN 1 ELSE 0 END) noOkQuality,
|
|
|
|
|
count(0) quality
|
|
|
|
|
FROM(
|
|
|
|
|
select check_result
|
|
|
|
|
from qc_check_task qct
|
|
|
|
|
where check_type = #{typeCode} and check_status = '2'
|
|
|
|
|
and CONVERT(varchar(4),qct.create_time, 120) = SUBSTRING(#{ymd},0,5)
|
|
|
|
|
where check_type = #{typeCode} and check_status = '2' and
|
|
|
|
|
CONVERT(varchar(10),qct.income_time, 120) >= SUBSTRING(#{productDateStart},0,11)
|
|
|
|
|
and
|
|
|
|
|
SUBSTRING(#{productDateEnd},0,11) >= CONVERT(varchar(10),qct.income_time, 120)
|
|
|
|
|
and del_flag = '0'
|
|
|
|
|
) t
|
|
|
|
|
</if>
|
|
|
|
|
<if test="ymdType == 'mm'">
|
|
|
|
|
select SUM(CASE WHEN check_result = 'N' THEN 1 ELSE 0 END) noOkQuality,
|
|
|
|
|
count(0) quality
|
|
|
|
|
FROM(
|
|
|
|
|
select check_result
|
|
|
|
|
from qc_check_task qct
|
|
|
|
|
where check_type = #{typeCode} and check_status = '2'
|
|
|
|
|
and CONVERT(varchar(7),qct.create_time, 120) = SUBSTRING(#{ymd},0,8)
|
|
|
|
|
and del_flag = '0'
|
|
|
|
|
) t
|
|
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
<if test="ymdType == 'dd'">
|
|
|
|
|
select SUM(CASE WHEN check_result = 'N' THEN 1 ELSE 0 END) noOkQuality,
|
|
|
|
|
count(0) quality
|
|
|
|
|
FROM(
|
|
|
|
|
select check_result
|
|
|
|
|
from qc_check_task qct
|
|
|
|
|
where check_type = #{typeCode} and check_status = '2'
|
|
|
|
|
and CONVERT(varchar(10),qct.create_time, 120) = SUBSTRING(#{ymd},0,11)
|
|
|
|
|
and del_flag = '0'
|
|
|
|
|
) t
|
|
|
|
|
</if>
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getCheckProjectsPie" resultType="com.op.quality.domain.QcInterface">
|
|
|
|
|
<!--
|
|
|
|
@ -147,15 +124,10 @@
|
|
|
|
|
from qc_check_task qct
|
|
|
|
|
where qct.check_type = #{checkType}
|
|
|
|
|
and qct.del_flag = '0'
|
|
|
|
|
<if test='ymdType=="yyyy"'>
|
|
|
|
|
and CONVERT(varchar(4),qct.income_time, 120) = SUBSTRING(#{ymd},0,5)
|
|
|
|
|
</if>
|
|
|
|
|
<if test='ymdType=="mm"'>
|
|
|
|
|
and CONVERT(varchar(7),qct.income_time, 120) = SUBSTRING(#{ymd},0,8)
|
|
|
|
|
</if>
|
|
|
|
|
<if test='ymdType=="dd"'>
|
|
|
|
|
and CONVERT(varchar(10),qct.income_time, 120) = SUBSTRING(#{ymd},0,11)
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
and CONVERT(varchar(10),qct.income_time, 120) >= SUBSTRING(#{productDateStart},0,11)
|
|
|
|
|
and SUBSTRING(#{productDateEnd},0,11) >= CONVERT(varchar(10),qct.income_time, 120)
|
|
|
|
|
|
|
|
|
|
and qct.check_status = '2'
|
|
|
|
|
group by qct.supplier_code,qct.supplier_name
|
|
|
|
|
) t0
|
|
|
|
@ -177,9 +149,11 @@
|
|
|
|
|
qct.check_result checkResult,
|
|
|
|
|
qct.check_man_name checkManName,
|
|
|
|
|
qc.check_name checkName,
|
|
|
|
|
qct.check_time checkTime
|
|
|
|
|
qct.check_time checkTime,
|
|
|
|
|
be.equipment_name checkLoc
|
|
|
|
|
from qc_check_task qct
|
|
|
|
|
left join qc_check_type qc on qct.check_type = qc.order_code
|
|
|
|
|
left join base_equipment be on be.equipment_type_code = 'equ_type_bzx' and be.equipment_code = qct.check_loc
|
|
|
|
|
where qct.del_flag = '0' and qct.status = '1'
|
|
|
|
|
and qct.type_code = #{typeCode}
|
|
|
|
|
<if test='ymdType=="yyyy"'>
|
|
|
|
@ -199,26 +173,24 @@
|
|
|
|
|
qct.income_batch_no incomeBatchNo,
|
|
|
|
|
qct.order_no orderNo,
|
|
|
|
|
qct.material_name materialName,
|
|
|
|
|
qct.quality,
|
|
|
|
|
qct.sample_quality quality,
|
|
|
|
|
qct.unit,
|
|
|
|
|
qct.supplier_name supplierName,
|
|
|
|
|
qct.income_time incomeTime,
|
|
|
|
|
qct.check_time checkTime,
|
|
|
|
|
qct.check_result checkResult,
|
|
|
|
|
qct.check_man_name checkManName,
|
|
|
|
|
qc.check_name checkName
|
|
|
|
|
qc.check_name checkName,
|
|
|
|
|
qdtc.class_name className,
|
|
|
|
|
qdt.defect_subclass defectSubclass,
|
|
|
|
|
qct.noOk_quality noOkQuality
|
|
|
|
|
from qc_check_task qct
|
|
|
|
|
left join qc_defect_type_class qdtc on qct.remark_code = qdtc.id
|
|
|
|
|
left join qc_defect_type qdt on qdtc.defect_id = qdt.defect_id
|
|
|
|
|
left join qc_check_type qc on qct.check_type = qc.order_code
|
|
|
|
|
where qct.type_code = #{typeCode} and qct.check_result = 'N'
|
|
|
|
|
<if test='ymdType=="yyyy"'>
|
|
|
|
|
and CONVERT(varchar(4),qct.income_time, 120) = SUBSTRING(#{ymd},0,5)
|
|
|
|
|
</if>
|
|
|
|
|
<if test='ymdType=="mm"'>
|
|
|
|
|
and CONVERT(varchar(7),qct.income_time, 120) = SUBSTRING(#{ymd},0,8)
|
|
|
|
|
</if>
|
|
|
|
|
<if test='ymdType=="dd"'>
|
|
|
|
|
and CONVERT(varchar(10),qct.income_time, 120) = SUBSTRING(#{ymd},0,11)
|
|
|
|
|
</if>
|
|
|
|
|
and CONVERT(varchar(10),qct.income_time, 120) >= SUBSTRING(#{productDateStart},0,11)
|
|
|
|
|
and SUBSTRING(#{productDateEnd},0,11) >= CONVERT(varchar(10),qct.income_time, 120)
|
|
|
|
|
order by qct.income_time desc
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
@ -346,7 +318,7 @@
|
|
|
|
|
</if>
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getCheckProjectsPieLL" resultType="com.op.quality.domain.QcInterface">
|
|
|
|
|
<if test="ymdType == 'yyyy'">
|
|
|
|
|
|
|
|
|
|
select count(0) quality,
|
|
|
|
|
class_name projectName
|
|
|
|
|
FROM(
|
|
|
|
@ -355,41 +327,14 @@
|
|
|
|
|
qdtc.class_name
|
|
|
|
|
from qc_check_task qct
|
|
|
|
|
left join qc_defect_type_class qdtc on qct.remark_code = qdtc.id
|
|
|
|
|
where qct.check_type = #{checkType} and qct.check_status = '2'
|
|
|
|
|
and CONVERT(varchar(4),qct.create_time, 120) = SUBSTRING(#{ymd},0,5)
|
|
|
|
|
where qct.check_type = #{checkType} and qct.check_status = '2' and
|
|
|
|
|
CONVERT(varchar(10),qct.income_time, 120) >= SUBSTRING(#{productDateStart},0,11)
|
|
|
|
|
and
|
|
|
|
|
SUBSTRING(#{productDateEnd},0,11) >= CONVERT(varchar(10),qct.income_time, 120)
|
|
|
|
|
and qdtc.del_flag = '0' and qct.del_flag = '0'
|
|
|
|
|
) t
|
|
|
|
|
group by class_name
|
|
|
|
|
</if>
|
|
|
|
|
<if test="ymdType == 'mm'">
|
|
|
|
|
select count(0) quality,
|
|
|
|
|
class_name projectName
|
|
|
|
|
FROM(
|
|
|
|
|
select
|
|
|
|
|
qct.remark_code,
|
|
|
|
|
qdtc.class_name
|
|
|
|
|
from qc_check_task qct
|
|
|
|
|
left join qc_defect_type_class qdtc on qct.remark_code = qdtc.id
|
|
|
|
|
where qct.check_type = #{checkType} and qct.check_status = '2'
|
|
|
|
|
and CONVERT(varchar(7),qct.create_time, 120) = SUBSTRING(#{ymd},0,8)
|
|
|
|
|
and qdtc.del_flag = '0' and qct.del_flag = '0'
|
|
|
|
|
) t
|
|
|
|
|
group by class_name
|
|
|
|
|
</if>
|
|
|
|
|
<if test="ymdType == 'dd'">
|
|
|
|
|
select count(0) quality,
|
|
|
|
|
class_name projectName
|
|
|
|
|
FROM(
|
|
|
|
|
select qct.remark_code,
|
|
|
|
|
qdtc.class_name
|
|
|
|
|
from qc_check_task qct
|
|
|
|
|
left join qc_defect_type_class qdtc on qct.remark_code = qdtc.id
|
|
|
|
|
where qct.check_type = #{checkType} and qct.check_status = '2'
|
|
|
|
|
and CONVERT(varchar(10),qct.create_time, 120) = SUBSTRING(#{ymd},0,11)
|
|
|
|
|
and qdtc.del_flag = '0' and qct.del_flag = '0'
|
|
|
|
|
) t
|
|
|
|
|
group by class_name
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getProduceNoOkList1" resultType="com.op.quality.domain.QcInterface">
|
|
|
|
|
select qctd.rule_name projectName,
|
|
|
|
|