|
@@ -0,0 +1,179 @@
|
|
|
+create table gk_user
|
|
|
+(
|
|
|
+ id bigint not null auto_increment,
|
|
|
+ create_time bigint not null comment '创建时间',
|
|
|
+ update_time bigint not null comment '更新时间',
|
|
|
+ enable bit(1) not null comment '是否启用',
|
|
|
+ role varchar(20) not null comment '角色类型:学校管理员;教学点管理员',
|
|
|
+ name varchar(50) not null comment '姓名',
|
|
|
+ login_name varchar(50) not null comment '登录名',
|
|
|
+ password varchar(32) not null comment '密码',
|
|
|
+ mobile varchar(20) comment '联系方式',
|
|
|
+ category_id bigint comment '所属教学点ID,角色为教学点管理员,必填',
|
|
|
+ org_id bigint comment '所属租户机构ID(预留字段)',
|
|
|
+ PRIMARY KEY (id)
|
|
|
+) comment '用户表';
|
|
|
+
|
|
|
+
|
|
|
+create table gk_student
|
|
|
+(
|
|
|
+ id bigint not null auto_increment,
|
|
|
+ create_time bigint not null comment '创建时间',
|
|
|
+ update_time bigint not null comment '更新时间',
|
|
|
+ name varchar(50) not null comment '考生姓名',
|
|
|
+ identity_number varchar(20) not null comment '证件号',
|
|
|
+ student_code varchar(20) not null comment '学号',
|
|
|
+ photo_path varchar(100) comment '头像相对路径',
|
|
|
+ gender varchar(10) comment '性别',
|
|
|
+ open_id varchar(50) comment '微信OID',
|
|
|
+ uid varchar(50) comment '微信UID',
|
|
|
+ apply_task_id bigint not null comment '所属预约任务ID',
|
|
|
+ category_id bigint not null comment '所属教学点ID',
|
|
|
+ apply_number int not null comment '允许预约时段数量',
|
|
|
+ apply_finished bit(1) not null comment '预约时段是否全部完成',
|
|
|
+ org_id bigint comment '所属租户机构ID(预留字段)',
|
|
|
+ PRIMARY KEY (id)
|
|
|
+) comment '考生表';
|
|
|
+
|
|
|
+
|
|
|
+create table gk_category
|
|
|
+(
|
|
|
+ id bigint not null auto_increment,
|
|
|
+ create_time bigint not null comment '创建时间',
|
|
|
+ update_time bigint not null comment '更新时间',
|
|
|
+ enable bit(1) not null comment '是否启用',
|
|
|
+ parent_id bigint not null default 0 comment '父级ID,顶级值为0',
|
|
|
+ code varchar(20) not null comment '分类代码',
|
|
|
+ name varchar(50) not null comment '分类名称',
|
|
|
+ level int not null comment '层级,第一级值为1',
|
|
|
+ capacity int null default 0 comment '容量',
|
|
|
+ PRIMARY KEY (id)
|
|
|
+) comment '数据分类表';
|
|
|
+
|
|
|
+
|
|
|
+create table gk_exam_site
|
|
|
+(
|
|
|
+ id bigint not null auto_increment,
|
|
|
+ create_time bigint not null comment '创建时间',
|
|
|
+ update_time bigint not null comment '更新时间',
|
|
|
+ enable bit(1) not null comment '是否启用',
|
|
|
+ code varchar(20) not null comment '考点代码',
|
|
|
+ name varchar(100) not null comment '考点名称',
|
|
|
+ category_id bigint not null comment '所属教学点ID',
|
|
|
+ capacity int comment '机房容量',
|
|
|
+ address varchar(200) comment '考点地址',
|
|
|
+ guide longtext comment '考点指引',
|
|
|
+ PRIMARY KEY (id)
|
|
|
+) comment '考点表';
|
|
|
+
|
|
|
+
|
|
|
+create table gk_exam_room
|
|
|
+(
|
|
|
+ id bigint not null auto_increment,
|
|
|
+ create_time bigint not null comment '创建时间',
|
|
|
+ update_time bigint not null comment '更新时间',
|
|
|
+ enable bit(1) not null comment '是否启用',
|
|
|
+ code varchar(20) not null comment '考场代码',
|
|
|
+ name varchar(100) not null comment '考场名称',
|
|
|
+ exam_site_id bigint not null comment '所属考点ID',
|
|
|
+ address varchar(200) comment '考场地址',
|
|
|
+ capacity int comment '机房容量',
|
|
|
+ PRIMARY KEY (id)
|
|
|
+) comment '考场表';
|
|
|
+
|
|
|
+
|
|
|
+create table gk_apply_task
|
|
|
+(
|
|
|
+ id bigint not null auto_increment,
|
|
|
+ create_time bigint not null comment '创建时间',
|
|
|
+ update_time bigint not null comment '更新时间',
|
|
|
+ enable bit(1) not null comment '是否启用',
|
|
|
+ name varchar(50) not null comment '任务名称',
|
|
|
+ allow_apply_days int not null comment '考前多少天,禁止考生自主预约',
|
|
|
+ allow_apply_cancel_days int not null comment '考前多少天,禁止考生自主取消预约',
|
|
|
+ self_apply_start_time bigint not null comment '自主预约起始时间,只能预约本教学点下的考点',
|
|
|
+ self_apply_end_time bigint not null comment '自主预约截止时间,只能预约本教学点下的考点',
|
|
|
+ open_apply_start_time bigint not null comment '开放式预约起始时间,可以在不同教学点间预约',
|
|
|
+ open_apply_end_time bigint not null comment '开放式预约截止时间,可以在不同教学点间预约',
|
|
|
+ notice longtext comment '考试说明',
|
|
|
+ PRIMARY KEY (id)
|
|
|
+) comment '预约任务表';
|
|
|
+
|
|
|
+
|
|
|
+create table gk_time_period
|
|
|
+(
|
|
|
+ id bigint not null auto_increment,
|
|
|
+ create_time bigint not null comment '创建时间',
|
|
|
+ update_time bigint not null comment '更新时间',
|
|
|
+ apply_task_id bigint not null comment '所属预约任务ID',
|
|
|
+ start_time bigint not null comment '预约起始时间',
|
|
|
+ end_time bigint not null comment '预约截止时间',
|
|
|
+ PRIMARY KEY (id)
|
|
|
+) comment '预约任务的时段表';
|
|
|
+
|
|
|
+
|
|
|
+create table gk_student_apply
|
|
|
+(
|
|
|
+ id bigint not null auto_increment,
|
|
|
+ create_time bigint not null comment '创建时间',
|
|
|
+ update_time bigint not null comment '更新时间',
|
|
|
+ student_id bigint not null comment '考生ID',
|
|
|
+ exam_site_id bigint not null comment '预约的考点ID',
|
|
|
+ exam_room_id bigint not null comment '预约的考场ID',
|
|
|
+ time_period_id varchar(50) not null comment '预约时段ID',
|
|
|
+ cancel bit(1) not null comment '是否取消预约',
|
|
|
+ ticketNumber varchar(50) comment '准考证号',
|
|
|
+ seatNumber varchar(20) comment '座位号',
|
|
|
+ PRIMARY KEY (id)
|
|
|
+) comment '考生预约记录表';
|
|
|
+
|
|
|
+
|
|
|
+create table gk_student_import_task
|
|
|
+(
|
|
|
+ id bigint not null auto_increment,
|
|
|
+ create_time bigint not null comment '创建时间',
|
|
|
+ update_time bigint not null comment '更新时间',
|
|
|
+ operate_id bigint not null comment '操作人ID',
|
|
|
+ type varchar(20) not null comment '导入类型',
|
|
|
+ status varchar(20) not null comment '执行状态',
|
|
|
+ file_path varchar(200) not null comment '导入文件相对路径',
|
|
|
+ message text comment '执行结果信息',
|
|
|
+ PRIMARY KEY (id)
|
|
|
+) comment '考生导入任务表';
|
|
|
+
|
|
|
+
|
|
|
+create table gk_operate_log
|
|
|
+(
|
|
|
+ id bigint not null auto_increment,
|
|
|
+ create_time bigint not null comment '创建时间',
|
|
|
+ update_time bigint not null comment '更新时间',
|
|
|
+ operate_id bigint not null comment '操作人ID',
|
|
|
+ event_type varchar(20) not null comment '事件类型,如:考生取消预约、用户登录等',
|
|
|
+ content text comment '操作内容(JSON)',
|
|
|
+ PRIMARY KEY (id)
|
|
|
+) comment '操作日志表';
|
|
|
+
|
|
|
+
|
|
|
+create table gk_system_property
|
|
|
+(
|
|
|
+ id bigint not null auto_increment,
|
|
|
+ create_time bigint not null comment '创建时间',
|
|
|
+ update_time bigint not null comment '更新时间',
|
|
|
+ `key` varchar(50) not null comment '属性键',
|
|
|
+ value varchar(500) not null comment '属性值',
|
|
|
+ PRIMARY KEY (id)
|
|
|
+) comment '系统属性表';
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+insert into gk_system_property(`key`, value, create_time, update_time)
|
|
|
+values ('ORG_TITLE', '广东开发大学', now(), now());
|
|
|
+
|
|
|
+insert into gk_system_property(`key`, value, create_time, update_time)
|
|
|
+values ('CATEGORY_LEVEL', '[{"level":1,"title":"城市"},{"level":2,"title":"教学点"}]', now(), now());
|
|
|
+
|
|
|
+insert into gk_user (role, name, login_name, password, mobile, category_id, org_id, enable, create_time, update_time)
|
|
|
+values ('ADMIN', '学校管理员', 'admin', UPPER(SHA2('123456', 256)), null, null, 1, 1, now(), now());
|
|
|
+
|
|
|
+
|
|
|
+
|