7658-devToTest_2428 #2663

Merged
alexm merged 251 commits from 7658-devToTest_2428 into test 2024-07-02 07:20:13 +00:00
1 changed files with 37 additions and 26 deletions
Showing only changes of commit b1e8cdfd86 - Show all commits

View File

@ -1,35 +1,46 @@
DELIMITER $$ DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`itemShelvingLog_get`(vShelvingFk VARCHAR(10) ) CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`itemShelvingLog_get`(
vShelvingFk VARCHAR(10),
vRecords INT
)
BEGIN BEGIN
/** /**
* Devuelve el log de los item en cada carro * Devuelve el log de los item en cada carro
* *
* @param vShelvingFk Matrícula del carro * @param vShelvingFk Matrícula del carro
* @param vRecords Límite de registros retornados
* *
*/ */
DECLARE vQuery TEXT;
SELECT isl.itemShelvingFk, SET vQuery = '
isl.created, SELECT isl.itemShelvingFk,
isl.accion, isl.created,
isl.itemFk, isl.accion,
isl.shelvingFk, isl.itemFk,
isl.quantity, isl.shelvingFk,
isl.visible, isl.quantity,
isl.available, isl.visible,
isl.grouping, isl.available,
isl.packing, isl.`grouping`,
isl.stars, isl.packing,
item.longName, isl.stars,
item.size, item.longName,
item.subName, item.size,
worker.code, item.subName,
isl.accion worker.code,
FROM item isl.accion
JOIN itemShelvingLog isl ON item.id = isl.itemFk FROM item
JOIN worker ON isl.workerFk = worker.id JOIN itemShelvingLog isl ON item.id = isl.itemFk
WHERE shelvingFk = vShelvingFk OR isl.itemFk = vShelvingFk JOIN worker ON isl.workerFk = worker.id
ORDER BY isl.created DESC; WHERE shelvingFk = ?
OR isl.itemFk = ?
ORDER BY isl.created DESC';
IF vRecords IS NOT NULL THEN
SET vQuery = CONCAT(vQuery, '\nLIMIT ', vRecords);
END IF;
EXECUTE IMMEDIATE vQuery
USING vShelvingFk, vShelvingFk;
END$$ END$$
DELIMITER ; DELIMITER ;