INSERT INTO plm_bom_header (site, part_no, eng_chg_level, bom_type, note_text, eff_phase_in_date, eff_phase_out_date, eng_revision, type_flag, net_weight, official_flag, create_date, create_by) VALUES (#{site}, #{partNo}, #{engChgLevel}, #{bomType}, #{noteText}, #{effPhaseInDate}, #{effPhaseOutDate}, #{engRevision}, #{typeFlag}, #{netWeight}, #{officialFlag}, getDate(), #{createBy}) INSERT INTO plm_bom_detail (site, part_no, eng_chg_level, bom_type, alternative_no, alternative_description, status, min_lot_qty, default_flag, note_text, create_date, create_by, official_flag) VALUES (#{site}, #{partNo}, #{engChgLevel}, #{bomType}, #{alternativeNo}, #{alternativeDescription}, #{status}, #{minLotQty}, #{defaultFlag}, #{detailNoteText}, getDate(), #{createBy}, #{officialFlag}) INSERT INTO plm_bom_component (site, part_no, eng_chg_level, bom_type, alternative_no, component_part, line_item_no, print_unit, qty_per_assembly, component_scrap, shrinkage_factor, issue_type, issue_to_loc, operation_id, note_text, create_date, create_by, line_sequence) VALUES (#{site}, #{partNo}, #{engChgLevel}, #{bomType}, #{alternativeNo}, #{componentPart}, #{lineItemNo}, #{printUnit}, #{qtyPerAssembly}, #{componentScrap}, #{shrinkageFactor}, #{issueType}, #{issueToLoc}, #{operationId}, #{noteText}, getDate(), #{createBy}, #{lineSequence}) update plm_bom_header set eff_phase_in_date = #{effPhaseInDate}, eff_phase_out_date = #{effPhaseOutDate}, eng_revision = #{engRevision}, type_flag = #{typeFlag}, net_weight = #{netWeight}, 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} update plm_bom_detail set alternative_description = #{alternativeDescription}, min_lot_qty = #{minLotQty}, note_text = #{detailNoteText}, status = #{status}, 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 = #{site} and part_no = #{partNo} and eng_chg_level = #{engChgLevel} and bom_type = #{bomType} and alternative_no = #{alternativeNo} and line_item_no = #{lineItemNo} delete from plm_bom_component where site = #{site} and part_no = #{partNo} and eng_chg_level = #{engChgLevel} and bom_type = #{bomType} delete from plm_bom_detail where site = #{site} and part_no = #{partNo} and eng_chg_level = #{engChgLevel} and bom_type = #{bomType} delete from plm_bom_header where site = #{site} and part_no = #{partNo} and eng_chg_level = #{engChgLevel} and bom_type = #{bomType} update plm_bom_component set qty_per_assembly = #{qtyPerAssembly}, component_scrap = #{componentScrap}, issue_type = #{issueType}, shrinkage_factor = #{shrinkageFactor}, operation_id = #{operationId}, issue_to_loc = #{issueToLoc}, note_text = #{noteText}, line_sequence = #{lineSequence}, 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 line_item_no = #{lineItemNo} update plm_bom_detail set status = #{status}, 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} update plm_bom_header set eff_phase_out_date = #{effPhaseOutDate}, update_date = getDate(), update_by = #{createBy} where site = #{site} and part_no = #{partNo} and eng_chg_level = #{engChgLevel} and bom_type = #{bomType} insert into part_revision (site, part_no, eng_chg_level, eff_phase_in_date, eff_phase_out_date, revision_text, product_status, repair_status, eng_revision, create_date, create_by) values (#{site}, #{partNo}, #{engChgLevel}, #{effPhaseInDate}, #{effPhaseOutDate}, #{noteText}, 'Not In Effect', 'Not In Effect', #{engRevision}, getDate(), #{createBy}) update part_revision set product_status = #{productStatus}, repair_status = 'In Effect', update_date = getDate(), update_by = #{updateBy} where site = #{site} and part_no = #{partNo} and eng_chg_level = #{engChgLevel}