wujianwei
2025-12-30 9200bfebd2c3a4deb16cf331f81b68c3a0bb07a1
tms/src/main/resources/mapper/tms/TmsDispatchOrderMapper.xml
@@ -624,6 +624,8 @@
    <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,
@@ -633,6 +635,7 @@
    SELECT id
    FROM tms_dispatch_order
    WHERE `status` IN (2, 3)
    and is_customs=0
    ORDER BY confirm_time DESC
    LIMIT 50
) tmp
@@ -641,5 +644,29 @@
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>
</mapper>