-- ----------------------------
-- Table structure for sys_log_longtext
-- ----------------------------
DROP TABLE IF EXISTS `sys_log_longtext`;
CREATE TABLE `sys_log_longtext`  (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `sys_id` bigint NULL DEFAULT NULL,
  `params` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '请求参数',
  `result` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '结果',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for sys_log_mediumtext
-- ----------------------------
DROP TABLE IF EXISTS `sys_log_mediumtext`;
CREATE TABLE `sys_log_mediumtext`  (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `sys_id` bigint NULL DEFAULT NULL,
  `params` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '请求参数',
  `result` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '结果',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `sys_id`(`sys_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for sys_log_text
-- ----------------------------
DROP TABLE IF EXISTS `sys_log_text`;
CREATE TABLE `sys_log_text`  (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `sys_id` bigint NULL DEFAULT NULL,
  `params` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '请求参数',
  `result` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '结果',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `sys_id`(`sys_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;



drop table if exists resources_question_snapshot;

/*==============================================================*/
/* Table: resources_question_snapshot                           */
/*==============================================================*/
create table resources_question_snapshot
(
    resources_question_snapshot_id bigint not null comment '题目快照ID',
    resources_question_snapshot_from_id bigint not null comment '来源ID',
    resources_question_snapshot_from_type varchar(100) not null comment '来源类型（HOMEWORK...）',
    course_info_id       bigint comment '课程ID',
    question_type        int(2) comment '题型(1单选 2多选 3判断)',
    question_score       decimal(3,1) comment '分值',
    question_stem        varchar(3000) comment '题干',
    question_option_a    varchar(1000) comment '选项A',
    question_option_b    varchar(1000) comment '选项B',
    question_option_c    varchar(1000) comment '选项C',
    question_option_d    varchar(1000) comment '选项D',
    question_option_e    varchar(1000) comment '选项E',
    question_answer      varchar(255) comment '答案（单选是一个 多选是多个 判断是对错）',
    question_analysis    varchar(3000) comment '解析',
    question_status      int(2) comment '题目状态 （1上架， 0下架）',
    user_id              bigint comment '后台用户ID',
    org_id               bigint comment '组织机构ID',
    primary key (resources_question_snapshot_id)
)
    auto_increment = 1
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8
COLLATE = utf8_general_ci;

alter table resources_question_snapshot comment '资源管理 - 题库管理-快照-关联来源';



ALTER TABLE hands_on ADD  COLUMN add_time datetime COMMENT '添加时间';
ALTER TABLE hands_on ADD  COLUMN org_id bigint(20) COMMENT '组织机构ID';
ALTER TABLE hands_on ADD  COLUMN user_id bigint(20) COMMENT '后台用户ID';
ALTER TABLE hands_on ADD  COLUMN training_data VARCHAR(1000) COMMENT '数据集（多个地址，逗号隔开）';

drop table if exists hands_on_achievement;
CREATE TABLE `hands_on_achievement` (
    `hand_on_achievement_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `hand_on_id` bigint(20) DEFAULT NULL COMMENT '实操项目ID',
    `class_id` bigint(20) DEFAULT NULL COMMENT '班级ID',
    `student_id` bigint(20) DEFAULT NULL COMMENT '学生ID',
    `video_score`  varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '观看视频得分',
    `ppt_score` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '观看PTT得分',
    `theory_score` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '理论测评得分',
    `practical_training_score` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '实训操作步骤得分',
    `report_writing_score` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '报告撰写得分',
    `total_score` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '合计得分',
    `hand_on_achievement_status` int(11) DEFAULT NULL COMMENT '状态(1正常 2删除)',
    `add_time` datetime(3) DEFAULT NULL COMMENT '添加时间',
    `org_id` bigint(20) DEFAULT NULL COMMENT '组织机构ID',
    `user_id` bigint(20) DEFAULT NULL COMMENT '后台用户ID',
    PRIMARY KEY (`hand_on_achievement_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=244 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='课程实操-实操成绩';

create table teacher_open_course_score_weight
(
    teacher_open_course_id bigint not null comment '课程id',
    teacher_id           bigint comment '老师id',
    sign_in_result       varchar(255) comment '签到成绩(权重)',
    chapter_contact_result varchar(255) comment '章节联系成绩(权重)',
    course_practice_result varchar(255) comment '课程实操成绩(权重)',
    homework_result      varchar(255) comment '作业成绩(权重)',
    examination_result   varchar(255) comment '考试成绩(权重)',
    interaction_result   varchar(255) comment '互动成绩(权重)',
    sign_in_result_setting varchar(255) comment '签到成绩设置1签到次数2到课到率',
    sign_in_score        varchar(255) comment '签到次数_每签到一次分数',
    chapter_contact_result_setting varchar(255) comment '章节联系设置1正确率积分2平均完成度计分',
    course_practice_result_setting varchar(255) comment '课程实操成绩设置1平均分2平均完成进度',
    homework_result_setting varchar(255) comment '作业成绩设置1平均分(默认1)',
    examination_result_setting varchar(255) comment '考试成绩设置1平均分(默认1)',
    interaction_result_setting varchar(255) comment '互动成绩设置1留言2提问3回答',
    interaction_result_message_score varchar(255) comment '互动成绩留言得分',
    interaction_result_question_score varchar(255) comment '互动成绩提问得分',
    interaction_result_answer_score varchar(255) comment '互动成绩回答得分',
    result_status_setting varchar(255) comment '成绩状态设置1二分法2等级法3字母法',
    dichotomy_score      varchar(255) comment '二分法分数',
    excellent_score      varchar(255) comment '等级法优秀分数',
    good_score           varchar(255) comment '等级法良好分数',
    secondary_score      varchar(255) comment '等级法中等分数',
    pass_score           varchar(255) comment '等级法及格分数',
    lettera_score        varchar(255) comment '字母法A分数',
    letterb_score        varchar(255) comment '字母法B分数',
    letterc_score        varchar(255) comment '字母法C分数',
    letterd_score        varchar(255) comment '字母法D分数',
    org_id               bigint comment '组织ID',
    user_id              bigint comment '用户ID',
    create_time          bigint comment '创建时间',
    primary key (teacher_open_course_id)
)
    auto_increment = 1
    ENGINE = InnoDB
    DEFAULT CHARACTER SET = utf8
    COLLATE = utf8_general_ci;

alter table teacher_open_course_score_weight comment '教师-我的课程-成绩权重';

ALTER TABLE teacher_open_course_score_dashboard ADD  COLUMN teacher_open_course_id bigint(20) COMMENT '课程开课ID';
