|
|
@@ -0,0 +1,64 @@
|
|
|
+create table if not exists core_reminder_configuration(
|
|
|
+ config_id bigint not null comment '配置ID'
|
|
|
+ primary key,
|
|
|
+ reminder_type int not null comment '提醒类型(0:逾期提醒、1:临期提醒)',
|
|
|
+ send_module varchar(50) not null comment '发送模块(五大计划之一)',
|
|
|
+ org_id bigint null comment '发送目标组织机构',
|
|
|
+ org_name varchar(125) not null comment '发送目标组织机构',
|
|
|
+ org_path varchar(125) not null comment '发送目标组织机构',
|
|
|
+ org_type int null comment '发送目标机构类型',
|
|
|
+ advance_notice_period int not null comment '临期时间(以天数表示)',
|
|
|
+ overdue_notice_period int not null comment '逾期时间(以天数表示)',
|
|
|
+ enabled tinyint(1) default 1 not null comment '是否启用该提醒配置'
|
|
|
+)
|
|
|
+ comment '短信提醒配置表';
|
|
|
+-- auto-generated definition
|
|
|
+create table if not exists core_reminder_configuration_role(
|
|
|
+ config_id bigint not null,
|
|
|
+ target_role_id bigint not null,
|
|
|
+ target_role_name bigint not null,
|
|
|
+ primary key (config_id, target_role_id)
|
|
|
+)
|
|
|
+ comment '短信提醒配置角色关联表';
|
|
|
+
|
|
|
+-- auto-generated definition
|
|
|
+create table if not exists core_reminder_log(
|
|
|
+ log_id bigint not null comment '日志ID'
|
|
|
+ primary key,
|
|
|
+ schedule_id bigint not null comment '关联的提醒任务ID',
|
|
|
+ recipient_id bigint not null comment '目标接收者id',
|
|
|
+ recipient_name varchar(50) not null comment '目标接收者',
|
|
|
+ message_content text not null comment '实际发送的短信内容',
|
|
|
+ send_time datetime not null comment '发送时间',
|
|
|
+ result_code varchar(50) null comment '发送结果代码',
|
|
|
+ result_description text null comment '发送结果描述'
|
|
|
+)
|
|
|
+ comment '短信提醒事件日志表';
|
|
|
+
|
|
|
+-- auto-generated definition
|
|
|
+create table if not exists core_reminder_schedule(
|
|
|
+ schedule_id bigint not null comment '任务ID'
|
|
|
+ primary key,
|
|
|
+ config_id bigint not null comment '关联的提醒配置ID',
|
|
|
+ recipient varchar(50) not null comment '目标接收者(手机号码或用户ID)',
|
|
|
+ scheduled_time datetime null comment '计划发送时间',
|
|
|
+ status varchar(20) not null comment '任务状态(未发送、已发送、发送失败等)',
|
|
|
+ sent_time datetime null comment '实际发送时间(若已发送)',
|
|
|
+ retry_count int default 0 null comment '重试次数(用于处理发送失败情况)'
|
|
|
+)
|
|
|
+ comment '短信提醒事件(任务)表';
|
|
|
+
|
|
|
+-- auto-generated definition
|
|
|
+create table if not exists core_reminder_template(
|
|
|
+ template_id bigint not null comment '模板ID'
|
|
|
+ primary key,
|
|
|
+ reminder_type int not null comment '提醒类型(与 core_reminder_configuration 关联)',
|
|
|
+ template_name varchar(100) not null comment '模板名称',
|
|
|
+ template_content text not null comment '提醒短信具体内容(支持变量替换)',
|
|
|
+ language varchar(20) not null comment '模板语言'
|
|
|
+)
|
|
|
+ comment '短信提醒内容模板表';
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|