INSERT INTO qc_method (site, bu_no, method_no, method_name, create_date, create_by, method_remark, update_date, update_by, inspection_type_no)
VALUES (#{site}, #{buNo}, #{methodNo}, #{methodName}, GetDate(), #{createBy}, #{methodRemark}, getDate(), #{updateBy}, #{inspectionTypeNo})
UPDATE qc_method
SET method_name = #{methodName},
method_remark = #{methodRemark},
update_date = getDate(),
update_by = #{updateBy},
inspection_type_no = #{inspectionTypeNo}
WHERE site = #{site} and method_no = #{methodNo} and bu_no = #{buNo}
DELETE FROM qc_method
WHERE site = #{site} and method_no = #{methodNo} and bu_no = #{buNo}
INSERT INTO eam_properties_item (site, bu_no, ItemNo, ItemDesc, DefaultValue, ValueType, ValueType_DB, ValueChooseFlag, CreatedDate, CreatedBy, MaxValue, MinValue, ItemRemark, ItemType, update_date, update_by, inspection_type_no, item_sampling_quantity, sampling_programme_no, sampling_level_no, default_sampling_proportion, collection_flag, collection_source, collection_method, collection_condition, collection_data_content)
VALUES (#{site}, #{buNo}, #{itemNo}, #{itemDesc}, #{defaultValue}, #{valueType}, #{valueTypeDb}, #{valueChooseFlag}, GetDate(), #{createdBy}, #{maxValue,jdbcType=DECIMAL}, #{minValue,jdbcType=DECIMAL}, #{itemRemark}, #{itemType}, getDate(), #{updateBy}, #{inspectionTypeNo}, #{itemSamplingQuantity}, #{samplingProgrammeNo}, #{samplingLevelNo}, #{defaultSamplingProportion}, #{collectionFlag}, #{collectionSource}, #{collectionMethod}, #{collectionCondition}, #{collectionDataContent})
INSERT INTO qc_method_item (ItemNo, method_no, site, bu_no)
VALUES (#{itemNo}, #{methodNo}, #{site}, #{buNo})
UPDATE eam_properties_item
SET ItemDesc = #{itemDesc},
DefaultValue = #{defaultValue},
ValueType = #{valueType},
ValueType_DB = #{valueTypeDb},
ValueChooseFlag = #{valueChooseFlag},
MaxValue = #{maxValue,jdbcType=DECIMAL},
MinValue = #{minValue,jdbcType=DECIMAL},
ItemRemark = #{itemRemark},
update_date = getDate(),
update_by = #{updateBy},
inspection_type_no = #{inspectionTypeNo},
item_sampling_quantity = #{itemSamplingQuantity},
sampling_programme_no = #{samplingProgrammeNo},
sampling_level_no = #{samplingLevelNo},
default_sampling_proportion = #{defaultSamplingProportion},
collection_flag = #{collectionFlag},
collection_source = #{collectionSource},
collection_method = #{collectionMethod},
collection_condition = #{collectionCondition},
collection_data_content = #{collectionDataContent}
WHERE site = #{site} and ItemNo = #{itemNo} and ItemType = #{itemType} and bu_no = #{buNo}
UPDATE qc_method_item
SET method_no = #{methodNo}
WHERE site = #{site} and ItemNo = #{itemNo} and bu_no = #{buNo}
DELETE
FROM eam_properties_item
WHERE site = #{site} and ItemNo = #{itemNo} and ItemType = #{itemType} and bu_no = #{buNo}
DELETE
FROM qc_method_item
WHERE site = #{site} and ItemNo = #{itemNo} and bu_no = #{buNo}
INSERT INTO qc_inspector (inspector_no, inspector_name, inspector_phone, inspector_type, inspector_active, create_time)
VALUES (#{inspectorNo}, #{inspectorName}, #{inspectorPhone}, #{inspectorType}, #{inspectorActive}, getDate())
UPDATE qc_inspector
SET inspector_name = #{inspectorName},
inspector_phone = #{inspectorPhone},
inspector_type = #{inspectorType},
inspector_active = #{inspectorActive}
WHERE inspector_no = #{inspectorNo}
DELETE FROM qc_inspector
WHERE inspector_no = #{inspectorNo}
INSERT INTO qc_sampling_inspection_plan (site, bu_no, sampling_plan_no, sampling_plan_desc, sampling_qty_rank_no, sampling_level_no, sampling_qty_no, sampling_plan_active, create_date, create_by, update_date, update_by)
VALUES (#{site}, #{buNo}, #{samplingPlanNo}, #{samplingPlanDesc}, #{samplingQtyRankNo}, #{samplingLevelNo}, #{samplingQtyNo}, #{samplingPlanActive}, getDate(), #{createBy}, getDate(), #{updateBy})
UPDATE qc_sampling_inspection_plan
SET sampling_qty_rank_no = #{samplingQtyRankNo},
sampling_level_no = #{samplingLevelNo},
sampling_qty_no = #{samplingQtyNo},
sampling_plan_active = #{samplingPlanActive},
update_date = getDate(),
update_by = #{updateBy}
WHERE sampling_plan_no = #{samplingPlanNo} AND site = #{site} and bu_no = #{buNo}
DELETE FROM qc_sampling_inspection_plan
WHERE sampling_plan_no = #{samplingPlanNo} AND site = #{site} and bu_no = #{buNo}
INSERT INTO qc_template (site, bu_no, template_id, template_name, template_version, template_remark, template_type, sampling_programme_no, inspection_type_no, create_time, create_by, sampling_level_no, inspection_cycle, AQL, AC, RE, default_sampling_quantity, default_sampling_proportion, update_date, update_by)
VALUES (#{site}, #{buNo}, #{templateId}, #{templateName},#{templateVersion}, #{templateRemark}, #{templateType}, #{samplingProgrammeNo}, #{inspectionTypeNo}, getDate(), #{createBy}, #{samplingLevelNo}, #{inspectionCycle,jdbcType=DECIMAL}, #{aql}, #{ac}, #{re}, #{defaultSamplingQuantity}, #{defaultSamplingProportion}, getDate(), #{updateBy})
UPDATE qc_template
SET template_name = #{templateName},
template_version = #{templateVersion},
template_remark = #{templateRemark},
template_type = #{templateType},
sampling_programme_no = #{samplingProgrammeNo},
inspection_cycle = #{inspectionCycle},
inspection_type_no = #{inspectionTypeNo},
sampling_level_no = #{samplingLevelNo},
AQL = #{aql},
AC = #{ac},
RE = #{re},
default_sampling_quantity = #{defaultSamplingQuantity},
default_sampling_proportion = #{defaultSamplingProportion},
update_date = getDate(),
update_by = #{updateBy}
WHERE template_id = #{templateId} AND site = #{site} and bu_no = #{buNo}
INSERT INTO qc_template_detailed (template_id, ItemNo, default_value, max_value, min_value, site, bu_no)
VALUES (#{templateId}, #{itemNo}, #{defaultValue}, #{maxValue,jdbcType=DECIMAL}, #{minValue,jdbcType=DECIMAL}, #{site}, #{buNo})
DELETE FROM qc_template_detailed
WHERE template_id = #{templateId} and ItemNo = #{itemNo} and site = #{site} and bu_no = #{buNo}
DELETE FROM qc_template
WHERE template_id = #{templateId} AND site = #{site} and bu_no = #{buNo}
DELETE FROM qc_template_detailed
WHERE template_id = #{templateId} and site = #{site} and bu_no = #{buNo}
INSERT INTO eam_properties_item (ItemNo, ItemDesc,DefaultValue,ValueType,ValueType_DB, CreatedDate,CreatedBy,MaxValue, MinValue, ItemRemark,ItemType)
VALUES(#{itemNo},#{itemDesc}, #{defaultValue}, #{valueType}, #{valueTypeDb}, GetDate(), #{createdBy}, #{maxValue,jdbcType=DECIMAL}, #{minValue,jdbcType=DECIMAL}, #{itemRemark}, #{itemType})
delete qc_template_detailed
WHERE template_id = #{templateId} and site = #{site} and bu_no = #{buNo}
INSERT INTO qc_template_detailed
(site, bu_no, template_id, ItemNo, default_value, max_value, min_value)
VALUES
(#{site}, #{buNo}, #{templateId}, #{itemNo}, #{defaultValue}, #{maxValue,jdbcType=DECIMAL}, #{minValue,jdbcType=DECIMAL})
INSERT INTO qc_sampling_inspection_qty (site, bu_no, sampling_qty_no, sampling_qty, sampling_qty_remark, sampling_qty_active, sampling_qty_desc, create_date, create_by, update_date, update_by)
VALUES(#{site}, #{buNo}, #{samplingQtyNo}, #{samplingQty,jdbcType=DECIMAL}, #{samplingQtyRemark}, #{samplingQtyActive}, #{samplingQtyDesc}, getDate(), #{createBy}, getDate(), #{updateBy})
UPDATE qc_sampling_inspection_qty
SET sampling_qty = #{samplingQty,jdbcType=DECIMAL},
sampling_qty_desc = #{samplingQtyDesc},
sampling_qty_remark = #{samplingQtyRemark},
sampling_qty_active = #{samplingQtyActive},
update_date = getDate(),
update_by = #{updateBy}
WHERE sampling_qty_no = #{samplingQtyNo} AND site = #{site} and bu_no = #{buNo}
DELETE FROM qc_sampling_inspection_qty
WHERE site = #{site} AND sampling_qty_no = #{samplingQtyNo} AND sampling_qty_desc = #{samplingQtyDesc} and bu_no = #{buNo}
INSERT INTO qc_sampling_inspection_qty_rank (site, bu_no, sampling_qty_rank_no, sampling_qty_rank_desc, min_qty, max_qty, sampling_qty_rank_Remark, sampling_qty_rank_active, create_date, create_by, update_date, update_by)
VALUES(#{site}, #{buNo}, #{samplingQtyRankNo}, #{samplingQtyRankDesc}, #{minQty,jdbcType=DECIMAL}, #{maxQty,jdbcType=DECIMAL}, #{samplingQtyRankRemark}, #{samplingQtyRankActive}, getDate(), #{createBy}, getDate(), #{updateBy})
UPDATE qc_sampling_inspection_qty_rank
SET sampling_qty_rank_desc = #{samplingQtyRankDesc},
min_qty = #{minQty,jdbcType=DECIMAL},
max_qty = #{maxQty,jdbcType=DECIMAL},
sampling_qty_rank_Remark = #{samplingQtyRankRemark},
sampling_qty_rank_active = #{samplingQtyRankActive},
update_date = getDate(),
update_by = #{updateBy}
WHERE sampling_qty_rank_no = #{samplingQtyRankNo} AND site = #{site} and bu_no = #{buNo}
DELETE FROM qc_sampling_inspection_qty_rank
WHERE site = #{site} and bu_no = #{buNo}
AND sampling_qty_rank_no = #{samplingQtyRankNo}
AND sampling_qty_rank_desc = #{samplingQtyRankDesc}
INSERT INTO qc_sampling_inspection_level (site, bu_no, sampling_level_no, sampling_level_desc, sampling_level_remark, sampling_level_active, create_date, create_by, update_date, update_by)
VALUES (#{site}, #{buNo}, #{samplingLevelNo}, #{samplingLevelDesc}, #{samplingLevelRemark}, #{samplingLevelActive}, getDate(), #{createBy}, getDate(), #{updateBy})
UPDATE qc_sampling_inspection_level
SET sampling_level_desc = #{samplingLevelDesc},
sampling_level_remark = #{samplingLevelRemark},
sampling_level_active = #{samplingLevelActive},
update_date = getDate(),
update_by = #{updateBy}
WHERE sampling_level_no = #{samplingLevelNo}
AND site = #{site} and bu_no = #{buNo}
DELETE FROM qc_sampling_inspection_level
WHERE site = #{site} and bu_no = #{buNo}
AND sampling_level_no = #{samplingLevelNo}
AND sampling_level_desc = #{samplingLevelDesc}
INSERT INTO qc_part_attribute (attribute_no, supplier_no, attribute_remark, create_time, create_by, attribute_type, site, exempt_inspection, bu_no)
VALUES(#{partNo}, #{supplierNo}, #{attributeRemark}, getDate(), #{createBy}, #{attributeType}, #{site}, #{exemptInspection}, #{buNo})
UPDATE qc_part_attribute
SET attribute_remark = #{attributeRemark},
exempt_inspection = #{exemptInspection},
update_date = getDate(),
update_by = #{updateBy}
WHERE site = #{site} and attribute_no = #{partNo} and attribute_type = #{attributeType} and bu_no = #{buNo}
DELETE FROM qc_part_attribute
WHERE site = #{site} and attribute_no = #{partNo} and attribute_type = #{attributeType}
DELETE FROM qc_attribute_template
WHERE site = #{site} and attribute_no = #{partNo} and attribute_type = #{attributeType}
INSERT INTO qc_attribute_template (attribute_no, template_id, sampling_level_no, inspection_cycle, sampling_programme_no, AQL, AC, RE, attribute_type, operation, manufacturer_id, resource_id, site, bu_no)
VALUES (#{attributeNo}, #{templateId}, #{samplingLevelNo}, #{inspectionCycle,jdbcType=DECIMAL}, #{samplingProgrammeNo}, #{aql,jdbcType=DECIMAL}, #{ac,jdbcType=DECIMAL}, #{re,jdbcType=DECIMAL}, #{attributeType}, #{operation}, #{manufacturerID}, #{resourceID}, #{site}, #{buNo})
DELETE FROM qc_attribute_template
site = #{site} and bu_no = #{buNo} and attribute_no = #{attributeNo} and template_id = #{templateId} and attribute_type = #{attributeType}
and operation = #{operation}
and resource_id = #{resourceID}
and manufacturer_id = #{manufacturerID}
UPDATE qc_attribute_template
SET sampling_level_no = #{samplingLevelNo},
inspection_cycle = #{inspectionCycle,jdbcType=DECIMAL},
sampling_programme_no = #{samplingProgrammeNo},
AQL = #{aql,jdbcType=DECIMAL},
AC = #{ac,jdbcType=DECIMAL},
RE = #{re,jdbcType=DECIMAL}
site = #{site} and attribute_no = #{attributeNo} AND template_id = #{templateId} AND attribute_type = #{attributeType} and bu_no = #{buNo}
AND operation = #{operation}
AND resource_id = #{resourceID}
AND manufacturer_id = #{manufacturerID}
UPDATE qc_part_attribute
SET update_date = getDate(),
update_by = #{updateBy}
WHERE site = #{site} and attribute_no = #{attributeNo} and attribute_type = #{attributeType} and bu_no = #{buNo}
INSERT INTO qc_part_attribute (attribute_no, attribute_remark, create_time, create_by, attribute_type, site, bu_no)
VALUES(#{familyID}, #{attributeRemark}, getDate(), #{createBy}, #{attributeType}, #{site}, #{buNo})
DELETE FROM qc_part_attribute
WHERE site = #{site} and attribute_no = #{familyID} and attribute_type = #{attributeType} and bu_no = #{buNo}
DELETE FROM qc_attribute_template
WHERE site = #{site} and attribute_no = #{familyID} and attribute_type = #{attributeType} and bu_no = #{buNo}
INSERT INTO qc_sampling_inspection_programme (site, bu_no, sampling_programme_no, sampling_programme_desc, sampling_programme_code, create_time, create_by, update_date, update_by)
VALUES(#{site}, #{buNo}, #{samplingProgrammeNo}, #{samplingProgrammeDesc}, #{samplingProgrammeCode}, getDate(), #{createBy}, getDate(), #{updateBy})
DELETE FROM qc_sampling_inspection_programme
WHERE site = #{site} and bu_no = #{buNo}
AND sampling_programme_no = #{samplingProgrammeNo}
DELETE FROM qc_programme_plan
WHERE sampling_programme_no = #{samplingProgrammeNo} and site = #{site} and bu_no = #{buNo}
INSERT INTO qc_programme_plan (site, bu_no, sampling_programme_no, sampling_plan_no)
VALUES (#{site}, #{buNo}, #{samplingProgrammeNo}, #{samplingPlanNo})
UPDATE qc_sampling_inspection_programme
SET update_date = getDate(),
update_by = #{updateBy}
WHERE site = #{site} AND sampling_programme_no = #{samplingProgrammeNo} and bu_no = #{buNo}
DELETE FROM qc_programme_plan
WHERE sampling_programme_no = #{samplingProgrammeNo} and sampling_plan_no = #{samplingPlanNo} and site = #{site} and bu_no = #{buNo}
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)
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})
UPDATE qc_fai_record
SET disposal_measures = #{disposalMeasures},
disposal_remark = #{disposalRemark},
inspection_result = #{inspectionResult},
inspector_no = #{inspectorNo},
state = #{state},
inspection_remark = #{inspectionRemark},
inspector_date = getDate(),
sampling_qty = #{samplingQty,jdbcType=DECIMAL},
roll_qty = #{rollQty,jdbcType=DECIMAL},
unqualified_qty = #{unqualifiedQty,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 = '已完成'
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)
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})
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)
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})
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 disposal_measures = #{disposalMeasures},
disposal_remark = #{disposalRemark},
inspection_result = #{inspectionResult},
inspector_no = #{inspectorNo},
state = #{state},
inspection_remark = #{inspectionRemark},
inspector_date = getDate(),
sampling_qty = #{samplingQty,jdbcType=DECIMAL},
roll_qty = #{rollQty,jdbcType=DECIMAL},
unqualified_qty = #{unqualifiedQty,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}
WHERE inspection_no = #{inspectionNo} and item_no = #{itemNo} and site = #{site} and bu_no = #{buNo}
UPDATE qc_ipqc_record
SET submit_flag = 'Y',
state = '已完成'
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)
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_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)
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})
UPDATE qc_iqc_record
SET inspection_type_no = #{inspectionTypeNo},
sampling_qty = #{samplingQty},
inspection_cycle = #{inspectionCycle},
part_desc = #{partDesc},
detail_flag = 'Y'
WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo}
UPDATE qc_iqc_record
SET disposal_measures = #{disposalMeasures},
disposal_remark = #{disposalRemark},
inspection_result = #{inspectionResult},
inspector_no = #{inspectorNo},
state = #{state},
inspection_remark = #{inspectionRemark},
inspector_date = getDate(),
roll_count = #{rollCount,jdbcType=DECIMAL},
sampling_qty = #{samplingQty,jdbcType=DECIMAL},
unqualified_qty = #{unqualifiedQty,jdbcType=DECIMAL}
WHERE site = #{site} and inspection_no = #{inspectionNo} and bu_no = #{buNo}
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}
WHERE inspection_no = #{inspectionNo} and item_no = #{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)
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})
UPDATE qc_iqc_record
SET submit_flag = 'Y',
state = '已完成'
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)
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})
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)
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})
DELETE FROM qc_fqc_record
WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo}
DELETE FROM qc_fqc_detailed_record
WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo}
DELETE FROM qc_fqc_sub_detail_record
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 = getDate(),
sampling_qty = #{samplingQty,jdbcType=DECIMAL},
roll_qty = #{rollQty,jdbcType=DECIMAL},
unqualified_qty = #{unqualifiedQty,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}
WHERE inspection_no = #{inspectionNo} and item_no = #{itemNo} and site = #{site} and bu_no = #{buNo}
UPDATE qc_fqc_record
SET submit_flag = 'Y',
state = '已完成'
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)
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 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)
VALUES (#{site}, #{orderNo}, #{itemNo}, #{partNo}, #{partDesc}, #{spec}, #{supplierId}, #{supplierName}, #{orderQty}, getDate(), #{status}, #{citemCode}, #{citemClass}, #{sendtoAddress}, #{orderType}, #{inspectionNo})
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 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)
values
(#{site}, #{buNo}, #{documentNo}, #{sender}, #{recipient}, getDate())
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}
delete from qc_inspection_standards
where site = #{site} and bu_no = #{buNo} and template_id = #{templateId} 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}