CREATE OR REPLACE TRIGGER TRIGGER_TTRD_XY_PAY_SYNC
BEFORE INSERT OR UPDATE ON TTRD_XY_PAY_SYNC
REFERENCING OLD AS OLD NEW AS NEW
FOR EACH ROW
/*
功能说明:TTRD_XY_PAY_SYNC表数据更新时,通过STATUS更新CHECK_RETURN_MSG(支付状态)
创建者 王 创建日期: 2022-04-14
*/
BEGIN
IF :NEW.STATUS IS NOT NULL THEN
IF :NEW.STATUS = ‘UNHANDLE’ THEN :NEW.CHECK_RETURN_MSG := ‘待处理’;
ELSIF :NEW.STATUS = ‘PAY_SUCCESS’ THEN :NEW.CHECK_RETURN_MSG := ‘收付款成功’;
ELSIF :NEW.STATUS = ‘PAY_FAILURE’ THEN :NEW.CHECK_RETURN_MSG := ‘收付款失败’;
ELSIF :NEW.STATUS = ‘CANCEL’ THEN :NEW.CHECK_RETURN_MSG := ‘主动撤销’;
ELSIF :NEW.STATUS = ‘INHANDLE’ THEN :NEW.CHECK_RETURN_MSG := ‘执行中’;
ELSE
:NEW.CHECK_RETURN_MSG := :NEW.STATUS ||‘为未知状态’;
END IF;
END IF;
END TRIGGER_TTRD_XY_PAY_SYNC;