7729-devToTest_2430 #2739
|
@ -0,0 +1,22 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` EVENT `vn`.`claim_changeState`
|
||||
ON SCHEDULE EVERY 1 DAY
|
||||
STARTS '2024-06-06 07:52:46.000'
|
||||
ON COMPLETION PRESERVE
|
||||
ENABLE
|
||||
DO BEGIN
|
||||
|
||||
DECLARE vClaimStete INT;
|
||||
|
||||
SELECT id INTO vClaimStete
|
||||
FROM claimState cs
|
||||
WHERE cs.code = 'canceled'
|
||||
|
||||
UPDATE claim c
|
||||
JOIN claimState cs ON cs.id = c.claimStateFk
|
||||
SET c.claimStateFk = vClaimStete
|
||||
WHERE c.created < util.VN_CURDATE() - INTERVAL 2 MONTH
|
||||
AND cs.code IN('incomplete','coming','waiting','out')
|
||||
|
||||
END$$
|
||||
DELIMITER ;
|
Loading…
Reference in New Issue