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_getFreezeProblem`()
|
2024-05-02 16:13:12 +00:00
|
|
|
BEGIN
|
2024-04-16 15:01:14 +00:00
|
|
|
/**
|
2024-05-02 16:13:12 +00:00
|
|
|
* Update the problem of tickets whose client is frozen or unfrozen
|
2024-04-16 15:01:14 +00:00
|
|
|
*
|
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 ticket ti ON ti.id = t.ticketFk
|
|
|
|
JOIN client c ON c.id = ti.clientFk
|
|
|
|
SET t.hasProblem = TRUE
|
|
|
|
WHERE c.isFreezed;
|
|
|
|
|
|
|
|
CALL ticket_setProblem('hasTicketRequest');
|
2024-04-16 15:01:14 +00:00
|
|
|
END$$
|
|
|
|
DELIMITER ;
|