wujianwei
2026-01-08 47f5004419c3c703919b5351034fc9cfa0ac39f8
tms/src/main/resources/mapper/tms/TmsDispatchOrderMapper.xml
@@ -1,56 +1,72 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.tms.mapper.TmsDispatchOrderMapper">
    <resultMap type="com.ruoyi.tms.domain.TmsDispatchOrder" id="TmsDispatchOrderResult">
        <result property="id"    column="id"    />
        <result property="dispatchNo"    column="dispatch_no"    />
        <result property="customerId"    column="customer_id"    />
        <result property="customerName"    column="customer_name"    />
        <result property="customerCode"    column="customer_code"    />
        <result property="projectId"    column="project_id"    />
        <result property="projectName"    column="project_name"    />
        <result property="transportPlanNo"    column="transport_plan_no"    />
        <result property="departureRegion"    column="departure_region"    />
        <result property="destinationRegion"    column="destination_region"    />
        <result property="contractId"    column="contract_id"    />
        <result property="contractName"    column="contract_name"    />
        <result property="orderType"    column="order_type"    />
        <result property="transportLine"    column="transport_line"    />
        <result property="vehicleProvider"    column="vehicle_provider"    />
        <result property="mainDriver"    column="main_driver"    />
        <result property="assistantDriver"    column="assistant_driver"    />
        <result property="requiredVehicleType"    column="required_vehicle_type"    />
        <result property="vehicleNumber"    column="vehicle_number"    />
        <result property="transportMode"    column="transport_mode"    />
        <result property="loadMode"    column="load_mode"    />
        <result property="goodsName"    column="goods_name"    />
        <result property="quantity"    column="quantity"    />
        <result property="goodsType"    column="goods_type"    />
        <result property="weight"    column="weight"    />
        <result property="netWeight"    column="net_weight"    />
        <result property="volume"    column="volume"    />
        <result property="loosePieces"    column="loose_pieces"    />
        <result property="fullContainers"    column="full_containers"    />
        <result property="signType"    column="sign_type"    />
        <result property="vehicleProviderId"    column="vehicle_provider_id"    />
        <result property="vehicleProviderName"    column="vehicle_provider_name"    />
        <result property="loadingServiceProviderId"    column="loading_service_provider_id"    />
        <result property="loadingServiceProviderName"    column="loading_service_provider_name"    />
        <result property="customsServiceProviderId"    column="customs_service_provider_id"    />
        <result property="customsServiceProviderName"    column="customs_service_provider_name"    />
        <result property="isUrgent"    column="is_urgent"    />
        <result property="transportType"    column="transport_type"    />
        <result property="loadMethod"    column="load_method"    />
        <result property="mainDriverId"    column="main_driver_id"    />
        <result property="mainDriverName"    column="main_driver_name"    />
        <result property="assistantDriverId"    column="assistant_driver_id"    />
        <result property="requiredVehicleTypes"    column="required_vehicle_types"    />
        <result property="assistantDriverName"    column="assistant_driver_name"    />
        <result property="vehicleId"    column="vehicle_id"    />
        <result property="containerNo"    column="container_no"    />
        <result property="palletCount"    column="pallet_count"    />
        <result property="licensePlate"    column="license_plate"    />
        <result property="shipperId"    column="shipper_id"    />
        <result property="earliestDeparture"    column="earliest_departure"    />
        <result property="shipperName"    column="shipper_name"    />
        <result property="latestDeparture"    column="latest_departure"    />
        <result property="shipperMobile"    column="shipper_mobile"    />
        <result property="earliestArrival"    column="earliest_arrival"    />
        <result property="shipperAddress"    column="shipper_address"    />
        <result property="latestArrival"    column="latest_arrival"    />
        <result property="departureAddress"    column="departure_address"    />
        <result property="shipperRegionCode"    column="shipper_region_code"    />
        <result property="receiverId"    column="receiver_id"    />
        <result property="destinationAddress"    column="destination_address"    />
        <result property="receiverName"    column="receiver_name"    />
        <result property="actualVehicleType"    column="actual_vehicle_type"    />
        <result property="receiverMobile"    column="receiver_mobile"    />
        <result property="actualLoadStart"    column="actual_load_start"    />
        <result property="shipperRegionLabel"    column="shipper_region_label"    />
        <result property="receiverAddress"    column="receiver_address"    />
        <result property="actualUnloadEnd"    column="actual_unload_end"    />
        <result property="receiverRegionCode"    column="receiver_region_code"    />
        <result property="actualDeparture"    column="actual_departure"    />
        <result property="actualArrival"    column="actual_arrival"    />
        <result property="actualQuantity"    column="actual_quantity"    />
        <result property="actualWeight"    column="actual_weight"    />
        <result property="receiverRegionLabel"    column="receiver_region_label"    />
        <result property="actualVolume"    column="actual_volume"    />
        <result property="reweighWeight"    column="reweigh_weight"    />
        <result property="containerId"    column="container_id"    />
        <result property="electronicLock"    column="electronic_lock"    />
        <result property="containerInfo"    column="container_info"    />
        <result property="carPlate"    column="car_plate"    />
        <result property="emptyMileage"    column="empty_mileage"    />
        <result property="shelfId"    column="shelf_id"    />
        <result property="emptyFuel"    column="empty_fuel"    />
        <result property="shelfCode"    column="shelf_code"    />
        <result property="loadedMileage"    column="loaded_mileage"    />
        <result property="loadedFuel"    column="loaded_fuel"    />
        <result property="shiftNo"    column="shift_no"    />
@@ -61,10 +77,44 @@
        <result property="updateBy"    column="update_by"    />
        <result property="updateTime"    column="update_time"    />
        <result property="remark"    column="remark"    />
        <result property="accountsReceivableStatus"    column="accounts_receivable_status"    />
        <result property="accountsPayableStatus"    column="accounts_payable_status"    />
        <result property="collectionPlanId"    column="collection_plan_id"    />
        <result property="paymentPlanId"    column="payment_plan_id"    />
        <result property="isCustoms"    column="is_customs"    />
        <result property="startRegionCode"    column="start_region_code"    />
        <result property="endRegionCode"    column="end_region_code"    />
        <result property="quoteDetailId"    column="quote_detail_id"    />
        <result property="operationMode"    column="operation_mode"    />
        <result property="quotePlanId"    column="quote_plan_id"    />
        <result property="okTime"    column="ok_time"    />
        <result property="confirmTime"    column="confirm_time"    />
        <result property="isLoad"    column="is_load"    />
        <result property="commissionModel"    column="commission_model"    />
        <result property="orderTime"    column="order_time"    />
        <result property="iscc"    column="iscc"    />
        <result property="closeWhy"    column="close_why"    />
        <result property="closeTime"    column="close_time"    />
        <result property="closeBy"    column="close_by"    />
        <result property="closeRemark"    column="close_remark"    />
        <result property="isfk"    column="isfk"    />
        <result property="isPrint"    column="is_print"    />
        <result property="printCount"    column="print_count"    />
        <result property="printTime"    column="print_time"    />
        <result property="printBy"    column="print_by"    />
        <result property="sixLinkNo"    column="six_link_no"    />
        <result property="portName"    column="port_name"    />
        <result property="billNo"    column="bill_no"    />
        <result property="terminalName"    column="terminal_name"    />
        <result property="cargoName"    column="cargo_name"    />
        <result property="pieceCount"    column="piece_count"    />
        <result property="weight"    column="weight"    />
        <result property="contactName"    column="contact_name"    />
        <result property="contactPhone"    column="contact_phone"    />
    </resultMap>
    <sql id="selectTmsDispatchOrderVo">
        select thisTab.id, thisTab.dispatch_no, thisTab.customer_name, thisTab.customer_code, thisTab.project_name, thisTab.transport_plan_no, thisTab.departure_region, thisTab.destination_region, thisTab.transport_line, thisTab.vehicle_provider, thisTab.main_driver, thisTab.assistant_driver, thisTab.required_vehicle_type, thisTab.vehicle_number, thisTab.transport_mode, thisTab.load_mode, thisTab.goods_name, thisTab.quantity, thisTab.goods_type, thisTab.weight, thisTab.net_weight, thisTab.volume, thisTab.loose_pieces, thisTab.full_containers, thisTab.container_no, thisTab.pallet_count, thisTab.earliest_departure, thisTab.latest_departure, thisTab.earliest_arrival, thisTab.latest_arrival, thisTab.departure_address, thisTab.destination_address, thisTab.actual_vehicle_type, thisTab.actual_load_start, thisTab.actual_unload_end, thisTab.actual_departure, thisTab.actual_arrival, thisTab.actual_quantity, thisTab.actual_weight, thisTab.actual_volume, thisTab.reweigh_weight, thisTab.electronic_lock, thisTab.container_info, thisTab.car_plate, thisTab.empty_mileage, thisTab.empty_fuel, thisTab.loaded_mileage, thisTab.loaded_fuel, thisTab.shift_no, thisTab.line_no, thisTab.status, thisTab.create_by, thisTab.create_time, thisTab.update_by, thisTab.update_time, thisTab.remark from tms_dispatch_order AS thisTab
        select thisTab.id, thisTab.dispatch_no, thisTab.customer_id, thisTab.customer_name, thisTab.customer_code, thisTab.project_id, thisTab.project_name, thisTab.contract_id, thisTab.contract_name, thisTab.order_type, thisTab.transport_line, thisTab.sign_type, thisTab.vehicle_provider_id, thisTab.vehicle_provider_name, thisTab.loading_service_provider_id, thisTab.loading_service_provider_name, thisTab.customs_service_provider_id, thisTab.customs_service_provider_name, thisTab.is_urgent, thisTab.transport_type, thisTab.load_method, thisTab.main_driver_id, thisTab.main_driver_name, thisTab.assistant_driver_id, thisTab.required_vehicle_types, thisTab.assistant_driver_name, thisTab.vehicle_id, thisTab.container_no, thisTab.license_plate, thisTab.shipper_id, thisTab.earliest_departure, thisTab.shipper_name, thisTab.latest_departure, thisTab.shipper_mobile, thisTab.earliest_arrival, thisTab.shipper_address, thisTab.latest_arrival, thisTab.departure_address, thisTab.shipper_region_code, thisTab.receiver_id, thisTab.destination_address, thisTab.receiver_name, thisTab.actual_vehicle_type, thisTab.receiver_mobile, thisTab.actual_load_start, thisTab.shipper_region_label, thisTab.receiver_address, thisTab.actual_unload_end, thisTab.receiver_region_code, thisTab.actual_departure, thisTab.actual_arrival, thisTab.actual_quantity, thisTab.actual_weight, thisTab.receiver_region_label, thisTab.actual_volume, thisTab.reweigh_weight, thisTab.container_id, thisTab.electronic_lock, thisTab.empty_mileage, thisTab.shelf_id, thisTab.empty_fuel, thisTab.shelf_code, thisTab.loaded_mileage, thisTab.loaded_fuel, thisTab.shift_no, thisTab.line_no, thisTab.status, thisTab.create_by, thisTab.create_time, thisTab.update_by, thisTab.update_time, thisTab.remark, thisTab.accounts_receivable_status, thisTab.accounts_payable_status, thisTab.collection_plan_id, thisTab.payment_plan_id , thisTab.is_customs, thisTab.start_region_code, thisTab.end_region_code, thisTab.quote_detail_id, thisTab.operation_mode, thisTab.quote_plan_id, thisTab.ok_time, thisTab.confirm_time, thisTab.is_load ,thisTab.commission_model ,thisTab.order_time, thisTab.iscc, thisTab.close_why, thisTab.close_time, thisTab.close_by, thisTab.close_remark, thisTab.isfk, thisTab.is_print, thisTab.print_count, thisTab.print_time, thisTab.print_by, thisTab.six_link_no, thisTab.port_name, thisTab.bill_no, thisTab.terminal_name, thisTab.cargo_name, thisTab.piece_count, thisTab.weight, thisTab.contact_name, thisTab.contact_phone from tms_dispatch_order AS thisTab
    </sql>
    <sql id="selectTmsDispatchOrderVoCount">
        select count(0) from tms_dispatch_order as thisTab
@@ -72,17 +122,99 @@
    <sql id="whereCondition">
        <if test="dispatchNo != null  and dispatchNo != ''"> and thisTab.dispatch_no = #{dispatchNo}</if>
        <if test="customerId != null "> and thisTab.customer_id = #{customerId}</if>
        <if test="customerCode != null  and customerCode != ''"> and thisTab.customer_code = #{customerCode}</if>
        <if test="customerName != null  and customerName != ''"> and  thisTab.customer_name like concat('%', #{customerName}, '%')</if>
        <if test="projectName != null  and projectName != ''"> and  thisTab.project_name like concat('%', #{projectName}, '%')</if>
        <if test="transportPlanNo != null  and transportPlanNo != ''"> and thisTab.transport_plan_no = #{transportPlanNo}</if>
        <if test="departureRegion != null  and departureRegion != ''"> and thisTab.departure_region = #{departureRegion}</if>
        <if test="destinationRegion != null  and destinationRegion != ''"> and thisTab.destination_region = #{destinationRegion}</if>
        <if test="transportLine != null "> and thisTab.transport_line = #{transportLine}</if>
        <if test="vehicleProvider != null "> and thisTab.vehicle_provider = #{vehicleProvider}</if>
        <if test="mainDriver != null "> and thisTab.main_driver = #{mainDriver}</if>
        <if test="requiredVehicleType != null "> and thisTab.required_vehicle_type = #{requiredVehicleType}</if>
        <if test="vehicleNumber != null  and vehicleNumber != ''"> and thisTab.vehicle_number = #{vehicleNumber}</if>
        <if test="projectId != null "> and thisTab.project_id = #{projectId}</if>
        <if test="contractId != null "> and thisTab.contract_id = #{contractId}</if>
        <if test="contractName != null  and contractName != ''"> and  thisTab.contract_name like concat('%', #{contractName}, '%')</if>
        <if test="transportLine != null  and transportLine != '' "> and thisTab.transport_line = #{transportLine}</if>
        <if test="orderType != null "> and thisTab.order_type = #{orderType}</if>
        <if test="signType != null "> and thisTab.sign_type = #{signType}</if>
        <if test="vehicleProviderId != null "> and thisTab.vehicle_provider_id = #{vehicleProviderId}</if>
        <if test="vehicleProviderName != null  and vehicleProviderName != ''"> and  thisTab.vehicle_provider_name like concat('%', #{vehicleProviderName}, '%')</if>
        <if test="loadingServiceProviderId != null "> and thisTab.loading_service_provider_id = #{loadingServiceProviderId}</if>
        <if test="loadingServiceProviderName != null  and loadingServiceProviderName != ''"> and  thisTab.loading_service_provider_name like concat('%', #{loadingServiceProviderName}, '%')</if>
        <if test="customsServiceProviderId != null "> and thisTab.customs_service_provider_id = #{customsServiceProviderId}</if>
        <if test="customsServiceProviderName != null  and customsServiceProviderName != ''"> and  thisTab.customs_service_provider_name like concat('%', #{customsServiceProviderName}, '%')</if>
        <if test="isUrgent != null "> and thisTab.is_urgent = #{isUrgent}</if>
        <if test="transportType != null "> and thisTab.transport_type = #{transportType}</if>
        <if test="loadMethod != null "> and thisTab.load_method = #{loadMethod}</if>
        <if test="mainDriverId != null "> and thisTab.main_driver_id = #{mainDriverId}</if>
        <if test="mainDriverName != null  and mainDriverName != ''"> and  thisTab.main_driver_name like concat('%', #{mainDriverName}, '%')</if>
        <if test="assistantDriverId != null "> and thisTab.assistant_driver_id = #{assistantDriverId}</if>
        <if test="assistantDriverName != null  and assistantDriverName != ''"> and  thisTab.assistant_driver_name like concat('%', #{assistantDriverName}, '%')</if>
        <if test="requiredVehicleTypes != null  and requiredVehicleTypes != ''"> and thisTab.required_vehicle_types = #{requiredVehicleTypes}</if>
        <if test="vehicleId != null "> and thisTab.vehicle_id = #{vehicleId}</if>
        <if test="licensePlate != null  and licensePlate != ''"> and thisTab.license_plate = #{licensePlate}</if>
        <if test="shipperId != null "> and thisTab.shipper_id = #{shipperId}</if>
        <if test="shipperName != null  and shipperName != ''"> and  thisTab.shipper_name like concat('%', #{shipperName}, '%')</if>
        <if test="shipperMobile != null  and shipperMobile != ''"> and thisTab.shipper_mobile = #{shipperMobile}</if>
        <if test="shipperAddress != null  and shipperAddress != ''"> and thisTab.shipper_address = #{shipperAddress}</if>
        <if test="shipperRegionCode != null  and shipperRegionCode != ''"> and thisTab.shipper_region_code = #{shipperRegionCode}</if>
        <if test="shipperRegionLabel != null  and shipperRegionLabel != ''"> and thisTab.shipper_region_label = #{shipperRegionLabel}</if>
        <if test="receiverId != null "> and thisTab.receiver_id = #{receiverId}</if>
        <if test="receiverName != null  and receiverName != ''"> and  thisTab.receiver_name like concat('%', #{receiverName}, '%')</if>
        <if test="receiverMobile != null  and receiverMobile != ''"> and thisTab.receiver_mobile = #{receiverMobile}</if>
        <if test="receiverAddress != null  and receiverAddress != ''"> and thisTab.receiver_address = #{receiverAddress}</if>
        <if test="receiverRegionCode != null  and receiverRegionCode != ''"> and thisTab.receiver_region_code = #{receiverRegionCode}</if>
        <if test="receiverRegionLabel != null  and receiverRegionLabel != ''"> and thisTab.receiver_region_label = #{receiverRegionLabel}</if>
        <if test="containerId != null "> and thisTab.container_id = #{containerId}</if>
        <if test="shelfId != null "> and thisTab.shelf_id = #{shelfId}</if>
        <if test="shelfCode != null  and shelfCode != ''"> and thisTab.shelf_code = #{shelfCode}</if>
        <if test="status != null "> and thisTab.status = #{status}</if>
        <if test="accountsReceivableStatus != null "> and thisTab.accounts_receivable_status = #{accountsReceivableStatus}</if>
        <if test="accountsPayableStatus != null "> and thisTab.accounts_payable_status = #{accountsPayableStatus}</if>
        <if test="collectionPlanId != null "> and thisTab.collection_plan_id = #{collectionPlanId}</if>
        <if test="paymentPlanId != null "> and thisTab.payment_plan_id = #{paymentPlanId}</if>
        <if test="isCustoms != null "> and thisTab.is_customs = #{isCustoms}</if>
        <if test="startRegionCode != null "> and thisTab.start_region_code = #{startRegionCode}</if>
        <if test="endRegionCode != null "> and thisTab.end_region_code = #{endRegionCode}</if>
        <if test="quoteDetailId != null "> and thisTab.quote_detail_id = #{quoteDetailId}</if>
        <if test="operationMode != null "> and thisTab.operation_mode = #{operationMode}</if>
        <if test="quotePlanId != null "> and thisTab.quote_plan_id = #{quotePlanId}</if>
        <if test="iscc != null "> and thisTab.iscc = #{iscc}</if>
        <if test="isfk != null "> and thisTab.isfk = #{isfk}</if>
        <if test="closeWhy != null "> and thisTab.close_why = #{closeWhy}</if>
        <if test="closeTime != null "> and thisTab.close_time = #{closeTime}</if>
        <if test="closeBy != null "> and thisTab.close_by = #{closeBy}</if>
        <if test="closeRemark != null "> and thisTab.close_remark = #{closeRemark}</if>
        <if test="createBy != null  and createBy != ''"> and  thisTab.create_by like concat('%', #{createBy}, '%')</if>
        <if test="updateBy != null  and updateBy != ''"> and  thisTab.update_by like concat('%', #{updateBy}, '%')</if>
        <if test="createTimeBegin != null and createTimeBegin != '' and createTimeEnd != null and createTimeEnd != ''"> and  thisTab.create_time between #{createTimeBegin} and #{createTimeEnd}</if>
        <if test="updateTimeBegin != null and updateTimeBegin != '' and updateTimeEnd != null and updateTimeEnd != ''"> and  thisTab.update_time between #{updateTimeBegin} and #{updateTimeEnd}</if>
        <if test="confirmTimeBegin != null and confirmTimeBegin != '' and confirmTimeEnd != null and confirmTimeEnd != ''"> and  thisTab.confirm_time between #{confirmTimeBegin} and #{confirmTimeEnd}</if>
        <if test="okTimeBegin != null and okTimeBegin != '' and okTimeEnd != null and okTimeEnd != ''"> and  thisTab.ok_time between #{okTimeBegin} and #{okTimeEnd}</if>
        <if test="isLoad != null "> and thisTab.is_load = #{isLoad}</if>
        <if test="commissionModel != null "> and thisTab.commission_model = #{commissionModel}</if>
        <if test="orderTime != null "> and thisTab.order_time = #{orderTime}</if>
        <if test="orderTimeBegin != null and orderTimeBegin != '' and orderTimeEnd != null and orderTimeEnd != ''"> and  thisTab.order_time between #{orderTimeBegin} and #{orderTimeEnd}</if>
        <if test="inStatusList != null and inStatusList.size > 0">
            and thisTab.status in
            <foreach item="item" collection="inStatusList" open="(" separator="," close=")">
                #{item}
            </foreach>
        </if>
        <if test="isPrint != null "> and thisTab.is_print = #{isPrint}</if>
        <if test="printCount != null "> and thisTab.print_count = #{printCount}</if>
        <if test="printTime != null "> and thisTab.print_time = #{printTime}</if>
        <if test="printBy != null  and printBy != ''"> and thisTab.print_by = #{printBy}</if>
        <if test="sixLinkNo != null  and sixLinkNo != ''"> and thisTab.six_link_no = #{sixLinkNo}</if>
        <if test="portName != null  and portName != ''"> and  thisTab.port_name like concat('%', #{portName}, '%')</if>
        <if test="billNo != null  and billNo != ''"> and thisTab.bill_no = #{billNo}</if>
        <if test="terminalName != null  and terminalName != ''"> and  thisTab.terminal_name like concat('%', #{terminalName}, '%')</if>
        <if test="cargoName != null  and cargoName != ''"> and  thisTab.cargo_name like concat('%', #{cargoName}, '%')</if>
        <if test="pieceCount != null "> and thisTab.piece_count = #{pieceCount}</if>
        <if test="weight != null "> and thisTab.weight = #{weight}</if>
        <if test="contactName != null  and contactName != ''"> and  thisTab.contact_name like concat('%', #{contactName}, '%')</if>
        <if test="contactPhone != null  and contactPhone != ''"> and thisTab.contact_phone = #{contactPhone}</if>
    </sql>
    <!--查询-->
@@ -105,56 +237,70 @@
        </where>
        order by thisTab.id desc
    </select>
    <!-- 新增 -->
    <insert id="insertTmsDispatchOrder" parameterType="com.ruoyi.tms.domain.TmsDispatchOrder"  useGeneratedKeys="true" keyProperty="id">
        insert into tms_dispatch_order
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="dispatchNo != null and dispatchNo != ''">dispatch_no,</if>
            <if test="customerName != null and customerName != ''">customer_name,</if>
            <if test="customerId != null">customer_id,</if>
            <if test="customerName != null">customer_name,</if>
            <if test="customerCode != null">customer_code,</if>
            <if test="projectId != null">project_id,</if>
            <if test="projectName != null and projectName != ''">project_name,</if>
            <if test="transportPlanNo != null and transportPlanNo != ''">transport_plan_no,</if>
            <if test="departureRegion != null and departureRegion != ''">departure_region,</if>
            <if test="destinationRegion != null and destinationRegion != ''">destination_region,</if>
            <if test="contractId != null">contract_id,</if>
            <if test="contractName != null and contractName != ''">contract_name,</if>
            <if test="orderType != null">order_type,</if>
            <if test="transportLine != null">transport_line,</if>
            <if test="vehicleProvider != null">vehicle_provider,</if>
            <if test="mainDriver != null">main_driver,</if>
            <if test="assistantDriver != null">assistant_driver,</if>
            <if test="requiredVehicleType != null">required_vehicle_type,</if>
            <if test="vehicleNumber != null and vehicleNumber != ''">vehicle_number,</if>
            <if test="transportMode != null">transport_mode,</if>
            <if test="loadMode != null">load_mode,</if>
            <if test="goodsName != null">goods_name,</if>
            <if test="quantity != null">quantity,</if>
            <if test="goodsType != null">goods_type,</if>
            <if test="weight != null">weight,</if>
            <if test="netWeight != null">net_weight,</if>
            <if test="volume != null">volume,</if>
            <if test="loosePieces != null">loose_pieces,</if>
            <if test="fullContainers != null">full_containers,</if>
            <if test="signType != null">sign_type,</if>
            <if test="vehicleProviderId != null">vehicle_provider_id,</if>
            <if test="vehicleProviderName != null and vehicleProviderName != ''">vehicle_provider_name,</if>
            <if test="loadingServiceProviderId != null">loading_service_provider_id,</if>
            <if test="loadingServiceProviderName != null and loadingServiceProviderName != ''">loading_service_provider_name,</if>
            <if test="customsServiceProviderId != null">customs_service_provider_id,</if>
            <if test="customsServiceProviderName != null and customsServiceProviderName != ''">customs_service_provider_name,</if>
            <if test="isUrgent != null">is_urgent,</if>
            <if test="transportType != null">transport_type,</if>
            <if test="loadMethod != null">load_method,</if>
            <if test="mainDriverId != null">main_driver_id,</if>
            <if test="mainDriverName != null and mainDriverName != ''">main_driver_name,</if>
            <if test="assistantDriverId != null">assistant_driver_id,</if>
            <if test="requiredVehicleTypes != null and requiredVehicleTypes != ''">required_vehicle_types,</if>
            <if test="assistantDriverName != null">assistant_driver_name,</if>
            <if test="vehicleId != null">vehicle_id,</if>
            <if test="containerNo != null">container_no,</if>
            <if test="palletCount != null">pallet_count,</if>
            <if test="licensePlate != null and licensePlate != ''">license_plate,</if>
            <if test="shipperId != null">shipper_id,</if>
            <if test="earliestDeparture != null">earliest_departure,</if>
            <if test="shipperName != null">shipper_name,</if>
            <if test="latestDeparture != null">latest_departure,</if>
            <if test="shipperMobile != null">shipper_mobile,</if>
            <if test="earliestArrival != null">earliest_arrival,</if>
            <if test="shipperAddress != null">shipper_address,</if>
            <if test="latestArrival != null">latest_arrival,</if>
            <if test="departureAddress != null">departure_address,</if>
            <if test="shipperRegionCode != null">shipper_region_code,</if>
            <if test="receiverId != null">receiver_id,</if>
            <if test="destinationAddress != null">destination_address,</if>
            <if test="actualVehicleType != null">actual_vehicle_type,</if>
            <if test="receiverName != null">receiver_name,</if>
            <if test="actualVehicleType != null and actualVehicleType != ''">actual_vehicle_type,</if>
            <if test="receiverMobile != null">receiver_mobile,</if>
            <if test="actualLoadStart != null">actual_load_start,</if>
            <if test="shipperRegionLabel != null">shipper_region_label,</if>
            <if test="receiverAddress != null">receiver_address,</if>
            <if test="actualUnloadEnd != null">actual_unload_end,</if>
            <if test="receiverRegionCode != null">receiver_region_code,</if>
            <if test="actualDeparture != null">actual_departure,</if>
            <if test="actualArrival != null">actual_arrival,</if>
            <if test="actualQuantity != null">actual_quantity,</if>
            <if test="actualWeight != null">actual_weight,</if>
            <if test="receiverRegionLabel != null">receiver_region_label,</if>
            <if test="actualVolume != null">actual_volume,</if>
            <if test="reweighWeight != null">reweigh_weight,</if>
            <if test="containerId != null">container_id,</if>
            <if test="electronicLock != null">electronic_lock,</if>
            <if test="containerInfo != null">container_info,</if>
            <if test="carPlate != null">car_plate,</if>
            <if test="emptyMileage != null">empty_mileage,</if>
            <if test="shelfId != null">shelf_id,</if>
            <if test="emptyFuel != null">empty_fuel,</if>
            <if test="shelfCode != null">shelf_code,</if>
            <if test="loadedMileage != null">loaded_mileage,</if>
            <if test="loadedFuel != null">loaded_fuel,</if>
            <if test="shiftNo != null">shift_no,</if>
@@ -165,53 +311,101 @@
            <if test="updateBy != null">update_by,</if>
            <if test="updateTime != null">update_time,</if>
            <if test="remark != null">remark,</if>
         </trim>
            <if test="accountsReceivableStatus != null">accounts_receivable_status,</if>
            <if test="accountsPayableStatus != null">accounts_payable_status,</if>
            <if test="collectionPlanId != null">collection_plan_id,</if>
            <if test="paymentPlanId != null">payment_plan_id,</if>
            <if test="isCustoms != null">is_customs,</if>
            <if test="startRegionCode != null">start_region_code,</if>
            <if test="endRegionCode != null">end_region_code,</if>
            <if test="quoteDetailId != null">quote_detail_id,</if>
            <if test="operationMode != null">operation_mode,</if>
            <if test="quotePlanId != null">quote_plan_id,</if>
            <if test="isLoad != null">is_load,</if>
            <if test="commissionModel != null">commission_model,</if>
            <if test="orderTime != null">order_time,</if>
            <if test="iscc != null">iscc,</if>
            <if test="closeWhy != null">close_why,</if>
            <if test="closeTime != null">close_time,</if>
            <if test="closeBy != null">close_by,</if>
            <if test="closeRemark != null">close_remark,</if>
            <if test="isfk != null">isfk,</if>
            <if test="isPrint != null">is_print,</if>
            <if test="printCount != null">print_count,</if>
            <if test="printTime != null">print_time,</if>
            <if test="printBy != null">print_by,</if>
            <if test="sixLinkNo != null and sixLinkNo != ''">six_link_no,</if>
            <if test="portName != null and portName != ''">port_name,</if>
            <if test="billNo != null and billNo != ''">bill_no,</if>
            <if test="terminalName != null">terminal_name,</if>
            <if test="cargoName != null">cargo_name,</if>
            <if test="pieceCount != null">piece_count,</if>
            <if test="weight != null">weight,</if>
            <if test="contactName != null">contact_name,</if>
            <if test="contactPhone != null">contact_phone,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="dispatchNo != null and dispatchNo != ''">#{dispatchNo},</if>
            <if test="customerName != null and customerName != ''">#{customerName},</if>
            <if test="customerId != null">#{customerId},</if>
            <if test="customerName != null">#{customerName},</if>
            <if test="customerCode != null">#{customerCode},</if>
            <if test="projectId != null">#{projectId},</if>
            <if test="projectName != null and projectName != ''">#{projectName},</if>
            <if test="transportPlanNo != null and transportPlanNo != ''">#{transportPlanNo},</if>
            <if test="departureRegion != null and departureRegion != ''">#{departureRegion},</if>
            <if test="destinationRegion != null and destinationRegion != ''">#{destinationRegion},</if>
            <if test="contractId != null">#{contractId},</if>
            <if test="contractName != null and contractName != ''">#{contractName},</if>
            <if test="orderType != null">#{orderType},</if>
            <if test="transportLine != null">#{transportLine},</if>
            <if test="vehicleProvider != null">#{vehicleProvider},</if>
            <if test="mainDriver != null">#{mainDriver},</if>
            <if test="assistantDriver != null">#{assistantDriver},</if>
            <if test="requiredVehicleType != null">#{requiredVehicleType},</if>
            <if test="vehicleNumber != null and vehicleNumber != ''">#{vehicleNumber},</if>
            <if test="transportMode != null">#{transportMode},</if>
            <if test="loadMode != null">#{loadMode},</if>
            <if test="goodsName != null">#{goodsName},</if>
            <if test="quantity != null">#{quantity},</if>
            <if test="goodsType != null">#{goodsType},</if>
            <if test="weight != null">#{weight},</if>
            <if test="netWeight != null">#{netWeight},</if>
            <if test="volume != null">#{volume},</if>
            <if test="loosePieces != null">#{loosePieces},</if>
            <if test="fullContainers != null">#{fullContainers},</if>
            <if test="signType != null">#{signType},</if>
            <if test="vehicleProviderId != null">#{vehicleProviderId},</if>
            <if test="vehicleProviderName != null and vehicleProviderName != ''">#{vehicleProviderName},</if>
            <if test="loadingServiceProviderId != null">#{loadingServiceProviderId},</if>
            <if test="loadingServiceProviderName != null and loadingServiceProviderName != ''">#{loadingServiceProviderName},</if>
            <if test="customsServiceProviderId != null">#{customsServiceProviderId},</if>
            <if test="customsServiceProviderName != null and customsServiceProviderName != ''">#{customsServiceProviderName},</if>
            <if test="isUrgent != null">#{isUrgent},</if>
            <if test="transportType != null">#{transportType},</if>
            <if test="loadMethod != null">#{loadMethod},</if>
            <if test="mainDriverId != null">#{mainDriverId},</if>
            <if test="mainDriverName != null and mainDriverName != ''">#{mainDriverName},</if>
            <if test="assistantDriverId != null">#{assistantDriverId},</if>
            <if test="requiredVehicleTypes != null and requiredVehicleTypes != ''">#{requiredVehicleTypes},</if>
            <if test="assistantDriverName != null">#{assistantDriverName},</if>
            <if test="vehicleId != null">#{vehicleId},</if>
            <if test="containerNo != null">#{containerNo},</if>
            <if test="palletCount != null">#{palletCount},</if>
            <if test="licensePlate != null and licensePlate != ''">#{licensePlate},</if>
            <if test="shipperId != null">#{shipperId},</if>
            <if test="earliestDeparture != null">#{earliestDeparture},</if>
            <if test="shipperName != null">#{shipperName},</if>
            <if test="latestDeparture != null">#{latestDeparture},</if>
            <if test="shipperMobile != null">#{shipperMobile},</if>
            <if test="earliestArrival != null">#{earliestArrival},</if>
            <if test="shipperAddress != null">#{shipperAddress},</if>
            <if test="latestArrival != null">#{latestArrival},</if>
            <if test="departureAddress != null">#{departureAddress},</if>
            <if test="shipperRegionCode != null">#{shipperRegionCode},</if>
            <if test="receiverId != null">#{receiverId},</if>
            <if test="destinationAddress != null">#{destinationAddress},</if>
            <if test="actualVehicleType != null">#{actualVehicleType},</if>
            <if test="receiverName != null">#{receiverName},</if>
            <if test="actualVehicleType != null and actualVehicleType != ''">#{actualVehicleType},</if>
            <if test="receiverMobile != null">#{receiverMobile},</if>
            <if test="actualLoadStart != null">#{actualLoadStart},</if>
            <if test="shipperRegionLabel != null">#{shipperRegionLabel},</if>
            <if test="receiverAddress != null">#{receiverAddress},</if>
            <if test="actualUnloadEnd != null">#{actualUnloadEnd},</if>
            <if test="receiverRegionCode != null">#{receiverRegionCode},</if>
            <if test="actualDeparture != null">#{actualDeparture},</if>
            <if test="actualArrival != null">#{actualArrival},</if>
            <if test="actualQuantity != null">#{actualQuantity},</if>
            <if test="actualWeight != null">#{actualWeight},</if>
            <if test="receiverRegionLabel != null">#{receiverRegionLabel},</if>
            <if test="actualVolume != null">#{actualVolume},</if>
            <if test="reweighWeight != null">#{reweighWeight},</if>
            <if test="containerId != null">#{containerId},</if>
            <if test="electronicLock != null">#{electronicLock},</if>
            <if test="containerInfo != null">#{containerInfo},</if>
            <if test="carPlate != null">#{carPlate},</if>
            <if test="emptyMileage != null">#{emptyMileage},</if>
            <if test="shelfId != null">#{shelfId},</if>
            <if test="emptyFuel != null">#{emptyFuel},</if>
            <if test="shelfCode != null">#{shelfCode},</if>
            <if test="loadedMileage != null">#{loadedMileage},</if>
            <if test="loadedFuel != null">#{loadedFuel},</if>
            <if test="shiftNo != null">#{shiftNo},</if>
@@ -222,17 +416,49 @@
            <if test="updateBy != null">#{updateBy},</if>
            <if test="updateTime != null">#{updateTime},</if>
            <if test="remark != null">#{remark},</if>
         </trim>
            <if test="accountsReceivableStatus != null">#{accountsReceivableStatus},</if>
            <if test="accountsPayableStatus != null">#{accountsPayableStatus},</if>
            <if test="collectionPlanId != null">#{collectionPlanId},</if>
            <if test="paymentPlanId != null">#{paymentPlanId},</if>
            <if test="isCustoms != null">#{isCustoms},</if>
            <if test="startRegionCode != null">#{startRegionCode},</if>
            <if test="endRegionCode != null">#{endRegionCode},</if>
            <if test="quoteDetailId != null">#{quoteDetailId},</if>
            <if test="operationMode != null">#{operationMode},</if>
            <if test="quotePlanId != null">#{quotePlanId},</if>
            <if test="isLoad != null">#{isLoad},</if>
            <if test="commissionModel != null">#{commissionModel},</if>
            <if test="orderTime != null">#{orderTime},</if>
            <if test="iscc != null">#{iscc},</if>
            <if test="closeWhy != null">#{closeWhy},</if>
            <if test="closeTime != null">#{closeTime},</if>
            <if test="closeBy != null">#{closeBy},</if>
            <if test="closeRemark != null">#{closeRemark},</if>
            <if test="isfk != null">#{isfk},</if>
            <if test="isPrint != null">#{isPrint},</if>
            <if test="printCount != null">#{printCount},</if>
            <if test="printTime != null">#{printTime},</if>
            <if test="printBy != null">#{printBy},</if>
            <if test="sixLinkNo != null and sixLinkNo != ''">#{sixLinkNo},</if>
            <if test="portName != null and portName != ''">#{portName},</if>
            <if test="billNo != null and billNo != ''">#{billNo},</if>
            <if test="terminalName != null">#{terminalName},</if>
            <if test="cargoName != null">#{cargoName},</if>
            <if test="pieceCount != null">#{pieceCount},</if>
            <if test="weight != null">#{weight},</if>
            <if test="contactName != null">#{contactName},</if>
            <if test="contactPhone != null">#{contactPhone},</if>
        </trim>
    </insert>
    <insert id="insertTmsDispatchOrderBatch" parameterType="java.util.List"  useGeneratedKeys="true" keyProperty="id">
        insert into tms_dispatch_order
        <trim prefix="(" suffix=") values" suffixOverrides=",">
            id,dispatch_no,customer_name,customer_code,project_name,transport_plan_no,departure_region,destination_region,transport_line,vehicle_provider,main_driver,assistant_driver,required_vehicle_type,vehicle_number,transport_mode,load_mode,goods_name,quantity,goods_type,weight,net_weight,volume,loose_pieces,full_containers,container_no,pallet_count,earliest_departure,latest_departure,earliest_arrival,latest_arrival,departure_address,destination_address,actual_vehicle_type,actual_load_start,actual_unload_end,actual_departure,actual_arrival,actual_quantity,actual_weight,actual_volume,reweigh_weight,electronic_lock,container_info,car_plate,empty_mileage,empty_fuel,loaded_mileage,loaded_fuel,shift_no,line_no,status,create_by,create_time,update_by,update_time,remark,
            id,dispatch_no,customer_id,customer_name,customer_code,project_id,project_name,contract_id,contract_name,order_type,transport_line,sign_type,vehicle_provider_id,vehicle_provider_name,loading_service_provider_id,loading_service_provider_name,customs_service_provider_id,customs_service_provider_name,is_urgent,transport_type,load_method,main_driver_id,main_driver_name,assistant_driver_id,required_vehicle_types,assistant_driver_name,vehicle_id,container_no,license_plate,shipper_id,earliest_departure,shipper_name,latest_departure,shipper_mobile,earliest_arrival,shipper_address,latest_arrival,departure_address,shipper_region_code,receiver_id,destination_address,receiver_name,actual_vehicle_type,receiver_mobile,actual_load_start,shipper_region_label,receiver_address,actual_unload_end,receiver_region_code,actual_departure,actual_arrival,actual_quantity,actual_weight,receiver_region_label,actual_volume,reweigh_weight,container_id,electronic_lock,empty_mileage,shelf_id,empty_fuel,shelf_code,loaded_mileage,loaded_fuel,shift_no,line_no,status,create_by,create_time,update_by,update_time,remark,accounts_receivable_status,accounts_payable_status,collection_plan_id,payment_plan_id,is_customs,start_region_code,end_region_code,quote_detail_id,operation_mode,quote_plan_id,is_load,commission_model,order_time,iscc,close_why,close_time,close_by,close_remark,isfk,
        </trim>
        <foreach item="item" index="index" collection="list" separator=",">
            <trim prefix="(" suffix=") " suffixOverrides=",">
                #{item.id},#{item.dispatchNo},#{item.customerName},#{item.customerCode},#{item.projectName},#{item.transportPlanNo},#{item.departureRegion},#{item.destinationRegion},#{item.transportLine},#{item.vehicleProvider},#{item.mainDriver},#{item.assistantDriver},#{item.requiredVehicleType},#{item.vehicleNumber},#{item.transportMode},#{item.loadMode},#{item.goodsName},#{item.quantity},#{item.goodsType},#{item.weight},#{item.netWeight},#{item.volume},#{item.loosePieces},#{item.fullContainers},#{item.containerNo},#{item.palletCount},#{item.earliestDeparture},#{item.latestDeparture},#{item.earliestArrival},#{item.latestArrival},#{item.departureAddress},#{item.destinationAddress},#{item.actualVehicleType},#{item.actualLoadStart},#{item.actualUnloadEnd},#{item.actualDeparture},#{item.actualArrival},#{item.actualQuantity},#{item.actualWeight},#{item.actualVolume},#{item.reweighWeight},#{item.electronicLock},#{item.containerInfo},#{item.carPlate},#{item.emptyMileage},#{item.emptyFuel},#{item.loadedMileage},#{item.loadedFuel},#{item.shiftNo},#{item.lineNo},#{item.status},#{item.createBy},#{item.createTime},#{item.updateBy},#{item.updateTime},#{item.remark},
                #{item.id},#{item.dispatchNo},#{item.customerId},#{item.customerName},#{item.customerCode},#{item.projectId},#{item.projectName},#{item.contractId},#{item.contractName},#{item.orderType},#{item.transportLine},#{item.signType},#{item.vehicleProviderId},#{item.vehicleProviderName},#{item.loadingServiceProviderId},#{item.loadingServiceProviderName},#{item.customsServiceProviderId},#{item.customsServiceProviderName},#{item.isUrgent},#{item.transportType},#{item.loadMethod},#{item.mainDriverId},#{item.mainDriverName},#{item.assistantDriverId},#{item.requiredVehicleTypes},#{item.assistantDriverName},#{item.vehicleId},#{item.containerNo},#{item.licensePlate},#{item.shipperId},#{item.earliestDeparture},#{item.shipperName},#{item.latestDeparture},#{item.shipperMobile},#{item.earliestArrival},#{item.shipperAddress},#{item.latestArrival},#{item.departureAddress},#{item.shipperRegionCode},#{item.receiverId},#{item.destinationAddress},#{item.receiverName},#{item.actualVehicleType},#{item.receiverMobile},#{item.actualLoadStart},#{item.shipperRegionLabel},#{item.receiverAddress},#{item.actualUnloadEnd},#{item.receiverRegionCode},#{item.actualDeparture},#{item.actualArrival},#{item.actualQuantity},#{item.actualWeight},#{item.receiverRegionLabel},#{item.actualVolume},#{item.reweighWeight},#{item.containerId},#{item.electronicLock},#{item.emptyMileage},#{item.shelfId},#{item.emptyFuel},#{item.shelfCode},#{item.loadedMileage},#{item.loadedFuel},#{item.shiftNo},#{item.lineNo},#{item.status},#{item.createBy},#{item.createTime},#{item.updateBy},#{item.updateTime},#{item.remark},#{item.accountsReceivableStatus},#{item.accountsPayableStatus},#{item.collectionPlanId},#{item.paymentPlanId},#{item.isCustoms},#{item.startRegionCode},#{item.endRegionCode},#{item.quoteDetailId},#{item.operationMode},#{item.quotePlanId},#{item.isLoad},#{item.commissionModel},#{item.orderTime},#{item.iscc},#{item.closeWhy},#{item.closeTime},#{item.closeBy},#{item.closeRemark},#{item.isfk},
            </trim>
        </foreach>
    </insert>
@@ -242,50 +468,66 @@
        update tms_dispatch_order
        <trim prefix="SET" suffixOverrides=",">
            <if test="dispatchNo != null and dispatchNo != ''">dispatch_no = #{dispatchNo},</if>
            <if test="customerName != null and customerName != ''">customer_name = #{customerName},</if>
            <if test="customerId != null">customer_id = #{customerId},</if>
            <if test="customerName != null">customer_name = #{customerName},</if>
            <if test="customerCode != null">customer_code = #{customerCode},</if>
            <if test="projectId != null">project_id = #{projectId},</if>
            <if test="projectName != null and projectName != ''">project_name = #{projectName},</if>
            <if test="transportPlanNo != null and transportPlanNo != ''">transport_plan_no = #{transportPlanNo},</if>
            <if test="departureRegion != null and departureRegion != ''">departure_region = #{departureRegion},</if>
            <if test="destinationRegion != null and destinationRegion != ''">destination_region = #{destinationRegion},</if>
            <if test="contractId != null">contract_id = #{contractId},</if>
            <if test="contractName != null and contractName != ''">contract_name = #{contractName},</if>
            <if test="orderType != null">order_type = #{orderType},</if>
            <if test="transportLine != null">transport_line = #{transportLine},</if>
            <if test="vehicleProvider != null">vehicle_provider = #{vehicleProvider},</if>
            <if test="mainDriver != null">main_driver = #{mainDriver},</if>
            <if test="assistantDriver != null">assistant_driver = #{assistantDriver},</if>
            <if test="requiredVehicleType != null">required_vehicle_type = #{requiredVehicleType},</if>
            <if test="vehicleNumber != null and vehicleNumber != ''">vehicle_number = #{vehicleNumber},</if>
            <if test="transportMode != null">transport_mode = #{transportMode},</if>
            <if test="loadMode != null">load_mode = #{loadMode},</if>
            <if test="goodsName != null">goods_name = #{goodsName},</if>
            <if test="quantity != null">quantity = #{quantity},</if>
            <if test="goodsType != null">goods_type = #{goodsType},</if>
            <if test="weight != null">weight = #{weight},</if>
            <if test="netWeight != null">net_weight = #{netWeight},</if>
            <if test="volume != null">volume = #{volume},</if>
            <if test="loosePieces != null">loose_pieces = #{loosePieces},</if>
            <if test="fullContainers != null">full_containers = #{fullContainers},</if>
            <if test="signType != null">sign_type = #{signType},</if>
            <if test="vehicleProviderId != null">vehicle_provider_id = #{vehicleProviderId},</if>
            <if test="vehicleProviderName != null and vehicleProviderName != ''">vehicle_provider_name = #{vehicleProviderName},</if>
            <if test="loadingServiceProviderId != null">loading_service_provider_id = #{loadingServiceProviderId},</if>
            <if test="loadingServiceProviderName != null and loadingServiceProviderName != ''">loading_service_provider_name = #{loadingServiceProviderName},</if>
            <if test="customsServiceProviderId != null">customs_service_provider_id = #{customsServiceProviderId},</if>
            <if test="customsServiceProviderName != null and customsServiceProviderName != ''">customs_service_provider_name = #{customsServiceProviderName},</if>
            <if test="isUrgent != null">is_urgent = #{isUrgent},</if>
            <if test="transportType != null">transport_type = #{transportType},</if>
            <if test="loadMethod != null">load_method = #{loadMethod},</if>
            <if test="mainDriverId != null">main_driver_id = #{mainDriverId},</if>
            <if test="mainDriverName != null and mainDriverName != ''">main_driver_name = #{mainDriverName},</if>
            <if test="assistantDriverId != null">assistant_driver_id = #{assistantDriverId},</if>
            <if test="requiredVehicleTypes != null and requiredVehicleTypes != ''">required_vehicle_types = #{requiredVehicleTypes},</if>
            <if test="assistantDriverName != null">assistant_driver_name = #{assistantDriverName},</if>
            <if test="vehicleId != null">vehicle_id = #{vehicleId},</if>
            <if test="containerNo != null">container_no = #{containerNo},</if>
            <if test="palletCount != null">pallet_count = #{palletCount},</if>
            <if test="licensePlate != null and licensePlate != ''">license_plate = #{licensePlate},</if>
            <if test="shipperId != null">shipper_id = #{shipperId},</if>
            <if test="earliestDeparture != null">earliest_departure = #{earliestDeparture},</if>
            <if test="shipperName != null">shipper_name = #{shipperName},</if>
            <if test="latestDeparture != null">latest_departure = #{latestDeparture},</if>
            <if test="shipperMobile != null">shipper_mobile = #{shipperMobile},</if>
            <if test="earliestArrival != null">earliest_arrival = #{earliestArrival},</if>
            <if test="shipperAddress != null">shipper_address = #{shipperAddress},</if>
            <if test="latestArrival != null">latest_arrival = #{latestArrival},</if>
            <if test="departureAddress != null">departure_address = #{departureAddress},</if>
            <if test="shipperRegionCode != null">shipper_region_code = #{shipperRegionCode},</if>
            <if test="receiverId != null">receiver_id = #{receiverId},</if>
            <if test="destinationAddress != null">destination_address = #{destinationAddress},</if>
            <if test="actualVehicleType != null">actual_vehicle_type = #{actualVehicleType},</if>
            <if test="receiverName != null">receiver_name = #{receiverName},</if>
            <if test="actualVehicleType != null and actualVehicleType != ''">actual_vehicle_type = #{actualVehicleType},</if>
            <if test="receiverMobile != null">receiver_mobile = #{receiverMobile},</if>
            <if test="actualLoadStart != null">actual_load_start = #{actualLoadStart},</if>
            <if test="shipperRegionLabel != null">shipper_region_label = #{shipperRegionLabel},</if>
            <if test="receiverAddress != null">receiver_address = #{receiverAddress},</if>
            <if test="actualUnloadEnd != null">actual_unload_end = #{actualUnloadEnd},</if>
            <if test="receiverRegionCode != null">receiver_region_code = #{receiverRegionCode},</if>
            <if test="actualDeparture != null">actual_departure = #{actualDeparture},</if>
            <if test="actualArrival != null">actual_arrival = #{actualArrival},</if>
            <if test="actualQuantity != null">actual_quantity = #{actualQuantity},</if>
            <if test="actualWeight != null">actual_weight = #{actualWeight},</if>
            <if test="receiverRegionLabel != null">receiver_region_label = #{receiverRegionLabel},</if>
            <if test="actualVolume != null">actual_volume = #{actualVolume},</if>
            <if test="reweighWeight != null">reweigh_weight = #{reweighWeight},</if>
            <if test="containerId != null">container_id = #{containerId},</if>
            <if test="electronicLock != null">electronic_lock = #{electronicLock},</if>
            <if test="containerInfo != null">container_info = #{containerInfo},</if>
            <if test="carPlate != null">car_plate = #{carPlate},</if>
            <if test="emptyMileage != null">empty_mileage = #{emptyMileage},</if>
            <if test="shelfId != null">shelf_id = #{shelfId},</if>
            <if test="emptyFuel != null">empty_fuel = #{emptyFuel},</if>
            <if test="shelfCode != null">shelf_code = #{shelfCode},</if>
            <if test="loadedMileage != null">loaded_mileage = #{loadedMileage},</if>
            <if test="loadedFuel != null">loaded_fuel = #{loadedFuel},</if>
            <if test="shiftNo != null">shift_no = #{shiftNo},</if>
@@ -296,6 +538,40 @@
            <if test="updateBy != null">update_by = #{updateBy},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
            <if test="remark != null">remark = #{remark},</if>
            <if test="accountsReceivableStatus != null">accounts_receivable_status = #{accountsReceivableStatus},</if>
            <if test="accountsPayableStatus != null">accounts_payable_status = #{accountsPayableStatus},</if>
            <if test="collectionPlanId != null">collection_plan_id = #{collectionPlanId},</if>
            <if test="paymentPlanId != null">payment_plan_id = #{paymentPlanId},</if>
            <if test="isCustoms != null">is_customs = #{isCustoms},</if>
            <if test="startRegionCode != null">start_region_code = #{startRegionCode},</if>
            <if test="endRegionCode != null">end_region_code = #{endRegionCode},</if>
            <if test="quoteDetailId != null">quote_detail_id = #{quoteDetailId},</if>
            <if test="operationMode != null">operation_mode = #{operationMode},</if>
            <if test="quotePlanId != null">quote_plan_id = #{quotePlanId},</if>
            <if test="confirmTime != null">confirm_time = #{confirmTime},</if>
            <if test="okTime != null">ok_time = #{okTime},</if>
            <if test="isLoad != null">is_load = #{isLoad},</if>
            <if test="commissionModel != null">commission_model = #{commissionModel},</if>
            <if test="orderTime != null">order_time = #{orderTime},</if>
            <if test="iscc != null">iscc = #{iscc},</if>
            <if test="closeWhy != null">close_why = #{closeWhy},</if>
            <if test="closeTime != null">close_time = #{closeTime},</if>
            <if test="closeBy != null">close_by = #{closeBy},</if>
            <if test="closeRemark != null">close_remark = #{closeRemark},</if>
            <if test="isfk != null">isfk = #{isfk},</if>
            <if test="isPrint != null">is_print = #{isPrint},</if>
            <if test="printCount != null">print_count = #{printCount},</if>
            <if test="printTime != null">print_time = #{printTime},</if>
            <if test="printBy != null">print_by = #{printBy},</if>
            <if test="sixLinkNo != null and sixLinkNo != ''">six_link_no = #{sixLinkNo},</if>
            <if test="portName != null and portName != ''">port_name = #{portName},</if>
            <if test="billNo != null and billNo != ''">bill_no = #{billNo},</if>
            <if test="terminalName != null">terminal_name = #{terminalName},</if>
            <if test="cargoName != null">cargo_name = #{cargoName},</if>
            <if test="pieceCount != null">piece_count = #{pieceCount},</if>
            <if test="weight != null">weight = #{weight},</if>
            <if test="contactName != null">contact_name = #{contactName},</if>
            <if test="contactPhone != null">contact_phone = #{contactPhone},</if>
        </trim>
        where id = #{id}
    </update>
@@ -305,50 +581,66 @@
            update tms_dispatch_order
            <trim prefix="SET" suffixOverrides=",">
                <if test="item.dispatchNo != null and item.dispatchNo != ''">dispatch_no = #{item.dispatchNo},</if>
                <if test="item.customerName != null and item.customerName != ''">customer_name = #{item.customerName},</if>
                <if test="item.customerId != null">customer_id = #{item.customerId},</if>
                <if test="item.customerName != null">customer_name = #{item.customerName},</if>
                <if test="item.customerCode != null">customer_code = #{item.customerCode},</if>
                <if test="item.projectId != null">project_id = #{item.projectId},</if>
                <if test="item.projectName != null and item.projectName != ''">project_name = #{item.projectName},</if>
                <if test="item.transportPlanNo != null and item.transportPlanNo != ''">transport_plan_no = #{item.transportPlanNo},</if>
                <if test="item.departureRegion != null and item.departureRegion != ''">departure_region = #{item.departureRegion},</if>
                <if test="item.destinationRegion != null and item.destinationRegion != ''">destination_region = #{item.destinationRegion},</if>
                <if test="item.contractId != null">contract_id = #{item.contractId},</if>
                <if test="item.contractName != null and item.contractName != ''">contract_name = #{item.contractName},</if>
                <if test="item.orderType != null">order_type = #{item.orderType},</if>
                <if test="item.transportLine != null">transport_line = #{item.transportLine},</if>
                <if test="item.vehicleProvider != null">vehicle_provider = #{item.vehicleProvider},</if>
                <if test="item.mainDriver != null">main_driver = #{item.mainDriver},</if>
                <if test="item.assistantDriver != null">assistant_driver = #{item.assistantDriver},</if>
                <if test="item.requiredVehicleType != null">required_vehicle_type = #{item.requiredVehicleType},</if>
                <if test="item.vehicleNumber != null and item.vehicleNumber != ''">vehicle_number = #{item.vehicleNumber},</if>
                <if test="item.transportMode != null">transport_mode = #{item.transportMode},</if>
                <if test="item.loadMode != null">load_mode = #{item.loadMode},</if>
                <if test="item.goodsName != null">goods_name = #{item.goodsName},</if>
                <if test="item.quantity != null">quantity = #{item.quantity},</if>
                <if test="item.goodsType != null">goods_type = #{item.goodsType},</if>
                <if test="item.weight != null">weight = #{item.weight},</if>
                <if test="item.netWeight != null">net_weight = #{item.netWeight},</if>
                <if test="item.volume != null">volume = #{item.volume},</if>
                <if test="item.loosePieces != null">loose_pieces = #{item.loosePieces},</if>
                <if test="item.fullContainers != null">full_containers = #{item.fullContainers},</if>
                <if test="item.signType != null">sign_type = #{item.signType},</if>
                <if test="item.vehicleProviderId != null">vehicle_provider_id = #{item.vehicleProviderId},</if>
                <if test="item.vehicleProviderName != null and item.vehicleProviderName != ''">vehicle_provider_name = #{item.vehicleProviderName},</if>
                <if test="item.loadingServiceProviderId != null">loading_service_provider_id = #{item.loadingServiceProviderId},</if>
                <if test="item.loadingServiceProviderName != null and item.loadingServiceProviderName != ''">loading_service_provider_name = #{item.loadingServiceProviderName},</if>
                <if test="item.customsServiceProviderId != null">customs_service_provider_id = #{item.customsServiceProviderId},</if>
                <if test="item.customsServiceProviderName != null and item.customsServiceProviderName != ''">customs_service_provider_name = #{item.customsServiceProviderName},</if>
                <if test="item.isUrgent != null">is_urgent = #{item.isUrgent},</if>
                <if test="item.transportType != null">transport_type = #{item.transportType},</if>
                <if test="item.loadMethod != null">load_method = #{item.loadMethod},</if>
                <if test="item.mainDriverId != null">main_driver_id = #{item.mainDriverId},</if>
                <if test="item.mainDriverName != null and item.mainDriverName != ''">main_driver_name = #{item.mainDriverName},</if>
                <if test="item.assistantDriverId != null">assistant_driver_id = #{item.assistantDriverId},</if>
                <if test="item.requiredVehicleTypes != null and item.requiredVehicleTypes != ''">required_vehicle_types = #{item.requiredVehicleTypes},</if>
                <if test="item.assistantDriverName != null">assistant_driver_name = #{item.assistantDriverName},</if>
                <if test="item.vehicleId != null">vehicle_id = #{item.vehicleId},</if>
                <if test="item.containerNo != null">container_no = #{item.containerNo},</if>
                <if test="item.palletCount != null">pallet_count = #{item.palletCount},</if>
                <if test="item.licensePlate != null and item.licensePlate != ''">license_plate = #{item.licensePlate},</if>
                <if test="item.shipperId != null">shipper_id = #{item.shipperId},</if>
                <if test="item.earliestDeparture != null">earliest_departure = #{item.earliestDeparture},</if>
                <if test="item.shipperName != null">shipper_name = #{item.shipperName},</if>
                <if test="item.latestDeparture != null">latest_departure = #{item.latestDeparture},</if>
                <if test="item.shipperMobile != null">shipper_mobile = #{item.shipperMobile},</if>
                <if test="item.earliestArrival != null">earliest_arrival = #{item.earliestArrival},</if>
                <if test="item.shipperAddress != null">shipper_address = #{item.shipperAddress},</if>
                <if test="item.latestArrival != null">latest_arrival = #{item.latestArrival},</if>
                <if test="item.departureAddress != null">departure_address = #{item.departureAddress},</if>
                <if test="item.shipperRegionCode != null">shipper_region_code = #{item.shipperRegionCode},</if>
                <if test="item.receiverId != null">receiver_id = #{item.receiverId},</if>
                <if test="item.destinationAddress != null">destination_address = #{item.destinationAddress},</if>
                <if test="item.actualVehicleType != null">actual_vehicle_type = #{item.actualVehicleType},</if>
                <if test="item.receiverName != null">receiver_name = #{item.receiverName},</if>
                <if test="item.actualVehicleType != null and actualVehicleType != ''">actual_vehicle_type = #{item.actualVehicleType},</if>
                <if test="item.receiverMobile != null">receiver_mobile = #{item.receiverMobile},</if>
                <if test="item.actualLoadStart != null">actual_load_start = #{item.actualLoadStart},</if>
                <if test="item.shipperRegionLabel != null">shipper_region_label = #{item.shipperRegionLabel},</if>
                <if test="item.receiverAddress != null">receiver_address = #{item.receiverAddress},</if>
                <if test="item.actualUnloadEnd != null">actual_unload_end = #{item.actualUnloadEnd},</if>
                <if test="item.receiverRegionCode != null">receiver_region_code = #{item.receiverRegionCode},</if>
                <if test="item.actualDeparture != null">actual_departure = #{item.actualDeparture},</if>
                <if test="item.actualArrival != null">actual_arrival = #{item.actualArrival},</if>
                <if test="item.actualQuantity != null">actual_quantity = #{item.actualQuantity},</if>
                <if test="item.actualWeight != null">actual_weight = #{item.actualWeight},</if>
                <if test="item.receiverRegionLabel != null">receiver_region_label = #{item.receiverRegionLabel},</if>
                <if test="item.actualVolume != null">actual_volume = #{item.actualVolume},</if>
                <if test="item.reweighWeight != null">reweigh_weight = #{item.reweighWeight},</if>
                <if test="item.containerId != null">container_id = #{item.containerId},</if>
                <if test="item.electronicLock != null">electronic_lock = #{item.electronicLock},</if>
                <if test="item.containerInfo != null">container_info = #{item.containerInfo},</if>
                <if test="item.carPlate != null">car_plate = #{item.carPlate},</if>
                <if test="item.emptyMileage != null">empty_mileage = #{item.emptyMileage},</if>
                <if test="item.shelfId != null">shelf_id = #{item.shelfId},</if>
                <if test="item.emptyFuel != null">empty_fuel = #{item.emptyFuel},</if>
                <if test="item.shelfCode != null">shelf_code = #{item.shelfCode},</if>
                <if test="item.loadedMileage != null">loaded_mileage = #{item.loadedMileage},</if>
                <if test="item.loadedFuel != null">loaded_fuel = #{item.loadedFuel},</if>
                <if test="item.shiftNo != null">shift_no = #{item.shiftNo},</if>
@@ -359,8 +651,40 @@
                <if test="item.updateBy != null">update_by = #{item.updateBy},</if>
                <if test="item.updateTime != null">update_time = #{item.updateTime},</if>
                <if test="item.remark != null">remark = #{item.remark},</if>
                <if test="item.accountsReceivableStatus != null">accounts_receivable_status = #{item.accountsReceivableStatus},</if>
                <if test="item.accountsPayableStatus != null">accounts_payable_status = #{item.accountsPayableStatus},</if>
                <if test="item.collectionPlanId != null">collection_plan_id = #{item.collectionPlanId},</if>
                <if test="item.paymentPlanId != null">payment_plan_id = #{item.paymentPlanId},</if>
                <if test="item.isCustoms != null">is_customs = #{item.isCustoms},</if>
                <if test="item.startRegionCode != null">start_region_code = #{item.startRegionCode},</if>
                <if test="item.endRegionCode != null">end_region_code = #{item.endRegionCode},</if>
                <if test="item.quoteDetailId != null">quote_detail_id = #{item.quoteDetailId},</if>
                <if test="item.operationMode != null">operation_mode = #{item.operationMode},</if>
                <if test="item.quotePlanId != null">quote_plan_id = #{item.quotePlanId},</if>
                <if test="item.isLoad != null">is_load = #{item.isLoad},</if>
                <if test="item.commissionModel != null">commission_model = #{item.commissionModel},</if>
                <if test="item.orderTime != null">order_time = #{item.orderTime},</if>
                <if test="item.iscc != null">iscc = #{item.iscc},</if>
                <if test="item.closeWhy != null">close_why = #{item.closeWhy},</if>
                <if test="item.closeTime != null">close_time = #{item.closeTime},</if>
                <if test="item.closeBy != null">close_by = #{item.closeBy},</if>
                <if test="item.closeRemark != null">close_remark = #{item.closeRemark},</if>
                <if test="item.isfk != null">isfk = #{item.isfk},</if>
                <if test="item.isPrint != null">is_print = #{item.isPrint},</if>
                <if test="item.printCount != null">print_count = #{item.printCount},</if>
                <if test="item.printTime != null">print_time = #{item.printTime},</if>
                <if test="item.printBy != null">print_by = #{item.printBy},</if>
                <if test="item.sixLinkNo != null and item.sixLinkNo != ''">six_link_no = #{item.sixLinkNo},</if>
                <if test="item.portName != null and item.portName != ''">port_name = #{item.portName},</if>
                <if test="item.billNo != null and item.billNo != ''">bill_no = #{item.billNo},</if>
                <if test="item.terminalName != null">terminal_name = #{item.terminalName},</if>
                <if test="item.cargoName != null">cargo_name = #{item.cargoName},</if>
                <if test="item.pieceCount != null">piece_count = #{item.pieceCount},</if>
                <if test="item.weight != null">weight = #{item.weight},</if>
                <if test="item.contactName != null">contact_name = #{item.contactName},</if>
                <if test="item.contactPhone != null">contact_phone = #{item.contactPhone},</if>
            </trim>
        where id = #{item.id}
            where id = #{item.id}
        </foreach>
    </update>
@@ -375,4 +699,117 @@
        </foreach>
    </delete>
    <select id="selectAssignedItineraryList" resultType="com.ruoyi.tms.domain.vo.DriverDispatchVo">
        SELECT tdo.dispatch_no, tdo.customer_name, tdo.license_plate,tdo.transport_line,tdo.status,tdo.latest_departure,
               tdd.status as tddStatus,tdd.driver_id,tdd.dispatch_id,tdo.ok_time
        FROM tms_dispatch_order AS tdo
                 LEFT JOIN tms_driver_dispatch AS tdd
                           ON tdo.id = tdd.dispatch_id
        where 1 = 1
        <if test="inStatusList != null and inStatusList.size > 0">
            and tdd.status in
            <foreach item="item" collection="inStatusList" open="(" separator="," close=")">
                #{item}
            </foreach>
        </if>
            <if test="inTdoStatusList != null and inTdoStatusList.size > 0">
            and tdo.status in
            <foreach item="item" collection="inTdoStatusList" open="(" separator="," close=")">
                #{item}
            </foreach>
        </if>
        and  tdd.driver_id = #{driverId};
    </select>
    <select id="selectAssignedItineraryDetail" resultType="com.ruoyi.tms.domain.vo.DriverDispatchVo">
        SELECT tdo.dispatch_no, tdo.customer_name, tdo.license_plate,tdo.transport_line,tdo.status,tdo.latest_departure,
               tdd.status as tddStatus,tdd.driver_id,tdd.dispatch_id,tdo.ok_time,tdo.shelf_code,tdo.shipper_address,tdo.receiver_address
        FROM tms_dispatch_order AS tdo
                 LEFT JOIN tms_driver_dispatch AS tdd
                           ON tdo.id = tdd.dispatch_id
        where     tdo.id = #{dispatchId} and  tdd.driver_id = #{driverId};
    </select>
    <select id="selectselectDpData" resultType="com.ruoyi.tms.domain.vo.DpDriverDispatchVo">
        SELECT
    tdo.main_driver_name as driverName,
    tdo.dispatch_no as dispatchNo,
        tdo.confirm_time as confirmTime,
    tdo.license_plate as licensePlate,
      tdo.status,
    src.region_name AS startRegionName,
    erc.region_name AS endRegionName
FROM (
    SELECT id
    FROM tms_dispatch_order
    WHERE `status` IN (2, 3)
    and is_customs=0
    ORDER BY confirm_time DESC
    LIMIT 50
) tmp
JOIN tms_dispatch_order tdo ON tmp.id = tdo.id
LEFT JOIN tms_region src ON SUBSTRING_INDEX(tdo.start_region_code, ',', -1) = src.region_code
LEFT JOIN tms_region erc ON SUBSTRING_INDEX(tdo.end_region_code, ',', -1) = erc.region_code
ORDER BY tdo.confirm_time DESC
    </select>
    <select id="selectDataByNo" resultType="com.ruoyi.tms.domain.vo.DpDriverDispatchItemVo">
        SELECT
    tdo.dispatch_no as dispatchNo,
    tdo.customer_name as customerName,
    tdo.project_name as projectName
,
    tdo.transport_line as transportLine,
    tdo.confirm_time as confirmTime,
    tdo.create_time as createTime,
    tdo.main_driver_name as driverName,
    tdo.license_plate as licensePlate,
    JSON_ARRAYAGG(
        JSON_OBJECT(
            'tripTime', DATE_FORMAT(tr.trip_time, '%Y.%m.%d %H:%i:%s'),
            'status', (SELECT dict_label FROM sys_dict_data WHERE dict_type='trip_type' AND dict_value = tr.trip_type),
            'address', tr.address
        )
    ) AS trips
FROM tms_dispatch_order tdo
LEFT JOIN tms_trip tr ON tr.dispatch_order_id = tdo.id
WHERE tdo.dispatch_no = #{no}
GROUP BY tdo.id
    </select>
    <select id="selectItineraryLog" resultType="com.ruoyi.tms.domain.vo.DpItineraryLogVo">
        SELECT
   tr.vehicle_number as vehicleNumber,
   tr.trip_time as tripTime ,
   tdo.dispatch_no as dispatchNo ,
CASE
      trip_type
      WHEN 0 THEN
      '开始申报'
      WHEN 3 THEN
      '审核通过'
      WHEN 4 THEN
      '海关验放'
      WHEN 5 THEN
      '放行离场'
      end  as remark
   FROM
      tms_trip tr
      LEFT JOIN tms_dispatch_order tdo ON tr.dispatch_order_id = tdo.id
   WHERE
      tdo.`status` = 3
      AND tr.trip_type IN (
         0,
         3,
      4,
   5)
   order by tr.trip_time desc
    </select>
</mapper>