SET @base_staff_annual_income_sql = IF(
    EXISTS(
        SELECT 1
        FROM information_schema.columns
        WHERE table_schema = DATABASE()
          AND table_name = 'ccdi_base_staff'
          AND column_name = 'annual_income'
    ),
    'SELECT 1',
    'ALTER TABLE `ccdi_base_staff` ADD COLUMN `annual_income` DECIMAL(15, 2) NULL COMMENT ''年收入（元/年）'' AFTER `phone`'
);

PREPARE base_staff_annual_income_stmt FROM @base_staff_annual_income_sql;
EXECUTE base_staff_annual_income_stmt;
DEALLOCATE PREPARE base_staff_annual_income_stmt;

SET @staff_fmy_relation_annual_income_sql = IF(
    EXISTS(
        SELECT 1
        FROM information_schema.columns
        WHERE table_schema = DATABASE()
          AND table_name = 'ccdi_staff_fmy_relation'
          AND column_name = 'annual_income'
    ),
    'SELECT 1',
    'ALTER TABLE `ccdi_staff_fmy_relation` ADD COLUMN `annual_income` DECIMAL(15, 2) NULL COMMENT ''家庭成员年收入（元/年）'' AFTER `mobile_phone2`'
);

PREPARE staff_fmy_relation_annual_income_stmt FROM @staff_fmy_relation_annual_income_sql;
EXECUTE staff_fmy_relation_annual_income_stmt;
DEALLOCATE PREPARE staff_fmy_relation_annual_income_stmt;
