USE jkserver_db;

-- ----------------------------
-- Table structure for basic_school
-- ----------------------------
DROP TABLE IF EXISTS `basic_school`;
CREATE TABLE `basic_school` (
                                `id` bigint NOT NULL COMMENT '主键',
                                `code` varchar(20) CHARACTER SET utf8mb4 NOT NULL COMMENT '学校编码',
                                `domain_name` varchar(20) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '域名',
                                `name` varchar(100) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '学校名称',
                                `enable` tinyint NOT NULL DEFAULT '1' COMMENT '是否启用，false：停用，true：启用',
                                `access_key` varchar(50) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '访问key',
                                `access_secret` varchar(50) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '访问秘钥',
                                `remark` text CHARACTER SET utf8mb4 COMMENT '备注',
                                `create_id` bigint DEFAULT NULL COMMENT '创建人',
                                `create_time` bigint DEFAULT NULL COMMENT '创建时间',
                                `update_id` bigint DEFAULT NULL COMMENT '更新人',
                                `update_time` bigint DEFAULT NULL COMMENT '更新时间',
                                `logo` mediumtext CHARACTER SET utf8mb4 COMMENT '学校logo',
                                PRIMARY KEY (`id`),
                                UNIQUE KEY `code` (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='学校表';

-- ----------------------------
-- Table structure for jk_attachment
-- ----------------------------
DROP TABLE IF EXISTS `jk_attachment`;
CREATE TABLE `jk_attachment` (
                                 `id` bigint NOT NULL COMMENT '主键',
                                 `exam_code` varchar(30) NOT NULL COMMENT '考试编码',
                                 `path` varchar(200) NOT NULL COMMENT '文件存储路径',
                                 `size` double NOT NULL COMMENT '文件大小',
                                 `original_name` varchar(100) NOT NULL COMMENT '原始文件名称',
                                 `name` varchar(100) NOT NULL COMMENT '文件存储名称',
                                 `md5` varchar(60) NOT NULL COMMENT 'md5',
                                 `ext` varchar(30) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '文件后缀',
                                 `time` bigint DEFAULT NULL COMMENT '创建时间',
                                 `access_uri` varchar(1000) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '真实地址',
                                 `moved` tinyint NOT NULL DEFAULT '0' COMMENT '是否已经转存到工作区了，1：是，0：不是',
                                 `relate_id` bigint DEFAULT NULL COMMENT '工作区文件ID',
                                 `type` varchar(30) DEFAULT NULL COMMENT '类型，FILE：文件，FOLDER：文件夹',
                                 PRIMARY KEY (`id`),
                                 KEY `jk_attachment_exam_code_IDX` (`exam_code`) USING BTREE,
                                 KEY `jk_attachment_name_IDX` (`name`) USING BTREE,
                                 KEY `jk_attachment_relate_id_IDX` (`relate_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='附件表';

-- ----------------------------
-- Table structure for jk_attachment_photo
-- ----------------------------
DROP TABLE IF EXISTS `jk_attachment_photo`;
CREATE TABLE `jk_attachment_photo` (
                                       `id` bigint NOT NULL COMMENT '主键',
                                       `exam_code` varchar(30) DEFAULT NULL COMMENT '考试编码',
                                       `place_code` varchar(50) DEFAULT NULL COMMENT '地方编码',
                                       `room_code` varchar(50) DEFAULT NULL COMMENT '考场编码',
                                       `file_name` varchar(100) DEFAULT NULL COMMENT '文件名称',
                                       `md5` varchar(60) DEFAULT NULL COMMENT 'md5',
                                       `path` varchar(200) DEFAULT NULL COMMENT '路径',
                                       `size` double DEFAULT NULL COMMENT '文件大小',
                                       `create_time` bigint DEFAULT NULL COMMENT '创建时间',
                                       PRIMARY KEY (`id`),
                                       KEY `jk_attachment_photo_exam_code_IDX` (`exam_code`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='附件照片表';

-- ----------------------------
-- Table structure for jk_exam_abort
-- ----------------------------
DROP TABLE IF EXISTS `jk_exam_abort`;
CREATE TABLE `jk_exam_abort` (
                                 `id` bigint NOT NULL COMMENT '主键',
                                 `reason` varchar(200) DEFAULT NULL COMMENT '异常原因',
                                 `time` bigint DEFAULT NULL COMMENT '异常处理时间',
                                 `remark` varchar(200) DEFAULT NULL COMMENT '备注',
                                 `exam_student_answer_id` bigint DEFAULT NULL COMMENT '考生答案id',
                                 PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='异常处理的考生';

-- ----------------------------
-- Table structure for jk_exam_absent
-- ----------------------------
DROP TABLE IF EXISTS `jk_exam_absent`;
CREATE TABLE `jk_exam_absent` (
                                  `id` bigint NOT NULL COMMENT '主键',
                                  `remark` varchar(200) DEFAULT NULL COMMENT '备注',
                                  `create_time` bigint DEFAULT NULL COMMENT '创建时间',
                                  `exam_student_answer_id` bigint DEFAULT NULL COMMENT '考生答案id',
                                  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='缺考考生';

-- ----------------------------
-- Table structure for jk_exam_cheat
-- ----------------------------
DROP TABLE IF EXISTS `jk_exam_cheat`;
CREATE TABLE `jk_exam_cheat` (
                                 `id` bigint NOT NULL COMMENT '主键',
                                 `operate_type` varchar(100) DEFAULT NULL COMMENT '操作类型',
                                 `operate_time` bigint DEFAULT NULL COMMENT '操作时间',
                                 `reason` varchar(200) DEFAULT NULL COMMENT '违纪原因',
                                 `introduce` varchar(200) DEFAULT NULL COMMENT '违纪说明',
                                 `create_time` bigint DEFAULT NULL COMMENT '创建时间',
                                 `exam_student_answer_id` bigint DEFAULT NULL COMMENT '考生答案id',
                                 PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='作弊考生';

-- ----------------------------
-- Table structure for jk_exam_code
-- ----------------------------
DROP TABLE IF EXISTS `jk_exam_code`;
CREATE TABLE `jk_exam_code` (
                                `id` bigint NOT NULL COMMENT '主键',
                                `school_id` bigint NOT NULL COMMENT '学校id',
                                `exam_code` varchar(30) NOT NULL COMMENT '考试编码',
                                `used` tinyint NOT NULL DEFAULT '0' COMMENT '是否使用，1：使用，0：未使用',
                                PRIMARY KEY (`id`),
                                UNIQUE KEY `jk_exam_code_UN` (`exam_code`),
                                KEY `jk_exam_code_school_id_IDX` (`school_id`,`exam_code`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='考试识别码';

-- ----------------------------
-- Table structure for jk_exam_kj_progress
-- ----------------------------
DROP TABLE IF EXISTS `jk_exam_kj_progress`;
CREATE TABLE `jk_exam_kj_progress` (
                                       `id` bigint NOT NULL COMMENT '主键',
                                       `exam_code` varchar(30) NOT NULL COMMENT '考试编码',
                                       `place_code` varchar(50) NOT NULL COMMENT '地方编码',
                                       `room_code` varchar(50) NOT NULL COMMENT '考场编码',
                                       `type` varchar(50) NOT NULL COMMENT '类型，LOCAL：本地导入，REMOTE：监考端提交',
                                       `attachment_id` bigint NOT NULL COMMENT '附件id',
                                       `start_time` bigint NOT NULL COMMENT '开始时间',
                                       PRIMARY KEY (`id`),
                                       KEY `jk_exam_kj_progress_exam_code_IDX` (`exam_code`,`place_code`,`room_code`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='统计当前考场内考生答案上传情形';

-- ----------------------------
-- Table structure for jk_exam_kw_progress
-- ----------------------------
DROP TABLE IF EXISTS `jk_exam_kw_progress`;
CREATE TABLE `jk_exam_kw_progress` (
                                       `id` bigint NOT NULL COMMENT '主键',
                                       `exam_code` varchar(30) NOT NULL COMMENT '考试编码',
                                       `place_code` varchar(50) NOT NULL COMMENT '地方编码',
                                       `room_code` varchar(50) NOT NULL COMMENT '考场编码',
                                       `type` varchar(30) NOT NULL COMMENT '类型，KW：下载考务考场数据，PAPER：下载试卷，UNCOILING：开卷',
                                       `download` tinyint NOT NULL DEFAULT '1' COMMENT '是否下载，1：下载，0：未下载',
                                       `time` bigint NOT NULL COMMENT '下载时间',
                                       PRIMARY KEY (`id`),
                                       KEY `jk_exam_kw_progress_exam_code_IDX` (`exam_code`,`place_code`,`room_code`,`type`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='考务数据以及试卷下载统计';

-- ----------------------------
-- Table structure for jk_exam_paper_temp
-- ----------------------------
DROP TABLE IF EXISTS `jk_exam_paper_temp`;
CREATE TABLE `jk_exam_paper_temp` (
                                      `id` bigint NOT NULL COMMENT '主键',
                                      `exam_code` varchar(30) NOT NULL COMMENT '考试编码',
                                      `attachment_id` bigint NOT NULL COMMENT '试卷附件id',
                                      `course_code` varchar(50) NOT NULL COMMENT '课程编码',
                                      `paper_name` varchar(100) NOT NULL COMMENT '试卷名称',
                                      `paper_id` varchar(50) NOT NULL COMMENT '试卷id',
                                      `exam_task_id` bigint DEFAULT NULL COMMENT '同步云阅卷考试id',
                                      `task_sync_result` tinyint NOT NULL DEFAULT '0' COMMENT '同步结果，1：已同步，0：未同步',
                                      PRIMARY KEY (`id`),
                                      KEY `jk_exam_paper_temp_exam_code_IDX` (`exam_code`,`attachment_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='试卷临时数据';

-- ----------------------------
-- Table structure for jk_exam_plan
-- ----------------------------
DROP TABLE IF EXISTS `jk_exam_plan`;
CREATE TABLE `jk_exam_plan` (
                                `id` bigint NOT NULL COMMENT '主键',
                                `school_id` bigint NOT NULL COMMENT '学校id',
                                `exam_task_id` bigint DEFAULT NULL COMMENT '同步云阅卷考试id',
                                `name` varchar(100) NOT NULL COMMENT '考试名称',
                                `exam_code` varchar(30) NOT NULL COMMENT '考试编码',
                                `exam_type` varchar(30) NOT NULL COMMENT '考试类型，NORMAL：通用机考，SOLFEGE：视唱机考，UTEST：优特机考',
                                `exam_status` varchar(30) NOT NULL COMMENT '考试状态，UN_PUBLISHED：未发布，PUBLISHED：已发布',
                                `start_time` bigint NOT NULL COMMENT '开始时间',
                                `end_time` bigint NOT NULL COMMENT '结束时间',
                                `creator_id` bigint DEFAULT NULL COMMENT '创建人id',
                                `create_time` bigint DEFAULT NULL COMMENT '创建时间',
                                `enable` tinyint NOT NULL DEFAULT '1' COMMENT '是否启用，1：启用，0：不启用',
                                `simulation` varchar(30) DEFAULT NULL COMMENT '是否是模拟测试，0：否，1：是',
                                `paper_rule` varchar(30) DEFAULT NULL COMMENT '抽卷规则，USE_LAST：使用上次考试的试卷，USE_NEW：重新抽卷',
                                `login_rule` varchar(30) DEFAULT NULL COMMENT '登录规则，ONLY_TICKET：准考证号，TICKET_IDCARD：准考证号和身份证号',
                                `client_theme` varchar(30) DEFAULT NULL COMMENT '客户端主题资源包，WHYYXY：武汉音乐学院，SCYYXY：四川音乐学院',
                                `open_monitor` varchar(30) DEFAULT NULL COMMENT '是否开启考场监控，YES：是，NO：否',
                                `face_verify_open` varchar(30) DEFAULT NULL COMMENT '是否开启人脸，0：否，1：是',
                                `face_verify_interval_time` varchar(50) DEFAULT NULL COMMENT '人脸识别间隔时间',
                                `scene_score` varchar(30) DEFAULT NULL COMMENT '是否现场出分，YES：是，NO：否',
                                PRIMARY KEY (`id`),
                                UNIQUE KEY `jk_exam_plan_UN` (`exam_code`),
                                KEY `jk_exam_plan_school_id_IDX` (`school_id`,`exam_code`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='考试计划';

-- ----------------------------
-- Table structure for jk_exam_repeat
-- ----------------------------
DROP TABLE IF EXISTS `jk_exam_repeat`;
CREATE TABLE `jk_exam_repeat` (
                                  `id` bigint NOT NULL COMMENT '主键',
                                  `new_batch_id` varchar(50) DEFAULT NULL COMMENT '新的批次id',
                                  `new_batch_name` varchar(100) DEFAULT NULL COMMENT '新的批次名称',
                                  `new_stage_id` varchar(50) DEFAULT NULL COMMENT '新的场次ID',
                                  `time` bigint DEFAULT NULL COMMENT '重考处理时间',
                                  `reason` varchar(200) DEFAULT NULL COMMENT '重考原因',
                                  `create_time` bigint DEFAULT NULL COMMENT '创建时间',
                                  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='重考的考生';

-- ----------------------------
-- Table structure for jk_exam_repeat_record
-- ----------------------------
DROP TABLE IF EXISTS `jk_exam_repeat_record`;
CREATE TABLE `jk_exam_repeat_record` (
                                         `id` bigint NOT NULL COMMENT '主键',
                                         `exam_code` varchar(30) NOT NULL COMMENT '考试编码',
                                         `place_code` varchar(50) NOT NULL COMMENT '地方编码',
                                         `room_code` varchar(50) NOT NULL COMMENT '考场编码',
                                         `batch_id` varchar(50) DEFAULT NULL COMMENT '批次id',
                                         `batch_name` varchar(100) DEFAULT NULL COMMENT '批次名称',
                                         `stage_id` varchar(50) DEFAULT NULL COMMENT '场次id',
                                         `ticket_no` varchar(50) DEFAULT NULL COMMENT '准考证号',
                                         `student_name` varchar(50) DEFAULT NULL COMMENT '学生姓名',
                                         `course_code` varchar(50) DEFAULT NULL COMMENT '科目编码',
                                         `course_name` varchar(50) DEFAULT NULL COMMENT '科目名称',
                                         `new_batch_id` varchar(50) DEFAULT NULL COMMENT '新批次id',
                                         `new_batch_name` varchar(100) DEFAULT NULL COMMENT '新批次名称',
                                         `new_stage_id` varchar(100) DEFAULT NULL COMMENT '新场次id',
                                         `time` bigint DEFAULT NULL COMMENT '重考处理时间',
                                         `reason` varchar(200) NOT NULL COMMENT '重考原因',
                                         `create_time` bigint DEFAULT NULL COMMENT '创建时间',
                                         PRIMARY KEY (`id`),
                                         KEY `jk_exam_repeat_record_exam_code_IDX1` (`exam_code`,`place_code`,`room_code`) USING BTREE,
                                         KEY `jk_exam_repeat_record_exam_code_IDX2` (`exam_code`,`ticket_no`,`course_code`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='重考记录表';

-- ----------------------------
-- Table structure for jk_exam_room
-- ----------------------------
DROP TABLE IF EXISTS `jk_exam_room`;
CREATE TABLE `jk_exam_room` (
                                `id` bigint NOT NULL COMMENT '主键',
                                `exam_code` varchar(30) NOT NULL COMMENT '考试编码',
                                `place_code` varchar(50) NOT NULL COMMENT '地方编码',
                                `place_name` varchar(100) NOT NULL COMMENT '地方名称',
                                `room_code` varchar(50) NOT NULL COMMENT '考场编码',
                                `room_name` varchar(100) NOT NULL COMMENT '考场名称',
                                `jk_teacher` varchar(50) DEFAULT NULL COMMENT '监考老师',
                                `jk_password` varchar(20) DEFAULT NULL COMMENT '监考密码',
                                `create_time` bigint DEFAULT NULL COMMENT '创建时间',
                                `kj_already` tinyint NOT NULL DEFAULT '0' COMMENT '当前考场答案文件已经上传，不支持视唱机考，0：未上传，1：已上传',
                                `kw_kc_already` tinyint NOT NULL DEFAULT '0' COMMENT '考务考场是否上传，0：未上传，1：已上传',
                                `kw_paper_already` tinyint NOT NULL DEFAULT '0' COMMENT '考务试卷是否上传，0：未上传，1：已上传',
                                `kw_uncoliling_already` tinyint DEFAULT '0' COMMENT '考务开卷是否上传，0：未上传，1：已上传',
                                PRIMARY KEY (`id`),
                                KEY `jk_exam_room_exam_code_IDX` (`exam_code`,`place_code`,`room_code`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='考点考场表';

-- ----------------------------
-- Table structure for jk_exam_room_address
-- ----------------------------
DROP TABLE IF EXISTS `jk_exam_room_address`;
CREATE TABLE `jk_exam_room_address` (
                                        `id` bigint NOT NULL COMMENT '主键',
                                        `exam_code` varchar(30) NOT NULL COMMENT '考试编码',
                                        `attachment_id` bigint DEFAULT NULL COMMENT '临时文件ID',
                                        `place_code` varchar(50) DEFAULT NULL COMMENT '地方编码',
                                        `place_name` varchar(100) DEFAULT NULL COMMENT '地方名称',
                                        `room_code` varchar(50) DEFAULT NULL COMMENT '考场编码',
                                        `room_name` varchar(100) DEFAULT NULL COMMENT '考场名称',
                                        `province` varchar(100) DEFAULT NULL COMMENT '省份',
                                        `city` varchar(100) DEFAULT NULL COMMENT '城市',
                                        `area` varchar(200) DEFAULT NULL COMMENT '地区',
                                        `create_time` bigint DEFAULT NULL COMMENT '创建时间',
                                        PRIMARY KEY (`id`),
                                        KEY `jk_exam_room_address_exam_code_IDX` (`exam_code`,`place_code`,`room_code`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='考点考场地址表';

-- ----------------------------
-- Table structure for jk_exam_room_address_temp
-- ----------------------------
DROP TABLE IF EXISTS `jk_exam_room_address_temp`;
CREATE TABLE `jk_exam_room_address_temp` (
                                             `id` bigint NOT NULL COMMENT '主键',
                                             `exam_code` varchar(30) NOT NULL COMMENT '考试编码',
                                             `attachment_id` bigint DEFAULT NULL COMMENT '临时文件ID',
                                             `place_code` varchar(50) DEFAULT NULL COMMENT '地方编码',
                                             `place_name` varchar(100) DEFAULT NULL COMMENT '地方名称',
                                             `room_code` varchar(50) DEFAULT NULL COMMENT '考场编码',
                                             `room_name` varchar(100) DEFAULT NULL COMMENT '考场名称',
                                             `province` varchar(100) DEFAULT NULL COMMENT '省份',
                                             `city` varchar(100) DEFAULT NULL COMMENT '城市',
                                             `area` varchar(200) DEFAULT NULL COMMENT '地区',
                                             `create_time` bigint DEFAULT NULL COMMENT '创建时间',
                                             PRIMARY KEY (`id`),
                                             KEY `jk_exam_room_address_temp_exam_code_IDX` (`exam_code`,`place_code`,`room_code`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='考点考场地址临时表';

-- ----------------------------
-- Table structure for jk_exam_room_monitor_info
-- ----------------------------
DROP TABLE IF EXISTS `jk_exam_room_monitor_info`;
CREATE TABLE `jk_exam_room_monitor_info` (
                                             `id` bigint NOT NULL COMMENT '主键',
                                             `exam_code` varchar(30) DEFAULT NULL COMMENT '考试编码',
                                             `place_code` varchar(50) DEFAULT NULL COMMENT '地方编码',
                                             `room_code` varchar(50) DEFAULT NULL COMMENT '考场编码',
                                             `course_code` varchar(50) DEFAULT NULL COMMENT '科目编码',
                                             `login_count` int DEFAULT NULL COMMENT '登记次数',
                                             `contact_error_count` int DEFAULT NULL COMMENT '联系错误次数',
                                             `create_time` bigint DEFAULT NULL COMMENT '创建时间',
                                             PRIMARY KEY (`id`),
                                             KEY `jk_exam_room_monitor_info_exam_code_IDX` (`exam_code`,`place_code`,`room_code`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='存储考场监控信息';

-- ----------------------------
-- Table structure for jk_exam_room_temp
-- ----------------------------
DROP TABLE IF EXISTS `jk_exam_room_temp`;
CREATE TABLE `jk_exam_room_temp` (
                                     `id` bigint NOT NULL COMMENT '主键',
                                     `exam_code` varchar(30) NOT NULL COMMENT '考试编码',
                                     `place_code` varchar(50) NOT NULL COMMENT '地方编码',
                                     `place_name` varchar(100) NOT NULL COMMENT '地方名称',
                                     `room_code` varchar(50) NOT NULL COMMENT '考场编码',
                                     `room_name` varchar(100) NOT NULL COMMENT '考场名称',
                                     `jk_teacher` varchar(50) DEFAULT NULL COMMENT '监考老师',
                                     `jk_password` varchar(20) DEFAULT NULL COMMENT '监考密码',
                                     `create_time` bigint DEFAULT NULL COMMENT '创建时间',
                                     `attachment_id` bigint DEFAULT NULL COMMENT '附件id',
                                     PRIMARY KEY (`id`),
                                     KEY `jk_exam_room_temp_exam_code_IDX` (`exam_code`,`attachment_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='考点考场临时表';

-- ----------------------------
-- Table structure for jk_exam_solfege_record
-- ----------------------------
DROP TABLE IF EXISTS `jk_exam_solfege_record`;
CREATE TABLE `jk_exam_solfege_record` (
                                          `id` bigint NOT NULL COMMENT '主键',
                                          `exam_code` varchar(30) DEFAULT NULL COMMENT '考试编码',
                                          `student_id` bigint DEFAULT NULL COMMENT '学生id',
                                          `paper_name` varchar(100) DEFAULT NULL COMMENT '试卷名称',
                                          `attachment_id` bigint DEFAULT NULL COMMENT '附件id',
                                          `progress_type` varchar(30) DEFAULT NULL COMMENT '答案提交方式，LOCAL：本地导入，REMOTE：监考端提交',
                                          `time` bigint DEFAULT NULL COMMENT '创建时间',
                                          PRIMARY KEY (`id`),
                                          KEY `jk_exam_solfege_record_student_id_IDX` (`student_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='视唱考生答案文件';

-- ----------------------------
-- Table structure for jk_exam_solfege_record_history
-- ----------------------------
DROP TABLE IF EXISTS `jk_exam_solfege_record_history`;
CREATE TABLE `jk_exam_solfege_record_history` (
                                                  `id` bigint NOT NULL COMMENT '主键',
                                                  `exam_code` varchar(30) DEFAULT NULL COMMENT '考试编码',
                                                  `student_id` bigint DEFAULT NULL COMMENT '学生id',
                                                  `paper_name` varchar(100) DEFAULT NULL COMMENT '试卷名称',
                                                  `attachment_id` bigint DEFAULT NULL COMMENT '附件id',
                                                  `progress_type` varchar(30) DEFAULT NULL COMMENT '答案提交方式，LOCAL：本地导入，REMOTE：监考端提交',
                                                  `time` bigint DEFAULT NULL COMMENT '创建时间',
                                                  PRIMARY KEY (`id`),
                                                  KEY `jk_exam_solfege_record_history_exam_code_IDX` (`exam_code`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='视唱考生答案文件历史记录';

-- ----------------------------
-- Table structure for jk_exam_stage
-- ----------------------------
DROP TABLE IF EXISTS `jk_exam_stage`;
CREATE TABLE `jk_exam_stage` (
                                 `id` bigint NOT NULL COMMENT '主键',
                                 `exam_code` varchar(30) NOT NULL COMMENT '考试编码',
                                 `batch_id` varchar(50) NOT NULL COMMENT '批次id',
                                 `batch_name` varchar(100) NOT NULL COMMENT '批次名称',
                                 `batch_start_time` bigint NOT NULL COMMENT '批次开始时间',
                                 `batch_end_time` bigint NOT NULL COMMENT '批次结束时间',
                                 `stage_id` varchar(50) NOT NULL COMMENT '场次id',
                                 `stage_start_time` bigint NOT NULL COMMENT '场次开始时间',
                                 `stage_end_time` bigint NOT NULL COMMENT '场次结束时间',
                                 `late_login_time` varchar(50) NOT NULL COMMENT '迟到登录时间',
                                 `frozen_time` varchar(50) NOT NULL COMMENT '交卷冻结时间',
                                 `create_time` bigint DEFAULT NULL COMMENT '创建时间',
                                 `sdsk` varchar(30) NOT NULL COMMENT '是否随到随考',
                                 PRIMARY KEY (`id`),
                                 KEY `jk_exam_stage_exam_code_IDX` (`exam_code`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='批次场次表';

-- ----------------------------
-- Table structure for jk_exam_stage_temp
-- ----------------------------
DROP TABLE IF EXISTS `jk_exam_stage_temp`;
CREATE TABLE `jk_exam_stage_temp` (
                                      `id` bigint NOT NULL COMMENT '主键',
                                      `exam_code` varchar(30) NOT NULL COMMENT '考试编码',
                                      `batch_id` varchar(50) NOT NULL COMMENT '批次id',
                                      `batch_name` varchar(100) NOT NULL COMMENT '批次名称',
                                      `batch_start_time` bigint NOT NULL COMMENT '批次开始时间',
                                      `batch_end_time` bigint NOT NULL COMMENT '批次结束时间',
                                      `stage_id` varchar(50) NOT NULL COMMENT '场次id',
                                      `stage_start_time` bigint NOT NULL COMMENT '场次开始时间',
                                      `stage_end_time` bigint NOT NULL COMMENT '场次结束时间',
                                      `late_login_time` varchar(50) NOT NULL COMMENT '迟到登录时间',
                                      `frozen_time` varchar(50) NOT NULL COMMENT '交卷冻结时间',
                                      `create_time` bigint DEFAULT NULL COMMENT '创建时间',
                                      `sdsk` varchar(30) NOT NULL COMMENT '是否随到随考',
                                      `attachment_id` bigint NOT NULL COMMENT '导入的考务文件的ID',
                                      PRIMARY KEY (`id`),
                                      KEY `jk_exam_stage_temp_exam_code_IDX` (`exam_code`,`attachment_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='批次场次临时表';

-- ----------------------------
-- Table structure for jk_exam_student
-- ----------------------------
DROP TABLE IF EXISTS `jk_exam_student`;
CREATE TABLE `jk_exam_student` (
                                   `id` bigint NOT NULL COMMENT '主键',
                                   `exam_code` varchar(30) NOT NULL COMMENT '考试编码',
                                   `batch_id` varchar(50) NOT NULL COMMENT '批次id',
                                   `batch_name` varchar(100) NOT NULL COMMENT '批次名称',
                                   `stage_id` varchar(50) NOT NULL COMMENT '场次id',
                                   `place_code` varchar(50) NOT NULL COMMENT '地方编码',
                                   `room_code` varchar(50) NOT NULL COMMENT '考场编码',
                                   `ticket_no` varchar(50) NOT NULL COMMENT '准考证号',
                                   `idcard` varchar(50) NOT NULL COMMENT '身份证号',
                                   `name` varchar(100) NOT NULL COMMENT '姓名',
                                   `course_code` varchar(50) NOT NULL COMMENT '科目编码',
                                   `course_name` varchar(100) NOT NULL COMMENT '科目名称',
                                   `sex` varchar(5) DEFAULT NULL COMMENT '性别',
                                   `seat_number` varchar(20) DEFAULT NULL COMMENT '座位号',
                                   `create_time` bigint DEFAULT NULL COMMENT '创建时间',
                                   `exam_task_id` bigint DEFAULT NULL COMMENT '云阅卷同步考试任务id',
                                   `task_sync_result` tinyint DEFAULT NULL COMMENT '同步结果，0：未同步，1：已同步',
                                   `percent` double DEFAULT NULL COMMENT '检录数据匹配度',
                                   `registration_status` tinyint DEFAULT NULL COMMENT '检录状态',
                                   `exam_finish_status` varchar(30) DEFAULT NULL COMMENT '考试状态，FINISHED：已完成，UN_FINISHED：未完成',
                                   PRIMARY KEY (`id`),
                                   KEY `jk_exam_student_batch_id_IDX1` (`batch_id`,`stage_id`,`place_code`,`room_code`) USING BTREE,
                                   KEY `jk_exam_student_exam_code_IDX2` (`exam_code`,`ticket_no`,`course_code`) USING BTREE,
                                   KEY `jk_exam_student_exam_code_IDX3` (`exam_code`,`place_code`,`room_code`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='考务考生表';

-- ----------------------------
-- Table structure for jk_exam_student_additional
-- ----------------------------
DROP TABLE IF EXISTS `jk_exam_student_additional`;
CREATE TABLE `jk_exam_student_additional` (
                                              `id` bigint NOT NULL COMMENT '主键',
                                              `exam_code` varchar(30) NOT NULL COMMENT '考试编码',
                                              `student_id` bigint NOT NULL COMMENT '学生id',
                                              `course_code` varchar(30) NOT NULL COMMENT '科目编码',
                                              `course_name` varchar(100) NOT NULL COMMENT '科目名称',
                                              `data` mediumtext COMMENT '数据',
                                              `create_time` bigint DEFAULT NULL COMMENT '创建时间',
                                              PRIMARY KEY (`id`),
                                              KEY `jk_exam_student_additional_course_code_IDX` (`course_code`) USING BTREE,
                                              KEY `jk_exam_student_additional_exam_code_IDX` (`exam_code`,`student_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='考务考生附加信息表';

-- ----------------------------
-- Table structure for jk_exam_student_additional_temp
-- ----------------------------
DROP TABLE IF EXISTS `jk_exam_student_additional_temp`;
CREATE TABLE `jk_exam_student_additional_temp` (
                                                   `id` bigint NOT NULL COMMENT '主键',
                                                   `exam_code` varchar(30) NOT NULL COMMENT '考试编码',
                                                   `student_id` bigint NOT NULL COMMENT '学生id',
                                                   `course_code` varchar(30) NOT NULL COMMENT '科目编码',
                                                   `course_name` varchar(100) NOT NULL COMMENT '科目名称',
                                                   `data` mediumtext COMMENT '数据',
                                                   `create_time` bigint DEFAULT NULL COMMENT '创建时间',
                                                   `attachment_id` bigint DEFAULT NULL COMMENT '附件id',
                                                   PRIMARY KEY (`id`),
                                                   KEY `jk_exam_student_additional_temp_exam_code_IDX` (`exam_code`,`attachment_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='考务考生附加信息临时表';

-- ----------------------------
-- Table structure for jk_exam_student_answer
-- ----------------------------
DROP TABLE IF EXISTS `jk_exam_student_answer`;
CREATE TABLE `jk_exam_student_answer` (
                                          `id` bigint NOT NULL COMMENT '主键',
                                          `exam_code` varchar(30) NOT NULL COMMENT '考试编码',
                                          `is_abort` tinyint NOT NULL DEFAULT '0' COMMENT '是否异常，0：否，1：是',
                                          `is_absent` tinyint NOT NULL DEFAULT '0' COMMENT '是否缺考，0：未缺考，1：缺考',
                                          `is_cheat` tinyint NOT NULL DEFAULT '0' COMMENT '是否作弊，0：未作弊，1：作弊',
                                          `paper_id` varchar(50) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '试卷id',
                                          `paper_name` varchar(100) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '试卷名称',
                                          `objective_answer` mediumtext DEFAULT NULL COMMENT '客观题答案',
                                          `answer_time` mediumtext DEFAULT NULL COMMENT '答题时间',
                                          `answer_path` mediumtext DEFAULT NULL COMMENT '答题轨迹',
                                          `decode_file_id` bigint DEFAULT NULL COMMENT '附件id，解码之后的考场答案数据包(通用机考、优特机考)或者考生答案数据包(视唱机考)',
                                          `progress_type` varchar(30) DEFAULT NULL COMMENT '答案的提交方式，LOCAL：本地导入，REMOTE：监考端提交',
                                          `login_time` bigint DEFAULT NULL COMMENT '登录时间',
                                          `time` bigint DEFAULT NULL COMMENT '创建时间',
                                          `student_id` bigint NOT NULL COMMENT '学生id',
                                          `original_answer_id` bigint DEFAULT NULL COMMENT '原始答案数据包附件id',
                                          `exam_task_id` bigint DEFAULT NULL COMMENT '云阅卷同步考试任务id',
                                          `task_sync_result` tinyint DEFAULT NULL COMMENT '同步结果，0：未同步，1：已同步',
                                          PRIMARY KEY (`id`),
                                          KEY `jk_exam_student_answer_exam_code_IDX` (`exam_code`) USING BTREE,
                                          KEY `jk_exam_student_answer_paper_id_IDX` (`paper_id`) USING BTREE,
                                          KEY `jk_exam_student_answer_student_id_IDX` (`student_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='考生答案';

-- ----------------------------
-- Table structure for jk_exam_student_answer_history
-- ----------------------------
DROP TABLE IF EXISTS `jk_exam_student_answer_history`;
CREATE TABLE `jk_exam_student_answer_history` (
                                                  `id` bigint NOT NULL COMMENT '主键',
                                                  `exam_code` varchar(30) NOT NULL COMMENT '考试编码',
                                                  `is_abort` tinyint NOT NULL DEFAULT '0' COMMENT '是否异常，0：否，1：是',
                                                  `is_absent` tinyint NOT NULL DEFAULT '0' COMMENT '是否缺考，0：未缺考，1：缺考',
                                                  `is_cheat` tinyint NOT NULL DEFAULT '0' COMMENT '是否作弊，0：未作弊，1：作弊',
                                                  `paper_id` varchar(50) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '试卷id',
                                                  `paper_name` varchar(100) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '试卷名称',
                                                  `objective_answer` mediumtext DEFAULT NULL COMMENT '客观题答案',
                                                  `answer_time` mediumtext DEFAULT NULL COMMENT '答题时间',
                                                  `answer_path` mediumtext DEFAULT NULL COMMENT '答题轨迹',
                                                  `decode_file_id` bigint DEFAULT NULL COMMENT '附件id，解码之后的考场答案数据包(通用机考、优特机考)或者考生答案数据包(视唱机考)',
                                                  `login_time` bigint DEFAULT NULL COMMENT '登录时间',
                                                  `time` bigint DEFAULT NULL COMMENT '创建时间',
                                                  `student_id` bigint NOT NULL COMMENT '学生id',
                                                  `original_answer_id` bigint DEFAULT NULL COMMENT '原始答案数据包附件id',
                                                  PRIMARY KEY (`id`),
                                                  KEY `jk_exam_student_answer_history_exam_code_IDX` (`exam_code`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='考生历史答案';

-- ----------------------------
-- Table structure for jk_exam_student_temp
-- ----------------------------
DROP TABLE IF EXISTS `jk_exam_student_temp`;
CREATE TABLE `jk_exam_student_temp` (
                                        `id` bigint NOT NULL COMMENT '主键',
                                        `exam_code` varchar(30) NOT NULL COMMENT '考试编码',
                                        `batch_id` varchar(50) NOT NULL COMMENT '批次id',
                                        `batch_name` varchar(100) NOT NULL COMMENT '批次名称',
                                        `stage_id` varchar(50) NOT NULL COMMENT '场次id',
                                        `place_code` varchar(50) NOT NULL COMMENT '地方编码',
                                        `room_code` varchar(50) NOT NULL COMMENT '考场编码',
                                        `ticket_no` varchar(50) NOT NULL COMMENT '准考证号',
                                        `idcard` varchar(50) NOT NULL COMMENT '身份证号',
                                        `name` varchar(100) NOT NULL COMMENT '姓名',
                                        `course_code` varchar(50) NOT NULL COMMENT '科目编码',
                                        `course_name` varchar(100) NOT NULL COMMENT '科目名称',
                                        `sex` varchar(5) DEFAULT NULL COMMENT '性别',
                                        `seat_number` varchar(20) DEFAULT NULL COMMENT '座位号',
                                        `create_time` bigint DEFAULT NULL COMMENT '创建时间',
                                        `attachment_id` bigint DEFAULT NULL COMMENT '附件id',
                                        PRIMARY KEY (`id`),
                                        KEY `jk_exam_student_temp_course_code_IDX` (`course_code`) USING BTREE,
                                        KEY `jk_exam_student_temp_exam_code_IDX` (`exam_code`,`attachment_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='考务考生临时表';

-- ----------------------------
-- Table structure for jk_exam_task
-- ----------------------------
DROP TABLE IF EXISTS `jk_exam_task`;
CREATE TABLE `jk_exam_task` (
                                `id` bigint NOT NULL COMMENT '主键',
                                `exam_code` varchar(30) NOT NULL COMMENT '考试编码',
                                `type` varchar(30) CHARACTER SET utf8mb4 NOT NULL COMMENT '任务类型，SYNC_YUN_MARK：云阅卷同步',
                                `sync` tinyint NOT NULL DEFAULT '0' COMMENT '云阅卷是否同步，0：未同步，1：同步',
                                `result` varchar(30) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '云阅卷同步结果，SUCCESS：成功，ERROR：失败',
                                `count` int NOT NULL DEFAULT '0' COMMENT '云阅卷同步次数',
                                `status` varchar(30) NOT NULL COMMENT '任务状态，INIT：未开始，RUNNING：进行中，FINISH：已完成',
                                `summary` mediumtext CHARACTER SET utf8mb4 COMMENT '实时摘要信息',
                                `total_progress` double NOT NULL DEFAULT '0' COMMENT '总进度',
                                `progress` double NOT NULL DEFAULT '0' COMMENT '执行进度',
                                `complete_progress` int NOT NULL DEFAULT '0' COMMENT '已完成进度',
                                `report_file_path` varchar(100) DEFAULT NULL COMMENT '报告路径',
                                `create_time` bigint DEFAULT NULL COMMENT '创建时间',
                                `update_time` bigint DEFAULT NULL COMMENT '更新时间',
                                `create_user_id` bigint DEFAULT NULL COMMENT '创建人id',
                                `update_user_id` bigint DEFAULT NULL COMMENT '更新人id',
                                `remark` varchar(500) DEFAULT NULL COMMENT '备注',
                                `obj_name` varchar(100) DEFAULT NULL COMMENT '实体名称',
                                PRIMARY KEY (`id`),
                                KEY `jk_exam_task_exam_code_IDX` (`exam_code`) USING BTREE,
                                KEY `jk_exam_task_status_IDX` (`status`,`result`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='云阅卷同步考试任务';

-- ----------------------------
-- Table structure for jk_exam_third_org
-- ----------------------------
DROP TABLE IF EXISTS `jk_exam_third_org`;
CREATE TABLE `jk_exam_third_org` (
                                     `id` bigint NOT NULL COMMENT '主键',
                                     `name` varchar(100) DEFAULT NULL COMMENT '机构名称',
                                     `code` varchar(50) DEFAULT NULL COMMENT '机构编码',
                                     `start_time` bigint DEFAULT NULL COMMENT '开始时间',
                                     `end_time` bigint DEFAULT NULL COMMENT '结束时间',
                                     `enable` tinyint NOT NULL DEFAULT '1' COMMENT '是否启用，1：启用，0：禁用',
                                     `access_key` varchar(50) DEFAULT NULL COMMENT '外部访问凭证',
                                     `access_secret` varchar(50) DEFAULT NULL COMMENT '外部访问密钥',
                                     PRIMARY KEY (`id`),
                                     UNIQUE KEY `jk_exam_third_org_UN` (`code`),
                                     KEY `jk_exam_third_org_code_IDX` (`code`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='数据中心第三方机构';

-- ----------------------------
-- Table structure for jk_kj_original_file_history
-- ----------------------------
DROP TABLE IF EXISTS `jk_kj_original_file_history`;
CREATE TABLE `jk_kj_original_file_history` (
                                               `id` bigint NOT NULL COMMENT '主键',
                                               `exam_code` varchar(30) NOT NULL COMMENT '考试编码',
                                               `place_code` varchar(50) NOT NULL COMMENT '地方编码',
                                               `room_code` varchar(50) NOT NULL COMMENT '考场编码',
                                               `original_file_id` bigint DEFAULT NULL COMMENT '存储区答案包原始文件id',
                                               `time` bigint DEFAULT NULL COMMENT '创建时间',
                                               PRIMARY KEY (`id`),
                                               KEY `jk_kj_original_file_history_exam_code_IDX` (`exam_code`,`place_code`,`room_code`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='考生答案数据包历史记录';

-- ----------------------------
-- Table structure for jk_kj_upload_history
-- ----------------------------
DROP TABLE IF EXISTS `jk_kj_upload_history`;
CREATE TABLE `jk_kj_upload_history` (
                                        `id` bigint NOT NULL COMMENT '主键',
                                        `exam_code` varchar(30) NOT NULL COMMENT '考试编码',
                                        `place_code` varchar(50) NOT NULL COMMENT '地方编码',
                                        `student_id` bigint DEFAULT NULL COMMENT '学生id',
                                        `room_code` varchar(50) NOT NULL COMMENT '考场编码',
                                        `attachment_id` bigint DEFAULT NULL COMMENT '文件id',
                                        `time` bigint DEFAULT NULL COMMENT '创建时间',
                                        PRIMARY KEY (`id`),
                                        KEY `jk_kj_upload_history_exam_code_IDX` (`exam_code`,`place_code`,`room_code`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='考生答案数据包上传历史记录';

-- ----------------------------
-- Table structure for jk_kw_file
-- ----------------------------
DROP TABLE IF EXISTS `jk_kw_file`;
CREATE TABLE `jk_kw_file` (
                              `id` bigint NOT NULL COMMENT '主键',
                              `exam_code` varchar(30) NOT NULL COMMENT '考试编码',
                              `room_file_temp_id` bigint DEFAULT NULL COMMENT '考场临时文件id',
                              `room_file_id` bigint DEFAULT NULL COMMENT '转存的考点考场原始文件id',
                              `scene_score_file_id` bigint DEFAULT NULL COMMENT '标答以及评分规则文件id',
                              `scene_score_file_temp_id` bigint DEFAULT NULL COMMENT '标答以及评分规则文件临时id',
                              `student_file_temp_id` bigint DEFAULT NULL COMMENT '考生临时文件id',
                              `student_file_id` bigint DEFAULT NULL COMMENT '转存的考点考场考生文件id',
                              `paper_file_temp_id` bigint DEFAULT NULL COMMENT '试卷临时文件id',
                              `paper_file_id` bigint DEFAULT NULL COMMENT '转存的考点考场试卷文件id',
                              `student_additional_file_temp_id` bigint DEFAULT NULL COMMENT '考生附加信息临时文件id',
                              `student_additional_file_id` bigint DEFAULT NULL COMMENT '转存的考生信息附加文件id',
                              `paper_answer_file_id` bigint DEFAULT NULL COMMENT '试卷答案附件id',
                              `create_time` bigint DEFAULT NULL COMMENT '创建时间',
                              PRIMARY KEY (`id`),
                              UNIQUE KEY `jk_kw_file_UN` (`exam_code`),
                              KEY `jk_kw_file_exam_code_IDX` (`exam_code`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='考务文件对象';

-- ----------------------------
-- Table structure for jk_paper_uncoiling
-- ----------------------------
DROP TABLE IF EXISTS `jk_paper_uncoiling`;
CREATE TABLE `jk_paper_uncoiling` (
                                      `id` bigint NOT NULL COMMENT '主键',
                                      `exam_code` varchar(30) DEFAULT NULL COMMENT '考试编码',
                                      `batch_id` varchar(50) DEFAULT NULL COMMENT '批次id',
                                      `password` varchar(50) DEFAULT NULL COMMENT '密码',
                                      `time` bigint DEFAULT NULL COMMENT '导入时间',
                                      PRIMARY KEY (`id`),
                                      KEY `jk_paper_uncoiling_exam_code_IDX` (`exam_code`,`batch_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='试卷开卷功能';

-- ----------------------------
-- Table structure for jk_room_monitor_client_data
-- ----------------------------
DROP TABLE IF EXISTS `jk_room_monitor_client_data`;
CREATE TABLE `jk_room_monitor_client_data` (
                                               `id` bigint NOT NULL COMMENT '主键',
                                               `exam_code` varchar(30) DEFAULT NULL COMMENT '考试编码',
                                               `place_code` varchar(50) DEFAULT NULL COMMENT '地方编码',
                                               `place_name` varchar(100) DEFAULT NULL COMMENT '地方名称',
                                               `room_code` varchar(50) DEFAULT NULL COMMENT '考场编码',
                                               `room_name` varchar(100) DEFAULT NULL COMMENT '考场名称',
                                               `decode_file_id` bigint DEFAULT NULL COMMENT '解密之后的qm文件id',
                                               `name` varchar(100) DEFAULT NULL COMMENT '备份的数据文件名',
                                               `size` double DEFAULT NULL COMMENT '大小',
                                               `time` bigint DEFAULT NULL COMMENT '创建时间',
                                               `exam_plan_id` bigint DEFAULT NULL COMMENT '考试计划id',
                                               `exam_room_id` bigint DEFAULT NULL COMMENT '考点考场id',
                                               `upload` tinyint NOT NULL DEFAULT '0' COMMENT '是否上传，1：已上传，0：未上传',
                                               PRIMARY KEY (`id`),
                                               KEY `jk_room_monitor_client_data_exam_code_IDX` (`exam_code`,`place_code`,`room_code`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='监考端数据备份';

-- ----------------------------
-- Table structure for jk_room_monitor_client_log
-- ----------------------------
DROP TABLE IF EXISTS `jk_room_monitor_client_log`;
CREATE TABLE `jk_room_monitor_client_log` (
                                              `id` bigint NOT NULL COMMENT '主键',
                                              `exam_code` varchar(30) DEFAULT NULL COMMENT '考试编码',
                                              `place_code` varchar(50) DEFAULT NULL COMMENT '地方编码',
                                              `place_name` varchar(100) DEFAULT NULL COMMENT '地方名称',
                                              `room_code` varchar(50) DEFAULT NULL COMMENT '考场编码',
                                              `room_name` varchar(100) DEFAULT NULL COMMENT '考场名称',
                                              `decode_file_id` bigint DEFAULT NULL COMMENT '解密之后的qm文件id',
                                              `name` varchar(100) DEFAULT NULL COMMENT '日志文件名',
                                              `time` bigint DEFAULT NULL COMMENT '创建时间',
                                              `size` double DEFAULT NULL COMMENT '大小',
                                              `exam_plan_id` bigint DEFAULT NULL COMMENT '考试计划id',
                                              `upload` tinyint NOT NULL DEFAULT '0' COMMENT '是否上传，1：已上传，0：未上传',
                                              PRIMARY KEY (`id`),
                                              KEY `jk_room_monitor_client_log_exam_code_IDX` (`exam_code`,`place_code`,`room_code`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='监考端日志';

-- ----------------------------
-- Table structure for jk_solfege_kj_history
-- ----------------------------
DROP TABLE IF EXISTS `jk_solfege_kj_history`;
CREATE TABLE `jk_solfege_kj_history` (
                                         `id` bigint NOT NULL COMMENT '主键',
                                         `exam_code` varchar(30) NOT NULL COMMENT '考试编码',
                                         `ticket_no` varchar(50) DEFAULT NULL COMMENT '准考证号',
                                         `record_file_id` bigint DEFAULT NULL COMMENT '考试记录id',
                                         `result_dto` varchar(1000) DEFAULT NULL COMMENT '考试记录相关信息',
                                         `time` bigint DEFAULT NULL COMMENT '创建时间',
                                         PRIMARY KEY (`id`),
                                         KEY `jk_solfege_kj_history_exam_code_IDX` (`exam_code`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='视唱机考考生答案上传历史记录';

-- ----------------------------
-- Table structure for jk_student_info
-- ----------------------------
DROP TABLE IF EXISTS `jk_student_info`;
CREATE TABLE `jk_student_info` (
                                   `id` bigint NOT NULL COMMENT '主键',
                                   `exam_code` varchar(30) NOT NULL COMMENT '考试编码',
                                   `attachment_id` bigint DEFAULT NULL COMMENT '临时文件id',
                                   `ticket_number` varchar(30) DEFAULT NULL COMMENT '准考证号',
                                   `idno` varchar(50) DEFAULT NULL COMMENT '身份证号',
                                   `name` varchar(100) DEFAULT NULL COMMENT '姓名',
                                   `category` varchar(50) DEFAULT NULL COMMENT '学院',
                                   `student_id` bigint DEFAULT NULL COMMENT '学生id',
                                   `phone` varchar(50) DEFAULT NULL COMMENT '手机号',
                                   `school_name` varchar(100) DEFAULT NULL COMMENT '学校名称',
                                   `province` varchar(100) DEFAULT NULL COMMENT '省份',
                                   `city` varchar(100) DEFAULT NULL COMMENT '城市',
                                   `area` varchar(100) DEFAULT NULL COMMENT '地区',
                                   PRIMARY KEY (`id`),
                                   KEY `jk_student_info_exam_code_IDX` (`exam_code`,`ticket_number`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='学生信息表';

-- ----------------------------
-- Table structure for jk_student_info_temp
-- ----------------------------
DROP TABLE IF EXISTS `jk_student_info_temp`;
CREATE TABLE `jk_student_info_temp` (
                                        `id` bigint NOT NULL COMMENT '主键',
                                        `exam_code` varchar(30) NOT NULL COMMENT '考试编码',
                                        `attachment_id` bigint DEFAULT NULL COMMENT '临时文件id',
                                        `ticket_number` varchar(30) DEFAULT NULL COMMENT '准考证号',
                                        `idno` varchar(50) DEFAULT NULL COMMENT '身份证号',
                                        `name` varchar(100) DEFAULT NULL COMMENT '姓名',
                                        `category` varchar(50) DEFAULT NULL COMMENT '学院',
                                        `student_id` bigint DEFAULT NULL COMMENT '学生id',
                                        `phone` varchar(50) DEFAULT NULL COMMENT '手机号',
                                        `school_name` varchar(100) DEFAULT NULL COMMENT '学校名称',
                                        `province` varchar(100) DEFAULT NULL COMMENT '省份',
                                        `city` varchar(100) DEFAULT NULL COMMENT '城市',
                                        `area` varchar(100) DEFAULT NULL COMMENT '地区',
                                        PRIMARY KEY (`id`),
                                        KEY `jk_student_info_temp_exam_code_IDX` (`exam_code`,`ticket_number`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='学生信息临时表';

-- ----------------------------
-- Table structure for jk_sync_data
-- ----------------------------
DROP TABLE IF EXISTS `jk_sync_data`;
CREATE TABLE `jk_sync_data` (
                                `id` bigint NOT NULL COMMENT '主键',
                                `name` varchar(100) NOT NULL COMMENT '名称',
                                `code` varchar(100) NOT NULL COMMENT '编码',
                                `data` mediumtext COMMENT '数据',
                                `create_time` bigint DEFAULT NULL COMMENT '创建时间',
                                PRIMARY KEY (`id`),
                                KEY `jk_sync_data_code_IDX` (`code`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='机考同步数据';

-- ----------------------------
-- Table structure for jk_user
-- ----------------------------
DROP TABLE IF EXISTS `jk_user`;
CREATE TABLE `jk_user` (
                           `id` bigint NOT NULL COMMENT '主键',
                           `school_id` bigint NOT NULL COMMENT '学校id',
                           `user_name` varchar(100) NOT NULL COMMENT '姓名',
                           `role` varchar(30) NOT NULL COMMENT '角色，ADMIN：管理员，SUPER_ADMIN：超级管理员',
                           `real_name` varchar(100) DEFAULT NULL COMMENT '真实姓名',
                           `password` varchar(50) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '密码',
                           `create_time` bigint DEFAULT NULL COMMENT '创建时间',
                           PRIMARY KEY (`id`),
                           UNIQUE KEY `jk_user_UN` (`user_name`),
                           KEY `jk_user_user_name_IDX` (`user_name`,`school_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户表';

-- ----------------------------
-- Records of jk_user
-- ----------------------------
BEGIN;
INSERT INTO `jk_user` VALUES (1, -1, 'super', 'SUPER_ADMIN', '超级管理员', 'cW10aDg3ODYzNTc3', 1684458680817);
COMMIT;

-- ----------------------------
-- Table structure for jk_user_log
-- ----------------------------
DROP TABLE IF EXISTS `jk_user_log`;
CREATE TABLE `jk_user_log` (
                               `id` bigint NOT NULL COMMENT '主键',
                               `user_id` bigint NOT NULL COMMENT '用户id',
                               `login_time` bigint NOT NULL COMMENT '登录时间',
                               PRIMARY KEY (`id`),
                               KEY `jk_user_log_user_id_IDX` (`user_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户日志表';

-- ----------------------------
-- Table structure for sys_config
-- ----------------------------
DROP TABLE IF EXISTS `sys_config`;
CREATE TABLE `sys_config` (
                              `id` bigint NOT NULL COMMENT '主键',
                              `school_id` bigint DEFAULT NULL COMMENT '学校id',
                              `config_key` varchar(100) CHARACTER SET utf8mb4 NOT NULL COMMENT '参数键名',
                              `config_name` varchar(100) CHARACTER SET utf8mb4 NOT NULL COMMENT '参数名称',
                              `config_value` varchar(100) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '参数键值',
                              `remark` varchar(100) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '备注',
                              `enable` tinyint DEFAULT '1' COMMENT '是否启用，0：停用，1：启用',
                              `sort` int DEFAULT '1' COMMENT '排序',
                              `create_id` bigint DEFAULT NULL COMMENT '创建人',
                              `create_time` bigint DEFAULT NULL COMMENT '创建时间',
                              `update_id` bigint DEFAULT NULL COMMENT '更新人',
                              `update_time` bigint DEFAULT NULL COMMENT '更新时间',
                              PRIMARY KEY (`id`),
                              KEY `sys_config_school_id_IDX` (`school_id`,`config_key`,`config_name`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='参数表';

-- ----------------------------
-- Records of sys_config
-- ----------------------------
BEGIN;
INSERT INTO `sys_config` VALUES (1, NULL, 'thread.pool.core.size', '自定义线程池大小', '1', NULL, 1, 1, 1, NULL, NULL, NULL);
INSERT INTO `sys_config` VALUES (2, NULL, 'custom.thread.pool.core.size', '是否自定义线程池大小', 'false', NULL, 1, 1, 1, NULL, NULL, NULL);
INSERT INTO `sys_config` VALUES (3, NULL, 'jkserver.single', '是否是单实例部署', 'true', NULL, 1, 1, 1, NULL, NULL, NULL);
INSERT INTO `sys_config` VALUES (4, NULL, 'cloudmark.host.url', '云阅卷地址', 'http://192.168.10.224:80', NULL, 1, 1, 1, NULL, NULL, NULL);
INSERT INTO `sys_config` VALUES (5, NULL, 'sys.txt.charset', 'txt文件编码', 'UTF-8', NULL, 1, 1, 1, NULL, NULL, 1688028852099);
COMMIT;

-- ----------------------------
-- Table structure for t_g_error
-- ----------------------------
DROP TABLE IF EXISTS `t_g_error`;
CREATE TABLE `t_g_error` (
                             `id` bigint NOT NULL COMMENT '主键',
                             `school_id` bigint DEFAULT NULL COMMENT '学校id',
                             `org_id` bigint DEFAULT NULL COMMENT '机构id',
                             `obj_id` bigint DEFAULT NULL COMMENT '实体id',
                             `summary` mediumtext CHARACTER SET utf8mb4 COMMENT '实时摘要信息',
                             `create_time` bigint DEFAULT NULL COMMENT '创建时间',
                             PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='全局异常错误信息表';

-- ----------------------------
-- Table structure for t_s_auth
-- ----------------------------
DROP TABLE IF EXISTS `t_s_auth`;
CREATE TABLE `t_s_auth` (
                            `id` bigint NOT NULL COMMENT '主键',
                            `school_id` bigint DEFAULT NULL COMMENT '学校id',
                            `access_key` varchar(255) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT 'accessKey',
                            `access_secret` varchar(255) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT 'accessSecret',
                            `description` text CHARACTER SET utf8mb4 COMMENT '离线授权证书',
                            `type` varchar(16) CHARACTER SET utf8mb4 NOT NULL COMMENT '授权类型',
                            `create_id` bigint DEFAULT NULL COMMENT '创建人',
                            `create_time` bigint DEFAULT NULL COMMENT '创建时间',
                            `update_id` bigint DEFAULT NULL COMMENT '更新人',
                            `update_time` bigint DEFAULT NULL COMMENT '更新时间',
                            `expire_time` bigint DEFAULT NULL COMMENT '过期时间',
                            `file` mediumblob COMMENT '文件数据',
                            PRIMARY KEY (`id`),
                            KEY `t_s_auth_school_id_IDX` (`school_id`,`access_key`,`access_secret`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='激活授权配置表';