wujianwei
2025-12-29 210e36fca8c7d1e4e2d73e1679da5a45cf4188d2
tms/src/main/resources/mapper/tms/TmsDispatchOrderMapper.xml
@@ -157,6 +157,10 @@
        <if test="operationMode != null "> and thisTab.operation_mode = #{operationMode}</if>
        <if test="quotePlanId != null "> and thisTab.quote_plan_id = #{quotePlanId}</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>
@@ -617,5 +621,25 @@
        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.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)
    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>
</mapper>