INSERT INTO SOOrderType (OrderType,TypeDesc,Site,Active) values (#{orderType},#{typeDesc},#{site},#{active}) UPDATE SOOrderType SET TypeDesc=#{typeDesc},Active=#{active},Site=#{site} where OrderType=#{orderType} and Site=#{site} delete from SOOrderType where OrderType=#{orderType} and Site=#{site} INSERT INTO SOPlanner (PlannerType,TypeDesc,Site,Active) values (#{plannerType},#{typeDesc},#{site},#{active}) UPDATE SOPlanner SET TypeDesc=#{typeDesc},Active=#{active},Site=#{site} where PlannerType=#{plannerType} and Site=#{site} delete from SOPlanner where PlannerType=#{plannerType} and Site=#{site} delete from ShopOrder where site=#{site} and orderNo=#{orderNo} update ShopOrder set NeedDate=#{needDate},PlanStartDate=#{planStartDate},OriginalNeedDate=#{originalNeedDate},OrderType=#{orderType}, Planner=#{planner},OriSOOrderNo=#{oriSOOrderNo},ProjectID=#{projectID},Leadtime=#{leadtime}, RepairSOFlag=#{repairSOFlag},TechInfo=#{techInfo},Remark=#{remark} where Site=#{site} and OrderNo=#{orderNo}