|
|
|
@ -310,86 +310,88 @@
|
|
|
|
|
GROUP by t.source_id
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getDLTableTitle" resultType="com.op.quality.domain.QcStaticTable">
|
|
|
|
|
SELECT
|
|
|
|
|
concat(q.material_code,'-',q.project_no,'-',CONVERT(varchar(10),q.ymdms, 120)) yearMonth,
|
|
|
|
|
material_code materialCode,
|
|
|
|
|
material_name materialName,
|
|
|
|
|
ymdms,rule_name ruleName,
|
|
|
|
|
project_no projectNo,
|
|
|
|
|
STUFF(
|
|
|
|
|
(SELECT ',' + t.actual_value
|
|
|
|
|
FROM (select
|
|
|
|
|
qct.material_code,qct.material_name,
|
|
|
|
|
CONVERT(varchar(10),qct.income_time, 120) ymdms,
|
|
|
|
|
qctd.rule_name, qctd.project_no,qctd.actual_value
|
|
|
|
|
from qc_check_task qct
|
|
|
|
|
left join qc_check_task_detail qctd on qct.record_id = qctd.belong_to
|
|
|
|
|
where qct.check_type = #{checkType} and qctd.property_code = '1' and qct.check_time is not null
|
|
|
|
|
<if test="ymArrayStart != null ">and CONVERT(varchar(10),qct.income_time, 120) >=
|
|
|
|
|
CONVERT(varchar(10),#{ymArrayStart}, 120)
|
|
|
|
|
</if>
|
|
|
|
|
<if test="ymArrayEnd != null ">and CONVERT(varchar(10),#{ymArrayEnd}, 120)>=CONVERT(varchar(10),qct.income_time,
|
|
|
|
|
120)
|
|
|
|
|
</if>
|
|
|
|
|
<if test="projectNoArray != null ">and qctd.project_id in(
|
|
|
|
|
<foreach collection="projectNoArray" separator="," item="projectId">
|
|
|
|
|
#{projectId}
|
|
|
|
|
</foreach>
|
|
|
|
|
)
|
|
|
|
|
</if>
|
|
|
|
|
<if test="orderNo != null ">
|
|
|
|
|
and qct.order_no = #{orderNo}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="materialCode != null ">
|
|
|
|
|
and qct.material_code = #{materialCode}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="supplierCode != null ">
|
|
|
|
|
and qct.supplier_code = #{supplierCode}
|
|
|
|
|
</if>
|
|
|
|
|
select t0.* ,bp.product_desc_zh materialName from(
|
|
|
|
|
SELECT
|
|
|
|
|
concat(q.material_code,'-',q.project_no,'-',CONVERT(varchar(10),q.ymdms, 120)) yearMonth,
|
|
|
|
|
material_code materialCode,
|
|
|
|
|
ymdms,rule_name ruleName,
|
|
|
|
|
project_no projectNo,
|
|
|
|
|
STUFF(
|
|
|
|
|
(SELECT ',' + t.actual_value
|
|
|
|
|
FROM (select
|
|
|
|
|
qct.material_code,qct.material_name,
|
|
|
|
|
CONVERT(varchar(10),qct.income_time, 120) ymdms,
|
|
|
|
|
qctd.rule_name, qctd.project_no,qctd.actual_value
|
|
|
|
|
from qc_check_task qct
|
|
|
|
|
left join qc_check_task_detail qctd on qct.record_id = qctd.belong_to
|
|
|
|
|
where qct.check_type = #{checkType} and qctd.property_code = '1' and qct.check_time is not null
|
|
|
|
|
<if test="ymArrayStart != null ">and CONVERT(varchar(10),qct.income_time, 120) >=
|
|
|
|
|
CONVERT(varchar(10),#{ymArrayStart}, 120)
|
|
|
|
|
</if>
|
|
|
|
|
<if test="ymArrayEnd != null ">and CONVERT(varchar(10),#{ymArrayEnd}, 120)>=CONVERT(varchar(10),qct.income_time,
|
|
|
|
|
120)
|
|
|
|
|
</if>
|
|
|
|
|
<if test="projectNoArray != null ">and qctd.project_id in(
|
|
|
|
|
<foreach collection="projectNoArray" separator="," item="projectId">
|
|
|
|
|
#{projectId}
|
|
|
|
|
</foreach>
|
|
|
|
|
)
|
|
|
|
|
</if>
|
|
|
|
|
<if test="orderNo != null ">
|
|
|
|
|
and qct.order_no = #{orderNo}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="materialCode != null ">
|
|
|
|
|
and qct.material_code = #{materialCode}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="supplierCode != null ">
|
|
|
|
|
and qct.supplier_code = #{supplierCode}
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
) t
|
|
|
|
|
WHERE t.material_code = q.material_code and t.project_no = q.project_no and t.ymdms=q.ymdms
|
|
|
|
|
FOR xml path('')
|
|
|
|
|
),1,1,''
|
|
|
|
|
) quality
|
|
|
|
|
FROM (
|
|
|
|
|
select
|
|
|
|
|
qct.material_code,qct.material_name,
|
|
|
|
|
CONVERT(varchar(10),qct.income_time, 120) ymdms,
|
|
|
|
|
qctd.rule_name,qctd.project_no,qctd.actual_value
|
|
|
|
|
from qc_check_task qct
|
|
|
|
|
left join qc_check_task_detail qctd on qct.record_id = qctd.belong_to
|
|
|
|
|
where qct.check_type = #{checkType} and qctd.property_code = '1' and qct.check_time is not null
|
|
|
|
|
<if test="ymArrayStart != null ">and CONVERT(varchar(10),qct.income_time, 120) >=
|
|
|
|
|
CONVERT(varchar(10),#{ymArrayStart}, 120)
|
|
|
|
|
</if>
|
|
|
|
|
<if test="ymArrayEnd != null ">and CONVERT(varchar(10),#{ymArrayEnd}, 120)>=CONVERT(varchar(10),qct.income_time,
|
|
|
|
|
120)
|
|
|
|
|
</if>
|
|
|
|
|
<if test="projectNoArray != null ">and qctd.project_id in(
|
|
|
|
|
<foreach collection="projectNoArray" separator="," item="projectId">
|
|
|
|
|
#{projectId}
|
|
|
|
|
</foreach>
|
|
|
|
|
)
|
|
|
|
|
</if>
|
|
|
|
|
<if test="orderNo != null ">
|
|
|
|
|
and qct.order_no = #{orderNo}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="materialCode != null ">
|
|
|
|
|
and qct.material_code = #{materialCode}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="supplierCode != null ">
|
|
|
|
|
and qct.supplier_code = #{supplierCode}
|
|
|
|
|
</if>
|
|
|
|
|
) q
|
|
|
|
|
GROUP BY q.material_code,q.material_name, q.ymdms,q.rule_name,q.project_no
|
|
|
|
|
) t
|
|
|
|
|
WHERE t.material_code = q.material_code and t.project_no = q.project_no and t.ymdms=q.ymdms
|
|
|
|
|
FOR xml path('')
|
|
|
|
|
),1,1,''
|
|
|
|
|
) quality
|
|
|
|
|
FROM (
|
|
|
|
|
select
|
|
|
|
|
qct.material_code,
|
|
|
|
|
CONVERT(varchar(10),qct.income_time, 120) ymdms,
|
|
|
|
|
qctd.rule_name,qctd.project_no,qctd.actual_value
|
|
|
|
|
from qc_check_task qct
|
|
|
|
|
left join qc_check_task_detail qctd on qct.record_id = qctd.belong_to
|
|
|
|
|
where qct.check_type = #{checkType} and qctd.property_code = '1' and qct.check_time is not null
|
|
|
|
|
<if test="ymArrayStart != null ">and CONVERT(varchar(10),qct.income_time, 120) >=
|
|
|
|
|
CONVERT(varchar(10),#{ymArrayStart}, 120)
|
|
|
|
|
</if>
|
|
|
|
|
<if test="ymArrayEnd != null ">and CONVERT(varchar(10),#{ymArrayEnd}, 120)>=CONVERT(varchar(10),qct.income_time,
|
|
|
|
|
120)
|
|
|
|
|
</if>
|
|
|
|
|
<if test="projectNoArray != null ">and qctd.project_id in(
|
|
|
|
|
<foreach collection="projectNoArray" separator="," item="projectId">
|
|
|
|
|
#{projectId}
|
|
|
|
|
</foreach>
|
|
|
|
|
)
|
|
|
|
|
</if>
|
|
|
|
|
<if test="orderNo != null ">
|
|
|
|
|
and qct.order_no = #{orderNo}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="materialCode != null ">
|
|
|
|
|
and qct.material_code = #{materialCode}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="supplierCode != null ">
|
|
|
|
|
and qct.supplier_code = #{supplierCode}
|
|
|
|
|
</if>
|
|
|
|
|
) q
|
|
|
|
|
GROUP BY q.material_code, q.ymdms,q.rule_name,q.project_no
|
|
|
|
|
) t0 left join base_product bp on bp.product_code = t0.materialCode
|
|
|
|
|
where t0.quality is not null
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getProjectList" resultType="com.op.quality.domain.QcStaticTable">
|
|
|
|
|
select qcp.id recordId,
|
|
|
|
|
qcp.rule_name ruleName
|
|
|
|
|
from qc_check_type_project qctp
|
|
|
|
|
left join qc_check_project qcp on qctp.project_id = qcp.id
|
|
|
|
|
left join qc_check_project qcp on qctp.project_id = qcp.id
|
|
|
|
|
where qctp.type_id = #{checkType} and qctp.property_code = '1'
|
|
|
|
|
and qctp.material_code is null
|
|
|
|
|
and qctp.material_code is null and qcp.rule_name is not null
|
|
|
|
|
</select>
|
|
|
|
|
</mapper>
|
|
|
|
|