select ppi.obj_id, ppi.plan_code, ppi.order_code, ppi.material_code, ppi.material_name, ppi.station_code, bpl.product_line_name station_name, ppi.device_code, ppi.team_code, btm.team_name, ppi.plan_amount, ppi.complete_amount, ppi.begin_time, ppi.end_time, ppi.comp_flag, ppi.created_by, ppi.created_time, ppi.updated_by, ppi.updated_time, ppi.plan_begin_time, ppi.plan_end_time from prod_plan_info ppi left join base_product_line bpl on bpl.product_line_code = ppi.station_code left join base_team_members btm on btm.team_code = ppi.team_code insert into prod_plan_info plan_code, order_code, material_code, material_name, station_code, device_code, team_code, plan_amount, complete_amount, begin_time, end_time, comp_flag, created_by, created_time, updated_by, updated_time, plan_begin_time, plan_end_time, #{planCode}, #{orderCode}, #{materialCode}, #{materialName}, #{stationCode}, #{deviceCode}, #{teamCode}, #{planAmount}, #{completeAmount}, #{beginTime}, #{endTime}, #{compFlag}, #{createdBy}, #{createdTime}, #{updatedBy}, #{updatedTime}, #{planBeginTime}, #{planEndTime}, update prod_plan_info plan_code = #{planCode}, order_code = #{orderCode}, material_code = #{materialCode}, material_name = #{materialName}, station_code = #{stationCode}, device_code = #{deviceCode}, team_code = #{teamCode}, plan_amount = #{planAmount}, complete_amount = #{completeAmount}, begin_time = #{beginTime}, end_time = #{endTime}, comp_flag = #{compFlag}, created_by = #{createdBy}, created_time = #{createdTime}, updated_by = #{updatedBy}, updated_time = #{updatedTime}, plan_begin_time = #{planBeginTime}, plan_end_time = #{planEndTime}, where obj_id = #{objId} delete from prod_plan_info where obj_id = #{objId} delete from prod_plan_info where obj_id in #{objId}