2022-12-12 17:27:45 +00:00
|
|
|
SELECT ep.id palletFk,
|
|
|
|
t.routeFk,
|
2024-04-30 09:48:18 +00:00
|
|
|
rs2.description truck,
|
2022-12-12 17:27:45 +00:00
|
|
|
r.description `zone`,
|
|
|
|
COUNT(es.id) labels,
|
|
|
|
t.warehouseFk warehouseFk,
|
|
|
|
dayname(r.created) `dayName`,
|
2024-04-30 09:48:18 +00:00
|
|
|
rs.id <=> rm.expeditionTruckFk isMatch
|
|
|
|
FROM vn.roadmapStop rs
|
|
|
|
JOIN vn.expeditionPallet ep ON ep.truckFk = rs.id
|
2022-12-12 17:27:45 +00:00
|
|
|
JOIN vn.expeditionScan es ON es.palletFk = ep.id
|
|
|
|
JOIN vn.expedition e ON e.id = es.expeditionFk
|
|
|
|
JOIN vn.ticket t ON t.id = e.ticketFk
|
|
|
|
JOIN vn.route r ON r.id = t.routeFk
|
2023-04-05 10:01:42 +00:00
|
|
|
LEFT JOIN vn.routesMonitor rm ON rm.routeFk = r.id
|
2024-04-30 09:48:18 +00:00
|
|
|
LEFT JOIN vn.roadmapStop rs2 ON rs2.id = rm.expeditionTruckFk
|
2022-12-12 17:27:45 +00:00
|
|
|
WHERE ep.id = ?
|
|
|
|
GROUP BY ep.id, t.routeFk
|
2023-04-05 10:01:42 +00:00
|
|
|
ORDER BY t.routeFk
|