2024-01-15 11:31:03 +00:00
|
|
|
DELIMITER $$
|
2024-07-09 08:09:00 +00:00
|
|
|
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`route_updateM3`(
|
|
|
|
vSelf INT
|
|
|
|
)
|
2024-01-15 11:31:03 +00:00
|
|
|
BEGIN
|
2024-07-09 08:09:00 +00:00
|
|
|
/**
|
|
|
|
* Actualiza el volumen de la ruta.
|
|
|
|
*
|
|
|
|
* @param vSelf Id ruta
|
|
|
|
*/
|
2024-07-18 12:27:10 +00:00
|
|
|
DECLARE vVolume DECIMAL(10,1)
|
|
|
|
DEFAULT (SELECT SUM(volume) FROM saleVolume WHERE routeFk = vSelf);
|
2024-07-09 08:09:00 +00:00
|
|
|
|
|
|
|
UPDATE `route`
|
2024-07-18 12:27:10 +00:00
|
|
|
SET m3 = IFNULL(vVolume, 0)
|
2024-07-09 08:09:00 +00:00
|
|
|
WHERE id = vSelf;
|
2024-01-15 11:31:03 +00:00
|
|
|
END$$
|
|
|
|
DELIMITER ;
|