salix/db/routines/vn/procedures/itemShelving_getInfo.sql

25 lines
617 B
MySQL
Raw Permalink Normal View History

DELIMITER $$
2024-08-20 08:06:10 +00:00
CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`itemShelving_getInfo`(vItemFk VARCHAR(22))
BEGIN
/**
* Muestra información realtiva a la ubicación de un item
*
* @param vItemFk Id del item
*/
SELECT vn.barcodeToItem(vItemFk)
INTO vItemFk;
SELECT pk.code Parking,
sh.code Matricula,
ish.visible visible,
ish.created created,
ish.itemFk itemFk,
sh.priority
FROM vn.itemShelving ish
2024-11-13 08:03:44 +00:00
JOIN vn.shelving sh ON sh.id = ish.shelvingFk
JOIN vn.parking pk ON pk.id = sh.parkingFk
WHERE ish.itemFk = vItemFk
ORDER BY sh.priority DESC, created ASC;
END$$
DELIMITER ;