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

29 lines
737 B
MySQL
Raw Normal View History

DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`itemShelving_get`(IN vSelf VARCHAR(8))
BEGIN
/**
* Lista artículos de itemshelving
*
* @param vSelf matrícula del carro
**/
SELECT ish.itemFk item,
IFNULL(i.longName, CONCAT(i.name, ' ', i.size)) description,
ish.visible,
CEIL(ish.visible/ish.packing) stickers,
ish.packing,
ish.grouping,
p.code,
ish.id,
s.priority,
2024-02-09 06:51:51 +00:00
ish.isChecked,
2024-07-31 16:11:03 +00:00
ic.url,
ish.available
FROM itemShelving ish
JOIN item i ON i.id = ish.itemFk
JOIN shelving s ON vSelf = s.code COLLATE utf8_unicode_ci
LEFT JOIN parking p ON s.parkingFk = p.id
2024-02-09 06:51:51 +00:00
JOIN hedera.imageConfig ic
WHERE ish.shelvingFk COLLATE utf8_unicode_ci = vSelf;
END$$
DELIMITER ;