select a.route_id, a.route_name, a.route_desc, a.active_flag, a.remark, a.create_by, a.create_time, a.update_by, a.update_time, sum(p.production_time) production_time, a.tenant_id from prod_base_route a left join prod_base_route_process b on b.route_id = a.route_id left join mes_base_process_info p on p.process_id = b.process_id insert into prod_base_route route_name, route_desc, active_flag, remark, create_by, create_time, update_by, update_time, tenant_id, #{routeName}, #{routeDesc}, #{activeFlag}, #{remark}, #{createBy}, #{createTime}, #{updateBy}, #{updateTime}, #{tenantId}, update prod_base_route route_name = #{routeName}, route_desc = #{routeDesc}, active_flag = #{activeFlag}, remark = #{remark}, create_by = #{createBy}, create_time = #{createTime}, update_by = #{updateBy}, update_time = #{updateTime}, tenant_id = #{tenantId}, where route_id = #{routeId} delete from prod_base_route where route_id = #{routeId} delete from prod_base_route where route_id in #{routeId} delete from prod_base_route_process where route_id in #{routeId} delete from prod_base_route_process where route_id = #{routeId} insert into prod_base_route_process( route_id, process_id, process_order, remark, create_by, create_time, update_by, update_time) values ( #{item.routeId}, #{item.processId}, #{item.processOrder}, #{item.remark}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime})