Files
cn-rdms/rdms-system/rdms-system-boot/src/main/resources/sql/notify_message_level.sql
hongawen 896ef0f127 feat(project): 实现临期逾期告警功能
- 新增告警记录表 rdms_due_alert_record 用于去重控制
- 添加告警相关常量类 DueAlertConstants 和对象类型枚举
- 在各数据访问层增加告警候选查询方法
- 实现告警候选服务类和站内信等级功能
- 添加临期逾期告警模板常量定义
- 扩展站内信发送接口支持消息等级
- 新增未读消息批量查询功能用于重复发送判定
2026-06-13 15:00:36 +08:00

11 lines
841 B
SQL
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- 站内信消息等级:通用消息表加 level 列1普通/2提醒/3警告/4严重默认普通
-- 设计见 docs/superpowers/specs/2026-06-13-告警消息等级-design.md
-- 幂等MySQL 不支持 ADD COLUMN IF NOT EXISTS用 information_schema 判断后 PREPARE 执行
-- 列定义/注释须与演示库补丁 docs/sql/patches/2026-06-13-告警消息等级-01.sql 块1 保持一致
SET @col_exists = (SELECT COUNT(*) FROM information_schema.columns
WHERE table_schema = DATABASE() AND table_name = 'system_notify_message' AND column_name = 'level');
SET @ddl = IF(@col_exists = 0,
'ALTER TABLE system_notify_message ADD COLUMN level TINYINT NOT NULL DEFAULT 1 COMMENT ''消息等级:1普通/2提醒/3警告/4严重'' AFTER read_time',
'SELECT 1');
PREPARE stmt FROM @ddl; EXECUTE stmt; DEALLOCATE PREPARE stmt;