|
|
|
@ -57,4 +57,101 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
</if>
|
|
|
|
|
group by qctd.project_no,qctd.rule_name
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getSupplierBadTOP5" resultType="com.op.quality.domain.QcInterface">
|
|
|
|
|
select top 5 * from(
|
|
|
|
|
select
|
|
|
|
|
concat(t1.supplier_name,'-',t1.material_name) supplierName,
|
|
|
|
|
ROUND(t2.noOkNum*100.00/t1.allNum, 2) quality
|
|
|
|
|
from (
|
|
|
|
|
select count(0) allNum,
|
|
|
|
|
qct.supplier_code,qct.supplier_name,qct.material_code,qct.material_name
|
|
|
|
|
from qc_check_task qct
|
|
|
|
|
where qct.type_code = #{typeCode}
|
|
|
|
|
<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>
|
|
|
|
|
group by
|
|
|
|
|
qct.supplier_code,qct.supplier_name,qct.material_code,qct.material_name
|
|
|
|
|
) t1
|
|
|
|
|
left join (
|
|
|
|
|
select
|
|
|
|
|
count(0) noOkNum,qct.supplier_code,qct.supplier_name,qct.material_code,qct.material_name
|
|
|
|
|
from qc_check_task qct
|
|
|
|
|
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>
|
|
|
|
|
group by
|
|
|
|
|
qct.supplier_code,qct.supplier_name,qct.material_code,qct.material_name
|
|
|
|
|
) t2 on t1.supplier_code = t2.supplier_code and t1.material_code = t2.material_code
|
|
|
|
|
) t order by t.quality desc
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getSupplierTaskList" resultType="com.op.quality.domain.QcInterface">
|
|
|
|
|
select
|
|
|
|
|
qct.check_no checkNo,
|
|
|
|
|
qct.income_batch_no incomeBatchNo,
|
|
|
|
|
qct.order_no orderNo,
|
|
|
|
|
qct.material_name materialName,
|
|
|
|
|
qct.quality,
|
|
|
|
|
qct.unit,
|
|
|
|
|
qct.supplier_name supplierName,
|
|
|
|
|
qct.income_time incomeTime,
|
|
|
|
|
qct.check_status checkStatus,
|
|
|
|
|
qct.check_result checkResult,
|
|
|
|
|
qct.check_man_name checkManName,
|
|
|
|
|
qc.check_name checkName
|
|
|
|
|
from qc_check_task qct
|
|
|
|
|
left join qc_check_type qc on qct.check_type = qc.order_code
|
|
|
|
|
where qct.del_flag = '0' and qct.status = '1'
|
|
|
|
|
and qct.type_code = #{typeCode}
|
|
|
|
|
<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>
|
|
|
|
|
order by qct.income_time desc,qct.check_status asc
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getSupplierNoOkList" resultType="com.op.quality.domain.QcInterface">
|
|
|
|
|
select
|
|
|
|
|
qct.check_no checkNo,
|
|
|
|
|
qct.income_batch_no incomeBatchNo,
|
|
|
|
|
qct.order_no orderNo,
|
|
|
|
|
qct.material_name materialName,
|
|
|
|
|
qct.quality,
|
|
|
|
|
qct.unit,
|
|
|
|
|
qct.supplier_name supplierName,
|
|
|
|
|
qct.income_time incomeTime,
|
|
|
|
|
qct.check_result checkResult,
|
|
|
|
|
qct.check_man_name checkManName,
|
|
|
|
|
qc.check_name checkName
|
|
|
|
|
from qc_check_task qct
|
|
|
|
|
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>
|
|
|
|
|
order by qct.income_time desc
|
|
|
|
|
</select>
|
|
|
|
|
</mapper>
|
|
|
|
|