INSERT INTO plm_bom_detail
(site, part_no, eng_chg_level, bom_type, alternative_no, alternative_description, min_lot_qty, default_flag, note_text, create_date, create_by)
VALUES
(#{site}, #{partNo}, #{engChgLevel}, #{bomType}, #{alternativeNo}, #{alternativeDescription}, #{minLotQty}, #{defaultFlag}, #{detailNoteText}, getDate(), #{createBy})
INSERT INTO plm_bom_component
(site, part_no, eng_chg_level, bom_type, alternative_no, component_part, print_unit, qty_per_assembly, component_scrap, shrinkage_factor, issue_type, issue_to_loc, operation_no, note_text, create_date, create_by)
VALUES
(#{site}, #{partNo}, #{engChgLevel}, #{bomType}, #{alternativeNo}, #{componentPart}, #{printUnit}, #{qtyPerAssembly}, #{componentScrap}, #{shrinkageFactor}, #{issueType}, #{issueToLoc}, #{operationNo}, #{noteText}, getDate(), #{createBy})
update plm_bom_detail
set alternative_description = #{alternativeDescription},
min_lot_qty = #{minLotQty},
note_text = #{detailNoteText},
update_date = getDate(),
update_by = #{updateBy}
where site = #{site} and part_no = #{partNo} and eng_chg_level = #{engChgLevel} and bom_type = #{bomType} and alternative_no = #{alternativeNo}
delete from plm_bom_component
where site = #{site} and part_no = #{partNo} and eng_chg_level = #{engChgLevel} and bom_type = #{bomType} and alternative_no = #{alternativeNo}
delete from plm_bom_detail
where site = #{site} and part_no = #{partNo} and eng_chg_level = #{engChgLevel} and bom_type = #{bomType} and alternative_no = #{alternativeNo}
delete from plm_bom_component
where
(site = #{item.site} and part_no = #{item.partNo} and eng_chg_level = #{item.engChgLevel} and bom_type = #{item.bomType} and alternative_no = #{item.alternativeNo} and component_part = #{item.componentPart})
delete from plm_bom_component
where
(site = #{item.site} and part_no = #{item.partNo} and eng_chg_level = #{item.engChgLevel} and bom_type = #{item.bomType})
delete from plm_bom_detail
where
(site = #{item.site} and part_no = #{item.partNo} and eng_chg_level = #{item.engChgLevel} and bom_type = #{item.bomType})
update plm_bom_component
set qty_per_assembly = #{qtyPerAssembly},
component_scrap = #{componentScrap},
issue_type = #{issueType},
shrinkage_factor = #{shrinkageFactor},
operation_no = #{operationNo},
issue_to_loc = #{issueToLoc},
note_text = #{noteText},
update_date = getDate(),
update_by = #{updateBy}
where site = #{site} and part_no = #{partNo} and eng_chg_level = #{engChgLevel} and bom_type = #{bomType} and alternative_no = #{alternativeNo} and component_part = #{componentPart}