2024-01-15 11:31:03 +00:00
|
|
|
DELIMITER $$
|
|
|
|
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticketStateToday_setState`(vTicketFk INT, vStateCode VARCHAR(45))
|
|
|
|
BEGIN
|
|
|
|
|
|
|
|
/* Modifica el estado de un ticket de hoy
|
|
|
|
*
|
|
|
|
* @param vTicketFk el id del ticket
|
|
|
|
* @param vStateCode estado a modificar del ticket
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
DECLARE vAlertLevel INT;
|
|
|
|
|
|
|
|
SELECT s.alertLevel INTO vAlertLevel
|
|
|
|
FROM state s
|
|
|
|
JOIN ticketStateToday tst ON tst.state = s.id
|
2024-01-25 16:33:54 +00:00
|
|
|
WHERE tst.ticketFk = vTicketFk
|
2024-01-15 11:31:03 +00:00
|
|
|
LIMIT 1;
|
|
|
|
|
|
|
|
IF vAlertLevel < 2 THEN
|
|
|
|
|
|
|
|
CALL vn.ticket_setState(vTicketFk, vStateCode);
|
|
|
|
|
|
|
|
END IF;
|
|
|
|
|
|
|
|
END$$
|
|
|
|
DELIMITER ;
|