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 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, ppi.plan_status, ppi.classes, ppi.process_code, ppd.obj_id d_obj_id, ppd.plan_code d_plan_code, ppd.material_code d_material_code, ppd.plan_amount d_plan_amount, ppd.complete_amount d_complete_amount, ppd.begin_time d_begin_time, ppd.end_time d_end_time, ppd.current_staff_id d_current_staff_id, ppd.next_staff_id d_next_staff_id, ppd.end_flag d_end_flag, ppd.classes d_classes, ppd.process_code d_process_code 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 left join prod_plan_detail ppd on ppd.plan_code = ppi.plan_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, plan_status, classes, process_code, #{planCode}, #{orderCode}, #{materialCode}, #{materialName}, #{stationCode}, #{deviceCode}, #{teamCode}, #{planAmount}, #{completeAmount}, #{beginTime}, #{endTime}, #{compFlag}, #{createdBy}, #{createdTime}, #{updatedBy}, #{updatedTime}, #{planBeginTime}, #{planEndTime}, #{planStatus}, #{classes}, #{processCode}, 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}, plan_status = #{planStatus}, classes = #{classes}, process_code = #{processCode}, where obj_id = #{objId} delete from prod_plan_info where obj_id = #{objId} delete from prod_plan_info where obj_id in #{objId}