Files
xj-platform/db/updatesql/20260205-xj-system新增表.sql
T
2026-02-11 16:40:47 +08:00

36 lines
1.8 KiB
Java
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.
-- 消息通知表
CREATE TABLE `sys_message_notice` (
`id` varchar(32) NOT NULL COMMENT 'id',
`title` varchar(255) DEFAULT NULL COMMENT '标题',
`content` text COMMENT '内容',
`scope_type` int(2) DEFAULT NULL COMMENT '范围(1-指定部门,2-指定人群,3-既指定部门又指定人群)',
`org_code` varchar(100) DEFAULT NULL COMMENT '创建机构',
`notice_status` int(2) DEFAULT '1' COMMENT '通知状态(0 1)',
`start_time` datetime DEFAULT NULL COMMENT '通知开始时间',
`end_time` datetime DEFAULT NULL COMMENT '通知结束时间',
`del_flag` varchar(1) DEFAULT '0' COMMENT '删除状态(0-正常,1-已删除)',
`create_by` varchar(50) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_by` varchar(50) DEFAULT NULL COMMENT '更新人',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`),
KEY `idx_org_code` (`org_code`),
KEY `idx_notice_status` (`notice_status`),
KEY `idx_start_time` (`start_time`),
KEY `idx_end_time` (`end_time`),
KEY `idx_del_flag` (`del_flag`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='消息通知表';
-- 消息通知范围表
CREATE TABLE `sys_message_notice_scope` (
`id` varchar(32) NOT NULL COMMENT 'id',
`notice_id` varchar(32) NOT NULL COMMENT '消息id',
`type` int(2) DEFAULT NULL COMMENT '类别(1-指定部门,2-指定人群)',
`scope_id` varchar(100) DEFAULT NULL COMMENT '限制范围标识(:部门Code,人员ID)',
`record` varchar(255) DEFAULT NULL COMMENT '记录值(:部门名称,人员名称)',
PRIMARY KEY (`id`),
KEY `idx_notice_id` (`notice_id`),
KEY `idx_type` (`type`),
KEY `idx_scope_notice` (`scope_id`, `notice_id`) COMMENT '联表查询复合索引支持WHERE scope_id + JOIN notice_id'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='消息通知范围表';