2024-01-15 11:31:03 +00:00
|
|
|
DELIMITER $$
|
2024-08-20 08:06:10 +00:00
|
|
|
CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`travel_getEntriesMissingPackage`(vSelf INT)
|
2024-01-15 11:31:03 +00:00
|
|
|
BEGIN
|
|
|
|
DECLARE vpackageOrPackingNull INT;
|
|
|
|
DECLARE vTravelFk INT;
|
|
|
|
|
|
|
|
SELECT travelfk INTO vTravelFk
|
|
|
|
FROM entry
|
|
|
|
WHERE id = vSelf;
|
|
|
|
|
|
|
|
SELECT e.id entryFk
|
|
|
|
FROM travel t
|
|
|
|
JOIN entry e ON e.travelFk = t.id
|
|
|
|
JOIN buy b ON b.entryFk = e.id
|
|
|
|
WHERE t.id = vTravelFk
|
|
|
|
AND (b.packing IS NULL OR b.packagingFk IS NULL);
|
|
|
|
END$$
|
|
|
|
DELIMITER ;
|