2023-08-22 08:45:41 +00:00
|
|
|
SELECT
|
2020-09-25 12:45:00 +00:00
|
|
|
r.id,
|
|
|
|
r.m3,
|
|
|
|
r.created,
|
|
|
|
r.time,
|
|
|
|
u.nickName userNickName,
|
|
|
|
v.tradeMark vehicleTradeMark,
|
|
|
|
v.model vehicleModel,
|
|
|
|
v.numberPlate plateNumber,
|
2021-05-18 12:21:49 +00:00
|
|
|
IFNULL(s.name, am.name) AS agencyName
|
2020-09-25 12:45:00 +00:00
|
|
|
FROM route r
|
|
|
|
LEFT JOIN vehicle v ON v.id = r.vehicleFk
|
|
|
|
LEFT JOIN worker w ON w.id = r.workerFk
|
2023-08-22 08:45:41 +00:00
|
|
|
LEFT JOIN account.user u ON u.id = w.id
|
2020-09-25 12:45:00 +00:00
|
|
|
LEFT JOIN agencyMode am ON am.id = r.agencyModeFk
|
2021-05-18 12:21:49 +00:00
|
|
|
LEFT JOIN agency a ON a.id = am.agencyFk
|
2022-05-02 12:53:03 +00:00
|
|
|
LEFT JOIN supplierAgencyTerm sa ON sa.agencyFk = a.id
|
|
|
|
LEFT JOIN supplier s ON s.id = sa.supplierFk
|
2023-08-22 08:45:41 +00:00
|
|
|
WHERE r.id IN(?)
|