INSERT INTO qc_fai_record (inspection_no, site, bu_no, state, task_date, inspection_type_no, inspection_cycle, order_no, operation_desc, resource_id, part_no, roll_qty, sampling_qty, ssr_id, seq_no, batch_roll_no, special_requirements, work_center_no, roll_no, um_id) VALUES(#{inspectionNo}, #{site}, #{buNo}, #{state}, getDate(), #{inspectionTypeNo}, #{inspectionCycle,jdbcType=DECIMAL}, #{orderNo}, #{operationDesc}, #{resourceId}, #{partNo}, #{rollQty}, #{samplingQty,jdbcType=DECIMAL}, #{ssrId}, #{seqNo}, #{batchRollNo}, #{specialRequirements}, #{workCenterNo}, #{rollNo}, #{umId}) INSERT INTO qc_fai_detailed_record (inspection_no, order_no, template_id, sampling_level_no, sampling_level_desc, sampling_programme_no, sampling_programme_desc, AQL, AC, RE, item_no, item_desc, object_id, object_desc, default_value, min_value, max_value, value_type_db, value_type, site, sampling_qty, bu_no,order_id) VALUES (#{inspectionNo}, #{orderNo}, #{templateId}, #{samplingLevelNo}, #{samplingLevelDesc}, #{samplingProgrammeNo}, #{samplingProgrammeDesc}, #{aql,jdbcType=DECIMAL}, #{ac,jdbcType=DECIMAL}, #{re,jdbcType=DECIMAL}, #{itemNo}, #{itemDesc}, #{objectId}, #{objectDesc}, #{defaultValue}, #{minValue,jdbcType=DECIMAL}, #{maxValue,jdbcType=DECIMAL}, #{valueTypeDb}, #{valueType}, #{site}, #{samplingQty,jdbcType=DECIMAL}, #{buNo},#{orderId,jdbcType=INTEGER}) INSERT INTO qc_fai_detailed_record (inspection_no, order_no, template_id, sampling_level_no, sampling_level_desc, sampling_programme_no, sampling_programme_desc, AQL, AC, RE, item_no, item_desc, object_id, object_desc, default_value, min_value, max_value, value_type_db, value_type, site, sampling_qty, bu_no, order_id) VALUES (#{item.inspectionNo}, #{item.orderNo}, #{item.templateId}, #{item.samplingLevelNo}, #{item.samplingLevelDesc}, #{item.samplingProgrammeNo}, #{item.samplingProgrammeDesc}, #{item.aql,jdbcType=DECIMAL}, #{item.ac,jdbcType=DECIMAL}, #{item.re,jdbcType=DECIMAL}, #{item.itemNo}, #{item.itemDesc}, #{item.objectId}, #{item.objectDesc}, #{item.defaultValue}, #{item.minValue,jdbcType=DECIMAL}, #{item.maxValue,jdbcType=DECIMAL}, #{item.valueTypeDb}, #{item.valueType}, #{item.site}, #{item.samplingQty,jdbcType=DECIMAL}, #{item.buNo}, #{item.orderId}) UPDATE qc_fai_record SET disposal_measures = #{disposalMeasures}, disposal_remark = #{disposalRemark}, inspection_result = #{inspectionResult}, inspector_no = #{inspectorNo}, state = #{state}, inspection_remark = #{inspectionRemark}, inspector_date = #{inspectorDate,jdbcType=TIMESTAMP}, sampling_qty = #{samplingQty,jdbcType=DECIMAL}, roll_qty = #{rollQty,jdbcType=DECIMAL}, unqualified_qty = #{unqualifiedQty,jdbcType=DECIMAL}, pass_qty = #{passQty,jdbcType=DECIMAL}, not_pass_qty = #{notPassQty,jdbcType=DECIMAL}, batch_qualified_qty = #{batchQualifiedQty,jdbcType=DECIMAL} WHERE site = #{site} AND inspection_no = #{inspectionNo} and bu_no = #{buNo} UPDATE qc_fai_detailed_record SET item_result = #{itemResult}, unqualified_quantity = #{unqualifiedQuantity,jdbcType=DECIMAL}, sampling_qty = #{samplingQty,jdbcType=DECIMAL}, text_value = #{textValue}, number_value = #{numberValue,jdbcType=DECIMAL} WHERE inspection_no = #{inspectionNo} and item_no = #{itemNo} and site = #{site} and bu_no = #{buNo} UPDATE qc_fai_sub_detail_record SET is_submit = 'Y' WHERE inspection_no = #{inspectionNo} DELETE FROM qc_fai_record WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo} DELETE FROM qc_fai_detailed_record WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo} DELETE FROM qc_fai_sub_detail_record WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo} UPDATE qc_fai_record SET submit_flag = 'Y', state = '已完成', submit_date = getDate() WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo} UPDATE qc_fai_detailed_record SET is_submit = 'Y' WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo} UPDATE qc_fai_sub_detail_record SET is_submit = 'Y' WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo} DELETE FROM qc_fai_sub_detail_record WHERE inspection_no = #{inspectionNo} and item_no = #{itemNo} and site = #{site} and bu_no = #{buNo} INSERT INTO qc_fai_sub_detail_record (inspection_no, item_no, sub_detail_value, sampling_location, site, sampling_location_b, bu_no, num, sub_detail_value_b, sub_detail_value_c, sub_detail_value_d, sub_detail_value_e) VALUES (#{item.inspectionNo}, #{item.itemNo}, #{item.subDetailValue}, #{item.samplingLocation}, #{item.site}, #{item.samplingLocationB}, #{item.buNo}, #{item.num}, #{item.subDetailValueB}, #{item.subDetailValueC}, #{item.subDetailValueD}, #{item.subDetailValueE}) INSERT INTO qc_ipqc_detailed_record (inspection_no, order_no, template_id, sampling_level_no, sampling_level_desc, sampling_programme_no, sampling_programme_desc, AQL, AC, RE, item_no, item_desc, object_id, object_desc, default_value, min_value, max_value, value_type_db, value_type, site, sampling_qty, bu_no,order_id, custom1, custom2, custom3) VALUES (#{inspectionNo}, #{orderNo}, #{templateId}, #{samplingLevelNo}, #{samplingLevelDesc}, #{samplingProgrammeNo}, #{samplingProgrammeDesc}, #{aql,jdbcType=DECIMAL}, #{ac,jdbcType=DECIMAL}, #{re,jdbcType=DECIMAL}, #{itemNo}, #{itemDesc}, #{objectId}, #{objectDesc}, #{defaultValue}, #{minValue,jdbcType=DECIMAL}, #{maxValue,jdbcType=DECIMAL}, #{valueTypeDb}, #{valueType}, #{site}, #{samplingQty,jdbcType=DECIMAL}, #{buNo},#{orderId,jdbcType=INTEGER}, #{custom1}, #{custom2}, #{custom3}) INSERT INTO qc_ipqc_detailed_record (inspection_no, order_no, template_id, sampling_level_no, sampling_level_desc, sampling_programme_no, sampling_programme_desc, AQL, AC, RE, item_no, item_desc, object_id, object_desc, default_value, min_value, max_value, value_type_db, value_type, site, sampling_qty, bu_no, order_id, custom1, custom2, custom3) VALUES (#{item.inspectionNo}, #{item.orderNo}, #{item.templateId}, #{item.samplingLevelNo}, #{item.samplingLevelDesc}, #{item.samplingProgrammeNo}, #{item.samplingProgrammeDesc}, #{item.aql,jdbcType=DECIMAL}, #{item.ac,jdbcType=DECIMAL}, #{item.re,jdbcType=DECIMAL}, #{item.itemNo}, #{item.itemDesc}, #{item.objectId}, #{item.objectDesc}, #{item.defaultValue}, #{item.minValue,jdbcType=DECIMAL}, #{item.maxValue,jdbcType=DECIMAL}, #{item.valueTypeDb}, #{item.valueType}, #{item.site}, #{item.samplingQty,jdbcType=DECIMAL}, #{item.buNo}, #{item.orderId}, #{item.custom1}, #{item.custom2}, #{item.custom3}) INSERT INTO qc_ipqc_record (inspection_no, site, bu_no, state, task_date, inspection_type_no, inspection_cycle, order_no, operation_desc, resource_id, part_no, roll_qty, sampling_qty, ssr_id, seq_no, batch_roll_no, special_requirements, work_center_no, roll_no, um_id, create_by, inspector_by) VALUES (#{inspectionNo}, #{site}, #{buNo}, #{state}, getDate(), #{inspectionTypeNo}, #{inspectionCycle,jdbcType=DECIMAL}, #{orderNo}, #{operationDesc}, #{resourceId}, #{partNo}, #{rollQty}, #{samplingQty,jdbcType=DECIMAL}, #{ssrId}, #{seqNo}, #{batchRollNo}, #{specialRequirements}, #{workCenterNo}, #{rollNo}, #{umId}, #{createBy}, #{inspectorBy}) DELETE FROM qc_ipqc_record WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo} DELETE FROM qc_ipqc_detailed_record WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo} DELETE FROM qc_ipqc_sub_detail_record WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo} UPDATE qc_ipqc_record SET inspection_type_no = #{inspectionTypeNo}, sampling_qty = #{samplingQty}, inspection_cycle = #{inspectionCycle}, state = '未开始', inspection_result = null, disposal_measures = null, disposal_remark = null, inspection_remark = null, inspector_no = null, inspector_date = null, submit_flag = 'N', action_date = null, action_by = null, pass_qty = null, not_pass_qty = null, unqualified_qty = null, batch_qualified_qty = null WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo} UPDATE qc_ipqc_record SET disposal_measures = #{disposalMeasures}, disposal_remark = #{disposalRemark}, inspection_result = #{inspectionResult}, inspector_no = #{inspectorNo}, state = #{state}, inspection_remark = #{inspectionRemark}, inspector_date = #{inspectorDate,jdbcType=TIMESTAMP}, sampling_qty = #{samplingQty,jdbcType=DECIMAL}, roll_qty = #{rollQty,jdbcType=DECIMAL}, unqualified_qty = #{unqualifiedQty,jdbcType=DECIMAL}, pass_qty = #{passQty,jdbcType=DECIMAL}, not_pass_qty = #{notPassQty,jdbcType=DECIMAL}, batch_qualified_qty = #{batchQualifiedQty,jdbcType=DECIMAL} WHERE site = #{site} and inspection_no = #{inspectionNo} and bu_no = #{buNo} UPDATE qc_ipqc_detailed_record SET item_result = #{itemResult}, unqualified_quantity = #{unqualifiedQuantity,jdbcType=DECIMAL}, sampling_qty = #{samplingQty,jdbcType=DECIMAL}, text_value = #{textValue}, number_value = #{numberValue,jdbcType=DECIMAL}, default_value = #{defaultValue}, min_value = #{minValue,jdbcType=DECIMAL}, max_value = #{maxValue,jdbcType=DECIMAL}, item_remark = #{itemRemark}, custom1 = #{custom1}, custom2 = #{custom2}, custom3 = #{custom3} WHERE inspection_no = #{inspectionNo} and item_no = #{itemNo} and site = #{site} and bu_no = #{buNo} UPDATE qc_ipqc_detailed_record item_result = #{itemResult}, unqualified_quantity = #{unqualifiedQuantity,jdbcType=DECIMAL}, number_value = #{numberValue,jdbcType=DECIMAL}, text_value = #{textValue}, WHERE inspection_no = #{inspectionNo} and RTRIM(item_no) = RTRIM(#{itemNo}) and site = #{site} and bu_no = #{buNo} UPDATE qc_ipqc_record SET submit_flag = 'Y', state = '已完成', submit_date = getDate(), submit_by = #{updateBy} WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo} UPDATE qc_ipqc_detailed_record SET is_submit = 'Y' WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo} UPDATE qc_ipqc_sub_detail_record SET is_submit = 'Y' WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo} DELETE FROM qc_ipqc_sub_detail_record WHERE inspection_no = #{inspectionNo} and item_no = #{itemNo} and site = #{site} and bu_no = #{buNo} INSERT INTO qc_ipqc_sub_detail_record (inspection_no, item_no, sub_detail_value, sampling_location, site, sampling_location_b, bu_no, num, sub_detail_value_b, sub_detail_value_c, sub_detail_value_d, sub_detail_value_e, file_name, is_transfer, is_qualified, defect_qty, roll_no, create_time) VALUES (#{item.inspectionNo}, #{item.itemNo}, #{item.subDetailValue}, #{item.samplingLocation}, #{item.site}, #{item.samplingLocationB}, #{item.buNo}, #{item.num}, #{item.subDetailValueB}, #{item.subDetailValueC}, #{item.subDetailValueD}, #{item.subDetailValueE}, #{item.fileName}, #{item.isTransfer}, #{item.isQualified}, #{item.defectQty}, #{item.rollNo}, getDate()) INSERT INTO qc_sqc_detailed_record (inspection_no, template_id, sampling_level_no, sampling_level_desc, sampling_programme_no, sampling_programme_desc, AQL, AC, RE, item_no, item_desc, object_id, object_desc, default_value, min_value, max_value, value_type_db, value_type, site, sampling_qty, bu_no, order_id, custom1, custom2, custom3) VALUES (#{inspectionNo}, #{templateId}, #{samplingLevelNo}, #{samplingLevelDesc}, #{samplingProgrammeNo}, #{samplingProgrammeDesc}, #{aql,jdbcType=DECIMAL}, #{ac,jdbcType=DECIMAL}, #{re,jdbcType=DECIMAL}, #{itemNo}, #{itemDesc}, #{objectId}, #{objectDesc}, #{defaultValue}, #{minValue,jdbcType=DECIMAL}, #{maxValue,jdbcType=DECIMAL}, #{valueTypeDb}, #{valueType}, #{site}, #{samplingQty,jdbcType=DECIMAL}, #{buNo}, #{orderId,jdbcType=INTEGER}, #{custom1}, #{custom2}, #{custom3}) INSERT INTO qc_sqc_record (inspection_no, site, bu_no, state, create_date, task_date, inspection_type_no, inspection_cycle, order_no, operation_desc, resource_id, part_no, part_desc, roll_qty, sampling_qty, seq_no, batch_roll_no, special_requirements, work_center_no, roll_no, um_id, batch_no, receipt_no, receipt_item_no, [po_orderNo], po_itemNo, supplier_no, create_by, inspector_by) VALUES (#{inspectionNo}, #{site}, #{buNo}, #{state}, getDate(), getDate(), #{inspectionTypeNo}, #{inspectionCycle,jdbcType=DECIMAL}, #{orderNo}, #{operationDesc}, #{resourceId}, #{partNo}, #{partDesc}, #{rollQty,jdbcType=DECIMAL}, #{samplingQty,jdbcType=DECIMAL}, #{seqNo}, #{batchRollNo}, #{specialRequirements}, #{workCenterNo}, #{rollNo}, #{umId}, #{batchNo}, #{receiptNo}, #{receiptItemNo}, #{poOrderNo}, #{poItemNo}, #{supplierNo}, #{createBy}, #{inspectorBy}) a.site in (select site from AccessSite where userID = #{query.userName}) and a.bu_no in (select bu_no from AccessBu where username = #{query.userName}) AND a.bu_no = #{query.buNo} AND a.inspection_no LIKE '%' + #{query.inspectionNo} + '%' AND a.part_no LIKE '%' + #{query.partNo} + '%' AND (d.PartDescription LIKE '%' + #{query.partDesc} + '%' OR a.part_desc LIKE '%' + #{query.partDesc} + '%') AND d.cinv_source_code LIKE '%' + #{query.cinvSourceCode} + '%' AND d.sku LIKE '%' + #{query.sku} + '%' AND a.state in #{item} AND a.inspection_type_no = #{query.inspectionTypeNo} AND a.inspection_type_no in #{item} AND a.inspection_result = #{query.inspectionResult} AND a.disposal_measures LIKE '%' + #{query.disposalMeasures} + '%' AND a.order_no LIKE '%' + #{query.orderNo} + '%' AND a.seq_no LIKE '%' + #{query.seqNo} + '%' AND a.batch_no LIKE '%' + #{query.batchNo} + '%' AND a.receipt_no LIKE '%' + #{query.receiptNo} + '%' AND a.operation_desc LIKE '%' + #{query.operationDesc} + '%' AND a.resource_id = #{query.resourceId} AND a.work_center_no = #{query.workCenterNo} AND a.inspector_date >= #{query.startDate} AND #{query.endDate} >= a.inspector_date AND a.task_date >= #{query.startDate2} AND #{query.endDate2} >= a.task_date AND d.spec LIKE '%' + #{query.spec} + '%' DELETE FROM qc_sqc_record WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo} DELETE FROM qc_sqc_detailed_record WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo} DELETE FROM qc_sqc_sub_detail_record WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo} UPDATE qc_sqc_record SET inspection_type_no = #{inspectionTypeNo}, sampling_qty = #{samplingQty}, inspection_cycle = #{inspectionCycle}, part_desc = #{partDesc}, state = '未开始', inspection_result = null, disposal_measures = null, disposal_remark = null, inspection_remark = null, inspector_no = null, inspector_date = null, submit_flag = 'N', action_date = null, action_by = null, pass_qty = null, not_pass_qty = null, unqualified_qty = null, batch_qualified_qty = null WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo} UPDATE qc_sqc_record SET disposal_measures = #{disposalMeasures}, disposal_remark = #{disposalRemark}, inspection_result = #{inspectionResult}, inspector_no = #{inspectorNo}, state = #{state}, inspection_remark = #{inspectionRemark}, inspector_date = #{inspectorDate,jdbcType=TIMESTAMP}, sampling_qty = #{samplingQty,jdbcType=DECIMAL}, roll_qty = #{rollQty,jdbcType=DECIMAL}, unqualified_qty = #{unqualifiedQty,jdbcType=DECIMAL}, pass_qty = #{passQty,jdbcType=DECIMAL}, not_pass_qty = #{notPassQty,jdbcType=DECIMAL}, batch_qualified_qty = #{batchQualifiedQty,jdbcType=DECIMAL} WHERE site = #{site} and inspection_no = #{inspectionNo} and bu_no = #{buNo} UPDATE qc_sqc_detailed_record SET item_result = #{itemResult}, unqualified_quantity = #{unqualifiedQuantity,jdbcType=DECIMAL}, sampling_qty = #{samplingQty,jdbcType=DECIMAL}, text_value = #{textValue}, number_value = #{numberValue,jdbcType=DECIMAL}, default_value = #{defaultValue}, min_value = #{minValue,jdbcType=DECIMAL}, max_value = #{maxValue,jdbcType=DECIMAL}, item_remark = #{itemRemark}, custom1 = #{custom1}, custom2 = #{custom2}, custom3 = #{custom3} WHERE inspection_no = #{inspectionNo} and item_no = #{itemNo} and site = #{site} and bu_no = #{buNo} UPDATE qc_sqc_detailed_record item_result = #{itemResult}, unqualified_quantity = #{unqualifiedQuantity,jdbcType=DECIMAL}, number_value = #{numberValue,jdbcType=DECIMAL}, text_value = #{textValue}, WHERE inspection_no = #{inspectionNo} and RTRIM(item_no) = RTRIM(#{itemNo}) and site = #{site} and bu_no = #{buNo} UPDATE qc_sqc_record SET submit_flag = 'Y', state = '已完成', submit_date = getDate(), submit_by = #{updateBy} WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo} UPDATE qc_sqc_detailed_record SET is_submit = 'Y' WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo} UPDATE qc_sqc_sub_detail_record SET is_submit = 'Y' WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo} DELETE FROM qc_sqc_sub_detail_record WHERE inspection_no = #{inspectionNo} and item_no = #{itemNo} and site = #{site} and bu_no = #{buNo} INSERT INTO qc_sqc_sub_detail_record (inspection_no, item_no, sub_detail_value, sampling_location, site, sampling_location_b, bu_no, num, sub_detail_value_b, sub_detail_value_c, sub_detail_value_d, sub_detail_value_e, file_name, is_transfer, is_qualified, defect_qty, roll_no, create_time) VALUES (#{item.inspectionNo}, #{item.itemNo}, #{item.subDetailValue}, #{item.samplingLocation}, #{item.site}, #{item.samplingLocationB}, #{item.buNo}, #{item.num}, #{item.subDetailValueB}, #{item.subDetailValueC}, #{item.subDetailValueD}, #{item.subDetailValueE}, #{item.fileName}, #{item.isTransfer}, #{item.isQualified}, #{item.defectQty}, #{item.rollNo}, getDate()) update qc_sqc_record set action_date = getDate(), action_by = #{actionBy}, state = #{state} where site = #{site} and bu_no = #{buNo} and inspection_no = #{inspectionNo} INSERT INTO qc_sqc_detailed_record ( inspection_no, template_id, item_no, item_desc, default_value, min_value, max_value, value_type_db, value_type, site, bu_no, order_id ) VALUES ( #{inspectionNo}, #{templateId}, #{itemNo}, #{itemDesc}, #{defaultValue}, #{minValue}, #{maxValue}, #{valueTypeDb}, #{valueType}, #{site}, #{buNo}, #{orderId} ) DELETE FROM qc_sqc_detailed_record WHERE site = #{site} AND bu_no = #{buNo} AND inspection_no = #{inspectionNo} AND item_no = #{itemNo} DELETE FROM qc_sqc_sub_detail_record WHERE site = #{site} AND bu_no = #{buNo} AND inspection_no = #{inspectionNo} AND item_no = #{itemNo} INSERT INTO qc_iqc_detailed_record (inspection_no, template_id, sampling_level_no, sampling_level_desc, sampling_programme_no, sampling_programme_desc, AQL, AC, RE, item_no, item_desc, object_id, object_desc, default_value, min_value, max_value, value_type_db, value_type, site, sampling_qty, bu_no,order_id, custom1, custom2, custom3) VALUES(#{inspectionNo}, #{templateId}, #{samplingLevelNo}, #{samplingLevelDesc}, #{samplingProgrammeNo}, #{samplingProgrammeDesc}, #{aql,jdbcType=DECIMAL}, #{ac,jdbcType=DECIMAL}, #{re,jdbcType=DECIMAL}, #{itemNo}, #{itemDesc}, #{objectId}, #{objectDesc}, #{defaultValue}, #{minValue,jdbcType=DECIMAL}, #{maxValue,jdbcType=DECIMAL}, #{valueTypeDb}, #{valueType}, #{site}, #{samplingQty}, #{buNo},#{orderId,jdbcType=INTEGER}, #{custom1}, #{custom2}, #{custom3}) INSERT INTO qc_iqc_record (inspection_no, site, bu_no, state, create_date, inspection_type_no, part_no, part_desc, roll_qty, roll_count, roll_no, supplier_no, create_by, inspector_by, detail_flag, submission_type, tool_instance_id, qualified_supplier_flag, supplier_avl_no, die_mold_type, special_requirements) VALUES (#{inspectionNo}, #{site}, #{buNo}, #{state}, getDate(), #{inspectionTypeNo}, #{partNo}, #{partDesc,jdbcType=VARCHAR}, #{rollQty,jdbcType=DECIMAL}, #{rollCount,jdbcType=DECIMAL}, #{rollNo,jdbcType=VARCHAR}, #{supplierNo,jdbcType=VARCHAR}, #{createBy}, #{inspectorBy}, 'N', #{taskSource,jdbcType=VARCHAR}, #{toolInstanceId,jdbcType=VARCHAR}, #{qualifiedSupplierFlag,jdbcType=CHAR}, #{supplierAvlNo,jdbcType=VARCHAR}, #{dieMoldType,jdbcType=NVARCHAR}, #{specialRequirements,jdbcType=VARCHAR}) UPDATE qc_iqc_record SET inspection_type_no = #{inspectionTypeNo}, sampling_qty = #{samplingQty}, inspection_cycle = #{inspectionCycle}, part_desc = #{partDesc}, detail_flag = 'Y', state = '未开始', action_date = null, action_by = null WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo} UPDATE qc_iqc_record SET roll_count = #{rollCount,jdbcType=DECIMAL} WHERE site = #{site} AND bu_no = #{buNo} AND po_orderNo = #{poOrderNo} AND po_itemNo = #{poItemNo} AND part_no = #{partNo} AND inspection_no = ( SELECT TOP 1 inspection_no FROM qc_iqc_record WHERE site = #{site} AND bu_no = #{buNo} AND po_orderNo = #{poOrderNo} AND po_itemNo = #{poItemNo} AND part_no = #{partNo} ORDER BY create_date DESC ) UPDATE qc_iqc_record SET roll_count = #{rollCount,jdbcType=DECIMAL}, roll_qty = #{rollQty,jdbcType=DECIMAL}, supplier_no = #{supplierNo,jdbcType=VARCHAR}, tool_instance_id = #{toolInstanceId,jdbcType=VARCHAR}, qualified_supplier_flag = #{qualifiedSupplierFlag,jdbcType=CHAR}, supplier_avl_no = #{supplierAvlNo,jdbcType=VARCHAR}, die_mold_type = #{dieMoldType,jdbcType=NVARCHAR} WHERE site = #{site} AND bu_no = #{buNo} AND part_no = #{partNo} AND inspection_no = ( SELECT TOP 1 inspection_no FROM qc_iqc_record WHERE site = #{site} AND bu_no = #{buNo} AND part_no = #{partNo} ORDER BY create_date DESC ) UPDATE qc_iqc_record qc_ipqc_record qc_fqc_record qc_oqc_record qc_sqc_record SET release_no = #{data.releaseNo,jdbcType=VARCHAR}, line_no = #{data.lineNo,jdbcType=VARCHAR} WHERE site = #{data.site} AND bu_no = #{data.buNo} AND inspection_no = #{data.inspectionNo} AND po_orderNo = #{data.poOrderNo} AND po_itemNo = #{data.poItemNo} AND part_no = #{data.partNo} AND inspection_no = ( SELECT TOP 1 inspection_no FROM qc_iqc_record WHERE site = #{data.site} AND bu_no = #{data.buNo} AND po_orderNo = #{data.poOrderNo} AND po_itemNo = #{data.poItemNo} AND part_no = #{data.partNo} ORDER BY create_date DESC ) AND part_no = #{data.partNo} AND inspector_by = #{data.inspectorBy} AND inspection_no = ( SELECT TOP 1 inspection_no FROM qc_oqc_record WHERE site = #{data.site} AND bu_no = #{data.buNo} AND part_no = #{data.partNo} AND inspector_by = #{data.inspectorBy} ORDER BY create_date DESC ) AND order_no = #{data.orderNo} AND seq_no = #{data.seqNo} AND part_no = #{data.partNo} AND inspection_no = ( SELECT TOP 1 inspection_no FROM qc_ipqc_record qc_fqc_record qc_sqc_record WHERE site = #{data.site} AND bu_no = #{data.buNo} AND order_no = #{data.orderNo} AND seq_no = #{data.seqNo} AND part_no = #{data.partNo} ORDER BY create_date DESC ) UPDATE qc_iqc_record SET disposal_measures = #{disposalMeasures}, disposal_remark = #{disposalRemark}, inspection_result = #{inspectionResult}, inspector_no = #{inspectorNo}, state = #{state}, inspection_remark = #{inspectionRemark}, inspector_date = #{inspectorDate,jdbcType=TIMESTAMP}, roll_count = #{rollCount,jdbcType=DECIMAL}, sampling_qty = #{samplingQty,jdbcType=DECIMAL}, unqualified_qty = #{unqualifiedQty,jdbcType=DECIMAL}, pass_qty = #{passQty,jdbcType=DECIMAL}, not_pass_qty = #{notPassQty,jdbcType=DECIMAL}, batch_qualified_qty = #{batchQualifiedQty,jdbcType=DECIMAL} WHERE site = #{site} and bu_no = #{buNo} and inspection_no = #{inspectionNo} UPDATE qc_iqc_detailed_record SET item_result = #{itemResult}, unqualified_quantity = #{unqualifiedQuantity,jdbcType=DECIMAL}, sampling_qty = #{samplingQty,jdbcType=DECIMAL}, text_value = #{textValue}, number_value = #{numberValue,jdbcType=DECIMAL}, default_value = #{defaultValue}, min_value = #{minValue,jdbcType=DECIMAL}, max_value = #{maxValue,jdbcType=DECIMAL}, item_remark = #{itemRemark}, custom1 = #{custom1}, custom2 = #{custom2}, custom3 = #{custom3} WHERE inspection_no = #{inspectionNo} and item_no = #{itemNo} and site = #{site} and bu_no = #{buNo} UPDATE qc_iqc_detailed_record item_result = #{itemResult}, unqualified_quantity = #{unqualifiedQuantity,jdbcType=DECIMAL}, number_value = #{numberValue,jdbcType=DECIMAL}, text_value = #{textValue}, WHERE inspection_no = #{inspectionNo} and RTRIM(item_no) = RTRIM(#{itemNo}) and site = #{site} and bu_no = #{buNo} DELETE FROM qc_iqc_sub_detail_record WHERE inspection_no = #{inspectionNo} and item_no = #{itemNo} and site = #{site} and bu_no = #{buNo} INSERT INTO qc_iqc_sub_detail_record (inspection_no, item_no, sub_detail_value, sampling_location, site, sampling_location_b, bu_no, num, sub_detail_value_b, sub_detail_value_c, sub_detail_value_d, sub_detail_value_e, file_name, is_transfer, is_qualified, defect_qty, roll_no, create_time) VALUES (#{item.inspectionNo}, #{item.itemNo}, #{item.subDetailValue}, #{item.samplingLocation}, #{item.site}, #{item.samplingLocationB}, #{item.buNo}, #{item.num}, #{item.subDetailValueB}, #{item.subDetailValueC}, #{item.subDetailValueD}, #{item.subDetailValueE}, #{item.fileName}, #{item.isTransfer}, #{item.isQualified}, #{item.defectQty}, #{item.rollNo}, getDate()) UPDATE qc_iqc_record SET submit_flag = 'Y', state = '已完成', submit_date = getDate(), submit_by = #{updateBy} WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo} UPDATE qc_iqc_detailed_record SET is_submit = 'Y' WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo} UPDATE qc_iqc_sub_detail_record SET is_submit = 'Y' WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo} DELETE FROM qc_iqc_record WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo} DELETE FROM qc_iqc_detailed_record WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo} DELETE FROM qc_iqc_sub_detail_record WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo} INSERT INTO qc_fqc_detailed_record (inspection_no, order_no, template_id, sampling_level_no, sampling_level_desc, sampling_programme_no, sampling_programme_desc, AQL, AC, RE, item_no, item_desc, object_id, object_desc, default_value, min_value, max_value, value_type_db, value_type, site, sampling_qty, bu_no,order_id, custom1, custom2, custom3) VALUES (#{inspectionNo}, #{orderNo}, #{templateId}, #{samplingLevelNo}, #{samplingLevelDesc}, #{samplingProgrammeNo}, #{samplingProgrammeDesc}, #{aql,jdbcType=DECIMAL}, #{ac,jdbcType=DECIMAL}, #{re,jdbcType=DECIMAL}, #{itemNo}, #{itemDesc}, #{objectId}, #{objectDesc}, #{defaultValue}, #{minValue,jdbcType=DECIMAL}, #{maxValue,jdbcType=DECIMAL}, #{valueTypeDb}, #{valueType}, #{site}, #{samplingQty,jdbcType=DECIMAL}, #{buNo},#{orderId,jdbcType=INTEGER}, #{custom1}, #{custom2}, #{custom3}) INSERT INTO qc_fqc_detailed_record (inspection_no, order_no, template_id, sampling_level_no, sampling_level_desc, sampling_programme_no, sampling_programme_desc, AQL, AC, RE, item_no, item_desc, object_id, object_desc, default_value, min_value, max_value, value_type_db, value_type, site, sampling_qty, bu_no, order_id, custom1, custom2, custom3) VALUES (#{item.inspectionNo}, #{item.orderNo}, #{item.templateId}, #{item.samplingLevelNo}, #{item.samplingLevelDesc}, #{item.samplingProgrammeNo}, #{item.samplingProgrammeDesc}, #{item.aql,jdbcType=DECIMAL}, #{item.ac,jdbcType=DECIMAL}, #{item.re,jdbcType=DECIMAL}, #{item.itemNo}, #{item.itemDesc}, #{item.objectId}, #{item.objectDesc}, #{item.defaultValue}, #{item.minValue,jdbcType=DECIMAL}, #{item.maxValue,jdbcType=DECIMAL}, #{item.valueTypeDb}, #{item.valueType}, #{item.site}, #{item.samplingQty,jdbcType=DECIMAL}, #{item.buNo}, #{item.orderId}, #{item.custom1}, #{item.custom2}, #{item.custom3}) INSERT INTO qc_fqc_record (inspection_no, site, bu_no, state, task_date, inspection_type_no, inspection_cycle, order_no, operation_desc, resource_id, part_no, roll_qty, sampling_qty, ssr_id, seq_no, batch_roll_no, special_requirements, work_center_no, roll_no, um_id, create_by, inspector_by) VALUES (#{inspectionNo}, #{site}, #{buNo}, #{state}, getDate(), #{inspectionTypeNo}, #{inspectionCycle,jdbcType=DECIMAL}, #{orderNo}, #{operationDesc}, #{resourceId}, #{partNo}, #{rollQty}, #{samplingQty,jdbcType=DECIMAL}, #{ssrId}, #{seqNo}, #{batchRollNo}, #{specialRequirements}, #{workCenterNo}, #{rollNo}, #{umId}, #{createBy}, #{inspectorBy}) DELETE FROM qc_fqc_record WHERE site = #{site} and bu_no = #{buNo} and inspection_no = #{inspectionNo} DELETE FROM qc_fqc_detailed_record WHERE site = #{site} and bu_no = #{buNo} and inspection_no = #{inspectionNo} DELETE FROM qc_fqc_sub_detail_record WHERE site = #{site} and bu_no = #{buNo} and inspection_no = #{inspectionNo} UPDATE qc_fqc_record SET inspection_type_no = #{inspectionTypeNo}, sampling_qty = #{samplingQty}, inspection_cycle = #{inspectionCycle}, state = '未开始', inspection_result = null, disposal_measures = null, disposal_remark = null, inspection_remark = null, inspector_no = null, inspector_date = null, submit_flag = 'N', action_date = null, action_by = null, pass_qty = null, not_pass_qty = null, unqualified_qty = null, batch_qualified_qty = null WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo} UPDATE qc_fqc_record SET disposal_measures = #{disposalMeasures}, disposal_remark = #{disposalRemark}, inspection_result = #{inspectionResult}, inspector_no = #{inspectorNo}, state = #{state}, inspection_remark = #{inspectionRemark}, inspector_date = #{inspectorDate,jdbcType=TIMESTAMP}, sampling_qty = #{samplingQty,jdbcType=DECIMAL}, roll_qty = #{rollQty,jdbcType=DECIMAL}, unqualified_qty = #{unqualifiedQty,jdbcType=DECIMAL}, pass_qty = #{passQty,jdbcType=DECIMAL}, not_pass_qty = #{notPassQty,jdbcType=DECIMAL}, batch_qualified_qty = #{batchQualifiedQty,jdbcType=DECIMAL} WHERE site = #{site} and inspection_no = #{inspectionNo} and bu_no = #{buNo} UPDATE qc_fqc_detailed_record SET item_result = #{itemResult}, unqualified_quantity = #{unqualifiedQuantity,jdbcType=DECIMAL}, sampling_qty = #{samplingQty,jdbcType=DECIMAL}, text_value = #{textValue}, number_value = #{numberValue,jdbcType=DECIMAL}, default_value = #{defaultValue}, min_value = #{minValue,jdbcType=DECIMAL}, max_value = #{maxValue,jdbcType=DECIMAL}, item_remark = #{itemRemark}, custom1 = #{custom1}, custom2 = #{custom2}, custom3 = #{custom3} WHERE inspection_no = #{inspectionNo} and item_no = #{itemNo} and site = #{site} and bu_no = #{buNo} UPDATE qc_fqc_detailed_record item_result = #{itemResult}, unqualified_quantity = #{unqualifiedQuantity,jdbcType=DECIMAL}, number_value = #{numberValue,jdbcType=DECIMAL}, text_value = #{textValue}, WHERE inspection_no = #{inspectionNo} and RTRIM(item_no) = RTRIM(#{itemNo}) and site = #{site} and bu_no = #{buNo} UPDATE qc_fqc_record SET submit_flag = 'Y', state = '已完成', submit_date = getDate(), submit_by = #{updateBy} WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo} UPDATE qc_fqc_detailed_record SET is_submit = 'Y' WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo} UPDATE qc_fqc_sub_detail_record SET is_submit = 'Y' WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo} DELETE FROM qc_fqc_sub_detail_record WHERE inspection_no = #{inspectionNo} and item_no = #{itemNo} and site = #{site} and bu_no = #{buNo} INSERT INTO qc_fqc_sub_detail_record (inspection_no, item_no, sub_detail_value, sampling_location, site, sampling_location_b, bu_no, num, sub_detail_value_b, sub_detail_value_c, sub_detail_value_d, sub_detail_value_e, file_name, is_transfer, is_qualified, defect_qty, roll_no, create_time) VALUES (#{item.inspectionNo}, #{item.itemNo}, #{item.subDetailValue}, #{item.samplingLocation}, #{item.site}, #{item.samplingLocationB}, #{item.buNo}, #{item.num}, #{item.subDetailValueB}, #{item.subDetailValueC}, #{item.subDetailValueD}, #{item.subDetailValueE}, #{item.fileName}, #{item.isTransfer}, #{item.isQualified}, #{item.defectQty}, #{item.rollNo}, getDate()) INSERT INTO receiving_task (site, order_no, item_no, part_no, part_desc, spec, supplier_id, supplier_name, order_qty, created_date, status, citem_code, citem_class, sendto_address, order_type, inspection_no, batch_no, production_date, expiration_warning_date, expiration_date) VALUES (#{site}, #{orderNo}, #{itemNo}, #{partNo}, #{partDesc}, #{spec}, #{supplierId}, #{supplierName}, #{orderQty}, getDate(), #{status}, #{citemCode}, #{citemClass}, #{sendtoAddress}, #{orderType}, #{inspectionNo}, #{batchNo}, #{productionDate}, #{expirationWarningDate}, #{expirationDate}) DELETE FROM sys_oss WHERE id = #{id} UPDATE qc_iqc_record SET detail_flag = 'N' WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo} UPDATE interface_time set updated_by = #{updatedBy}, updated_date = #{updatedDate}, del_flag = #{delFlag} INSERT INTO purchase_in_storage_count (site, trans_no, created_date, created_by, erp_flag, toacc, logindate, cordercode, cdepcode, cwhcode, crdcode, coutcode, ddate, bredvouch, cmemo, verify, irowno, cinvcode, iquantity, citemcode, erp_remark, trans_date, csource, trans_type) values (#{site}, #{transNo}, #{createdDate}, #{createdBy}, #{erpFlag}, #{toacc}, #{logindate}, #{cordercode}, #{cdepcode}, #{cwhcode}, #{crdcode}, #{coutcode}, #{ddate}, #{bredvouch}, #{cmemo}, #{verify}, #{irowno}, #{cinvcode}, #{iquantity}, #{citemcode}, #{erpRemark}, #{transDate}, #{csource}, #{transType}) insert into TransHeader (TransNo, Site, WarehouseID, TransDate, TransType_DB, TransType, UserName, Receiver, TransYear, TransMonth, PartnerID, PartnerType, AuthorizeFlag, AuthorizeDate, Authorizor, TransferFlag, TransferDate, TransferGuys, VoucherDate, ProjectID, EnterDate, Remark, UseLocation, OrderRef1, LinkOrderFlag, DelAddID, Status, ProjectName, PartnerName, erp_warehouse_id, ERP, department_no, picking_status, scan_type, inCategory, pmProject, remarks, item_no_mat, remark3, location_id, count_id) values (#{TransNo}, #{Site}, #{WarehouseID}, #{TransDate}, #{TransTypeDB}, #{TransType}, #{UserName}, #{Receiver}, #{TransYear}, #{TransMonth}, #{PartnerID}, #{PartnerType}, #{AuthorizeFlag}, #{AuthorizeDate}, #{Authorizor}, #{TransferFlag}, #{TransferDate}, #{TransferGuys}, #{VoucherDate}, #{ProjectID}, #{EnterDate}, #{Remark}, #{UseLocation}, #{OrderRef1}, #{LinkOrderFlag}, #{DelAddID}, #{Status}, #{ProjectName}, #{PartnerName}, #{erpWarehouseId}, #{ERP}, #{departmentNo}, #{pickingStatus}, #{scanType}, #{inCategory}, #{pmProject}, #{remarks}, #{itemNoMat}, #{remark3}, #{locationId}, #{countId}) INSERT INTO TransDetail (TransNo, Site, PartNo, LocationID, TransQty, Direction, OrderRef1, ItemNo, OrderRef2, OrderRef3, OrderRef5, Remark, citem_code) values (#{TransNo}, #{Site}, #{PartNo}, #{LocationID}, #{TransQty}, #{Direction}, #{OrderRef1}, #{ItemNo}, #{OrderRef2}, #{OrderRef3}, #{OrderRef5}, #{Remark}, #{citemCode}) insert into send_mail_record (site, bu_no, document_no, sender, recipient, send_date, type) values (#{site}, #{buNo}, #{documentNo}, #{sender}, #{recipient}, getDate(), #{type}) update qc_iqc_record set action_date = getDate(), action_by = #{actionBy}, state = #{state} where site = #{site} and bu_no = #{buNo} and inspection_no = #{inspectionNo} update qc_fai_record set action_date = getDate(), action_by = #{actionBy}, state = #{state} where site = #{site} and bu_no = #{buNo} and inspection_no = #{inspectionNo} update qc_ipqc_record set action_date = getDate(), action_by = #{actionBy}, state = #{state} where site = #{site} and bu_no = #{buNo} and inspection_no = #{inspectionNo} update qc_fqc_record set action_date = getDate(), action_by = #{actionBy}, state = #{state} where site = #{site} and bu_no = #{buNo} and inspection_no = #{inspectionNo} insert into Equipment_data_acquisition (site, bu_no, equipment_no, inspection_no, create_date, create_by, item_no, collection_source, collection_method) values (#{item.site}, #{item.buNo}, #{item.equipmentNo}, #{item.inspectionNo}, getDate(), #{item.actionBy}, #{item.itemNo}, #{item.collectionSource}, #{item.collectionMethod}) INSERT INTO eam_actual_operator (site, order_no, function_type, operator, bu_no) VALUES (#{item.site}, #{item.orderNo}, #{item.functionType}, #{item.operator}, #{item.buNo}) DELETE FROM eam_actual_operator WHERE site = #{site} and order_no = #{inspectionNo} and bu_no = #{buNo} INSERT INTO sys_oss (url, create_date, file_name, new_file_name, order_ref1, order_ref2, order_ref3, order_ref4) VALUES (#{item.url}, getDate(), #{item.fileName}, #{item.newFileName}, #{item.orderRef1}, #{item.orderRef2}, #{item.orderRef3}, #{item.orderRef4}) INSERT INTO qc_item_object (site, bu_no, ItemNo, ObjectID, default_flag) VALUES (#{item.site}, #{item.buNo}, #{item.itemNo}, #{item.objectID}, #{item.defaultFlag}) DELETE FROM qc_item_object WHERE (site = #{item.site} and bu_no = #{item.buNo} and ItemNo = #{item.itemNo} and ObjectID = #{item.objectID}) UPDATE qc_item_object SET default_flag = #{defaultFlag} WHERE site = #{site} and bu_no = #{buNo} and ItemNo = #{itemNo} and ObjectID = #{objectID} delete from Equipment_data_acquisition where site = #{site} and bu_no = #{buNo} and inspection_no = #{inspectionNo} INSERT INTO qc_ipqc_detailed_record ( inspection_no, order_no, template_id, item_no, item_desc, default_value, min_value, max_value, value_type_db, value_type, site, bu_no, foreign_flag, order_id ) VALUES ( #{inspectionNo}, #{orderNo}, #{templateId}, #{itemNo}, #{itemDesc}, #{defaultValue}, #{minValue}, #{maxValue}, #{valueTypeDb}, #{valueType}, #{site}, #{buNo}, #{foreignFlag}, #{orderId} ) DELETE FROM qc_ipqc_detailed_record WHERE site = #{site} AND bu_no = #{buNo} AND inspection_no = #{inspectionNo} AND item_no = #{itemNo} DELETE FROM qc_ipqc_sub_detail_record WHERE site = #{site} AND bu_no = #{buNo} AND inspection_no = #{inspectionNo} AND item_no = #{itemNo} INSERT INTO qc_iqc_detailed_record ( inspection_no, template_id, item_no, item_desc, default_value, min_value, max_value, value_type_db, value_type, site, bu_no, foreign_flag, order_id ) VALUES ( #{inspectionNo}, #{templateId}, #{itemNo}, #{itemDesc}, #{defaultValue}, #{minValue}, #{maxValue}, #{valueTypeDb}, #{valueType}, #{site}, #{buNo}, #{foreignFlag}, #{orderId} ) DELETE FROM qc_iqc_detailed_record WHERE site = #{site} AND bu_no = #{buNo} AND inspection_no = #{inspectionNo} AND item_no = #{itemNo} DELETE FROM qc_iqc_sub_detail_record WHERE site = #{site} AND bu_no = #{buNo} AND inspection_no = #{inspectionNo} AND item_no = #{itemNo} INSERT INTO qc_fqc_detailed_record ( inspection_no, template_id, item_no, item_desc, default_value, min_value, max_value, value_type_db, value_type, site, bu_no, foreign_flag, order_id ) VALUES ( #{inspectionNo}, #{templateId}, #{itemNo}, (SELECT ItemDesc FROM eam_properties_item WHERE site = #{site} AND bu_no = #{buNo} AND ItemNo = #{itemNo}), (SELECT DefaultValue FROM eam_properties_item WHERE site = #{site} AND bu_no = #{buNo} AND ItemNo = #{itemNo}), (SELECT MinValue FROM eam_properties_item WHERE site = #{site} AND bu_no = #{buNo} AND ItemNo = #{itemNo}), (SELECT MaxValue FROM eam_properties_item WHERE site = #{site} AND bu_no = #{buNo} AND ItemNo = #{itemNo}), (SELECT ValueType_DB FROM eam_properties_item WHERE site = #{site} AND bu_no = #{buNo} AND ItemNo = #{itemNo}), (SELECT ValueType FROM eam_properties_item WHERE site = #{site} AND bu_no = #{buNo} AND ItemNo = #{itemNo}), #{site}, #{buNo}, #{foreignFlag}, #{orderId} ) DELETE FROM qc_fqc_detailed_record WHERE site = #{site} AND bu_no = #{buNo} AND inspection_no = #{inspectionNo} AND item_no = #{itemNo} DELETE FROM qc_fqc_sub_detail_record WHERE site = #{site} AND bu_no = #{buNo} AND inspection_no = #{inspectionNo} AND item_no = #{itemNo} INSERT INTO qc_oqc_detailed_record ( inspection_no, template_id, item_no, item_desc, default_value, min_value, max_value, value_type_db, value_type, site, bu_no, foreign_flag, order_id ) VALUES ( #{inspectionNo}, #{templateId}, #{itemNo}, (SELECT ItemDesc FROM eam_properties_item WHERE site = #{site} AND bu_no = #{buNo} AND ItemNo = #{itemNo}), (SELECT DefaultValue FROM eam_properties_item WHERE site = #{site} AND bu_no = #{buNo} AND ItemNo = #{itemNo}), (SELECT MinValue FROM eam_properties_item WHERE site = #{site} AND bu_no = #{buNo} AND ItemNo = #{itemNo}), (SELECT MaxValue FROM eam_properties_item WHERE site = #{site} AND bu_no = #{buNo} AND ItemNo = #{itemNo}), (SELECT ValueType_DB FROM eam_properties_item WHERE site = #{site} AND bu_no = #{buNo} AND ItemNo = #{itemNo}), (SELECT ValueType FROM eam_properties_item WHERE site = #{site} AND bu_no = #{buNo} AND ItemNo = #{itemNo}), #{site}, #{buNo}, #{foreignFlag}, #{orderId} ) DELETE FROM qc_oqc_detailed_record WHERE site = #{site} AND bu_no = #{buNo} AND inspection_no = #{inspectionNo} AND item_no = #{itemNo} DELETE FROM qc_oqc_sub_detail_record WHERE site = #{site} AND bu_no = #{buNo} AND inspection_no = #{inspectionNo} AND item_no = #{itemNo} delete from qc_inspection_standards where site = #{site} and bu_no = #{buNo} and template_id = #{templateId} and item_no = #{itemNo} INSERT INTO qc_inspection_standards (site, bu_no, template_id, item_no, default_value, min_value, max_value, condition, collection_source, seq_no) VALUES (#{item.site}, #{item.buNo}, #{item.templateId}, #{item.itemNo}, #{item.defaultValue}, #{item.minValue}, #{item.maxValue}, #{item.condition}, #{item.collectionSource}, #{item.seqNo}) update Equipment_data_detail set inspection_no = #{inspectionNo} where id = #{id} delete sys_oss where order_ref1 = #{site} and order_ref2 = #{inspectionNo} and order_ref4 = #{buNo} update qc_template_detailed set order_id=#{orderId} where site = #{site} and bu_no= #{buNo} and template_id = #{templateId} and ItemNo = #{itemNo} UPDATE qc_iqc_record SET submit_flag = 'N', state = '待检验', cancel_check_by = #{updateBy}, cancel_check_date = getDate(), submit_by = NULL WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo} UPDATE qc_iqc_detailed_record SET is_submit = 'N' WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo} UPDATE qc_iqc_sub_detail_record SET is_submit = 'N' WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo} {CALL UspUpdatePartDefectTracking( #{site,mode=IN,jdbcType=VARCHAR}, #{buNo,mode=IN,jdbcType=VARCHAR}, #{partNo,mode=IN,jdbcType=VARCHAR}, #{supplierId,mode=IN,jdbcType=VARCHAR}, #{passFlag,mode=IN,jdbcType=BIT} )} UPDATE qc_fai_record SET submit_flag = 'N', state = '待检验', cancel_check_by = #{updateBy}, cancel_check_date = getDate() WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo} UPDATE qc_fai_detailed_record SET is_submit = 'N' WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo} UPDATE qc_fai_sub_detail_record SET is_submit = 'N' WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo} UPDATE qc_ipqc_record SET submit_flag = 'N', state = '待检验', cancel_check_by = #{updateBy}, cancel_check_date = getDate(), submit_by = NULL WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo} UPDATE qc_ipqc_detailed_record SET is_submit = 'N' WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo} UPDATE qc_ipqc_sub_detail_record SET is_submit = 'N' WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo} UPDATE qc_sqc_record SET submit_flag = 'N', state = '待检验', cancel_check_by = #{updateBy}, cancel_check_date = getDate(), submit_by = NULL WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo} UPDATE qc_sqc_detailed_record SET is_submit = 'N' WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo} UPDATE qc_sqc_sub_detail_record SET is_submit = 'N' WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo} UPDATE qc_fqc_record SET submit_flag = 'N', state = '待检验', cancel_check_by = #{updateBy}, cancel_check_date = getDate(), submit_by = NULL WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo} UPDATE qc_fqc_detailed_record SET is_submit = 'N' WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo} UPDATE qc_fqc_sub_detail_record SET is_submit = 'N' WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo} UPDATE qc_oqc_record SET submit_flag = 'N', state = '待检验', cancel_check_by = #{updateBy}, cancel_check_date = getDate(), submit_by = NULL WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo} UPDATE qc_oqc_detailed_record SET is_submit = 'N' WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo} UPDATE qc_oqc_sub_detail_record SET is_submit = 'N' WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo} delete receiving_task where site = #{site} and citem_code = #{buNo} and inspection_no = #{inspectionNo} delete from sys_oss where id = #{id} INSERT INTO qc_oqc_detailed_record (inspection_no, template_id, sampling_level_no, sampling_level_desc, sampling_programme_no, sampling_programme_desc, AQL, AC, RE, item_no, item_desc, object_id, object_desc, default_value, min_value, max_value, value_type_db, value_type, site, sampling_qty, bu_no, order_id, custom1, custom2, custom3) VALUES (#{inspectionNo}, #{templateId}, #{samplingLevelNo}, #{samplingLevelDesc}, #{samplingProgrammeNo}, #{samplingProgrammeDesc}, #{aql,jdbcType=DECIMAL}, #{ac,jdbcType=DECIMAL}, #{re,jdbcType=DECIMAL}, #{itemNo}, #{itemDesc}, #{objectId}, #{objectDesc}, #{defaultValue}, #{minValue,jdbcType=DECIMAL}, #{maxValue,jdbcType=DECIMAL}, #{valueTypeDb}, #{valueType}, #{site}, #{samplingQty}, #{buNo}, #{orderId}, #{custom1}, #{custom2}, #{custom3}) UPDATE qc_oqc_record SET inspection_type_no = #{inspectionTypeNo}, sampling_qty = #{samplingQty}, inspection_cycle = #{inspectionCycle}, part_desc = #{partDesc}, detail_flag = 'Y', pass_qty = #{samplingQty}, not_pass_qty = 0 , inspector_by = #{inspectorBy} WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo} UPDATE qc_oqc_record SET disposal_measures = #{disposalMeasures}, disposal_remark = #{disposalRemark}, inspection_result = #{inspectionResult}, inspector_no = #{inspectorNo}, state = #{state}, inspection_remark = #{inspectionRemark}, inspector_date = #{inspectorDate,jdbcType=TIMESTAMP}, roll_count = #{rollCount,jdbcType=DECIMAL}, sampling_qty = #{samplingQty,jdbcType=DECIMAL}, unqualified_qty = #{unqualifiedQty,jdbcType=DECIMAL}, pass_qty = #{passQty,jdbcType=DECIMAL}, not_pass_qty = #{notPassQty,jdbcType=DECIMAL}, batch_qualified_qty = #{batchQualifiedQty,jdbcType=DECIMAL} WHERE site = #{site} and inspection_no = #{inspectionNo} and bu_no = #{buNo} UPDATE qc_oqc_detailed_record SET item_result = #{itemResult}, unqualified_quantity = #{unqualifiedQuantity,jdbcType=DECIMAL}, sampling_qty = #{samplingQty,jdbcType=DECIMAL}, text_value = #{textValue}, number_value = #{numberValue,jdbcType=DECIMAL}, default_value = #{defaultValue}, min_value = #{minValue,jdbcType=DECIMAL}, max_value = #{maxValue,jdbcType=DECIMAL}, item_remark = #{itemRemark}, custom1 = #{custom1}, custom2 = #{custom2}, custom3 = #{custom3} WHERE inspection_no = #{inspectionNo} and item_no = #{itemNo} and site = #{site} and bu_no = #{buNo} UPDATE qc_oqc_detailed_record item_result = #{itemResult}, unqualified_quantity = #{unqualifiedQuantity,jdbcType=DECIMAL}, number_value = #{numberValue,jdbcType=DECIMAL}, text_value = #{textValue}, WHERE inspection_no = #{inspectionNo} and RTRIM(item_no) = RTRIM(#{itemNo}) and site = #{site} and bu_no = #{buNo} UPDATE qc_oqc_record SET submit_flag = 'Y', state = '已完成', submit_date = getDate(), submit_by = #{updateBy} WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo} UPDATE qc_oqc_detailed_record SET is_submit = 'Y' WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo} UPDATE qc_oqc_sub_detail_record SET is_submit = 'Y' WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo} DELETE FROM qc_oqc_sub_detail_record WHERE inspection_no = #{inspectionNo} and item_no = #{itemNo} and site = #{site} and bu_no = #{buNo} INSERT INTO qc_oqc_sub_detail_record (inspection_no, item_no, sub_detail_value, sampling_location, site, sampling_location_b, bu_no, num, sub_detail_value_b, sub_detail_value_c, sub_detail_value_d, sub_detail_value_e, file_name, is_transfer, is_qualified, defect_qty, roll_no, create_time) VALUES (#{item.inspectionNo}, #{item.itemNo}, #{item.subDetailValue}, #{item.samplingLocation}, #{item.site}, #{item.samplingLocationB}, #{item.buNo}, #{item.num}, #{item.subDetailValueB}, #{item.subDetailValueC}, #{item.subDetailValueD}, #{item.subDetailValueE}, #{item.fileName}, #{item.isTransfer}, #{item.isQualified}, #{item.defectQty}, #{item.rollNo}, getDate()) DELETE FROM qc_oqc_record WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo} DELETE FROM qc_oqc_detailed_record WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo} DELETE FROM qc_oqc_sub_detail_record WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo} update qc_oqc_record set action_date = getDate(), action_by = #{actionBy}, state = #{state} where site = #{site} and bu_no = #{buNo} and inspection_no = #{inspectionNo} update qc_iqc_record qc_oqc_record set sampling_qty = #{samplingQty,jdbcType=DECIMAL} where site = #{site} and bu_no = #{buNo} and inspection_no = #{inspectionNo} update qc_iqc_detailed_record qc_oqc_detailed_record set sampling_qty = #{samplingQty,jdbcType=DECIMAL} where site = #{site} and bu_no = #{buNo} and inspection_no = #{inspectionNo} INSERT INTO part_sop ( site, bu_no, part_no, sop_no, sop_name, sop_url, sop_type, version, sop_status, phase_in_date, phase_out_date, created_by, creation_date, operation_desc ) VALUES ( #{data.site}, #{data.buNo}, #{data.partNo}, #{data.sopNo}, #{data.sopName}, #{data.sopUrl}, #{data.sopType}, #{data.version}, #{data.sopStatus}, CONVERT(DATE, #{data.phaseInDate}) NULL , CONVERT(DATE, #{data.phaseOutDate}) NULL , #{data.createdBy}, CONVERT(DATE, #{data.creationDate}) GETDATE() , #{data.operationDesc} ) DELETE FROM part_sop AND site = #{params.site} AND bu_no = #{params.buNo} AND part_no = #{params.partNo} AND sop_no = #{params.sopNo} update inbound_notification_head set order_status = #{status} , inspection_flag = #{inspectionFlag} where site = #{site} and bu_no = #{buNo} and order_no = #{documentNo} update outbound_notification_head set order_status = #{status} where site = #{site} and bu_no = #{buNo} and order_no = #{documentNo} update outbound_notification_detail set inspection_flag = #{inspectionFlag} where site = #{site} and bu_no = #{buNo} and order_no = #{documentNo} insert into Equipment_folder_location (folder_path,equipment_no,site,bu_no,file_no,backup_folder_path,IP,suffix,equipment_desc,backup_photo_path,batch_date,port,register_address, register_num,register_num_columntype,register_address_inspection,register_num_inspection,register_num_inspection_columntype,unit_id, excel_compare_fields_x,excel_compare_fields_y,initial_line,data_row,data_column,skip_line,cutting_symbol,transparent_flag,Formula_calculation, Formula,Group_calculation,regexp,data_storage_mode,serial_no,repair_type,buzzer,equipment_classification) values (#{folderPath}, #{equipmentNo}, #{site}, #{buNo}, #{fileNo}, #{backupFolderPath}, #{IP}, #{suffix}, #{equipmentDesc}, #{backupPhotoPath}, #{batchDate}, #{port}, #{registerAddress}, #{registerNum}, #{registerNumColumntype}, #{registerAddressInspection}, #{registerNumInspection}, #{registerNumInspectionColumntype}, #{unitId}, #{excelCompareFieldsX}, #{excelCompareFieldsY}, #{initialLine}, #{dataRow}, #{dataColumn}, #{skipLine}, #{cuttingSymbol}, #{transparentFlag}, #{formulaCalculation}, #{formula}, #{groupCalculation}, #{regexp}, #{dataStorageMode}, #{serialNo}, #{repairType}, #{buzzer}, #{equipmentClassification}) UPDATE Equipment_folder_location SET folder_path = #{folderPath}, equipment_no = #{equipmentNo}, bu_no = #{buNo}, file_no = #{fileNo}, backup_folder_path = #{backupFolderPath}, IP = #{IP}, suffix = #{suffix}, equipment_desc = #{equipmentDesc}, backup_photo_path = #{backupPhotoPath}, batch_date = #{batchDate}, port = #{port}, register_address = #{registerAddress}, register_num = #{registerNum}, register_num_columntype = #{registerNumColumntype}, register_address_inspection = #{registerAddressInspection}, register_num_inspection = #{registerNumInspection}, register_num_inspection_columntype = #{registerNumInspectionColumntype}, unit_id = #{unitId}, excel_compare_fields_x = #{excelCompareFieldsX}, excel_compare_fields_y = #{excelCompareFieldsY}, initial_line = #{initialLine}, data_row = #{dataRow}, data_column = #{dataColumn}, skip_line = #{skipLine}, cutting_symbol = #{cuttingSymbol}, transparent_flag = #{transparentFlag}, Formula_calculation = #{formulaCalculation}, Formula = #{formula}, Group_calculation = #{groupCalculation}, regexp = #{regexp}, data_storage_mode = #{dataStorageMode}, serial_no = #{serialNo}, repair_type = #{repairType}, buzzer = #{buzzer}, equipment_classification = #{equipmentClassification}, update_by = #{updateBy}, update_time = getDate() WHERE id = #{id} delete from Equipment_folder_location where id = #{id} update qc_ipqc_detailed_record qc_sqc_detailed_record qc_fqc_detailed_record qc_fai_detailed_record qc_oqc_detailed_record qc_iqc_detailed_record set number_value = #{numberValue,jdbcType=DECIMAL}, text_value = #{textValue} where site = #{site} and bu_no = #{buNo} and inspection_no = #{inspectionNo} and item_no = #{itemNo} UPDATE qc_iqc_detailed_record SET unqualified_quantity = #{unqualifiedQuantity,jdbcType=DECIMAL}, item_result = #{itemResult} WHERE inspection_no = #{inspectionNo} and item_no = #{itemNo} and site = #{site} and bu_no = #{buNo} UPDATE qc_iqc_record SET unqualified_qty = ( SELECT COUNT(*) FROM qc_iqc_detailed_record WHERE site = #{site} AND bu_no = #{buNo} AND inspection_no = #{inspectionNo} AND item_result = 'N' ) WHERE site = #{site} AND bu_no = #{buNo} AND inspection_no = #{inspectionNo} UPDATE qc_ipqc_detailed_record SET unqualified_quantity = #{unqualifiedQuantity,jdbcType=DECIMAL}, item_result = #{itemResult} WHERE inspection_no = #{inspectionNo} and item_no = #{itemNo} and site = #{site} and bu_no = #{buNo} UPDATE qc_ipqc_record SET unqualified_qty = ( SELECT COUNT(*) FROM qc_ipqc_detailed_record WHERE site = #{site} AND bu_no = #{buNo} AND inspection_no = #{inspectionNo} AND item_result = 'N' ) WHERE site = #{site} AND bu_no = #{buNo} AND inspection_no = #{inspectionNo} UPDATE qc_sqc_detailed_record SET unqualified_quantity = #{unqualifiedQuantity,jdbcType=DECIMAL}, item_result = #{itemResult} WHERE inspection_no = #{inspectionNo} and item_no = #{itemNo} and site = #{site} and bu_no = #{buNo} UPDATE qc_sqc_record SET unqualified_qty = ( SELECT COUNT(*) FROM qc_sqc_detailed_record WHERE site = #{site} AND bu_no = #{buNo} AND inspection_no = #{inspectionNo} AND item_result = 'N' ) WHERE site = #{site} AND bu_no = #{buNo} AND inspection_no = #{inspectionNo} UPDATE qc_fqc_detailed_record SET unqualified_quantity = #{unqualifiedQuantity,jdbcType=DECIMAL}, item_result = #{itemResult} WHERE inspection_no = #{inspectionNo} and item_no = #{itemNo} and site = #{site} and bu_no = #{buNo} UPDATE qc_fqc_record SET unqualified_qty = ( SELECT COUNT(*) FROM qc_fqc_detailed_record WHERE site = #{site} AND bu_no = #{buNo} AND inspection_no = #{inspectionNo} AND item_result = 'N' ) WHERE site = #{site} AND bu_no = #{buNo} AND inspection_no = #{inspectionNo} UPDATE qc_oqc_detailed_record SET unqualified_quantity = #{unqualifiedQuantity,jdbcType=DECIMAL}, item_result = #{itemResult} WHERE inspection_no = #{inspectionNo} and item_no = #{itemNo} and site = #{site} and bu_no = #{buNo} UPDATE qc_oqc_record SET unqualified_qty = ( SELECT COUNT(*) FROM qc_oqc_detailed_record WHERE site = #{site} AND bu_no = #{buNo} AND inspection_no = #{inspectionNo} AND item_result = 'N' ) WHERE site = #{site} AND bu_no = #{buNo} AND inspection_no = #{inspectionNo} UPDATE Equipment_data_acquisition SET batch_no = #{batchNo} WHERE site = #{site} AND bu_no = #{buNo} AND inspection_no = #{inspectionNo} AND equipment_no = #{equipmentNo} UPDATE Equipment_data_acquisition SET accumulate_collect = #{accumulateCollect}, delete_after_collect = #{deleteAfterCollect} WHERE site = #{site} AND bu_no = #{buNo} AND inspection_no = #{inspectionNo} AND equipment_no = #{equipmentNo}