/*
 Navicat Premium Data Transfer

 Source Server         : 127.0.0.1
 Source Server Type    : MySQL
 Source Server Version : 50717
 Source Host           : localhost:3306
 Source Schema         : aa

 Target Server Type    : MySQL
 Target Server Version : 50717
 File Encoding         : 65001

 Date: 06/09/2022 13:55:32
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for attachment
-- ----------------------------
DROP TABLE IF EXISTS `attachment`;
CREATE TABLE `attachment`  (
  `id` bigint(64) NOT NULL AUTO_INCREMENT,
  `work_id` bigint(20) NULL DEFAULT NULL,
  `subject` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `exam_number` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `file_path_local` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `file_name` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `file_type` varchar(8) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `file_ext` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `bucket` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `object_key` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `oss_name` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `oss_status` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `oss_fail_msg` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '上传oss失败原因',
  `delete_status` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `time` datetime(0) NOT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for change_level
-- ----------------------------
DROP TABLE IF EXISTS `change_level`;
CREATE TABLE `change_level`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `work_id` bigint(20) NULL DEFAULT NULL,
  `subject` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `stage` int(2) NULL DEFAULT NULL COMMENT '阶段',
  `paper_id` bigint(20) NULL DEFAULT NULL,
  `original_level` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '原档位',
  `audit_status` tinyint(1) NULL DEFAULT NULL COMMENT '改档审核：0-申请，1-同意，2-不同意',
  `create_id` bigint(20) NULL DEFAULT NULL COMMENT '申请改档用户id',
  `create_date` datetime(0) NULL DEFAULT NULL COMMENT '申请改档时间',
  `audit_id` bigint(20) NULL DEFAULT NULL COMMENT '审核用户id',
  `audit_date` datetime(0) NULL DEFAULT NULL COMMENT '审核时间',
  `suggest_level` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `is_curr` int(11) NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '改档记录表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for check_data
-- ----------------------------
DROP TABLE IF EXISTS `check_data`;
CREATE TABLE `check_data`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `work_id` bigint(20) NULL DEFAULT NULL COMMENT '工作ID',
  `check_item` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '数据校验类型',
  `param_value` int(3) NULL DEFAULT NULL COMMENT '变量值',
  `status` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `result` tinyint(1) NULL DEFAULT NULL COMMENT '是否校验通过（1：是，0：否）',
  `error_count` int(7) NULL DEFAULT 0 COMMENT '未通过数量（result=0时，数量大于0）',
  `content` mediumtext CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '校验不通过考生列表',
  `start_time` datetime(0) NULL DEFAULT NULL COMMENT '开始时间',
  `end_time` datetime(0) NULL DEFAULT NULL COMMENT '结束时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '数据校验日志' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for exam_question
-- ----------------------------
DROP TABLE IF EXISTS `exam_question`;
CREATE TABLE `exam_question`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `area_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `area_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `subject` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `work_id` bigint(20) NOT NULL,
  `is_test` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否试评,0:不是，1:数据已导入，2:试评中',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for exam_score_prop
-- ----------------------------
DROP TABLE IF EXISTS `exam_score_prop`;
CREATE TABLE `exam_score_prop`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `subject` varchar(50) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL COMMENT '科目',
  `exclude` varchar(100) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL COMMENT '打分阶段配置过滤档位(可选一个或多个档位，多个档位用\",\"号隔开)',
  `task_sort` varchar(50) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL COMMENT '打分阶段配置档位排序规则(可选random/paper，为paper时，score.level.exclude置为空)',
  `enable` bit(1) NULL DEFAULT b'0' COMMENT '打分阶段配置是否启用(为false则不启用打分阶段分档)，0：不启用，1：启用',
  `work_id` bigint(20) NULL DEFAULT NULL COMMENT '工作区id',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci COMMENT = '考试打分配置' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for inspect_range
-- ----------------------------
DROP TABLE IF EXISTS `inspect_range`;
CREATE TABLE `inspect_range`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `condition` int(11) NULL DEFAULT NULL,
  `enabled` bit(1) NULL DEFAULT NULL,
  `student_count` int(11) NULL DEFAULT NULL,
  `type` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `work_id` bigint(20) NULL DEFAULT NULL,
  `active` bit(1) NOT NULL,
  `editable` bit(1) NOT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for inspect_student
-- ----------------------------
DROP TABLE IF EXISTS `inspect_student`;
CREATE TABLE `inspect_student`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `exam_number` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `inspect_range_id` bigint(20) NOT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for inspect_task
-- ----------------------------
DROP TABLE IF EXISTS `inspect_task`;
CREATE TABLE `inspect_task`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `created_on` datetime(0) NULL DEFAULT NULL,
  `inspect_range_id` bigint(20) NOT NULL,
  `marker_id` bigint(20) NOT NULL,
  `marker_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `question_id` bigint(20) NULL DEFAULT NULL,
  `subject` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `updated_on` datetime(0) NULL DEFAULT NULL,
  `work_id` bigint(20) NOT NULL,
  `paper_id` bigint(20) NOT NULL,
  `level` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `score` int(11) NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `FK4e9mfahf522t4ej4y4yd065dh`(`paper_id`) USING BTREE,
  CONSTRAINT `FK4e9mfahf522t4ej4y4yd065dh` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `inspect_task_ibfk_1` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `inspect_task_ibfk_10` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `inspect_task_ibfk_11` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `inspect_task_ibfk_12` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `inspect_task_ibfk_13` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `inspect_task_ibfk_14` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `inspect_task_ibfk_15` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `inspect_task_ibfk_16` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `inspect_task_ibfk_2` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `inspect_task_ibfk_3` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `inspect_task_ibfk_4` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `inspect_task_ibfk_5` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `inspect_task_ibfk_6` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `inspect_task_ibfk_7` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `inspect_task_ibfk_8` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `inspect_task_ibfk_9` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for level
-- ----------------------------
DROP TABLE IF EXISTS `level`;
CREATE TABLE `level`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `interval_score` int(11) NOT NULL,
  `level_type` int(11) NULL DEFAULT NULL,
  `level_value` int(11) NOT NULL,
  `max_score` int(11) NOT NULL,
  `min_score` int(11) NOT NULL,
  `pt` int(11) NOT NULL,
  `score_list` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `weight` int(11) NOT NULL,
  `work_id` bigint(20) NULL DEFAULT NULL,
  `kdpt` int(11) NOT NULL,
  `rough_code` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '粗分档档位',
  `rough_weight` int(11) NULL DEFAULT NULL COMMENT '粗分档典型值',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `idx_level_workId_code`(`work_id`, `code`) USING BTREE,
  CONSTRAINT `FK3km0g7jbkt78oj20csqeh26f2` FOREIGN KEY (`work_id`) REFERENCES `work` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `level_ibfk_1` FOREIGN KEY (`work_id`) REFERENCES `work` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `level_ibfk_10` FOREIGN KEY (`work_id`) REFERENCES `work` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `level_ibfk_11` FOREIGN KEY (`work_id`) REFERENCES `work` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `level_ibfk_12` FOREIGN KEY (`work_id`) REFERENCES `work` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `level_ibfk_13` FOREIGN KEY (`work_id`) REFERENCES `work` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `level_ibfk_14` FOREIGN KEY (`work_id`) REFERENCES `work` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `level_ibfk_15` FOREIGN KEY (`work_id`) REFERENCES `work` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `level_ibfk_16` FOREIGN KEY (`work_id`) REFERENCES `work` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `level_ibfk_2` FOREIGN KEY (`work_id`) REFERENCES `work` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `level_ibfk_3` FOREIGN KEY (`work_id`) REFERENCES `work` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `level_ibfk_4` FOREIGN KEY (`work_id`) REFERENCES `work` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `level_ibfk_5` FOREIGN KEY (`work_id`) REFERENCES `work` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `level_ibfk_6` FOREIGN KEY (`work_id`) REFERENCES `work` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `level_ibfk_7` FOREIGN KEY (`work_id`) REFERENCES `work` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `level_ibfk_8` FOREIGN KEY (`work_id`) REFERENCES `work` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `level_ibfk_9` FOREIGN KEY (`work_id`) REFERENCES `work` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for mark_log
-- ----------------------------
DROP TABLE IF EXISTS `mark_log`;
CREATE TABLE `mark_log`  (
 `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
 `work_id` bigint(20) NULL DEFAULT NULL COMMENT '考区id',
 `work_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
 `paper_id` bigint(20) NULL DEFAULT NULL COMMENT '试卷id',
 `subject` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '科目',
 `stage` bigint(20) NULL DEFAULT NULL COMMENT '试卷阶段，0：初始，1：分档，2：打分',
 `exam_number` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '准考证号',
 `student_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '学生姓名',
 `create_user_id` bigint(20) NULL DEFAULT NULL COMMENT '操作人id',
 `create_user_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '操作人名字',
 `create_role` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '操作人角色',
 `oper_type` int(11) NULL DEFAULT NULL COMMENT '操作类型，1：分档，2：打分，3：回评档位，4：回评分数，5：档位打回，6：档位打回回评，7：一键定档，8：标准卷设置',
 `oper_data_before` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '操作前数据',
 `oper_data_after` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '操作后数据',
 `remark` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
 `create_time` datetime(0) NULL DEFAULT NULL COMMENT '操作时间',
 `login_time` datetime(0) NULL DEFAULT NULL COMMENT '登录时间（采集专用）',
 `logout_time` datetime(0) NULL DEFAULT NULL COMMENT '登出时间（采集专用）',
 PRIMARY KEY (`id`) USING BTREE,
 INDEX `union_001_index`(`create_user_id`, `oper_type`, `subject`, `exam_number`) USING BTREE,
 INDEX `idx_union_2`(`work_id`, `paper_id`, `oper_type`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '操作日志' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for mark_subject
-- ----------------------------
DROP TABLE IF EXISTS `mark_subject`;
CREATE TABLE `mark_subject`  (
  `id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `work_id` bigint(20) NULL DEFAULT NULL,
  `collect_config` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `stage` int(11) NULL DEFAULT NULL,
  `total_score` int(11) NOT NULL,
  `sample_count` int(11) NOT NULL DEFAULT 100,
  `is_test` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否试评,0:不是，1:数据已导入，2:试评中',
  `all_level` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否全部根据档位分配完，0:不是，1:是',
  `enable` tinyint(1) NULL DEFAULT 1 COMMENT '是否启用 0：禁用 1：启用',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `FK1tvc2mil1ebqgt08912t4hxqw`(`work_id`) USING BTREE,
  CONSTRAINT `FK1tvc2mil1ebqgt08912t4hxqw` FOREIGN KEY (`work_id`) REFERENCES `work` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_subject_ibfk_1` FOREIGN KEY (`work_id`) REFERENCES `work` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_subject_ibfk_10` FOREIGN KEY (`work_id`) REFERENCES `work` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_subject_ibfk_11` FOREIGN KEY (`work_id`) REFERENCES `work` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_subject_ibfk_12` FOREIGN KEY (`work_id`) REFERENCES `work` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_subject_ibfk_13` FOREIGN KEY (`work_id`) REFERENCES `work` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_subject_ibfk_14` FOREIGN KEY (`work_id`) REFERENCES `work` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_subject_ibfk_15` FOREIGN KEY (`work_id`) REFERENCES `work` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_subject_ibfk_16` FOREIGN KEY (`work_id`) REFERENCES `work` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_subject_ibfk_2` FOREIGN KEY (`work_id`) REFERENCES `work` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_subject_ibfk_3` FOREIGN KEY (`work_id`) REFERENCES `work` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_subject_ibfk_4` FOREIGN KEY (`work_id`) REFERENCES `work` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_subject_ibfk_5` FOREIGN KEY (`work_id`) REFERENCES `work` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_subject_ibfk_6` FOREIGN KEY (`work_id`) REFERENCES `work` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_subject_ibfk_7` FOREIGN KEY (`work_id`) REFERENCES `work` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_subject_ibfk_8` FOREIGN KEY (`work_id`) REFERENCES `work` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_subject_ibfk_9` FOREIGN KEY (`work_id`) REFERENCES `work` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for mark_task_job
-- ----------------------------
DROP TABLE IF EXISTS `mark_task_job`;
CREATE TABLE `mark_task_job`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `data_object` varchar(4000) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL COMMENT 'object',
  `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
  `status` bit(1) NULL DEFAULT b'0' COMMENT '状态，0：未记录，1：已记录',
  `work_id` bigint(20) NULL DEFAULT NULL COMMENT '工作区id',
  `version` int(11) NULL DEFAULT 0 COMMENT '版本号',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci COMMENT = '定时任务调度表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for mark_task_level
-- ----------------------------
DROP TABLE IF EXISTS `mark_task_level`;
CREATE TABLE `mark_task_level`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `work_id` bigint(20) NOT NULL,
  `paper_id` bigint(20) NOT NULL,
  `is_rejected` bit(1) NOT NULL,
  `level_value` int(11) NULL DEFAULT NULL,
  `marker_id` bigint(20) NOT NULL,
  `marker_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `origin_level` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `question_id` bigint(20) NULL DEFAULT NULL,
  `result` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `level` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '最终档位（和paper表中level一致）',
  `stage` int(11) NOT NULL,
  `subject` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `created_on` datetime(0) NULL DEFAULT NULL,
  `updated_on` datetime(0) NULL DEFAULT NULL,
  `random_seq` int(11) NULL DEFAULT NULL,
  `secret_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `random_seq_new` bigint(20) NULL DEFAULT NULL COMMENT '随机号',
  `is_active` bit(1) NULL DEFAULT b'0' COMMENT '是否激活',
  `is_test` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否试评,0:不是，1:数据已导入，2:试评中',
  `batch_no` bigint(45) NULL DEFAULT NULL COMMENT '批次号',
  `is_change_stage` tinyint(1) NULL DEFAULT NULL COMMENT '是否改档',
  `serial_number` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '叫号序号',
  `display_number` int(11) NULL DEFAULT NULL,
  `is_sample` bit(1) NULL DEFAULT NULL COMMENT '是否标准卷',
  `deviation_direction` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '偏差方向',
  `is_mark` bit(1) NULL DEFAULT b'0' COMMENT '是否标记',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `idx_mark_task_paper_id`(`paper_id`) USING BTREE,
  INDEX `question_id`(`question_id`, `marker_id`, `stage`, `result`, `is_rejected`, `random_seq`, `random_seq_new`) USING BTREE,
  INDEX `idx_union_1`(`marker_id`, `stage`, `result`, `random_seq`, `random_seq_new`) USING BTREE,
  CONSTRAINT `FKq15ptavipihjxg24fo2hnuaiy` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_task_level_ibfk_1` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_task_level_ibfk_10` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_task_level_ibfk_11` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_task_level_ibfk_12` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_task_level_ibfk_13` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_task_level_ibfk_14` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_task_level_ibfk_15` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_task_level_ibfk_16` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_task_level_ibfk_2` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_task_level_ibfk_3` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_task_level_ibfk_4` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_task_level_ibfk_5` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_task_level_ibfk_6` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_task_level_ibfk_7` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_task_level_ibfk_8` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_task_level_ibfk_9` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for mark_task_rough_level
-- ----------------------------
DROP TABLE IF EXISTS `mark_task_rough_level`;
CREATE TABLE `mark_task_rough_level`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `work_id` bigint(20) NOT NULL,
  `paper_id` bigint(20) NOT NULL,
  `is_rejected` bit(1) NOT NULL,
  `level_value` int(11) NULL DEFAULT NULL,
  `marker_id` bigint(20) NOT NULL,
  `marker_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `origin_level` int(11) NULL DEFAULT NULL,
  `question_id` bigint(20) NULL DEFAULT NULL,
  `result` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `level` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '最终档位（和paper表中level一致）',
  `stage` int(11) NOT NULL,
  `subject` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `created_on` datetime(0) NULL DEFAULT NULL,
  `updated_on` datetime(0) NULL DEFAULT NULL,
  `random_seq` int(11) NULL DEFAULT NULL,
  `secret_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `random_seq_new` bigint(20) NULL DEFAULT NULL COMMENT '随机号',
  `is_active` bit(1) NULL DEFAULT b'0' COMMENT '是否激活',
  `is_test` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否试评,0:不是，1:数据已导入，2:试评中',
  `batch_no` bigint(45) NULL DEFAULT NULL COMMENT '批次号',
  `is_change_stage` tinyint(1) NULL DEFAULT NULL COMMENT '是否改档',
  `serial_number` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '叫号序号',
  `display_number` int(11) NULL DEFAULT NULL,
  `is_sample` bit(1) NULL DEFAULT NULL COMMENT '是否标准卷',
  `deviation_direction` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '偏差方向',
  `is_mark` bit(1) NULL DEFAULT b'0' COMMENT '是否标记',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `idx_mark_task_paper_id`(`paper_id`) USING BTREE,
  INDEX `question_id`(`question_id`, `marker_id`, `stage`, `result`, `is_rejected`, `random_seq`, `random_seq_new`) USING BTREE,
  INDEX `idx_union_1`(`marker_id`, `stage`, `result`, `random_seq`, `random_seq_new`) USING BTREE,
  CONSTRAINT `FKg9qn80erklpyev237eux96hkr` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_task_rough_level_ibfk_1` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_task_rough_level_ibfk_10` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_task_rough_level_ibfk_11` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_task_rough_level_ibfk_12` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_task_rough_level_ibfk_13` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_task_rough_level_ibfk_14` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_task_rough_level_ibfk_15` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_task_rough_level_ibfk_16` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_task_rough_level_ibfk_2` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_task_rough_level_ibfk_3` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_task_rough_level_ibfk_4` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_task_rough_level_ibfk_5` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_task_rough_level_ibfk_6` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_task_rough_level_ibfk_7` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_task_rough_level_ibfk_8` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_task_rough_level_ibfk_9` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for mark_task_score
-- ----------------------------
DROP TABLE IF EXISTS `mark_task_score`;
CREATE TABLE `mark_task_score`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `work_id` bigint(20) NOT NULL,
  `paper_id` bigint(20) NOT NULL,
  `is_rejected` bit(1) NOT NULL,
  `level_value` int(11) NULL DEFAULT NULL,
  `marker_id` bigint(20) NOT NULL,
  `marker_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `origin_level` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `question_id` bigint(20) NULL DEFAULT NULL,
  `result` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `level` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '最终档位（和paper表中level一致）',
  `stage` int(11) NOT NULL,
  `subject` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `created_on` datetime(0) NULL DEFAULT NULL,
  `updated_on` datetime(0) NULL DEFAULT NULL,
  `random_seq` int(11) NULL DEFAULT NULL,
  `secret_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `random_seq_new` bigint(20) NULL DEFAULT NULL COMMENT '随机号',
  `is_active` bit(1) NULL DEFAULT b'0' COMMENT '是否激活',
  `is_test` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否试评,0:不是，1:数据已导入，2:试评中',
  `batch_no` bigint(45) NULL DEFAULT NULL COMMENT '批次号',
  `is_change_stage` tinyint(1) NULL DEFAULT NULL COMMENT '是否改档',
  `serial_number` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '叫号序号',
  `display_number` int(11) NULL DEFAULT NULL,
  `is_sample` bit(1) NULL DEFAULT NULL COMMENT '是否标准卷',
  `deviation_direction` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '偏差方向',
  `is_mark` bit(1) NULL DEFAULT b'0' COMMENT '是否标记',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `idx_mark_task_paper_id`(`paper_id`) USING BTREE,
  INDEX `question_id`(`question_id`, `marker_id`, `stage`, `result`, `is_rejected`, `random_seq`, `random_seq_new`) USING BTREE,
  INDEX `idx_union_1`(`marker_id`, `stage`, `result`, `random_seq`, `random_seq_new`) USING BTREE,
  CONSTRAINT `FK9sftme2i9tse0k40ulrsk8u6j` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_task_score_ibfk_1` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_task_score_ibfk_10` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_task_score_ibfk_11` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_task_score_ibfk_12` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_task_score_ibfk_13` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_task_score_ibfk_14` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_task_score_ibfk_15` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_task_score_ibfk_16` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_task_score_ibfk_2` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_task_score_ibfk_3` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_task_score_ibfk_4` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_task_score_ibfk_5` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_task_score_ibfk_6` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_task_score_ibfk_7` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_task_score_ibfk_8` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_task_score_ibfk_9` FOREIGN KEY (`paper_id`) REFERENCES `paper` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for mark_user
-- ----------------------------
DROP TABLE IF EXISTS `mark_user`;
CREATE TABLE `mark_user`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `work_id` bigint(20) NOT NULL,
  `subject` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `role` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `enabled` bit(1) NOT NULL,
  `login_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `pw_changed_count` int(11) NOT NULL,
  `session_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `group_id` bigint(20) NULL DEFAULT NULL,
  `mark_right` int(11) NULL DEFAULT NULL,
  `inspect_sc` bit(1) NULL DEFAULT NULL,
  `inspect_sm` bit(1) NULL DEFAULT NULL,
  `inspect_sx` bit(1) NULL DEFAULT NULL,
  `weight` double NULL DEFAULT NULL,
  `one_click_level` bit(1) NULL DEFAULT b'0' COMMENT '科组长是否开启一键定档',
  `standard_volume` bit(1) NOT NULL,
  `level_callback` bit(1) NOT NULL,
  `leader_confirm` bit(1) NULL DEFAULT NULL COMMENT '科组长打回、定档是否要确认',
  `display_count` int(1) NULL DEFAULT NULL COMMENT '显示数量：4-4张显示，6-6张显示，8-8张显示',
  `default_account` tinyint(1) NULL DEFAULT NULL COMMENT '是否默认账号（采集账号）',
  `last_login_time` datetime(0) NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `UK_cyf7k1neuij8lma85x19omo07`(`login_name`) USING BTREE,
  INDEX `FKinr4i9gbxj9njwo82s7cc89q5`(`group_id`) USING BTREE,
  CONSTRAINT `FKinr4i9gbxj9njwo82s7cc89q5` FOREIGN KEY (`group_id`) REFERENCES `marker_group` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_user_ibfk_1` FOREIGN KEY (`group_id`) REFERENCES `marker_group` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_user_ibfk_10` FOREIGN KEY (`group_id`) REFERENCES `marker_group` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_user_ibfk_11` FOREIGN KEY (`group_id`) REFERENCES `marker_group` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_user_ibfk_12` FOREIGN KEY (`group_id`) REFERENCES `marker_group` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_user_ibfk_13` FOREIGN KEY (`group_id`) REFERENCES `marker_group` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_user_ibfk_14` FOREIGN KEY (`group_id`) REFERENCES `marker_group` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_user_ibfk_15` FOREIGN KEY (`group_id`) REFERENCES `marker_group` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_user_ibfk_16` FOREIGN KEY (`group_id`) REFERENCES `marker_group` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_user_ibfk_17` FOREIGN KEY (`group_id`) REFERENCES `marker_group` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_user_ibfk_2` FOREIGN KEY (`group_id`) REFERENCES `marker_group` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_user_ibfk_3` FOREIGN KEY (`group_id`) REFERENCES `marker_group` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_user_ibfk_4` FOREIGN KEY (`group_id`) REFERENCES `marker_group` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_user_ibfk_5` FOREIGN KEY (`group_id`) REFERENCES `marker_group` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_user_ibfk_6` FOREIGN KEY (`group_id`) REFERENCES `marker_group` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_user_ibfk_7` FOREIGN KEY (`group_id`) REFERENCES `marker_group` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_user_ibfk_8` FOREIGN KEY (`group_id`) REFERENCES `marker_group` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `mark_user_ibfk_9` FOREIGN KEY (`group_id`) REFERENCES `marker_group` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for marker_group
-- ----------------------------
DROP TABLE IF EXISTS `marker_group`;
CREATE TABLE `marker_group`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `work_id` bigint(20) NOT NULL,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `subject` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `stage` int(1) NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for marker_group_leader
-- ----------------------------
DROP TABLE IF EXISTS `marker_group_leader`;
CREATE TABLE `marker_group_leader`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `work_id` bigint(20) NOT NULL COMMENT '工作ID',
  `subject` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '科目',
  `stage` int(11) NOT NULL COMMENT '阶段',
  `mark_leader_id` bigint(20) NULL DEFAULT NULL COMMENT '科组长ID',
  `marker_id` bigint(20) NULL DEFAULT NULL COMMENT '评卷员ID',
  `group_id` bigint(20) NOT NULL,
  `group_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for marker_group_student
-- ----------------------------
DROP TABLE IF EXISTS `marker_group_student`;
CREATE TABLE `marker_group_student`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `work_id` bigint(20) NOT NULL,
  `subject` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `stage` int(1) NOT NULL COMMENT '所属阶段',
  `group_id` bigint(20) NOT NULL COMMENT '分组ID',
  `paper_id` bigint(20) NULL DEFAULT NULL COMMENT '试卷ID',
  `question_id` bigint(20) NULL DEFAULT NULL COMMENT '考区ID',
  `exam_number` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `area_code` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `area_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `exam_room` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `school` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `source_name` varchar(225) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '生源地',
  `batch_no` bigint(20) NULL DEFAULT NULL COMMENT '批次号',
  `used` tinyint(1) NULL DEFAULT NULL COMMENT '已否已发任务',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for message
-- ----------------------------
DROP TABLE IF EXISTS `message`;
CREATE TABLE `message`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `work_id` bigint(20) NULL DEFAULT NULL COMMENT '工作ID',
  `subject` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '科目',
  `stage` int(2) NULL DEFAULT NULL COMMENT '阶段',
  `send_user_id` bigint(20) NULL DEFAULT NULL COMMENT '发件人ID',
  `send_user_name` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '发件人名称',
  `content` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '消息内容',
  `receive_user` mediumtext CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '收件人集合json',
  `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '消息管理' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for message_receive
-- ----------------------------
DROP TABLE IF EXISTS `message_receive`;
CREATE TABLE `message_receive`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `message_id` bigint(20) NULL DEFAULT NULL,
  `receive_user_id` bigint(20) NULL DEFAULT NULL,
  `is_read` tinyint(1) NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `FKsg879qydqr4dx6r0khxfkkick`(`message_id`) USING BTREE,
  CONSTRAINT `FKsg879qydqr4dx6r0khxfkkick` FOREIGN KEY (`message_id`) REFERENCES `message` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `message_receive_ibfk_1` FOREIGN KEY (`message_id`) REFERENCES `message` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '消息发送的用户' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for paper
-- ----------------------------
DROP TABLE IF EXISTS `paper`;
CREATE TABLE `paper`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `work_id` bigint(20) NOT NULL,
  `subject` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `exam_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `student_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `area_code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `is_arbitrated` bit(1) NOT NULL,
  `is_manual` bit(1) NOT NULL,
  `is_rejected` bit(1) NOT NULL,
  `is_tagged` bit(1) NOT NULL,
  `level` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `mark_by_leader` bit(1) NOT NULL,
  `marked_logic` bit(1) NOT NULL,
  `question_id` bigint(20) NOT NULL,
  `question_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `redo_level` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `score` double NULL DEFAULT NULL,
  `secret_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `updated_on` datetime(0) NULL DEFAULT NULL,
  `uploaded_count` int(11) NOT NULL,
  `uploaded_on` datetime(0) NULL DEFAULT NULL,
  `inspect_range` bigint(20) NULL DEFAULT NULL,
  `inspect_score` double NULL DEFAULT NULL,
  `source_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `inspect_level` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `inspector` bigint(20) NULL DEFAULT NULL,
  `is_rough_sample` bit(1) NULL DEFAULT NULL COMMENT '粗分档标准卷',
  `is_sample` bit(1) NOT NULL,
  `sheet_md5` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `slice_md5` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `random_seq` bigint(20) NULL DEFAULT NULL COMMENT '随机号',
  `is_missing` bit(1) NOT NULL,
  `exam_room` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `is_test` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否试评,0:不是，1:数据已导入，2:试评中',
  `rough_batch_no` bigint(45) NULL DEFAULT NULL COMMENT '粗分档批次号',
  `batch_no` bigint(45) NULL DEFAULT NULL COMMENT '批次号',
  `score_batch_no` bigint(45) NULL DEFAULT NULL COMMENT '打分任务发布批次号',
  `is_shift` bit(1) NULL DEFAULT b'0' COMMENT '是否改档',
  `is_shift_score` bit(1) NULL DEFAULT b'0' COMMENT '是否改档打分',
  `is_rough_one_click` bit(1) NULL DEFAULT b'0',
  `is_one_click` bit(1) NULL DEFAULT b'0' COMMENT '是否一键定档',
  `is_rejected_by_leader` bit(1) NULL DEFAULT b'0' COMMENT '是否科组长打回',
  `is_relate` bit(1) NULL DEFAULT b'0' COMMENT '是否关联试卷',
  `sort_num` int(11) NULL DEFAULT 0 COMMENT '排序值',
  `scan_user_id` bigint(20) NULL DEFAULT NULL COMMENT '采集员ID',
  `is_mark` bit(1) NULL DEFAULT b'0' COMMENT '是否标记',
  `rough_level` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `redo_rough_level` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `is_admin_mark` bit(1) NULL DEFAULT b'0' COMMENT '管理员标记',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `idx_paper_exam_number`(`exam_number`) USING BTREE,
  INDEX `idx_union_1`(`batch_no`) USING BTREE,
  INDEX `idx_union_4`(`is_shift`, `is_shift_score`) USING BTREE,
  INDEX `idx_union_3`(`work_id`, `subject`, `batch_no`) USING BTREE,
  INDEX `idx_union_5`(`work_id`, `subject`, `score_batch_no`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for param_setting
-- ----------------------------
DROP TABLE IF EXISTS `param_setting`;
CREATE TABLE `param_setting`  (
  `id` bigint(10) NOT NULL AUTO_INCREMENT,
  `work_id` bigint(10) NULL DEFAULT NULL COMMENT '工作id',
  `collect_config` mediumtext CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '采集规则参数',
  `level_config` mediumtext CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '细分档规则参数',
  `rough_level_config` mediumtext CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '粗分档规则参数',
  `score_config` mediumtext CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '打分规则参数',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '参数设置' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for student
-- ----------------------------
DROP TABLE IF EXISTS `student`;
CREATE TABLE `student`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `work_id` bigint(20) NULL DEFAULT NULL,
  `exam_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `area_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `area_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `exam_room` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `school` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '学校',
  `is_absent` bit(1) NOT NULL,
  `upload_status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `source_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `relate_exam_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '关联考号',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `exam_number`(`exam_number`, `work_id`) USING BTREE,
  INDEX `idx_student_name`(`name`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for task_publish_setting
-- ----------------------------
DROP TABLE IF EXISTS `task_publish_setting`;
CREATE TABLE `task_publish_setting`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `work_id` bigint(20) NULL DEFAULT NULL,
  `question_id` bigint(45) NULL DEFAULT NULL COMMENT '考区',
  `subject` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `code` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '档位',
  `total_count` int(11) NULL DEFAULT NULL COMMENT '总数量',
  `success_count` int(11) NULL DEFAULT NULL COMMENT '已评数量',
  `wait_count` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '待评数量',
  `sort_rule` tinyint(1) NULL DEFAULT NULL COMMENT '排序规则：0-乱序，1-定序',
  `display_number` tinyint(1) NULL DEFAULT NULL COMMENT '是否显示序号：0-否，1-是',
  `task_count` int(11) NULL DEFAULT NULL COMMENT '本次任务数',
  `batch_no` bigint(45) NULL DEFAULT NULL,
  `publish_count` int(3) NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '发布打分任务' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for work
-- ----------------------------
DROP TABLE IF EXISTS `work`;
CREATE TABLE `work`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `active` bit(1) NOT NULL,
  `created_on` date NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

SET FOREIGN_KEY_CHECKS = 1;
