feat: refs #8057 Added geoFk columns #3204

Merged
guillermo merged 10 commits from 8057-geoFk into dev 2024-11-18 11:47:54 +00:00
3 changed files with 8 additions and 6 deletions
Showing only changes of commit a64f9b74ec - Show all commits

View File

@ -10,9 +10,9 @@ CREATE OR REPLACE TEMPORARY TABLE tAddressGeo
FROM address a FROM address a
JOIN town t ON t.provinceFk = a.provinceFk JOIN town t ON t.provinceFk = a.provinceFk
JOIN postCode p ON p.townFk = t.id JOIN postCode p ON p.townFk = t.id
guillermo marked this conversation as resolved
Review

Lo mismo, pondria la restriccion del postcode en el order by

Lo mismo, pondria la restriccion del postcode en el order by
AND p.`code` = a.postalCode
GROUP BY a.id GROUP BY a.id
ORDER BY (a.city SOUNDS LIKE t.`name`) DESC; ORDER BY (a.city SOUNDS LIKE t.`name`) DESC,
(p.code = a.postalCode) DESC;
UPDATE address a UPDATE address a
JOIN tAddressGeo tag ON tag.id = a.id JOIN tAddressGeo tag ON tag.id = a.id

View File

@ -13,9 +13,9 @@ CREATE OR REPLACE TEMPORARY TABLE tClientGeo
FROM client c FROM client c
JOIN town t ON t.provinceFk = c.provinceFk JOIN town t ON t.provinceFk = c.provinceFk
JOIN postCode p ON p.townFk = t.id JOIN postCode p ON p.townFk = t.id
AND p.`code` = c.postcode
GROUP BY c.id GROUP BY c.id
ORDER BY (c.city SOUNDS LIKE t.`name`) DESC; ORDER BY (c.city SOUNDS LIKE t.`name`) DESC,
(p.code = c.postcode) DESC;
UPDATE client c UPDATE client c
JOIN tClientGeo tcg ON tcg.id = c.id JOIN tClientGeo tcg ON tcg.id = c.id

View File

@ -12,9 +12,11 @@ CREATE OR REPLACE TEMPORARY TABLE tSupplierGeo
FROM supplier s FROM supplier s
JOIN town t ON t.provinceFk = s.provinceFk JOIN town t ON t.provinceFk = s.provinceFk
JOIN postCode p ON p.townFk = t.id JOIN postCode p ON p.townFk = t.id
guillermo marked this conversation as resolved
Review

Lo mismo de antes

Lo mismo de antes
AND p.`code` = s.postCode LEFT JOIN supplierAddress sad ON sad.supplierFk = s.id
GROUP BY s.id GROUP BY s.id
ORDER BY (s.city SOUNDS LIKE t.`name`) DESC; ORDER BY (s.city SOUNDS LIKE t.`name`) DESC,
(p.code = s.postCode) DESC,
(p.code = sad.postalCode) DESC;
UPDATE supplier s UPDATE supplier s
JOIN tSupplierGeo tsg ON tsg.id = s.id JOIN tSupplierGeo tsg ON tsg.id = s.id