wujianwei
2025-12-29 db3d45754040c64bdf7f7ff62f8cf2a03b63dba3
tms/src/main/resources/mapper/tms/TmsDispatchOrderMapper.xml
@@ -624,6 +624,7 @@
    <select id="selectselectDpData" resultType="com.ruoyi.tms.domain.vo.DpDriverDispatchVo">
        SELECT
    tdo.main_driver_name as driverName,
    tdo.dispatch_no as dispatchNo,
    tdo.license_plate as licensePlate,
      tdo.status,
    src.region_name AS startRegionName,
@@ -642,5 +643,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>