DELIMITER $$
DROP TRIGGER IF EXISTS TG_UPDATE_T_ARMS_ANNUAL_INCOME;
$$
CREATE TRIGGER TG_UPDATE_T_ARMS_ANNUAL_INCOME
    BEFORE  UPDATE ON T_ARMS_ANNUAL_INCOME
    FOR EACH ROW
BEGIN
    IF NEW.C_ID <> 1 AND NEW.C_ID <> 2
        THEN
            INSERT INTO T_ARMS_ANNUAL_INCOME_LOG (C_ID, C_PARENTID, C_POSITION, C_LEFT, C_RIGHT, C_LEVEL, C_TITLE, C_TYPE, C_METHOD, C_STATE, C_DATE, C_NAME, C_KEY, C_ANNUAL_INCOME) VALUES (NEW.C_ID,NEW.C_PARENTID,NEW.C_POSITION,NEW.C_LEFT,NEW.C_RIGHT,NEW.C_LEVEL,NEW.C_TITLE,NEW.C_TYPE,'update','변경이후데이터',now(), NEW.C_NAME, NEW.C_KEY, NEW.C_ANNUAL_INCOME);
    END IF;
END $$

DELIMITER ;