delete from PartSubPropertiesValueHeader where PartNo = #{partNo} and site = #{site} and RecordType = #{recordType} delete from PartSubPropertiesValue where PartNo = #{partNo} and site = #{site} and RecordType = #{recordType} insert into PartSubPropertiesValueHeader (PartNo, Site, CodeNo, SubCodeSeqNo, SubCodeDesc, RecordType) select #{partNo}, #{site}, #{codeNo}, 1, Code_Desc, #{recordType} from plm_properties_model_header where Code_No = #{codeNo} and site = #{site} and function_type = #{recordType} insert into PartSubPropertiesValue (PartNo, Site, CodeNo, SubCodeSeqNo, SubCodeDesc, ItemNo, PropertiesItemNo, TextValue, NumValue, RecordType) select #{partNo}, #{site}, #{codeNo}, 1, a.Code_Desc, b.seq_No, b.properties_item_no, case when c.ValueType_DB = 'T' then c.DefaultValue else null end, case when c.ValueType_DB = 'N' and c.DefaultValue != '' then c.DefaultValue else null end, #{recordType} from plm_properties_model_header a left join plm_properties_model_detail b on a.Code_No = b.Code_No and a.site = b.site and a.function_type = b.function_type left join plm_properties_item c on b.properties_item_no = c.ItemNo and b.site = c.site and a.function_type = c.itemType where a.Code_No = #{codeNo} and a.site = #{site} AND B.SITE IS NOT NULL AND A.function_type = #{recordType} update PartSubPropertiesValue set TextValue = #{textValue}, NumValue = #{numValue, jdbcType=DOUBLE} where PropertiesItemNo = #{propertiesItemNo} and site = #{site} and PartNo = #{partNo} and RecordType = #{recordType} insert into part_agent (site, part_no, agent_id) values (#{site}, #{partNo}, #{agentId}) delete from part_agent where part_no = #{partNo} and site = #{site} and agent_id = #{agentId} delete from part_agent where part_no = #{partNo} and site = #{site} and agent_id = #{agentId} insert into part_manufacturer (site, part_no, manufacturer_id) values (#{site}, #{partNo}, #{manufacturerId}) delete from part_manufacturer where part_no = #{partNo} and site = #{site} and manufacturer_id = #{manufacturerId} delete from part_manufacturer where part_no = #{partNo} and site = #{site} and manufacturer_id = #{manufacturerId} UPDATE PartSubPropertiesValue SET TextValue = #{textValue}, NumValue = #{numValue,jdbcType=DECIMAL} WHERE PartNo = #{partNo} and Site = #{site} and CodeNo = #{codeNo} and SubCodeSeqNo = #{subCodeSeqNo} and ItemNo = #{itemNo} and RecordType = #{recordType} delete from PartSubPropertiesValue where PartNo = #{partNo} and site = #{site} and RecordType = #{recordType} and CodeNo = #{codeNo} and SubCodeSeqNo = #{subCodeSeqNo} and ItemNo = #{itemNo} insert into PartSubPropertiesValue (PartNo, Site, CodeNo, SubCodeSeqNo, SubCodeDesc, ItemNo, PropertiesItemNo, TextValue, NumValue, RecordType) values (#{partNo}, #{site}, #{codeNo}, #{subCodeSeqNo,jdbcType=FLOAT}, #{codeDesc}, #{itemNo, jdbcType=FLOAT}, #{itNo}, #{textValue}, #{numValue, jdbcType=FLOAT}, #{recordType}) delete from PartSubPropertiesValue where PartNo = #{partNo} and site = #{site} and RecordType = #{recordType} and CodeNo = #{codeNo} and SubCodeSeqNo = #{subCodeSeqNo} and ItemNo = #{itemNo} insert into plm_part_location (site, part_no, location_id) values (#{site}, #{partNo}, #{locationId}) delete from plm_part_location where part_no = #{partNo} and site = #{site} and location_id = #{locationId} delete from part_agent where part_no = #{partNo} and site = #{site} delete from part_manufacturer where part_no = #{partNo} and site = #{site} delete from plm_part_location where part_no = #{partNo} and site = #{site}