|
|
|
@ -1357,6 +1357,7 @@ |
|
|
|
<!-- 查询类别模板 --> |
|
|
|
<select id="searchPartAttributeDetails" resultType="com.heai.modules.pms.data.QcTemplateData" parameterType="com.heai.modules.pms.data.QcTemplateData"> |
|
|
|
SELECT |
|
|
|
qat.id, |
|
|
|
qat.site, |
|
|
|
qat.bu_no, |
|
|
|
qpa.attribute_no, |
|
|
|
@ -1451,6 +1452,7 @@ |
|
|
|
<!-- 已有模板 --> |
|
|
|
<select id="getPartTemplateList" resultType="com.heai.modules.pms.data.QcTemplateData" parameterType="com.heai.modules.pms.data.QcTemplateData"> |
|
|
|
SELECT |
|
|
|
qat.id, |
|
|
|
qt.template_id, |
|
|
|
qt.template_name, |
|
|
|
qit.inspection_type_name, |
|
|
|
@ -1502,24 +1504,10 @@ |
|
|
|
</where> |
|
|
|
</select> |
|
|
|
|
|
|
|
<!-- 删除物料属性模板 --> |
|
|
|
<!-- 删除物料属性模板(按自增id。需先执行:ALTER TABLE qc_attribute_template ADD id INT IDENTITY(1,1) NOT NULL;) --> |
|
|
|
<delete id="deletePartAttributeDetails" parameterType="com.heai.modules.pms.data.QcTemplateData"> |
|
|
|
DELETE FROM qc_attribute_template |
|
|
|
<where> |
|
|
|
site = #{site} and bu_no = #{buNo} and attribute_no = #{attributeNo} and template_id = #{templateId} and attribute_type = #{attributeType} |
|
|
|
<if test = "operation != null and operation != ''"> |
|
|
|
and operation = #{operation} |
|
|
|
</if> |
|
|
|
<if test = "resourceID != null and resourceID != ''"> |
|
|
|
and resource_id = #{resourceID} |
|
|
|
</if> |
|
|
|
<if test = "manufacturerID != null and manufacturerID != ''"> |
|
|
|
and manufacturer_id = #{manufacturerID} |
|
|
|
</if> |
|
|
|
<if test = "customerID != null and customerID != ''"> |
|
|
|
and customer_id = #{customerID} |
|
|
|
</if> |
|
|
|
</where> |
|
|
|
WHERE id = #{id} |
|
|
|
</delete> |
|
|
|
|
|
|
|
<!-- 查询模板的基础数据 --> |
|
|
|
@ -1548,18 +1536,7 @@ |
|
|
|
AC = #{ac,jdbcType=DECIMAL}, |
|
|
|
ipqc_inspection_method = #{ipqcInspectionMethod}, |
|
|
|
RE = #{re,jdbcType=DECIMAL} |
|
|
|
<where> |
|
|
|
site = #{site} and attribute_no = #{attributeNo} AND template_id = #{templateId} AND attribute_type = #{attributeType} and bu_no = #{buNo} |
|
|
|
<if test = "operation != null and operation != ''"> |
|
|
|
AND operation = #{operation} |
|
|
|
</if> |
|
|
|
<if test = "resourceID != null and resourceID != ''"> |
|
|
|
AND resource_id = #{resourceID} |
|
|
|
</if> |
|
|
|
<if test = "manufacturerID != null and manufacturerID != ''"> |
|
|
|
AND manufacturer_id = #{manufacturerID} |
|
|
|
</if> |
|
|
|
</where> |
|
|
|
WHERE id = #{id} |
|
|
|
</update> |
|
|
|
|
|
|
|
<!-- 更新物料属性修改时间 --> |
|
|
|
@ -2579,6 +2556,18 @@ |
|
|
|
#{partNo}, #{rollQty}, #{samplingQty,jdbcType=DECIMAL}, #{ssrId}, #{seqNo}, #{batchRollNo}, #{specialRequirements}, #{workCenterNo}, #{rollNo}, #{umId},#{refInfo1},#{refInfo2}) |
|
|
|
</insert> |
|
|
|
|
|
|
|
<!-- 上机检验单号:IQC + 当天日期 + 4位流水,按当天最大序号 +1 --> |
|
|
|
<select id="selectNextIQCInspectionNoByDate" resultType="java.lang.String" parameterType="com.heai.modules.pms.data.QcFAIRecordData"> |
|
|
|
SELECT |
|
|
|
'IQC' + CONVERT(varchar(8), GETDATE(), 112) |
|
|
|
+ RIGHT('0000' + CONVERT(varchar(10), ISNULL(MAX(CONVERT(INT, SUBSTRING(inspection_no, 12, 4))), 0) + 1), 4) |
|
|
|
FROM qc_iqc_record |
|
|
|
WHERE site = #{site} |
|
|
|
AND bu_no = #{buNo} |
|
|
|
AND inspection_no LIKE 'IQC' + CONVERT(varchar(8), GETDATE(), 112) + '%' |
|
|
|
AND LEN(inspection_no) = 15 |
|
|
|
</select> |
|
|
|
|
|
|
|
<!-- 由外观检验单复制生成上机检验单。需先执行:ALTER TABLE qc_iqc_record ADD source_inspection_no VARCHAR(50) NULL; --> |
|
|
|
<insert id="copyIQCRecordForMachineInspect" parameterType="com.heai.modules.pms.data.QcFAIRecordData"> |
|
|
|
INSERT INTO qc_iqc_record |
|
|
|
@ -4410,7 +4399,11 @@ |
|
|
|
expiration_warning_date, |
|
|
|
expiration_date, |
|
|
|
ref_info1, |
|
|
|
ref_info2 |
|
|
|
ref_info2, |
|
|
|
submission_type, |
|
|
|
supplier_no, |
|
|
|
inspection_type_no, |
|
|
|
part_desc |
|
|
|
FROM qc_iqc_record |
|
|
|
WHERE site = #{site} AND bu_no = #{buNo} AND inspection_no = #{inspectionNo} |
|
|
|
</select> |
|
|
|
|