INSERT INTO InspectionDefectCode (InspectionType_DB,DefectCode,InspectionType,DefectDesc,Active,Site,workCenter_no) values (#{inspectionTypeDb},#{defectCode},#{inspectionType},#{defectDesc},#{active},#{site},#{workCenterNo}) UPDATE InspectionDefectCode SET Active=#{active},DefectDesc=#{defectDesc},InspectionType_DB=#{inspectionTypeDb},InspectionType=#{inspectionType},workCenter_no=#{workCenterNo} where DefectCode=#{defectCode} and Site=#{site} delete from InspectionDefectCode where DefectCode=#{defectCode} and Site=#{site}