refactor: refs #7146 Add Route.dated #3041

Open
ivanm wants to merge 5 commits from 7146-AddRoute.dated into dev
1 changed files with 3 additions and 1 deletions
Showing only changes of commit 25114ff204 - Show all commits

View File

@ -16,7 +16,8 @@ BEGIN
a.nickname,
sub2.itemPackingTypeConcat,
est.code,
es.isScanned
es2.isScanned,
es2.scanOrder
FROM expedition e
JOIN ticket t ON t.id = e.ticketFk
JOIN ticketState ts ON ts.ticketFk = e.ticketFk
@ -38,6 +39,7 @@ BEGIN
SELECT MAX(id)
FROM expeditionState es
WHERE expeditionFk = e.id)
LEFT JOIN expeditionState es2 ON es2.id = es.id
WHERE t.routeFk = vRouteFk AND e.freightItemFk <> FALSE
ORDER BY r.dated, t.priority DESC;
END$$