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

37 lines
837 B
MySQL
Raw Normal View History

DELIMITER $$
2024-11-13 10:15:31 +00:00
CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`itemShelvingLog_get`(
2024-11-14 08:59:01 +00:00
vShelvingCode VARCHAR(10)
2024-11-13 10:15:31 +00:00
)
BEGIN
/**
* Devuelve el log de los item en cada carro
*
2024-11-14 08:59:01 +00:00
* @param vShelvingCode Matrícula del carro
*
*/
SELECT isl.itemShelvingFk,
isl.created,
isl.accion,
isl.itemFk,
isl.shelvingFk,
isl.quantity,
isl.visible,
isl.available,
isl.grouping,
isl.packing,
isl.stars,
item.longName,
item.size,
item.subName,
worker.code,
isl.accion
FROM item
JOIN itemShelvingLog isl ON item.id = isl.itemFk
JOIN worker ON isl.workerFk = worker.id
2024-11-13 10:15:31 +00:00
JOIN shelving sh ON sh.id = isl.shelvingFk
2024-11-14 08:59:01 +00:00
WHERE sh.code = vShelvingCode COLLATE utf8mb3_unicode_ci
OR isl.itemFk = vShelvingCode -- ?? Respeto porque ya estaba
2024-11-13 10:15:31 +00:00
ORDER BY isl.created DESC;
END$$
DELIMITER ;