-- 2024-06-05
CREATE TABLE obe_course_outline (
    id BIGINT(20) NOT NULL COMMENT '课程大纲表id',
    culture_program_id BIGINT(20) NOT NULL COMMENT '培养方案id',
    name VARCHAR(255) NOT NULL COMMENT '课程大纲名称',
    semester_id BIGINT(20) NOT NULL COMMENT '修读学期id',
    course_id BIGINT(20) NOT NULL,
    evaluation_mode VARCHAR(32) NOT NULL COMMENT '考核方式',
    course_type VARCHAR(32) NOT NULL COMMENT '课程类别',
    user_id BIGINT(20) NOT NULL COMMENT '课程大纲责任人',
    create_id BIGINT(20) NULL COMMENT '创建人',
    create_time BIGINT(20) NULL COMMENT '创建时间',
    update_id BIGINT(20) NULL COMMENT '更新人',
    update_time BIGINT(20) NULL COMMENT '更新时间',
    PRIMARY KEY (id))
COMMENT = '课程大纲表';

-- 2024-06-06
ALTER TABLE obe_course_outline
    ADD UNIQUE INDEX obe_course_outline_unique (culture_program_id ASC, name ASC);
;

ALTER TABLE obe_course_outline
    ADD COLUMN weight_setting TINYINT(1) NULL COMMENT '权重设置' AFTER user_id,
    ADD COLUMN weight_setting_sign BIGINT NULL COMMENT '课程权重设置标识' AFTER weight_setting,
    ADD COLUMN dimension_sign BIGINT NULL COMMENT '知识点标识' AFTER weight_setting_sign;


ALTER TABLE course_dimension
    DROP COLUMN user_id,
    DROP COLUMN course_code,
    DROP COLUMN exam_id,
    DROP COLUMN semester_id,
    CHANGE COLUMN teach_course_id obe_course_outline_id BIGINT NOT NULL COMMENT '课程大纲id' ;
ALTER TABLE course_dimension
    RENAME TO  obe_course_dimension ;

ALTER TABLE obe_course_outline
    ADD COLUMN school_id BIGINT NOT NULL COMMENT '学校id' AFTER culture_program_id;

ALTER TABLE course_target
    DROP COLUMN user_id,
    DROP COLUMN course_code,
    DROP COLUMN exam_id,
    CHANGE COLUMN teach_course_id obe_course_outline_id BIGINT NOT NULL COMMENT '教学课程id' , COMMENT = '课程大纲目标表' , RENAME TO  obe_course_target ;

ALTER TABLE course_evaluation
    DROP COLUMN user_id,
    DROP COLUMN course_code,
    DROP COLUMN exam_id,
    CHANGE COLUMN teach_course_id obe_course_outline_id BIGINT NOT NULL COMMENT '教学课程id' , COMMENT = '课程大纲评价方式表' , RENAME TO  obe_course_evaluation ;

ALTER TABLE course_weight
    DROP COLUMN user_id,
    DROP COLUMN course_code,
    DROP COLUMN exam_id,
    CHANGE COLUMN teach_course_id obe_course_outline_id BIGINT NOT NULL COMMENT '课程大纲id' , COMMENT = '课程大纲权重设置表' , RENAME TO  obe_course_weight ;

CREATE TABLE obe_course_requirement_dimension (
    id BIGINT NOT NULL COMMENT 'id',
    obe_course_outline_id BIGINT NOT NULL COMMENT '课程大纲id',
    obe_culture_program_requirement_id BIGINT NOT NULL COMMENT '指标id',
    obe_course_dimension_id BIGINT NOT NULL COMMENT '知识点id',
    school_id BIGINT NOT NULL COMMENT '学校id',
    create_id BIGINT NULL COMMENT '创建人',
    create_time BIGINT NULL COMMENT '创建时间',
    update_id BIGINT NULL COMMENT '更新人',
    update_time BIGINT NULL COMMENT '更新时间',
    PRIMARY KEY (id),
UNIQUE INDEX obe_course_requirement_dimension_unique (obe_course_outline_id ASC, obe_culture_program_requirement_id ASC, obe_course_dimension_id ASC) VISIBLE)
COMMENT = '课程大纲指标与知识点关联表';

ALTER TABLE obe_course_target
    DROP COLUMN target_content,
    ADD COLUMN obe_culture_program_requirement_id BIGINT NOT NULL COMMENT '培养方案毕业要求指标点id' AFTER obe_course_outline_id,
    ADD COLUMN expect_value DOUBLE NULL COMMENT '预期值' AFTER total_weight;


-- 2024-06-08
ALTER TABLE obe_course_target
    CHANGE COLUMN obe_culture_program_requirement_id obe_culture_program_requirement_id BIGINT NULL COMMENT '培养方案毕业要求指标点id' ;

-- 2024-06-11
INSERT INTO sys_privilege (id, name, url, type, parent_id, sequence, enable, default_auth, front_display) VALUES ('3000', '课程大纲管理', 'CourseOutlineManager', 'MENU', '2035', '2', '1', '0', '1');
INSERT INTO sys_privilege (id, name, url, type, parent_id, sequence, enable, default_auth, front_display) VALUES ('3001', '课程考核设置', 'CourseAssessmentSetting', 'MENU', '2035', '3', '1', '0', '1');

INSERT INTO sys_privilege (id, name, url, type, parent_id, sequence, property, enable, default_auth, front_display) VALUES ('3002', '课程大纲-查询', '/api/admin/obe/course_outline/page', 'URL', '3000', '1', 'AUTH', '1', '1', '1');
INSERT INTO sys_privilege (id, name, url, type, parent_id, sequence, property, enable, default_auth, front_display) VALUES ('3003', '课程大纲-保存', '/api/admin/obe/course_outline/save', 'URL', '3000', '2', 'AUTH', '1', '1', '1');
INSERT INTO sys_privilege (id, name, url, type, parent_id, sequence, property, enable, default_auth, front_display) VALUES ('3004', '课程大纲-删除', '/api/admin/obe/course_outline/delete', 'URL', '3000', '3', 'AUTH', '1', '1', '1');
INSERT INTO sys_privilege (id, name, url, type, parent_id, sequence, property, enable, default_auth, front_display) VALUES ('3005', '课程大纲-查询课程权重设置状态', '/api/admin/obe/course_outline/find_course_weight_setting_status', 'URL', '3000', '4', 'AUTH', '1', '1', '1');
INSERT INTO sys_privilege (id, name, url, type, parent_id, sequence, property, related, enable, default_auth, front_display) VALUES ('3010', '列表', 'List', 'LIST', '3000', '1', 'AUTH', '3002', '1', '0', '1');
INSERT INTO sys_privilege (id, name, url, type, parent_id, sequence, property, related, enable, default_auth, front_display) VALUES ('3011', '查询条件', 'Condition', 'CONDITION', '3000', '2', 'AUTH', '3002', '1', '0', '1');
INSERT INTO sys_privilege (id, name, url, type, parent_id, sequence, property, related, enable, default_auth, front_display) VALUES ('3012', '查询', 'Select', 'BUTTON', '3000', '3', 'AUTH', '3002', '1', '0', '1');
INSERT INTO sys_privilege (id, name, url, type, parent_id, sequence, property, related, enable, default_auth, front_display) VALUES ('3013', '新增课程大纲', 'Save', 'BUTTON', '3000', '4', 'AUTH', '3003', '1', '0', '1');
INSERT INTO sys_privilege (id, name, url, type, parent_id, sequence, property, related, enable, default_auth, front_display) VALUES ('3014', '编辑', 'Edit', 'LINK', '3000', '5', 'AUTH', '3003', '1', '0', '1');
INSERT INTO sys_privilege (id, name, url, type, parent_id, sequence, property, related, enable, default_auth, front_display) VALUES ('3015', '删除', 'Delete', 'LINK', '3000', '6', 'AUTH', '3004', '1', '0', '1');
INSERT INTO sys_privilege (id, name, url, type, parent_id, sequence, property, related, enable, default_auth, front_display) VALUES ('3016', '查看详情', 'Detail', 'LINK', '3000', '7', 'AUTH', '3005', '1', '0', '1');

INSERT INTO sys_privilege (id, name, url, type, parent_id, sequence, property, enable, default_auth, front_display) VALUES ('3017', '课程大纲-课程基本信息', '/api/admin/obe/course_outline/course_basic_info', 'URL', '3016', '1', 'AUTH', '1', '1', '1');
INSERT INTO sys_privilege (id, name, url, type, parent_id, sequence, property, enable, default_auth, front_display) VALUES ('3018', '课程目标管理-列表查询', '/api/admin/obe/course_target/list', 'URL', '3016', '2', 'AUTH', '1', '1', '1');
INSERT INTO sys_privilege (id, name, url, type, parent_id, sequence, property, enable, default_auth, front_display) VALUES ('3019', '课程目标管理-新增/编辑', '/api/admin/obe/course_target/save', 'URL', '3016', '3', 'AUTH', '1', '1', '1');
INSERT INTO sys_privilege (id, name, url, type, parent_id, sequence, property, enable, default_auth, front_display) VALUES ('3020', '课程目标管理-课程知识点树查询', '/api/admin/obe/course_target/dimension_tree', 'URL', '3016', '4', 'AUTH', '1', '1', '1');
INSERT INTO sys_privilege (id, name, url, type, parent_id, sequence, property, enable, default_auth, front_display) VALUES ('3021', '课程目标管理-导入课程知识点', '/api/admin/obe/course_target/dimension_import', 'URL', '3016', '5', 'AUTH', '1', '1', '1');
INSERT INTO sys_privilege (id, name, url, type, parent_id, sequence, property, enable, default_auth, front_display) VALUES ('3022', '课程目标管理-指标知识点关系查询', '/api/admin/obe/course_target/requirement_dimension', 'URL', '3016', '6', 'AUTH', '1', '1', '1');
INSERT INTO sys_privilege (id, name, url, type, parent_id, sequence, property, enable, default_auth, front_display) VALUES ('3023', '课程目标管理-删除', '/api/admin/obe/course_target/delete', 'URL', '3016', '7', 'AUTH', '1', '1', '1');
INSERT INTO sys_privilege (id, name, url, type, parent_id, sequence, property, enable, default_auth, front_display) VALUES ('3024', '课程目标管理-预期值设置', '/api/admin/obe/course_target/setting_expect_value', 'URL', '3016', '8', 'AUTH', '1', '1', '1');
UPDATE sys_privilege SET related = '3005,3017,3018,3019,3020,3021,3022,3023,3024' WHERE (id = '3016');

INSERT INTO sys_privilege (id, name, url, type, parent_id, sequence, property, enable, default_auth, front_display) VALUES ('3030', '课程考核设置-查询', '/api/admin/obe/course_outline/assessment_setting_page', 'URL', '3001', '1', 'AUTH', '1', '1', '1');
INSERT INTO sys_privilege (id, name, url, type, parent_id, sequence, property, related, enable, default_auth, front_display) VALUES ('3040', '列表', 'List', 'LIST', '3001', '1', 'AUTH', '3030', '1', '0', '1');
INSERT INTO sys_privilege (id, name, url, type, parent_id, sequence, property, related, enable, default_auth, front_display) VALUES ('3041', '查询条件', 'Condition', 'CONDITION', '3001', '2', 'AUTH', '3030', '1', '0', '1');
INSERT INTO sys_privilege (id, name, url, type, parent_id, sequence, property, related, enable, default_auth, front_display) VALUES ('3042', '查询', 'Select', 'BUTTON', '3001', '3', 'AUTH', '3030', '1', '0', '1');
INSERT INTO sys_privilege (id, name, url, type, parent_id, sequence, property, related, enable, default_auth, front_display) VALUES ('3043', '删除', 'Delete', 'LINK', '3001', '4', 'AUTH', '3004', '1', '0', '1');
INSERT INTO sys_privilege (id, name, url, type, parent_id, sequence, property, enable, default_auth, front_display) VALUES ('3044', '编辑', 'Edit', 'LINK', '3001', '5', 'AUTH', '1', '0', '1');

INSERT INTO sys_privilege (id, name, url, type, parent_id, sequence, property, enable, default_auth, front_display) VALUES ('3050', '评价方式管理-列表查询', '/api/admin/obe/course_evaluation/list', 'URL', '3044', '1', 'AUTH', '1', '1', '1');
INSERT INTO sys_privilege (id, name, url, type, parent_id, sequence, property, enable, default_auth, front_display) VALUES ('3051', '评价方式管理-新增/编辑', '/api/admin/obe/course_evaluation/save', 'URL', '3044', '2', 'AUTH', '1', '1', '1');
INSERT INTO sys_privilege (id, name, url, type, parent_id, sequence, property, enable, default_auth, front_display) VALUES ('3052', '评价方式管理-删除', '/api/admin/obe/course_evaluation/delete', 'URL', '3044', '3', 'AUTH', '1', '1', '1');
INSERT INTO sys_privilege (id, name, url, type, parent_id, sequence, property, enable, default_auth, front_display) VALUES ('3053', '课程权重管理-列表查询', '/api/admin/obe/course_weight/find', 'URL', '3044', '4', 'AUTH', '1', '1', '1');
INSERT INTO sys_privilege (id, name, url, type, parent_id, sequence, property, enable, default_auth, front_display) VALUES ('3054', '课程权重管理-新增/编辑', '/api/admin/obe/course_weight/save', 'URL', '3044', '5', 'AUTH', '1', '1', '1');
UPDATE sys_privilege SET related = '3050,3051,3052,3053,3054' WHERE (id = '3044');

INSERT INTO sys_privilege (id, name, url, type, parent_id, sequence, property, enable, default_auth, front_display) VALUES ('3025', '根据培养方案、课程查询指标点', '/api/admin/obe/course_target/sub_requirement/list', 'URL', '3016', '9', 'AUTH', '1', '1', '1');
UPDATE sys_privilege SET related = '3005,3017,3018,3019,3020,3021,3022,3023,3024,3025' WHERE (id = '3016');

-- 2024-06-12
INSERT INTO sys_privilege (id, name, url, type, parent_id, sequence, property, enable, default_auth, front_display) VALUES ('3031', '课程考核设置-删除', '/api/admin/obe/course_outline/assessment_setting_delete', 'URL', '3001', '2', 'AUTH', '1', '1', '1');
UPDATE sys_privilege SET related = '3031' WHERE (id = '3043');

INSERT INTO sys_privilege (id, name, url, type, parent_id, sequence, property, enable, default_auth, front_display) VALUES ('3006', '课程大纲-查询可选择的培养方案', '/api/admin/obe/course_outline/can_choose_culture_program', 'URL', '3000', '5', 'AUTH', '1', '1', '1');
INSERT INTO sys_privilege (id, name, url, type, parent_id, sequence, property, enable, default_auth, front_display) VALUES ('3007', '课程大纲-查询可选择的课程', '/api/admin/obe/course_outline/can_choose_course', 'URL', '3000', '6', 'AUTH', '1', '1', '1');
UPDATE sys_privilege SET related = '3003,3006,3007' WHERE (id = '3014');

-- 2024-06-13
INSERT INTO sys_privilege (id, name, url, type, parent_id, sequence, property, enable, default_auth, front_display) VALUES ('1173', '共用接口-OBE学期', '/api/admin/basic/condition/list_outline_semester', 'URL', '149', '19', 'SYS', '1', '1', '1');
