select thisTab.id, thisTab.system_code, thisTab.plan_name, thisTab.dispatch_id, thisTab.dispatch_no, thisTab.customer_id, thisTab.customer_code, thisTab.project_id, thisTab.customer_name, thisTab.project_name, thisTab.vehicle_provider_id, thisTab.vehicle_provider_name, thisTab.required_vehicle_types, thisTab.actual_vehicle_type, thisTab.main_driver_id, thisTab.main_driver_name, thisTab.vehicle_id, thisTab.assistant_driver_id, thisTab.assistant_driver_name, thisTab.license_plate, thisTab.total_amount, thisTab.shipper_id, thisTab.shipper_name, thisTab.transport_line, thisTab.shipper_mobile, thisTab.shipper_address, thisTab.shipper_region_code, thisTab.receiver_id, thisTab.receiver_name, thisTab.shipper_region_label, thisTab.receiver_mobile, thisTab.receiver_address, thisTab.receiver_region_code, thisTab.status, thisTab.receiver_region_label, thisTab.create_by, thisTab.create_time, thisTab.update_by, thisTab.update_time, thisTab.remark, thisTab.record_status, thisTab.plan_id, thisTab.confirm_by, thisTab.type, thisTab.confirm_time from tms_finance AS thisTab select count(0) from tms_finance as thisTab and thisTab.system_code = #{systemCode} and thisTab.plan_name like concat('%', #{planName}, '%') and thisTab.dispatch_id = #{dispatchId} and thisTab.dispatch_no = #{dispatchNo} and thisTab.customer_id = #{customerId} and thisTab.customer_code = #{customerCode} and thisTab.project_id = #{projectId} and thisTab.customer_name like concat('%', #{customerName}, '%') and thisTab.project_name like concat('%', #{projectName}, '%') and thisTab.vehicle_provider_id = #{vehicleProviderId} and thisTab.vehicle_provider_name like concat('%', #{vehicleProviderName}, '%') and thisTab.required_vehicle_types = #{requiredVehicleTypes} and thisTab.actual_vehicle_type = #{actualVehicleType} and thisTab.main_driver_id = #{mainDriverId} and thisTab.main_driver_name like concat('%', #{mainDriverName}, '%') and thisTab.vehicle_id = #{vehicleId} and thisTab.assistant_driver_id = #{assistantDriverId} and thisTab.assistant_driver_name like concat('%', #{assistantDriverName}, '%') and thisTab.license_plate = #{licensePlate} and thisTab.total_amount = #{totalAmount} and thisTab.shipper_id = #{shipperId} and thisTab.shipper_name like concat('%', #{shipperName}, '%') and thisTab.transport_line = #{transportLine} and thisTab.shipper_mobile = #{shipperMobile} and thisTab.shipper_address = #{shipperAddress} and thisTab.shipper_region_code = #{shipperRegionCode} and thisTab.receiver_id = #{receiverId} and thisTab.receiver_name like concat('%', #{receiverName}, '%') and thisTab.shipper_region_label = #{shipperRegionLabel} and thisTab.receiver_mobile = #{receiverMobile} and thisTab.receiver_address = #{receiverAddress} and thisTab.receiver_region_code = #{receiverRegionCode} and thisTab.status = #{status} and thisTab.receiver_region_label = #{receiverRegionLabel} and thisTab.record_status = #{recordStatus} and thisTab.plan_id = #{planId} and thisTab.confirm_by = #{confirmBy} and thisTab.type = #{type} and thisTab.confirm_time = #{confirmTime} insert into tms_finance system_code, plan_name, dispatch_id, dispatch_no, customer_id, customer_code, project_id, customer_name, project_name, vehicle_provider_id, vehicle_provider_name, required_vehicle_types, actual_vehicle_type, main_driver_id, main_driver_name, vehicle_id, assistant_driver_id, assistant_driver_name, license_plate, total_amount, shipper_id, shipper_name, transport_line, shipper_mobile, shipper_address, shipper_region_code, receiver_id, receiver_name, shipper_region_label, receiver_mobile, receiver_address, receiver_region_code, status, receiver_region_label, create_by, create_time, update_by, update_time, remark, record_status, plan_id, confirm_by, type, confirm_time, #{systemCode}, #{planName}, #{dispatchId}, #{dispatchNo}, #{customerId}, #{customerCode}, #{projectId}, #{customerName}, #{projectName}, #{vehicleProviderId}, #{vehicleProviderName}, #{requiredVehicleTypes}, #{actualVehicleType}, #{mainDriverId}, #{mainDriverName}, #{vehicleId}, #{assistantDriverId}, #{assistantDriverName}, #{licensePlate}, #{totalAmount}, #{shipperId}, #{shipperName}, #{transportLine}, #{shipperMobile}, #{shipperAddress}, #{shipperRegionCode}, #{receiverId}, #{receiverName}, #{shipperRegionLabel}, #{receiverMobile}, #{receiverAddress}, #{receiverRegionCode}, #{status}, #{receiverRegionLabel}, #{createBy}, #{createTime}, #{updateBy}, #{updateTime}, #{remark}, #{recordStatus}, #{planId}, #{confirmBy}, #{type}, #{confirmTime}, insert into tms_finance system_code,plan_name,dispatch_id,dispatch_no,customer_id,customer_code,project_id,customer_name,project_name,vehicle_provider_id,vehicle_provider_name,required_vehicle_types,actual_vehicle_type,main_driver_id,main_driver_name,vehicle_id,assistant_driver_id,assistant_driver_name,license_plate,total_amount,shipper_id,shipper_name,transport_line,shipper_mobile,shipper_address,shipper_region_code,receiver_id,receiver_name,shipper_region_label,receiver_mobile,receiver_address,receiver_region_code,status,receiver_region_label,create_by,create_time,remark,plan_id,confirm_by,type,confirm_time, #{item.systemCode},#{item.planName},#{item.dispatchId},#{item.dispatchNo},#{item.customerId},#{item.customerCode},#{item.projectId},#{item.customerName},#{item.projectName},#{item.vehicleProviderId},#{item.vehicleProviderName},#{item.requiredVehicleTypes},#{item.actualVehicleType},#{item.mainDriverId},#{item.mainDriverName},#{item.vehicleId},#{item.assistantDriverId},#{item.assistantDriverName},#{item.licensePlate},#{item.totalAmount},#{item.shipperId},#{item.shipperName},#{item.transportLine},#{item.shipperMobile},#{item.shipperAddress},#{item.shipperRegionCode},#{item.receiverId},#{item.receiverName},#{item.shipperRegionLabel},#{item.receiverMobile},#{item.receiverAddress},#{item.receiverRegionCode},#{item.status},#{item.receiverRegionLabel},#{item.createBy},#{item.createTime},#{item.remark},#{item.planId},#{item.confirmBy},#{item.type},#{item.confirmTime}, update tms_finance system_code = #{systemCode}, plan_name = #{planName}, dispatch_id = #{dispatchId}, dispatch_no = #{dispatchNo}, customer_id = #{customerId}, customer_code = #{customerCode}, project_id = #{projectId}, customer_name = #{customerName}, project_name = #{projectName}, vehicle_provider_id = #{vehicleProviderId}, vehicle_provider_name = #{vehicleProviderName}, required_vehicle_types = #{requiredVehicleTypes}, actual_vehicle_type = #{actualVehicleType}, main_driver_id = #{mainDriverId}, main_driver_name = #{mainDriverName}, vehicle_id = #{vehicleId}, assistant_driver_id = #{assistantDriverId}, assistant_driver_name = #{assistantDriverName}, license_plate = #{licensePlate}, total_amount = #{totalAmount}, shipper_id = #{shipperId}, shipper_name = #{shipperName}, transport_line = #{transportLine}, shipper_mobile = #{shipperMobile}, shipper_address = #{shipperAddress}, shipper_region_code = #{shipperRegionCode}, receiver_id = #{receiverId}, receiver_name = #{receiverName}, shipper_region_label = #{shipperRegionLabel}, receiver_mobile = #{receiverMobile}, receiver_address = #{receiverAddress}, receiver_region_code = #{receiverRegionCode}, status = #{status}, receiver_region_label = #{receiverRegionLabel}, create_by = #{createBy}, create_time = #{createTime}, update_by = #{updateBy}, update_time = #{updateTime}, remark = #{remark}, record_status = #{recordStatus}, plan_id = #{planId}, confirm_by = #{confirmBy}, type = #{type}, confirm_time = #{confirmTime}, where id = #{id} update tms_finance system_code = #{item.systemCode}, plan_name = #{item.planName}, dispatch_id = #{item.dispatchId}, dispatch_no = #{item.dispatchNo}, customer_id = #{item.customerId}, customer_code = #{item.customerCode}, project_id = #{item.projectId}, customer_name = #{item.customerName}, project_name = #{item.projectName}, vehicle_provider_id = #{item.vehicleProviderId}, vehicle_provider_name = #{item.vehicleProviderName}, required_vehicle_types = #{item.requiredVehicleTypes}, actual_vehicle_type = #{item.actualVehicleType}, main_driver_id = #{item.mainDriverId}, main_driver_name = #{item.mainDriverName}, vehicle_id = #{item.vehicleId}, assistant_driver_id = #{item.assistantDriverId}, assistant_driver_name = #{item.assistantDriverName}, license_plate = #{item.licensePlate}, total_amount = #{item.totalAmount}, shipper_id = #{item.shipperId}, shipper_name = #{item.shipperName}, transport_line = #{item.transportLine}, shipper_mobile = #{item.shipperMobile}, shipper_address = #{item.shipperAddress}, shipper_region_code = #{item.shipperRegionCode}, receiver_id = #{item.receiverId}, receiver_name = #{item.receiverName}, shipper_region_label = #{item.shipperRegionLabel}, receiver_mobile = #{item.receiverMobile}, receiver_address = #{item.receiverAddress}, receiver_region_code = #{item.receiverRegionCode}, status = #{item.status}, receiver_region_label = #{item.receiverRegionLabel}, create_by = #{item.createBy}, create_time = #{item.createTime}, update_by = #{item.updateBy}, update_time = #{item.updateTime}, remark = #{item.remark}, record_status = #{item.recordStatus}, plan_id = #{item.planId}, confirm_by = #{item.confirmBy}, type = #{item.type}, confirm_time = #{item.confirmTime}, where id = #{item.id} delete from tms_finance where id = #{id} delete from tms_finance where id in #{id}