2024-04-16 15:01:14 +00:00
|
|
|
DELIMITER $$
|
2024-05-02 15:05:10 +00:00
|
|
|
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticket_getRequestProblem`()
|
2024-04-16 15:01:14 +00:00
|
|
|
BEGIN
|
|
|
|
/**
|
2024-05-02 16:13:12 +00:00
|
|
|
* Update the problems of tickets that have a pending ticketRequest or no longer have it
|
|
|
|
*
|
2024-05-02 15:05:10 +00:00
|
|
|
* @table tmp.ticket(ticketFk, hasProblem)
|
2024-04-16 15:01:14 +00:00
|
|
|
*/
|
2024-05-02 15:05:10 +00:00
|
|
|
UPDATE tmp.ticket t
|
|
|
|
JOIN ticketRequest tr ON tr.ticketFk = t.ticketFk
|
|
|
|
SET t.hasProblem = TRUE
|
|
|
|
WHERE tr.isOK IS NULL;
|
2024-04-16 15:01:14 +00:00
|
|
|
|
|
|
|
CALL ticket_setProblem('hasTicketRequest');
|
|
|
|
END$$
|
|
|
|
DELIMITER ;
|