|
|
|
@ -704,7 +704,14 @@ |
|
|
|
c.method_name, |
|
|
|
c.method_remark, |
|
|
|
sw.color_code as qcSpecWarningColorCode, |
|
|
|
sw.threshold_value as qcSpecWarningThresholdValue |
|
|
|
sw.threshold_value as qcSpecWarningThresholdValue, |
|
|
|
(SELECT TOP 1 epi.collection_flag |
|
|
|
FROM eam_properties_item epi |
|
|
|
WHERE epi.site = a.site |
|
|
|
AND epi.bu_no = a.bu_no |
|
|
|
AND RTRIM(epi.ItemNo) = RTRIM(a.item_no) |
|
|
|
ORDER BY CASE WHEN RTRIM(ISNULL(epi.inspection_type_no, '')) = RTRIM(ISNULL(r.inspection_type_no, '')) THEN 0 ELSE 1 END, |
|
|
|
epi.inspection_type_no) AS collectionFlag |
|
|
|
FROM qc_ipqc_detailed_record as a |
|
|
|
LEFT JOIN qc_ipqc_record as r on a.site = r.site and a.bu_no = r.bu_no and a.inspection_no = r.inspection_no |
|
|
|
OUTER APPLY ( |
|
|
|
@ -799,6 +806,20 @@ |
|
|
|
WHERE inspection_no = #{inspectionNo} and item_no = #{itemNo} and site = #{site} and bu_no = #{buNo} |
|
|
|
</update> |
|
|
|
|
|
|
|
<update id="patchIPQCDetailedItemResult" parameterType="com.gaotao.modules.pms.data.QcFAIRecordData"> |
|
|
|
UPDATE qc_ipqc_detailed_record |
|
|
|
<set> |
|
|
|
<if test="itemResult != null and itemResult != ''">item_result = #{itemResult},</if> |
|
|
|
<if test="unqualifiedQuantity != null">unqualified_quantity = #{unqualifiedQuantity,jdbcType=DECIMAL},</if> |
|
|
|
<if test="numberValue != null">number_value = #{numberValue,jdbcType=DECIMAL},</if> |
|
|
|
<if test="textValue != null">text_value = #{textValue},</if> |
|
|
|
</set> |
|
|
|
WHERE inspection_no = #{inspectionNo} |
|
|
|
and RTRIM(item_no) = RTRIM(#{itemNo}) |
|
|
|
and site = #{site} |
|
|
|
and bu_no = #{buNo} |
|
|
|
</update> |
|
|
|
|
|
|
|
<!-- 修改IPQC主记录标识为已提交 --> |
|
|
|
<update id="updateIPQCMasterSubmitFlag" parameterType="com.gaotao.modules.pms.data.QcFAIRecordData"> |
|
|
|
UPDATE qc_ipqc_record |
|
|
|
@ -1115,7 +1136,14 @@ |
|
|
|
c.method_name, |
|
|
|
c.method_remark, |
|
|
|
sw.color_code as qcSpecWarningColorCode, |
|
|
|
sw.threshold_value as qcSpecWarningThresholdValue |
|
|
|
sw.threshold_value as qcSpecWarningThresholdValue, |
|
|
|
(SELECT TOP 1 epi.collection_flag |
|
|
|
FROM eam_properties_item epi |
|
|
|
WHERE epi.site = a.site |
|
|
|
AND epi.bu_no = a.bu_no |
|
|
|
AND RTRIM(epi.ItemNo) = RTRIM(a.item_no) |
|
|
|
ORDER BY CASE WHEN RTRIM(ISNULL(epi.inspection_type_no, '')) = RTRIM(ISNULL(r.inspection_type_no, '')) THEN 0 ELSE 1 END, |
|
|
|
epi.inspection_type_no) AS collectionFlag |
|
|
|
FROM qc_sqc_detailed_record as a |
|
|
|
LEFT JOIN qc_sqc_record as r on a.site = r.site and a.bu_no = r.bu_no and a.inspection_no = r.inspection_no |
|
|
|
OUTER APPLY ( |
|
|
|
@ -1206,6 +1234,20 @@ |
|
|
|
WHERE inspection_no = #{inspectionNo} and item_no = #{itemNo} and site = #{site} and bu_no = #{buNo} |
|
|
|
</update> |
|
|
|
|
|
|
|
<update id="patchSQCDetailedItemResult" parameterType="com.gaotao.modules.pms.data.QcFAIRecordData"> |
|
|
|
UPDATE qc_sqc_detailed_record |
|
|
|
<set> |
|
|
|
<if test="itemResult != null and itemResult != ''">item_result = #{itemResult},</if> |
|
|
|
<if test="unqualifiedQuantity != null">unqualified_quantity = #{unqualifiedQuantity,jdbcType=DECIMAL},</if> |
|
|
|
<if test="numberValue != null">number_value = #{numberValue,jdbcType=DECIMAL},</if> |
|
|
|
<if test="textValue != null">text_value = #{textValue},</if> |
|
|
|
</set> |
|
|
|
WHERE inspection_no = #{inspectionNo} |
|
|
|
and RTRIM(item_no) = RTRIM(#{itemNo}) |
|
|
|
and site = #{site} |
|
|
|
and bu_no = #{buNo} |
|
|
|
</update> |
|
|
|
|
|
|
|
<update id="updateSQCMasterSubmitFlag" parameterType="com.gaotao.modules.pms.data.QcFAIRecordData"> |
|
|
|
UPDATE qc_sqc_record |
|
|
|
SET submit_flag = 'Y', |
|
|
|
@ -1907,7 +1949,14 @@ |
|
|
|
c.method_remark, |
|
|
|
sw.color_code as qcSpecWarningColorCode, |
|
|
|
sw.threshold_value as qcSpecWarningThresholdValue, |
|
|
|
a.sampling_qty |
|
|
|
a.sampling_qty, |
|
|
|
(SELECT TOP 1 epi.collection_flag |
|
|
|
FROM eam_properties_item epi |
|
|
|
WHERE epi.site = a.site |
|
|
|
AND epi.bu_no = a.bu_no |
|
|
|
AND RTRIM(epi.ItemNo) = RTRIM(a.item_no) |
|
|
|
ORDER BY CASE WHEN RTRIM(ISNULL(epi.inspection_type_no, '')) = RTRIM(ISNULL(r.inspection_type_no, '')) THEN 0 ELSE 1 END, |
|
|
|
epi.inspection_type_no) AS collectionFlag |
|
|
|
FROM qc_iqc_detailed_record as a |
|
|
|
LEFT JOIN qc_iqc_record as r on a.site = r.site and a.bu_no = r.bu_no and a.inspection_no = r.inspection_no |
|
|
|
OUTER APPLY ( |
|
|
|
@ -1993,6 +2042,21 @@ |
|
|
|
WHERE inspection_no = #{inspectionNo} and item_no = #{itemNo} and site = #{site} and bu_no = #{buNo} |
|
|
|
</update> |
|
|
|
|
|
|
|
<!-- 部分更新IQC明细(实测值/结论即时落库,避免 null 覆盖其他字段) --> |
|
|
|
<update id="patchIQCDetailedItemResult" parameterType="com.gaotao.modules.pms.data.QcFAIRecordData"> |
|
|
|
UPDATE qc_iqc_detailed_record |
|
|
|
<set> |
|
|
|
<if test="itemResult != null and itemResult != ''">item_result = #{itemResult},</if> |
|
|
|
<if test="unqualifiedQuantity != null">unqualified_quantity = #{unqualifiedQuantity,jdbcType=DECIMAL},</if> |
|
|
|
<if test="numberValue != null">number_value = #{numberValue,jdbcType=DECIMAL},</if> |
|
|
|
<if test="textValue != null">text_value = #{textValue},</if> |
|
|
|
</set> |
|
|
|
WHERE inspection_no = #{inspectionNo} |
|
|
|
and RTRIM(item_no) = RTRIM(#{itemNo}) |
|
|
|
and site = #{site} |
|
|
|
and bu_no = #{buNo} |
|
|
|
</update> |
|
|
|
|
|
|
|
<!-- 查询该记录明细是否已存在 --> |
|
|
|
<select id="checkIQCDetail" parameterType="com.gaotao.modules.pms.data.QcFAIRecordData" resultType="com.gaotao.modules.pms.data.QcFAIRecordData"> |
|
|
|
SELECT inspection_no, |
|
|
|
@ -2352,7 +2416,14 @@ |
|
|
|
c.method_name, |
|
|
|
c.method_remark, |
|
|
|
sw.color_code as qcSpecWarningColorCode, |
|
|
|
sw.threshold_value as qcSpecWarningThresholdValue |
|
|
|
sw.threshold_value as qcSpecWarningThresholdValue, |
|
|
|
(SELECT TOP 1 epi.collection_flag |
|
|
|
FROM eam_properties_item epi |
|
|
|
WHERE epi.site = a.site |
|
|
|
AND epi.bu_no = a.bu_no |
|
|
|
AND RTRIM(epi.ItemNo) = RTRIM(a.item_no) |
|
|
|
ORDER BY CASE WHEN RTRIM(ISNULL(epi.inspection_type_no, '')) = RTRIM(ISNULL(r.inspection_type_no, '')) THEN 0 ELSE 1 END, |
|
|
|
epi.inspection_type_no) AS collectionFlag |
|
|
|
FROM qc_fqc_detailed_record as a |
|
|
|
LEFT JOIN qc_fqc_record as r on a.site = r.site and a.bu_no = r.bu_no and a.inspection_no = r.inspection_no |
|
|
|
OUTER APPLY ( |
|
|
|
@ -2447,6 +2518,20 @@ |
|
|
|
WHERE inspection_no = #{inspectionNo} and item_no = #{itemNo} and site = #{site} and bu_no = #{buNo} |
|
|
|
</update> |
|
|
|
|
|
|
|
<update id="patchFQCDetailedItemResult" parameterType="com.gaotao.modules.pms.data.QcFAIRecordData"> |
|
|
|
UPDATE qc_fqc_detailed_record |
|
|
|
<set> |
|
|
|
<if test="itemResult != null and itemResult != ''">item_result = #{itemResult},</if> |
|
|
|
<if test="unqualifiedQuantity != null">unqualified_quantity = #{unqualifiedQuantity,jdbcType=DECIMAL},</if> |
|
|
|
<if test="numberValue != null">number_value = #{numberValue,jdbcType=DECIMAL},</if> |
|
|
|
<if test="textValue != null">text_value = #{textValue},</if> |
|
|
|
</set> |
|
|
|
WHERE inspection_no = #{inspectionNo} |
|
|
|
and RTRIM(item_no) = RTRIM(#{itemNo}) |
|
|
|
and site = #{site} |
|
|
|
and bu_no = #{buNo} |
|
|
|
</update> |
|
|
|
|
|
|
|
<!-- 修改FQC主记录标识为已提交 --> |
|
|
|
<update id="updateFQCMasterSubmitFlag" parameterType="com.gaotao.modules.pms.data.QcFAIRecordData"> |
|
|
|
UPDATE qc_fqc_record |
|
|
|
@ -4739,7 +4824,14 @@ |
|
|
|
c.method_remark, |
|
|
|
sw.color_code as qcSpecWarningColorCode, |
|
|
|
sw.threshold_value as qcSpecWarningThresholdValue, |
|
|
|
a.sampling_qty |
|
|
|
a.sampling_qty, |
|
|
|
(SELECT TOP 1 epi.collection_flag |
|
|
|
FROM eam_properties_item epi |
|
|
|
WHERE epi.site = a.site |
|
|
|
AND epi.bu_no = a.bu_no |
|
|
|
AND RTRIM(epi.ItemNo) = RTRIM(a.item_no) |
|
|
|
ORDER BY CASE WHEN RTRIM(ISNULL(epi.inspection_type_no, '')) = RTRIM(ISNULL(r.inspection_type_no, '')) THEN 0 ELSE 1 END, |
|
|
|
epi.inspection_type_no) AS collectionFlag |
|
|
|
FROM qc_oqc_detailed_record as a |
|
|
|
LEFT JOIN qc_oqc_record as r on a.site = r.site and a.bu_no = r.bu_no and a.inspection_no = r.inspection_no |
|
|
|
OUTER APPLY ( |
|
|
|
@ -4821,6 +4913,20 @@ |
|
|
|
WHERE inspection_no = #{inspectionNo} and item_no = #{itemNo} and site = #{site} and bu_no = #{buNo} |
|
|
|
</update> |
|
|
|
|
|
|
|
<update id="patchFQASDetailedItemResult" parameterType="com.gaotao.modules.pms.data.QcFAIRecordData"> |
|
|
|
UPDATE qc_oqc_detailed_record |
|
|
|
<set> |
|
|
|
<if test="itemResult != null and itemResult != ''">item_result = #{itemResult},</if> |
|
|
|
<if test="unqualifiedQuantity != null">unqualified_quantity = #{unqualifiedQuantity,jdbcType=DECIMAL},</if> |
|
|
|
<if test="numberValue != null">number_value = #{numberValue,jdbcType=DECIMAL},</if> |
|
|
|
<if test="textValue != null">text_value = #{textValue},</if> |
|
|
|
</set> |
|
|
|
WHERE inspection_no = #{inspectionNo} |
|
|
|
and RTRIM(item_no) = RTRIM(#{itemNo}) |
|
|
|
and site = #{site} |
|
|
|
and bu_no = #{buNo} |
|
|
|
</update> |
|
|
|
|
|
|
|
<!-- 查询FQAS主记录信息 --> |
|
|
|
<select id="getFQASInspectionRecord" parameterType="com.gaotao.modules.pms.data.QcFAIRecordData" resultType="com.gaotao.modules.pms.data.QcFAIRecordData"> |
|
|
|
SELECT |
|
|
|
|