-- 添加搜索数据表
-- 试验表添加 理化所统计、西核院统计两个字段

DROP TABLE IF EXISTS `component_search`;
CREATE TABLE `component_search` (
                                    `id` varchar(36) CHARACTER SET utf8mb4  NOT NULL,
                                    `create_by` varchar(50) CHARACTER SET utf8mb4  DEFAULT NULL COMMENT '创建人',
                                    `create_time` datetime DEFAULT NULL COMMENT '创建日期',
                                    `update_by` varchar(50) CHARACTER SET utf8mb4  DEFAULT NULL COMMENT '更新人',
                                    `update_time` datetime DEFAULT NULL COMMENT '更新日期',
                                    `data_type` varchar(32) CHARACTER SET utf8mb4  DEFAULT NULL COMMENT '数据类型',
                                    `content` varchar(200) CHARACTER SET utf8mb4  DEFAULT NULL COMMENT '搜索内容',
                                    `extent_info` varchar(648) CHARACTER SET utf8mb4  DEFAULT NULL COMMENT '拓展字段',
    -- 索引
                                    INDEX idx_combined (data_type, content),
                                    PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;


-- 添加权限
INSERT INTO `sys_permission` (`id`, `parent_id`, `name`, `url`, `component`, `is_route`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_leaf`, `keep_alive`, `hidden`, `hide_tab`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`) VALUES
                                                                                                                                                                                                                                                                                                                                                                                  ('1917954826328580097', '1850214135831830529', '报告审核', '/experiment/report', 'experiment/manage/ReportList', 1, '', NULL, 1, NULL, '0', 1.00, 0, 'ant-design:audit-outlined', 1, 0, 0, 0, NULL, 'caoxiang', '2025-05-01 22:50:39', NULL, NULL, 0, 0, NULL, 0),
                                                                                                                                                                                                                                                                                                                                                                                  ('1916494403063308290', '1834565842028310529', '样品类型', '/database/sampleTypeList', 'database/sampleTypeList/SampleTypeList', 1, '', NULL, 1, NULL, '0', 6.00, 0, NULL, 1, 0, 0, 0, NULL, 'caoxiang', '2025-04-27 22:07:27', NULL, NULL, 0, 0, NULL, 0);

-- 试验报告添加文件路径字段
ALTER TABLE `physical-boot`.`experiment_report`
    ADD COLUMN `file_url` text NULL COMMENT '生成的文件路径' AFTER `sample_info`;
-- 试验评定新增评定状态字段
ALTER TABLE `physical-boot`.`experiment_review`
    ADD COLUMN `review_status` int COMMENT '试验评定状态';

