CREATE TABLE `obe_culture_program` (
          `id` BIGINT(20) NOT NULL,
          `school_id` BIGINT(20) NULL COMMENT '学校ID',
          `professional_id` BIGINT(20) NULL COMMENT '专业ID',
          `name` VARCHAR(100) NULL COMMENT '培养方案名称',
          `target_count` INT NULL DEFAULT 0 COMMENT '培养目标数量',
          `requirement_count` INT NULL DEFAULT 0 COMMENT '毕业要求数量',
          `course_count` INT NULL DEFAULT 0 COMMENT '课程体系数量',
          `description` MEDIUMTEXT NULL COMMENT '总体描述',
          `expect_value` DOUBLE NULL COMMENT '期望值',
          `create_id` BIGINT(20) NULL COMMENT '创建人ID',
          `create_time` BIGINT(20) NULL COMMENT '创建时间',
          `update_id` BIGINT(20) NULL COMMENT '更新人ID',
          `update_time` BIGINT(20) NULL COMMENT '更新时间',
          PRIMARY KEY (`id`),
          INDEX `idx_1` (`professional_id` ASC, `name` ASC) VISIBLE)
    COMMENT = '培养方案';

ALTER TABLE `t_p_course`
    ADD COLUMN `course_id` BIGINT(20) NULL COMMENT '课程ID' AFTER `culture_program_id`,
CHANGE COLUMN `professional_id` `culture_program_id` BIGINT NOT NULL COMMENT '培养方案ID' ,
CHANGE COLUMN `course_code` `course_code` VARCHAR(45) NULL COMMENT '课程代码' ,
CHANGE COLUMN `course_name` `course_name` VARCHAR(100) NULL COMMENT '课程名称' , COMMENT = '培养方案课程体系' , RENAME TO  `obe_culture_program_course` ;

ALTER TABLE `t_p_requirement`
DROP COLUMN `node_count`,
ADD COLUMN `parent_id` BIGINT(20) NULL COMMENT '上级毕业要求' AFTER `name`,
CHANGE COLUMN `professional_id` `culture_program_id` BIGINT NOT NULL COMMENT '培养方案ID' , COMMENT = '培养方案毕业要求' , RENAME TO  `obe_culture_program_requirement` ;

ALTER TABLE `obe_culture_program_requirement` ADD COLUMN `content` MEDIUMTEXT NULL COMMENT '内容' AFTER `name`;
ALTER TABLE `obe_culture_program_requirement` ADD COLUMN `expect_value` DOUBLE NULL COMMENT '预期值' AFTER `sort_num`;

ALTER TABLE `t_p_matrix`
    ADD COLUMN `intensity` VARCHAR(1) NULL COMMENT '强度' AFTER `content`,
CHANGE COLUMN `professional_id` `culture_program_id` BIGINT NOT NULL COMMENT '培养方案ID' ,
CHANGE COLUMN `course_id` `obe_course_id` BIGINT NOT NULL COMMENT '专业认证课程ID' ,
CHANGE COLUMN `requirement_id` `obe_requirement_id` BIGINT NOT NULL COMMENT '专业认证毕业要求ID' ,
CHANGE COLUMN `sub_name` `obe_sub_requirement_id` BIGINT(20) NULL DEFAULT NULL COMMENT '子节点名称' , COMMENT = '培养方案毕业要求支撑矩阵' , RENAME TO  `obe_course_requirement_matrix` ;

CREATE TABLE `obe_culture_program_target` (
     `id` BIGINT(20) NOT NULL,
     `culture_program_id` BIGINT(20) NULL COMMENT '培养方案ID',
     `name` VARCHAR(100) NULL COMMENT '培养目标名称',
     `detail` VARCHAR(2000) NULL COMMENT '目标拆解详情',
     `create_id` BIGINT(20) NULL,
     `create_time` BIGINT(20) NULL,
     `update_id` BIGINT(20) NULL,
     `update_time` BIGINT(20) NULL,
     PRIMARY KEY (`id`),
     INDEX `idx_1` (`culture_program_id` ASC) VISIBLE)
    COMMENT = '培养方案培养目标';

ALTER TABLE `t_p_professional`
    COMMENT = '专业表' , RENAME TO  `basic_professional` ;


CREATE TABLE `obe_requirement_target_matrix` (
        `id` BIGINT(20) NOT NULL,
        `culture_program_id` BIGINT(20) NULL COMMENT '培养方案ID',
        `obe_requirement_id` BIGINT(20) NULL COMMENT '毕业要求ID',
        `obe_target_id` BIGINT(20) NULL COMMENT '培养目标ID',
        `enable` TINYINT(1) NULL COMMENT '是否包含',
        `create_id` BIGINT(20) NULL,
        `create_time` BIGINT(20) NULL,
        `update_id` BIGINT(20) NULL,
        `update_time` BIGINT(20) NULL,
        PRIMARY KEY (`id`))
    COMMENT = '培养目标与毕业要求关系矩阵';

UPDATE `sys_privilege` SET `name` = '培养方案管理', `url` = 'CultureProgramManage' WHERE (`id` = '2035');
UPDATE `sys_privilege` SET `name` = '培养方案管理', `url` = 'CultureProgram' WHERE (`id` = '2036');
UPDATE `sys_privilege` SET `name` = '查看详情', `url` = 'CultureProgramDetail', `related` = '2044,2045,2046,2047,2048,2049,2050,2051,2052,2053,2054,2055,2058,2059,2060,2066,2067,2068,2069' WHERE (`id` = '2041');
UPDATE `sys_privilege` SET `url` = '/api/admin/obe/culture/program/page' WHERE (`id` = '2042');
UPDATE `sys_privilege` SET `url` = '/api/admin/obe/culture/program/save' WHERE (`id` = '2043');
UPDATE `sys_privilege` SET `name` = '课程体系-选择课程', `url` = '/api/admin/obe/culture/program/course/query_list' WHERE (`id` = '2044');
UPDATE `sys_privilege` SET `name` = '课程体系-查询列表', `url` = '/api/admin/obe/culture/program/course/list' WHERE (`id` = '2045');
UPDATE `sys_privilege` SET `name` = '课程体系-新增', `url` = '/api/admin/obe/culture/program/course/save' WHERE (`id` = '2046');
UPDATE `sys_privilege` SET `name` = '课程体系-排序', `url` = '/api/admin/obe/culture/program/course/sort' WHERE (`id` = '2047');
UPDATE `sys_privilege` SET `name` = '课程体系-删除', `url` = '/api/admin/obe/culture/program/course/remove' WHERE (`id` = '2048');
UPDATE `sys_privilege` SET `name` = '毕业要求-查询', `url` = '/api/admin/obe/culture/program/requirement/list' WHERE (`id` = '2049');
UPDATE `sys_privilege` SET `name` = '毕业要求-新增/编辑', `url` = '/api/admin/obe/culture/program/requirement/save' WHERE (`id` = '2050');
UPDATE `sys_privilege` SET `name` = '毕业要求-删除', `url` = '/api/admin/obe/culture/program/requirement/remove' WHERE (`id` = '2052');
UPDATE `sys_privilege` SET `name` = '课程支撑毕业要求达成矩阵-查询-查询', `url` = '/api/admin/obe/culture/program/course/matrix/get' WHERE (`id` = '2053');
UPDATE `sys_privilege` SET `name` = '课程支撑毕业要求达成矩阵-提交-提交', `url` = '/api/admin/obe/culture/program/course/matrix/save' WHERE (`id` = '2054');
UPDATE `sys_privilege` SET `name` = '培养目标-列表', `url` = '/api/admin/obe/culture/program/target/list' WHERE (`id` = '2051');
UPDATE `sys_privilege` SET `name` = '培养目标-新增/编辑', `url` = '/api/admin/obe/culture/program/target/save' WHERE (`id` = '2055');
INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `enable`, `default_auth`, `front_display`) VALUES ('2058', '培养目标-删除', '/api/admin/obe/culture/program/target/remove', 'URL', '2036', '15', 'AUTH', '1', '0', '1');
INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `enable`, `default_auth`, `front_display`) VALUES ('2059', '培养目标与毕业要求关系矩阵-查询', '/api/admin/obe/culture/program/target/matrix/get', 'URL', '2036', '16', 'AUTH', '1', '0', '1');
INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `enable`, `default_auth`, `front_display`) VALUES ('2060', '培养目标与毕业要求关系矩阵-提交', '/api/admin/obe/culture/program/target/matrix/save', 'URL', '2036', '17', 'AUTH', '1', '0', '1');
UPDATE `sys_privilege` SET `url` = 'ProfessionalManage', `enable` = '1', `front_display` = '1' WHERE (`id` = '515');
UPDATE `sys_privilege` SET `enable` = '1', `front_display` = '1' WHERE (`id` = '519');
UPDATE `sys_privilege` SET `enable` = '1', `front_display` = '1' WHERE (`id` = '520');
UPDATE `sys_privilege` SET `enable` = '1', `front_display` = '1' WHERE (`id` = '522');
UPDATE `sys_privilege` SET `enable` = '1', `front_display` = '1' WHERE (`id` = '516');
UPDATE `sys_privilege` SET `enable` = '1', `front_display` = '1' WHERE (`id` = '517');
UPDATE `sys_privilege` SET `enable` = '1', `front_display` = '1' WHERE (`id` = '518');
UPDATE `sys_privilege` SET `url` = '/api/admin/basic/professional/page', `enable` = '1', `front_display` = '1' WHERE (`id` = '536');
UPDATE `sys_privilege` SET `url` = '/api/admin/basic/professional/save', `enable` = '1', `front_display` = '1' WHERE (`id` = '537');
UPDATE `sys_privilege` SET `url` = '/api/admin/basic/professional/remove', `enable` = '1', `front_display` = '1' WHERE (`id` = '538');
INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES ('2061', '编辑', 'Edit', 'LINK', '2036', '8', 'AUTH', '2043', '1', '0', '1');
INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES ('2062', '复制', 'Copy', 'LINK', '2036', '9', 'AUTH', '2063', '1', '0', '1');
INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `enable`, `default_auth`, `front_display`) VALUES ('2063', '复制', '/api/admin/obe/culture/program/copy', 'URL', '2036', '18', 'AUTH', '1', '1', '1');
INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES ('2064', '删除', 'Delete', 'LINK', '2036', '10', 'AUTH', '2065', '1', '0', '1');
INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `enable`, `default_auth`, `front_display`) VALUES ('2065', '删除', '/api/admin/obe/culture/program/remove', 'URL', '2036', '19', 'AUTH', '1', '1', '1');
UPDATE `sys_privilege` SET `name` = '达成度分析' WHERE (`id` = '2000');

-- 2024-06-07
INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `enable`, `default_auth`, `front_display`) VALUES ('540', '查询（不分页）', '/api/admin/basic/professional/list', 'URL', '515', '4', 'AUTH', '1', '1', '1');
UPDATE `sys_privilege` SET `related` = '536,540' WHERE (`id` = '519');
UPDATE `sys_privilege` SET `related` = '536,540' WHERE (`id` = '520');
UPDATE `sys_privilege` SET `related` = '536,540' WHERE (`id` = '522');
UPDATE `sys_privilege` SET `related` = '2042,540' WHERE (`id` = '2038');
INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `enable`, `default_auth`, `front_display`) VALUES ('2066', '保存总体描述', '/api/admin/obe/culture/program/description/save', 'URL', '2036', '20', 'AUTH', '1', '1', '1');
INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `enable`, `default_auth`, `front_display`) VALUES ('2067', '设置期望值', '/api/admin/obe/culture/program/requirement/expect/save', 'URL', '2036', '21', 'AUTH', '1', '1', '1');


-- 2024-06-11
INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `enable`, `default_auth`, `front_display`) VALUES ('2068', '基本信息查询', '/api/admin/obe/culture/program/get', 'URL', '2036', '22', 'AUTH', '1', '1', '1');
INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `enable`, `default_auth`, `front_display`) VALUES ('2069', '毕业要求-新增指标点', '/api/admin/obe/culture/program/requirement/node/add', 'URL', '2036', '23', 'AUTH', '1', '1', '1');

-- 2024-06-12
ALTER TABLE `obe_course_requirement_matrix` CHANGE COLUMN `content` `scale` DOUBLE NULL DEFAULT NULL COMMENT '指标值' ;
INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `enable`, `default_auth`, `front_display`) VALUES ('1170', '共用接口-OBE专业', '/api/admin/basic/condition/list_professional', 'URL', '149', '17', 'SYS', '1', '1', '1');
INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `enable`, `default_auth`, `front_display`) VALUES ('1171', '共用接口-OBE培养方案', '/api/admin/basic/condition/list_culture_program', 'URL', '149', '18', 'SYS', '1', '1', '1');
INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `enable`, `default_auth`, `front_display`) VALUES ('1172', '共用接口-OBE课程', '/api/admin/basic/condition/list_culture_program_course', 'URL', '149', '18', 'SYS', '1', '1', '1');

INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `enable`, `default_auth`, `front_display`) VALUES ('2080', '学生毕业要求达成度', 'StudentRequirement', 'MENU', '1999', '3', 'AUTH', '1', '0', '1');
INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES ('2081', '列表', 'List', 'LIST', '2080', '1', 'AUTH', '2085', '1', '0', '1');
INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES ('2082', '查询条件', 'Condition', 'CONDITION', '2080', '2', 'AUTH', '2085', '1', '0', '1');
INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES ('2083', '查询', 'Select', 'BUTTON', '2080', '3', 'AUTH', '2085', '1', '0', '1');
INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES ('2084', '查看详情', 'Detail', 'LINK', '2080', '4', 'AUTH', '2086', '1', '0', '1');
INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `enable`, `default_auth`, `front_display`) VALUES ('2085', '查询', '/api/admin/obe/student_requirement/page', 'URL', '2080', '1', 'AUTH', '1', '1', '1');
INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `enable`, `default_auth`, `front_display`) VALUES ('2086', '查看详情', '/api/admin/obe/student_requirement/detail', 'URL', '2080', '2', 'AUTH', '1', '1', '1');

INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `enable`, `default_auth`, `front_display`) VALUES ('2070', '毕业要求达成度统计', 'GraduationRequirement', 'MENU', '1999', '1', 'AUTH', '1', '0', '1');
INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES ('2071', '列表', 'List', 'LIST', '2070', '1', 'AUTH', '2075', '1', '0', '1');
INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES ('2072', '查询条件', 'Condition', 'CONDITION', '2070', '2', 'AUTH', '2075', '1', '0', '1');
INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES ('2073', '查询', 'Select', 'BUTTON', '2070', '3', 'AUTH', '2075', '1', '0', '1');
INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES ('2074', '查看详情', 'Detail', 'LINK', '2070', '4', 'AUTH', '2076,2077', '1', '0', '1');
INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `enable`, `default_auth`, `front_display`) VALUES ('2075', '查询', '/api/admin/obe/graduation_requirement/page', 'URL', '2070', '1', 'AUTH', '1', '1', '1');
INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `enable`, `default_auth`, `front_display`) VALUES ('2076', '毕业要求达成度雷达图', '/api/admin/obe/graduation_requirement/radar_detail', 'URL', '2070', '2', 'AUTH', '1', '1', '1');
INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `enable`, `default_auth`, `front_display`) VALUES ('2077', '毕业要求达成情况详细报表', '/api/admin/obe/graduation_requirement/detail', 'URL', '2070', '3', 'AUTH', '1', '1', '1');
