2024-01-15 11:31:03 +00:00
|
|
|
DELIMITER $$
|
2024-07-22 09:52:42 +00:00
|
|
|
CREATE OR REPLACE DEFINER=`vn-admin`@`localhost` PROCEDURE `vn`.`freelance_getInfo`(workerFk INT)
|
2024-01-15 11:31:03 +00:00
|
|
|
BEGIN
|
|
|
|
SELECT s.name, s.street, s.city, s.nif, s.postCode
|
|
|
|
FROM route r
|
|
|
|
JOIN agencyMode am ON r.agencyModeFk = am.id
|
|
|
|
JOIN agency a ON am.agencyFk = a.id
|
|
|
|
JOIN supplierAgencyTerm sat ON a.id = sat.agencyFk
|
|
|
|
JOIN supplier s ON sat.supplierFk = s.id
|
|
|
|
WHERE r.workerFk = workerFk
|
|
|
|
ORDER BY r.id DESC
|
|
|
|
LIMIT 1;
|
|
|
|
END$$
|
|
|
|
DELIMITER ;
|