This commit is contained in:
parent
acf308fd16
commit
e55af8d36f
|
@ -1,37 +1,35 @@
|
||||||
DELIMITER $$
|
DELIMITER $$
|
||||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`itemShelvingLog_get`(
|
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`itemShelvingLog_get`(vShelvingFk VARCHAR(10) )
|
||||||
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;
|
|
||||||
SET vQuery = '
|
SELECT isl.itemShelvingFk,
|
||||||
SELECT isl.itemFk,
|
isl.created,
|
||||||
i.longName,
|
isl.accion,
|
||||||
isl.shelvingFk,
|
isl.itemFk,
|
||||||
w.code,
|
isl.shelvingFk,
|
||||||
isl.accion,
|
isl.quantity,
|
||||||
isl.quantity,
|
isl.visible,
|
||||||
isl.created
|
isl.available,
|
||||||
FROM item i
|
isl.grouping,
|
||||||
JOIN itemShelvingLog isl ON i.id = isl.itemFk
|
isl.packing,
|
||||||
JOIN worker w ON isl.workerFk = w.id
|
isl.stars,
|
||||||
WHERE shelvingFk = ?
|
item.longName,
|
||||||
OR isl.itemFk = ?
|
item.size,
|
||||||
ORDER BY isl.created DESC';
|
item.subName,
|
||||||
|
worker.code,
|
||||||
IF vRecords IS NOT NULL THEN
|
isl.accion
|
||||||
SET vQuery = CONCAT(vQuery, '\nLIMIT ', vRecords);
|
FROM item
|
||||||
END IF;
|
JOIN itemShelvingLog isl ON item.id = isl.itemFk
|
||||||
|
JOIN worker ON isl.workerFk = worker.id
|
||||||
EXECUTE IMMEDIATE vQuery
|
WHERE shelvingFk = vShelvingFk OR isl.itemFk = vShelvingFk
|
||||||
USING vShelvingFk, vShelvingFk;
|
ORDER BY isl.created DESC;
|
||||||
|
|
||||||
END$$
|
END$$
|
||||||
DELIMITER ;
|
DELIMITER ;
|
||||||
|
|
Loading…
Reference in New Issue