USE stmms_ms;

ALTER TABLE `paper`
    ADD COLUMN `first_collect_size` INT NULL COMMENT '首次采集原图大小（KB）' AFTER `is_admin_mark`,
    ADD COLUMN `size_abnormal` BIT(1) NULL DEFAULT 0 COMMENT '大小是否异常（1：异常）' AFTER `first_collect_size`;

CREATE TABLE `mark_task_self_check` (
       `id` BIGINT(10) NOT NULL,
       `work_id` BIGINT(10) NOT NULL COMMENT '工作ID',
       `subject` VARCHAR(10) NOT NULL COMMENT '科目',
       `task_id` BIGINT(10) NOT NULL COMMENT '评卷任务ID',
       `marker_id` BIGINT(10) NULL COMMENT '评卷员ID',
       `stage` INT(11) NULL COMMENT '阶段',
       `level` VARCHAR(1) NULL COMMENT '自查评卷档位',
       `level_value` INT(1) NULL COMMENT '档位值',
       `marking` BIT(1) NULL COMMENT '是否已评',
       `created_on` DATETIME NULL COMMENT '创建时间',
       `updated_on` DATETIME NULL COMMENT '修改时间',
       PRIMARY KEY (`id`),
       INDEX `ix_1` (`work_id` ASC, `task_id` ASC, `marker_id` ASC, `stage` ASC)
    ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '自查任务表';


CREATE TABLE `mark_task_marker_paper` (
         `id` BIGINT(10) NOT NULL AUTO_INCREMENT,
         `work_id` BIGINT(10) NOT NULL COMMENT '工作ID',
         `subject` VARCHAR(2) NOT NULL COMMENT '科目',
         `stage` INT(11) NULL COMMENT '阶段',
         `marker_id` BIGINT(10) NOT NULL COMMENT '评卷员ID',
         `task_id` BIGINT(10) NOT NULL COMMENT '评卷任务ID',
         PRIMARY KEY (`id`),
         INDEX `ix_1` (`work_id` ASC, `subject` ASC, `stage` ASC,  `marker_id` ASC)
        )ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '评卷员评卷任务表（自查）';


ALTER TABLE `marker_group_leader`
    ADD COLUMN `marking_count` INT(10) NULL DEFAULT 0 COMMENT '评卷数量（达到自查卷分发频率值时，清零后再自增。若频率值为0，继续累加）' AFTER `group_name`;
