/*
 Navicat Premium Dump SQL

 Source Server         : yun
 Source Server Type    : MySQL
 Source Server Version : 80046 (8.0.46-0ubuntu0.22.04.2)
 Source Host           : 127.0.0.1:3306
 Source Schema         : knowledge_management_system

 Target Server Type    : MySQL
 Target Server Version : 80046 (8.0.46-0ubuntu0.22.04.2)
 File Encoding         : 65001

 Date: 10/06/2026 20:42:07
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for collection
-- ----------------------------
DROP TABLE IF EXISTS `collection`;
CREATE TABLE `collection`  (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '1' COMMENT '知识库名',
  `path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '知识库存放路径',
  `uploader` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '上传者信息',
  `department` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '所属部门，为空表示个人所有',
  `owner_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT 'personal' COMMENT '所有者类型：personal(个人) / department(部门)',
  `visibility` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT 'private' COMMENT '可见性：public(公开) / private(私密)',
  `file_size` bigint NULL DEFAULT NULL COMMENT '文件大小（字节）',
  `display_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '显示名称',
  `description` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '描述信息',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `sync_status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT 'LATEST' COMMENT '同步状态：LATEST-最新版, OUTDATED-未更新, SYNCING-同步中, FAILED-同步失败',
  `last_sync_time` datetime NULL DEFAULT NULL COMMENT '最后同步时间',
  `sync_message` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '同步信息/错误消息',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `uk_path`(`path` ASC) USING BTREE,
  INDEX `idx_uploader`(`uploader` ASC) USING BTREE,
  INDEX `idx_department`(`department` ASC) USING BTREE,
  INDEX `idx_owner_type`(`owner_type` ASC) USING BTREE,
  INDEX `idx_visibility`(`visibility` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 31 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '知识库存放路径表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of collection
-- ----------------------------
INSERT INTO `collection` VALUES (23, 'dept_1_kb', '/knowledge/dept_1_kb', '1', '总公司', 'department', 'public', NULL, '部门1知识库', '自动创建的向量库', '2026-06-02 14:05:53', '2026-06-02 14:05:53', 'LATEST', NULL, NULL);
INSERT INTO `collection` VALUES (28, 'dept_3_kb', '/knowledge/dept_3_kb', '1', '技术部', 'department', 'public', NULL, '部门3知识库', '自动创建的向量库', '2026-06-10 04:58:28', '2026-06-10 04:58:28', 'LATEST', NULL, NULL);
INSERT INTO `collection` VALUES (30, 'dept_6_kb', '/knowledge/dept_6_kb', '1', '人事部门', 'department', 'public', NULL, '部门6知识库', '自动创建的向量库', '2026-06-10 06:19:34', '2026-06-10 06:19:34', 'LATEST', NULL, NULL);

-- ----------------------------
-- Table structure for collection_file
-- ----------------------------
DROP TABLE IF EXISTS `collection_file`;
CREATE TABLE `collection_file`  (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `collection_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '向量库名称（如 public_kb）',
  `doc_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '文档名称（用于匹配 context_reference 的 doc_name）',
  `file_id` bigint NULL DEFAULT NULL COMMENT '关联的文件ID（关联 file 表）',
  `file_path` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '文件存储路径',
  `doc_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '文档类型：pdf、word、excel',
  `status` tinyint NULL DEFAULT 1 COMMENT '状态：1-有效，0-无效',
  `create_time` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `uk_collection_doc`(`collection_name` ASC, `doc_name` ASC) USING BTREE,
  INDEX `idx_collection_name`(`collection_name` ASC) USING BTREE,
  INDEX `idx_doc_name`(`doc_name` ASC) USING BTREE,
  INDEX `idx_file_id`(`file_id` ASC) USING BTREE,
  CONSTRAINT `fk_collection_file_file` FOREIGN KEY (`file_id`) REFERENCES `file` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 61 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '向量库文件关联表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of collection_file
-- ----------------------------
INSERT INTO `collection_file` VALUES (42, 'dept_1_kb', '1.docx', 72, 'resources/rule/总公司/南京分公司/技术部/1/v1/1.docx', '.docx', 1, '2026-06-02 22:06:41', '2026-06-05 16:10:42');
INSERT INTO `collection_file` VALUES (49, 'dept_1_kb', '需求分析.docx', 74, 'resources/rule/总公司/需求分析/v5/需求分析.docx', '.docx', 1, '2026-06-04 10:23:36', '2026-06-04 10:23:36');
INSERT INTO `collection_file` VALUES (55, 'dept_1_kb', '3.docx', 71, 'resources/rule/总公司/3/v1/3.docx', '.docx', 1, '2026-06-10 11:48:05', '2026-06-10 11:48:05');
INSERT INTO `collection_file` VALUES (57, 'dept_3_kb', 'longrule.docx', 76, 'resources/rule/总公司/南京分公司/技术部/longrule/v1/longrule.docx', '.docx', 1, '2026-06-10 13:01:38', '2026-06-10 13:01:38');
INSERT INTO `collection_file` VALUES (59, 'dept_1_kb', '参考样例.pdf', 79, 'resources/rule/总公司/参考样例/v8/参考样例.pdf', '.pdf', 1, '2026-06-10 13:14:08', '2026-06-10 13:14:08');

-- ----------------------------
-- Table structure for context_conversation
-- ----------------------------
DROP TABLE IF EXISTS `context_conversation`;
CREATE TABLE `context_conversation`  (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '会话ID（唯一）',
  `session_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '会话ID，用于关联历史摘要',
  `user_id` bigint NOT NULL COMMENT '用户ID',
  `summary` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '会话摘要（给AI用）',
  `create_time` datetime NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `idx_user_id`(`user_id` ASC) USING BTREE,
  INDEX `idx_session_id`(`session_id` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 73 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '上下文会话表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of context_conversation
-- ----------------------------
INSERT INTO `context_conversation` VALUES (72, 'sess_1780638743383', 1, '用户问: 市场权重计算公式', '2026-06-05 05:52:23');

-- ----------------------------
-- Table structure for context_image
-- ----------------------------
DROP TABLE IF EXISTS `context_image`;
CREATE TABLE `context_image`  (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `image_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '图片唯一标识',
  `path` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '存储路径',
  `source` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '来源文档',
  `page` int NULL DEFAULT NULL COMMENT '来源页码(PDF)',
  `section` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '章节信息',
  `chunk_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '块类型(chart/image)',
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '图片描述',
  `score` decimal(10, 4) NULL DEFAULT NULL COMMENT '相关性评分',
  `collection` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '所属向量库',
  `create_time` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `uk_image_id`(`image_id` ASC) USING BTREE,
  INDEX `idx_collection`(`collection` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 12 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '图片存储表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of context_image
-- ----------------------------
INSERT INTO `context_image` VALUES (10, '49d2910b148d.jpg', 'img/49d2910b148d.jpg', '1.docx', 1, NULL, NULL, '这张图片展示了一个数学公式，属于数学表达式类型。公式表示的是一个一级指标（\\(\\xi_i\\)）乘以相应的权重（\\(w_i^*\\)）。主要内容是数学符号和变量的组合，关键信息在于表示了指标与权重的乘积关', 12.8000, NULL, '2026-06-05 03:57:03');
INSERT INTO `context_image` VALUES (11, '34d876d1a23b.jpg', 'img/34d876d1a23b.jpg', '1.docx', 1, NULL, NULL, '这张图片是一个占位符图像，显示“WMF/EMF placeholder Use Windows to parse the original image”，表明原始图像未加载或无法解析。图片类型为占位符', 3.5000, NULL, '2026-06-05 03:57:03');

-- ----------------------------
-- Table structure for context_message
-- ----------------------------
DROP TABLE IF EXISTS `context_message`;
CREATE TABLE `context_message`  (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '消息ID',
  `conversation_id` bigint NOT NULL COMMENT '会话ID',
  `role` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT 'user/assistant',
  `content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '问题/回答原文',
  `message_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT 'text' COMMENT '消息类型：text/summary/references',
  `is_finished` tinyint NULL DEFAULT 0 COMMENT '回答是否结束',
  `summary` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '会话摘要',
  `kb_paths` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '知识库路径列表（JSON格式）',
  `answer` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '完整答案',
  `mode` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '模式（如rag）',
  `duration_ms` int NULL DEFAULT NULL COMMENT '处理耗时(毫秒)',
  `images` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '图片信息列表（JSON格式，存储image_id和url）',
  `create_time` datetime NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `idx_conversation_id`(`conversation_id` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 188 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '上下文消息表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of context_message
-- ----------------------------
INSERT INTO `context_message` VALUES (182, 72, 'assistant', '市场权重计算公式', 'rag', 1, NULL, '[\"dept_1_kb\"]', '根据提供的参考资料，市场状态的计算公式为：市场状态=+二级指标均值\\*权重。这里的“二级指标均值”指的是各个二级指标的平均值，而“权重”则是每个二级指标在整体市场状态评估中的重要性比例。这个公式用于综合评估不同指标对市场状态的影响。\n\n对于市场权重的计算，资料中提到各明细指标权重确定可采用专家评分法确定，组织专家选取各类市场状态有代表性的在销品规进行评分，并根据市场状态计算公式确定各指标的权重。这意味着权重的确定是一个基于专家意见的过程，旨在反映各个指标在市场状态评估中的相对重要性。[ref:1.docx_86]\n\n综上所述，市场权重的计算涉及到确定每个二级指标的均值以及它们各自的权重，而这些权重是通过专家评分来确定的。不过，具体的权重数值或计算步骤在提供的资料中并未详细说明。', NULL, 66805, '[{\"image_id\":\"49d2910b148d.jpg\",\"url\":\"/api/image/49d2910b148d.jpg/data\"},{\"image_id\":\"34d876d1a23b.jpg\",\"url\":\"/api/image/34d876d1a23b.jpg/data\"}]', '2026-06-05 05:53:30');
INSERT INTO `context_message` VALUES (183, 72, 'assistant', '市场权重计算公式', 'rag', 1, NULL, '[\"dept_1_kb\"]', '根据提供的参考资料，市场权重的计算公式并没有直接给出。但是，有提到“市场状态=+二级指标均值\\*权重”，这表明市场状态是通过将各个二级指标的均值乘以相应的权重后相加得到的。\n\n此外，还提到了一级指标合计权重不低于70%，并且各明细指标权重确定可采用专家评分法确定。[ref:1.docx_86]\n\n因此，虽然没有明确的市场权重计算公式，但可以推断市场权重的计算涉及将各个指标的均值乘以相应的权重，并且一级指标的权重总和应不低于70%。', NULL, 61181, '[{\"image_id\":\"49d2910b148d.jpg\",\"url\":\"/api/image/49d2910b148d.jpg/data\"},{\"image_id\":\"34d876d1a23b.jpg\",\"url\":\"/api/image/34d876d1a23b.jpg/data\"}]', '2026-06-05 06:04:59');
INSERT INTO `context_message` VALUES (184, 72, 'assistant', '市场权重计算公式', 'rag', 1, NULL, '[\"dept_1_kb\"]', '根据提供的参考资料，市场权重的计算公式并没有直接给出。但是，有提到“市场状态=+二级指标均值\\*权重”，这表明市场状态的计算涉及二级指标的均值与权重的乘积。\n\n此外，关于权重确定的方法，资料中提到可以采用专家评分法来确定各明细指标的权重，组织专家对各类市场状态有代表性的在销品规进行评分，并根据市场状态计算公式确定各指标的权重。[ref:1.docx_86]\n\n因此，虽然没有明确的市场权重计算公式，但可以推断出市场权重的计算可能涉及到将各个二级指标的均值与其对应的权重相乘，然后将这些结果相加得到市场状态的综合值。具体的权重数值需要通过专家评分等方法来确定。', NULL, 67865, '[{\"image_id\":\"49d2910b148d.jpg\",\"url\":\"/api/image/49d2910b148d.jpg/data\"},{\"image_id\":\"34d876d1a23b.jpg\",\"url\":\"/api/image/34d876d1a23b.jpg/data\"}]', '2026-06-05 06:18:14');
INSERT INTO `context_message` VALUES (185, 72, 'assistant', '市场权重计算公式', 'rag', 1, NULL, '[\"dept_1_kb\"]', '根据提供的参考资料，市场权重的计算公式并没有直接给出。但是，有提到“市场状态=+二级指标均值\\*权重”，这表明市场状态的计算涉及到二级指标的均值乘以相应的权重。\n\n此外，还提到“一级指标合计权重不低于70%”，这说明在计算市场状态时，各个一级指标的权重总和应该至少为70%。[ref:1.docx_86]\n\n对于具体的权重确定方法，资料中提到可以采用专家评分法来确定各明细指标的权重，组织专家选取各类市场状态有代表性的在销品规进行评分，并根据市场状态计算公式确定各指标的权重。[ref:1.docx_86]\n\n综上所述，虽然没有直接提供市场权重的计算公式，但可以推断出市场权重的计算涉及到了二级指标的均值与权重的乘积，以及一级指标权重的合计不低于70%。具体的权重值需要通过专家评分等方法来确定。', NULL, 63932, '[{\"image_id\":\"49d2910b148d.jpg\",\"url\":\"/api/image/49d2910b148d.jpg/data\"},{\"image_id\":\"34d876d1a23b.jpg\",\"url\":\"/api/image/34d876d1a23b.jpg/data\"}]', '2026-06-05 06:28:41');
INSERT INTO `context_message` VALUES (186, 72, 'assistant', '市场权重计算公式', 'rag', 1, NULL, '[\"dept_1_kb\"]', '根据提供的参考资料，市场权重的计算公式并没有直接给出。但是，有提到“市场状态=+二级指标均值\\*权重”，这表明市场状态是通过将各个二级指标的均值乘以相应的权重来计算的。\n\n此外，还提到“一级指标合计权重不低于70%”，这说明在计算市场状态时，需要确保所有一级指标的权重总和至少为70%。[ref:1.docx_86]\n\n对于具体的权重确定方法，资料中提到可以采用专家评分法，组织专家对各类市场状态有代表性的在销品规进行评分，并根据市场状态计算公式确定各指标的权重。[ref:1.docx_86]\n\n综上所述，虽然没有直接给出市场权重的计算公式，但可以通过上述信息推断出市场权重的计算方式。', NULL, 60684, '[{\"image_id\":\"49d2910b148d.jpg\",\"url\":\"/api/image/49d2910b148d.jpg/data\"},{\"image_id\":\"34d876d1a23b.jpg\",\"url\":\"/api/image/34d876d1a23b.jpg/data\"}]', '2026-06-05 06:37:10');
INSERT INTO `context_message` VALUES (187, 72, 'assistant', '市场权重计算公式', 'rag', 1, NULL, '[\"dept_1_kb\"]', '根据提供的参考资料，市场权重的计算公式并没有直接给出。但是，有提到“市场状态=+二级指标均值\\*权重”，这表明市场状态是通过将各个二级指标的均值乘以相应的权重来计算的。\n\n此外，还提到“一级指标合计权重不低于70%”，这说明在计算市场状态时，各个一级指标的权重总和必须至少为70%。[ref:1.docx_86]\n\n对于具体的权重确定方法，资料中提到可以采用专家评分法，组织专家对各类市场状态有代表性的在销品规进行评分，并根据市场状态计算公式确定各指标的权重。[ref:1.docx_86]\n\n综上所述，虽然没有明确的市场权重计算公式，但可以根据上述信息推断出市场权重的计算方式。', NULL, 61949, '[{\"image_id\":\"49d2910b148d.jpg\",\"url\":\"/api/image/49d2910b148d.jpg/data\"},{\"image_id\":\"34d876d1a23b.jpg\",\"url\":\"/api/image/34d876d1a23b.jpg/data\"}]', '2026-06-06 07:17:19');

-- ----------------------------
-- Table structure for context_reference
-- ----------------------------
DROP TABLE IF EXISTS `context_reference`;
CREATE TABLE `context_reference`  (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '引用ID',
  `message_id` bigint NOT NULL COMMENT '消息ID',
  `chunk_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT 'Chunk唯一ID',
  `chunk_index` int NULL DEFAULT NULL COMMENT '全局切片序号',
  `collection` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '所属知识库',
  `doc_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '文件展示名称',
  `doc_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '文档类型：pdf、word、excel',
  `page` int NULL DEFAULT NULL COMMENT '起始页码',
  `page_end` int NULL DEFAULT NULL COMMENT '结束页码（跨页切片时有值）',
  `page_range` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '页码范围显示文本，如 \"5\" 或 \"5-8\"',
  `section` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '所属章节路径',
  `chunk_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '切片类型：text、table、image',
  `section_chunk_id` int NULL DEFAULT NULL COMMENT '章节内段落序号（Word文档语义定位）',
  `bbox` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '边界框坐标 [x0,y0,x1,y1]（仅PDF）',
  `bbox_mode` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '坐标模式：normalized',
  `preview` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '内容摘要（用于搜索定位）',
  `excerpt` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '匹配原文片段',
  `score` decimal(5, 4) NULL DEFAULT NULL COMMENT '相关性分数（0-1）',
  `create_time` datetime NULL DEFAULT CURRENT_TIMESTAMP,
  `file_id` bigint NULL DEFAULT NULL COMMENT '关联的 collection_file 表的 id',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `idx_message_id`(`message_id` ASC) USING BTREE,
  INDEX `idx_chunk_id`(`chunk_id` ASC) USING BTREE,
  INDEX `idx_chunk_index`(`chunk_index` ASC) USING BTREE,
  INDEX `idx_collection`(`collection` ASC) USING BTREE,
  INDEX `idx_file_id`(`file_id` ASC) USING BTREE,
  CONSTRAINT `fk_context_reference_message` FOREIGN KEY (`message_id`) REFERENCES `context_message` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 481 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '上下文引用表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of context_reference
-- ----------------------------
INSERT INTO `context_reference` VALUES (474, 182, '1.docx_80', 80, 'dept_1_kb', '1.docx', 'other', 1, 1, NULL, '1.市场状态的计算公式为： > 市场状态=+二级指标均值\\*权重', 'text', 0, 'null', 'null', '市场状态=+二级指标均值\\*权重\n主题：1.市场状态的计算公式为： > 市场状态=+二级指标均值\\*权重\n市场状态=+二级指标均值\\*权重', '市场状态=+二级指标均值\\*权重\n主题：1.市场状态的计算公式为： > 市场状态=+二级指标均值\\*权重\n市场状态=+二级指标均值\\*权重', NULL, '2026-06-05 06:01:08', 42);
INSERT INTO `context_reference` VALUES (475, 182, '1.docx_86', 86, 'dept_1_kb', '1.docx', 'other', 1, 1, NULL, '', 'text', 0, 'null', 'null', '一级指标合计权重不低于70%。\n主题：2.指标值与权重确定。 > 一级指标合计权重不低于70%。\n一级指标合计权重不低于70%。\n各明细指标权重确定可采用专家评分法确定，组织专家选取各类市场状态有代表性的在销品规进行评分，并根据市场状态计算公式确定各指标的权重。\n专家评分可由系统内营销管理人员、一线营销人员、工业企业营销代表和零售客户代表组成，以集中研讨或调查问卷的方式开展。', '一级指标合计权重不低于70%。\n主题：2.指标值与权重确定。 > 一级指标合计权重不低于70%。\n一级指标合计权重不低于70%。\n各明细指标权重确定可采用专家评分法确定，组织专家选取各类市场状态有代表性的在销品规进行评分，并根据市场状态计算公式确定各指标的权重。\n专家评分可由系统内营销管理人员、一线营销人员、工业企业营销代表和零售客户代表组成，以集中研讨或调查问卷的方式开展。', NULL, '2026-06-05 06:01:08', 42);
INSERT INTO `context_reference` VALUES (476, 183, '1.docx_86', 86, 'dept_1_kb', '1.docx', 'other', 1, 1, NULL, '', 'text', 0, 'null', 'null', '一级指标合计权重不低于70%。\n主题：2.指标值与权重确定。 > 一级指标合计权重不低于70%。\n一级指标合计权重不低于70%。\n各明细指标权重确定可采用专家评分法确定，组织专家选取各类市场状态有代表性的在销品规进行评分，并根据市场状态计算公式确定各指标的权重。\n专家评分可由系统内营销管理人员、一线营销人员、工业企业营销代表和零售客户代表组成，以集中研讨或调查问卷的方式开展。', '一级指标合计权重不低于70%。\n主题：2.指标值与权重确定。 > 一级指标合计权重不低于70%。\n一级指标合计权重不低于70%。\n各明细指标权重确定可采用专家评分法确定，组织专家选取各类市场状态有代表性的在销品规进行评分，并根据市场状态计算公式确定各指标的权重。\n专家评分可由系统内营销管理人员、一线营销人员、工业企业营销代表和零售客户代表组成，以集中研讨或调查问卷的方式开展。', NULL, '2026-06-05 06:04:59', 42);
INSERT INTO `context_reference` VALUES (477, 184, '1.docx_86', 86, 'dept_1_kb', '1.docx', 'other', 1, 1, NULL, '', 'text', 0, 'null', 'null', '一级指标合计权重不低于70%。\n主题：2.指标值与权重确定。 > 一级指标合计权重不低于70%。\n一级指标合计权重不低于70%。\n各明细指标权重确定可采用专家评分法确定，组织专家选取各类市场状态有代表性的在销品规进行评分，并根据市场状态计算公式确定各指标的权重。\n专家评分可由系统内营销管理人员、一线营销人员、工业企业营销代表和零售客户代表组成，以集中研讨或调查问卷的方式开展。', '一级指标合计权重不低于70%。\n主题：2.指标值与权重确定。 > 一级指标合计权重不低于70%。\n一级指标合计权重不低于70%。\n各明细指标权重确定可采用专家评分法确定，组织专家选取各类市场状态有代表性的在销品规进行评分，并根据市场状态计算公式确定各指标的权重。\n专家评分可由系统内营销管理人员、一线营销人员、工业企业营销代表和零售客户代表组成，以集中研讨或调查问卷的方式开展。', NULL, '2026-06-05 06:18:14', 42);
INSERT INTO `context_reference` VALUES (478, 185, '1.docx_86', 86, 'dept_1_kb', '1.docx', 'other', 1, 1, NULL, '', 'text', 0, 'null', 'null', '一级指标合计权重不低于70%。\n主题：2.指标值与权重确定。 > 一级指标合计权重不低于70%。\n一级指标合计权重不低于70%。\n各明细指标权重确定可采用专家评分法确定，组织专家选取各类市场状态有代表性的在销品规进行评分，并根据市场状态计算公式确定各指标的权重。\n专家评分可由系统内营销管理人员、一线营销人员、工业企业营销代表和零售客户代表组成，以集中研讨或调查问卷的方式开展。', '一级指标合计权重不低于70%。\n主题：2.指标值与权重确定。 > 一级指标合计权重不低于70%。\n一级指标合计权重不低于70%。\n各明细指标权重确定可采用专家评分法确定，组织专家选取各类市场状态有代表性的在销品规进行评分，并根据市场状态计算公式确定各指标的权重。\n专家评分可由系统内营销管理人员、一线营销人员、工业企业营销代表和零售客户代表组成，以集中研讨或调查问卷的方式开展。', NULL, '2026-06-05 06:28:41', 42);
INSERT INTO `context_reference` VALUES (479, 186, '1.docx_86', 86, 'dept_1_kb', '1.docx', 'other', 1, 1, NULL, '', 'text', 0, 'null', 'null', '一级指标合计权重不低于70%。\n主题：2.指标值与权重确定。 > 一级指标合计权重不低于70%。\n一级指标合计权重不低于70%。\n各明细指标权重确定可采用专家评分法确定，组织专家选取各类市场状态有代表性的在销品规进行评分，并根据市场状态计算公式确定各指标的权重。\n专家评分可由系统内营销管理人员、一线营销人员、工业企业营销代表和零售客户代表组成，以集中研讨或调查问卷的方式开展。', '一级指标合计权重不低于70%。\n主题：2.指标值与权重确定。 > 一级指标合计权重不低于70%。\n一级指标合计权重不低于70%。\n各明细指标权重确定可采用专家评分法确定，组织专家选取各类市场状态有代表性的在销品规进行评分，并根据市场状态计算公式确定各指标的权重。\n专家评分可由系统内营销管理人员、一线营销人员、工业企业营销代表和零售客户代表组成，以集中研讨或调查问卷的方式开展。', NULL, '2026-06-05 06:37:10', 42);
INSERT INTO `context_reference` VALUES (480, 187, '1.docx_86', 86, 'dept_1_kb', '1.docx', 'other', 1, 1, NULL, '', 'text', 0, 'null', 'null', '一级指标合计权重不低于70%。\n主题：2.指标值与权重确定。 > 一级指标合计权重不低于70%。\n一级指标合计权重不低于70%。\n各明细指标权重确定可采用专家评分法确定，组织专家选取各类市场状态有代表性的在销品规进行评分，并根据市场状态计算公式确定各指标的权重。\n专家评分可由系统内营销管理人员、一线营销人员、工业企业营销代表和零售客户代表组成，以集中研讨或调查问卷的方式开展。', '一级指标合计权重不低于70%。\n主题：2.指标值与权重确定。 > 一级指标合计权重不低于70%。\n一级指标合计权重不低于70%。\n各明细指标权重确定可采用专家评分法确定，组织专家选取各类市场状态有代表性的在销品规进行评分，并根据市场状态计算公式确定各指标的权重。\n专家评分可由系统内营销管理人员、一线营销人员、工业企业营销代表和零售客户代表组成，以集中研讨或调查问卷的方式开展。', NULL, '2026-06-06 07:17:20', 42);

-- ----------------------------
-- Table structure for data_dict
-- ----------------------------
DROP TABLE IF EXISTS `data_dict`;
CREATE TABLE `data_dict`  (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `dict_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '字典类型',
  `dict_code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '字典编码',
  `dict_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '字典名称',
  `dict_value` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '字典值',
  `parent_id` bigint NULL DEFAULT NULL COMMENT '父级ID',
  `sort_order` int NULL DEFAULT 0 COMMENT '排序号',
  `status` tinyint NULL DEFAULT 1 COMMENT '状态：1 启用，0 禁用',
  `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '备注',
  `create_time` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `uk_dict_type_code`(`dict_type` ASC, `dict_code` ASC) USING BTREE,
  INDEX `idx_dict_type`(`dict_type` ASC) USING BTREE,
  INDEX `idx_parent_id`(`parent_id` ASC) USING BTREE,
  INDEX `idx_status`(`status` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '数据字典表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of data_dict
-- ----------------------------

-- ----------------------------
-- Table structure for department
-- ----------------------------
DROP TABLE IF EXISTS `department`;
CREATE TABLE `department`  (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '部门 ID',
  `dept_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '部门名称',
  `dept_code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '部门编码',
  `parent_id` bigint NULL DEFAULT NULL COMMENT '父部门 ID',
  `dept_level` int NULL DEFAULT NULL COMMENT '部门层级',
  `manager_id` bigint NULL DEFAULT NULL COMMENT '部门管理员 ID',
  `status` tinyint NULL DEFAULT 1 COMMENT '状态：1 启用，0 禁用',
  `sort_order` int NULL DEFAULT 0 COMMENT '排序号',
  `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '备注',
  `create_time` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `dept_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT 'DEPARTMENT' COMMENT '部门类型：HEADQUARTERS-总公司, BRANCH-分公司, DEPARTMENT-部门',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `uk_dept_code`(`dept_code` ASC) USING BTREE,
  INDEX `idx_parent_id`(`parent_id` ASC) USING BTREE,
  INDEX `idx_status`(`status` ASC) USING BTREE,
  INDEX `idx_dept_type`(`dept_type` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 8 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '部门表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of department
-- ----------------------------
INSERT INTO `department` VALUES (1, '总公司', 'HEADQUARTERS_MAIN', 0, 1, NULL, 1, 0, '集团总公司', '2026-04-27 09:22:57', '2026-04-27 09:36:53', 'HEADQUARTERS');
INSERT INTO `department` VALUES (2, '南京分公司', 'NANJING_BRANCH', 1, 2, NULL, 1, 1, '南京地区分公司', '2026-04-27 09:22:57', '2026-04-27 09:36:53', 'BRANCH');
INSERT INTO `department` VALUES (3, '技术部', 'TECH_DEPT', 2, 3, NULL, 1, 1, NULL, '2026-04-16 09:05:15', '2026-04-27 09:36:53', 'DEPARTMENT');
INSERT INTO `department` VALUES (4, '采购部门', 'PURCHASE_DEPT', 2, 3, NULL, 1, 2, NULL, '2026-04-16 19:30:00', '2026-04-27 09:36:53', 'DEPARTMENT');
INSERT INTO `department` VALUES (5, '管理部门', 'MANAGE_DEPT', 2, 3, NULL, 1, 3, NULL, '2026-04-16 19:30:00', '2026-04-27 09:36:53', 'DEPARTMENT');
INSERT INTO `department` VALUES (6, '人事部门', 'HR_DEPT', 2, 3, NULL, 1, 4, NULL, '2026-04-16 19:30:00', '2026-04-27 09:36:53', 'DEPARTMENT');
INSERT INTO `department` VALUES (7, '公共部门', 'PUBLIC_DEPT', 2, 3, NULL, 1, 5, '公共资源和信息管理部门', '2026-04-16 19:30:00', '2026-04-27 09:36:53', 'DEPARTMENT');

-- ----------------------------
-- Table structure for dept_admin
-- ----------------------------
DROP TABLE IF EXISTS `dept_admin`;
CREATE TABLE `dept_admin`  (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `user_id` bigint NOT NULL COMMENT '用户ID（必须是部门管理员）',
  `dept_id` bigint NOT NULL COMMENT '管理的部门ID',
  `is_primary` tinyint NULL DEFAULT 0 COMMENT '是否主管理员：1 是，0 否',
  `status` tinyint NULL DEFAULT 1 COMMENT '状态：1 启用，0 禁用',
  `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '备注',
  `create_time` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `uk_user_dept`(`user_id` ASC, `dept_id` ASC) USING BTREE,
  INDEX `idx_dept_id`(`dept_id` ASC) USING BTREE,
  INDEX `idx_status`(`status` ASC) USING BTREE,
  CONSTRAINT `fk_dept_admin_dept` FOREIGN KEY (`dept_id`) REFERENCES `department` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT,
  CONSTRAINT `fk_dept_admin_user` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '部门管理员关联表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of dept_admin
-- ----------------------------
INSERT INTO `dept_admin` VALUES (1, 2, 3, 1, 1, NULL, '2026-04-16 09:05:15', '2026-04-16 09:05:15');
INSERT INTO `dept_admin` VALUES (2, 7, 4, 1, 1, NULL, '2026-04-16 19:30:00', '2026-04-16 19:30:00');
INSERT INTO `dept_admin` VALUES (3, 8, 6, 1, 1, NULL, '2026-04-16 19:30:00', '2026-04-16 19:30:00');
INSERT INTO `dept_admin` VALUES (4, 9, 7, 1, 1, NULL, '2026-04-16 19:30:00', '2026-04-16 19:30:00');

-- ----------------------------
-- Table structure for exam_assignment
-- ----------------------------
DROP TABLE IF EXISTS `exam_assignment`;
CREATE TABLE `exam_assignment`  (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `paper_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '试卷ID',
  `dept_id` bigint NULL DEFAULT NULL COMMENT '部门ID（为空表示全部部门）',
  `dept_ids` json NULL COMMENT '部门ID列表（JSON数组，支持多部门选择）',
  `user_ids` json NULL COMMENT '指定用户ID列表（JSON数组）',
  `exclude_user_ids` json NULL COMMENT '排除用户ID列表（JSON数组）',
  `publish_time` datetime NOT NULL COMMENT '发布时间',
  `deadline` datetime NULL DEFAULT NULL COMMENT '截止时间',
  `status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT 'active' COMMENT '状态：active-有效，revoked-已撤回',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `idx_paper_id`(`paper_id` ASC) USING BTREE,
  INDEX `idx_dept_id`(`dept_id` ASC) USING BTREE,
  INDEX `idx_status`(`status` ASC) USING BTREE,
  CONSTRAINT `fk_exam_assignment_dept` FOREIGN KEY (`dept_id`) REFERENCES `department` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT,
  CONSTRAINT `fk_exam_assignment_paper` FOREIGN KEY (`paper_id`) REFERENCES `exam_paper` (`paper_id`) ON DELETE CASCADE ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 70 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '试卷分配表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of exam_assignment
-- ----------------------------
INSERT INTO `exam_assignment` VALUES (69, '4e1c48d5-2019-48b6-a31b-2fea3ebf1b6f', NULL, '[1]', '[]', '[]', '2026-06-10 11:11:17', NULL, 'active', '2026-06-10 11:11:17', '2026-06-10 11:11:17');

-- ----------------------------
-- Table structure for exam_paper
-- ----------------------------
DROP TABLE IF EXISTS `exam_paper`;
CREATE TABLE `exam_paper`  (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `paper_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '试卷UUID',
  `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '试卷标题',
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '试卷描述',
  `total_score` decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT '总分',
  `duration` int NULL DEFAULT 0 COMMENT '考试时长（分钟），0表示不限时',
  `question_count` int NULL DEFAULT 0 COMMENT '题目数量',
  `question_ids` json NULL COMMENT '题目ID列表（JSON数组）',
  `permission_scope` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT '本部门' COMMENT '权限范围：本部门/本部门+本人/公开',
  `status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT 'draft' COMMENT '状态：draft-草稿，published-已发布，closed-已结束',
  `created_by` bigint NOT NULL COMMENT '创建人ID',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `publish_time` datetime NULL DEFAULT NULL COMMENT '发布时间',
  `deadline` datetime NULL DEFAULT NULL COMMENT '截止时间',
  `dept_id` bigint NULL DEFAULT NULL COMMENT '部门ID',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `uk_paper_id`(`paper_id` ASC) USING BTREE,
  INDEX `idx_created_by`(`created_by` ASC) USING BTREE,
  INDEX `idx_status`(`status` ASC) USING BTREE,
  INDEX `idx_publish_time`(`publish_time` ASC) USING BTREE,
  CONSTRAINT `fk_exam_paper_user` FOREIGN KEY (`created_by`) REFERENCES `user` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 58 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '试卷基础信息表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of exam_paper
-- ----------------------------
INSERT INTO `exam_paper` VALUES (57, '4e1c48d5-2019-48b6-a31b-2fea3ebf1b6f', '自动生成的试卷', NULL, 4.00, 120, 2, '[\"ea6a7f44-9077-4f19-b10e-8239a5198f4d\", \"9d59e7c5-edfc-4517-9fb5-780b389b66fb\"]', '本部门', 'published', 1, '2026-06-10 11:11:11', '2026-06-10 11:11:17', '2026-06-10 11:11:17', NULL, 1);

-- ----------------------------
-- Table structure for exam_record
-- ----------------------------
DROP TABLE IF EXISTS `exam_record`;
CREATE TABLE `exam_record`  (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `record_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '记录UUID',
  `paper_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '试卷ID',
  `answer_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT 'practice' COMMENT '答题类型：formal_exam-正式考试，mock_exam-模拟考，practice-日常练习',
  `user_id` bigint NOT NULL COMMENT '用户ID',
  `status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT 'not_started' COMMENT '状态：not_started-未开始，in_progress-作答中，submitted-已提交，graded-已批阅',
  `total_score` decimal(10, 2) NULL DEFAULT 0.00 COMMENT '总得分',
  `submit_time` datetime NULL DEFAULT NULL COMMENT '提交时间',
  `graded_time` datetime NULL DEFAULT NULL COMMENT '批阅时间',
  `graded_by` bigint NULL DEFAULT NULL COMMENT '批阅人ID',
  `time_spent` int NULL DEFAULT 0 COMMENT '答题耗时（秒）',
  `start_time` datetime NULL DEFAULT NULL COMMENT '开始时间',
  `last_active_time` datetime NULL DEFAULT NULL COMMENT '最后活跃时间',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `uk_record_id`(`record_id` ASC) USING BTREE,
  UNIQUE INDEX `uk_user_paper_type`(`user_id` ASC, `paper_id` ASC, `answer_type` ASC) USING BTREE,
  INDEX `idx_paper_id`(`paper_id` ASC) USING BTREE,
  INDEX `idx_user_id`(`user_id` ASC) USING BTREE,
  INDEX `idx_status`(`status` ASC) USING BTREE,
  INDEX `idx_exam_record_user_status`(`user_id` ASC, `status` ASC) USING BTREE,
  INDEX `idx_exam_record_paper_status`(`paper_id` ASC, `status` ASC) USING BTREE,
  INDEX `fk_exam_record_graded_by`(`graded_by` ASC) USING BTREE,
  CONSTRAINT `fk_exam_record_graded_by` FOREIGN KEY (`graded_by`) REFERENCES `user` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT,
  CONSTRAINT `fk_exam_record_user` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 242 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '考试记录表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of exam_record
-- ----------------------------
INSERT INTO `exam_record` VALUES (239, '17f5be59-3d81-480a-98bb-1e1a2a4556e6', '4e1c48d5-2019-48b6-a31b-2fea3ebf1b6f', 'formal_exam', 1, 'graded', 0.00, '2026-06-10 11:11:49', '2026-06-10 11:11:49', NULL, 30, '2026-06-10 11:11:19', '2026-06-10 11:11:19', '2026-06-10 11:11:17', '2026-06-10 11:11:49');
INSERT INTO `exam_record` VALUES (240, 'ff860338-99ed-4211-bf85-fce6605c8fcc', '4e1c48d5-2019-48b6-a31b-2fea3ebf1b6f', 'formal_exam', 3, 'not_started', 0.00, NULL, NULL, NULL, 0, NULL, NULL, '2026-06-10 11:11:17', '2026-06-10 11:11:17');
INSERT INTO `exam_record` VALUES (241, '26b9fac0-3f92-4d71-a5dc-3e8b432bd580', '4e1c48d5-2019-48b6-a31b-2fea3ebf1b6f', 'formal_exam', 4, 'not_started', 0.00, NULL, NULL, NULL, 0, NULL, NULL, '2026-06-10 11:11:17', '2026-06-10 11:11:17');

-- ----------------------------
-- Table structure for faq
-- ----------------------------
DROP TABLE IF EXISTS `faq`;
CREATE TABLE `faq`  (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `question` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '问题',
  `answer` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '答案',
  `avg_rating` decimal(3, 2) NULL DEFAULT 0.00 COMMENT '平均评分',
  `frequency` int NULL DEFAULT 0 COMMENT '查询频率',
  `status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT 'pending' COMMENT '状态：pending/approved/rejected',
  `source_documents` json NULL COMMENT '来源文档',
  `created_at` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` datetime NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `idx_status`(`status` ASC) USING BTREE,
  FULLTEXT INDEX `idx_question`(`question`)
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = 'FAQ表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of faq
-- ----------------------------

-- ----------------------------
-- Table structure for faq_suggestion
-- ----------------------------
DROP TABLE IF EXISTS `faq_suggestion`;
CREATE TABLE `faq_suggestion`  (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `query` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '用户查询',
  `answer` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '建议答案',
  `avg_rating` decimal(3, 2) NULL DEFAULT 0.00 COMMENT '平均评分',
  `frequency` int NULL DEFAULT 0 COMMENT '出现频率',
  `status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT 'pending' COMMENT '状态：pending/approved/rejected',
  `faq_id` bigint NULL DEFAULT NULL COMMENT '关联的FAQ ID（审批通过后）',
  `created_at` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `idx_status`(`status` ASC) USING BTREE,
  INDEX `fk_faq_suggestion_faq`(`faq_id` ASC) USING BTREE,
  CONSTRAINT `fk_faq_suggestion_faq` FOREIGN KEY (`faq_id`) REFERENCES `faq` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = 'FAQ建议表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of faq_suggestion
-- ----------------------------

-- ----------------------------
-- Table structure for feedback
-- ----------------------------
DROP TABLE IF EXISTS `feedback`;
CREATE TABLE `feedback`  (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `feedback_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '反馈唯一标识',
  `session_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '会话ID',
  `user_id` bigint NULL DEFAULT NULL COMMENT '用户ID',
  `query` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '用户问题',
  `answer` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '系统回答',
  `rating` tinyint NOT NULL COMMENT '评分：1=赞，-1=踩',
  `reason` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '反馈原因',
  `sources` json NULL COMMENT '来源文档列表',
  `faq_suggested` tinyint NULL DEFAULT 0 COMMENT '是否建议为FAQ',
  `suggestion_id` bigint NULL DEFAULT NULL COMMENT '关联的FAQ建议ID',
  `created_at` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `uk_feedback_id`(`feedback_id` ASC) USING BTREE,
  INDEX `idx_session_id`(`session_id` ASC) USING BTREE,
  INDEX `idx_user_id`(`user_id` ASC) USING BTREE,
  INDEX `idx_rating`(`rating` ASC) USING BTREE,
  INDEX `idx_created_at`(`created_at` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '用户反馈表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of feedback
-- ----------------------------
INSERT INTO `feedback` VALUES (1, '7', 'sess_test_001', NULL, '出差补助标准是什么？', '根据公司规定，国内出差补助标准为每天200元。', 1, '回答准确详细', '[\"报销制度.pdf\"]', 0, NULL, '2026-05-06 08:50:59');
INSERT INTO `feedback` VALUES (2, '8', 'sess_test_001', NULL, '出差补助标准是什么？', '根据公司规定，国内出差补助标准为每天200元。', 1, '回答准确详细', '[\"报销制度.pdf\"]', 0, NULL, '2026-05-06 08:58:38');

-- ----------------------------
-- Table structure for file
-- ----------------------------
DROP TABLE IF EXISTS `file`;
CREATE TABLE `file`  (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `file_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '文件名',
  `file_path` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '文件存储路径',
  `file_size` bigint NULL DEFAULT NULL COMMENT '文件大小（字节）',
  `file_type` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '文件类型（MIME类型）',
  `extension` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '文件扩展名',
  `file_md5` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '文件MD5值',
  `upload_user_id` bigint NULL DEFAULT NULL COMMENT '上传用户ID',
  `dept_id` bigint NULL DEFAULT NULL COMMENT '部门ID',
  `dept_ids` json NULL COMMENT '拥有该文件的部门ID列表（JSON数组，支持多部门）',
  `is_public` tinyint NULL DEFAULT 1 COMMENT '是否公开：0-私密，1-公开',
  `file_category` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT 'personal' COMMENT '文件分类：rule-制度文件，personal-个人文件',
  `description` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '文件描述',
  `status` tinyint NULL DEFAULT 1 COMMENT '状态：0-禁用，1-启用',
  `audit_status` tinyint NULL DEFAULT 0 COMMENT '审核状态：0-待审核，1-已通过，2-已拒绝',
  `vector_db_address` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '向量库地址',
  `create_time` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `process_status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'INDEXED' COMMENT '处理状态：PENDING-未入库, INDEXED-已入库, SLICING-正在切片, VECTORIZING-正在向量化, EXPIRED-已过期',
  `exam_status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT 'UNGENERATED' COMMENT '题目生成状态：UNGENERATED-未出题, GENERATING-出题中, GENERATED-已有题目, FAILED-出题失败',
  `process_step_status` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT 'UPLOADED' COMMENT '流程状态: UPLOADED-文件已上传, VECTORIZING-正在向量化, VECTORIZED-向量化完成, VECTORIZE_FAILED-向量化失败, EXAM_GENERATING-正在生成题目, EXAM_GENERATED-题目生成完成, EXAM_GENERATE_FAILED-题目生成失败, COMPLETED-全部流程完成',
  `process_step_message` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '流程状态信息',
  `process_message` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '处理信息/错误消息',
  `tags` json NULL COMMENT '文件自定义标签，如版本信息、分类标识等元数据',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `idx_upload_user_id`(`upload_user_id` ASC) USING BTREE,
  INDEX `idx_dept_id`(`dept_id` ASC) USING BTREE,
  INDEX `idx_status`(`status` ASC) USING BTREE,
  INDEX `idx_create_time`(`create_time` ASC) USING BTREE,
  INDEX `idx_is_public`(`is_public` ASC) USING BTREE,
  INDEX `idx_file_category`(`file_category` ASC) USING BTREE,
  INDEX `idx_audit_status`(`audit_status` ASC) USING BTREE,
  INDEX `idx_file_status`(`status` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 81 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '文件管理表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of file
-- ----------------------------
INSERT INTO `file` VALUES (70, '2.docx', 'resources/rule/总公司/2/v1/2.docx', 775988, 'application/vnd.openxmlformats-officedocument.word', '.docx', NULL, 1, 1, NULL, 1, 'rule', NULL, 1, 1, 'dept_1_kb/2.docx', '2026-06-02 14:11:01', '2026-06-10 05:26:37', 'FAILED', 'GENERATED', 'VECTORIZE_FAILED', '向量化失败: 向量化失败[AI端错误]: 文件上传到向量库失败: I/O error on POST request for \"http://localhost:5001/documents/upload\": Unexpected end of file from server (耗时 154115 毫秒)', '向量化失败[AI端错误]: 文件上传到向量库失败: I/O error on POST request for \"http://localhost:5001/documents/upload\": Unexpected end of file from server (耗时 154115 毫秒)', NULL);
INSERT INTO `file` VALUES (71, '3.docx', 'resources/rule/总公司/3/v1/3.docx', 1454500, 'application/vnd.openxmlformats-officedocument.word', '.docx', NULL, 1, 1, NULL, 1, 'rule', NULL, 1, 1, 'dept_1_kb/3.docx', '2026-06-02 14:11:12', '2026-06-10 04:58:48', 'INDEXED', 'GENERATED', 'EXAM_GENERATED', '题目生成完成', '生成成功，共4道题', NULL);
INSERT INTO `file` VALUES (72, '1.docx', 'resources/rule/总公司/南京分公司/技术部/1/v1/1.docx', 483352, 'application/vnd.openxmlformats-officedocument.word', '.docx', NULL, 1, 3, NULL, 1, 'rule', NULL, 1, 1, 'dept_3_kb/1.docx', '2026-06-03 02:01:08', '2026-06-09 06:42:02', 'INDEXED', 'GENERATED', 'EXAM_GENERATED', '题目生成完成', '生成成功，共5道题', NULL);
INSERT INTO `file` VALUES (74, '需求分析.docx', 'resources/rule/总公司/需求分析/v5/需求分析.docx', 15330, 'application/vnd.openxmlformats-officedocument.word', '.docx', NULL, 1, 1, NULL, 1, 'rule', NULL, 1, 1, 'dept_1_kb/需求分析.docx', '2026-06-04 02:07:06', '2026-06-04 17:51:16', 'INDEXED', 'GENERATED', 'EXAM_GENERATED', '题目生成完成', '生成成功，共1道题\n\n【AI分析结果】\n{\"question_types\":{\"fill_blank\":0,\"multiple_choice\":0,\"single_choice\":1,\"subjective\":0,\"true_false\":0},\"reason\":\"文档内容极简仅含标题，无实质知识点，适宜输出1道单选题覆盖基础概念。\",\"suitable_types\":[\"single_choice\"],\"total_knowledge_points\":0}', '{}');
INSERT INTO `file` VALUES (75, '参考样例.pdf', 'resources/rule/总公司/参考样例/v7/参考样例.pdf', 3588003, 'application/pdf', '.pdf', NULL, 1, 1, NULL, 1, 'rule', NULL, 1, 1, NULL, '2026-06-04 07:40:55', '2026-06-04 15:40:55', 'PENDING', 'UNGENERATED', 'UPLOADED', '文件已上传', NULL, NULL);
INSERT INTO `file` VALUES (76, 'longrule.docx', 'resources/rule/总公司/南京分公司/技术部/longrule/v1/longrule.docx', 14675, 'application/vnd.openxmlformats-officedocument.word', '.docx', NULL, 1, 3, NULL, 1, 'rule', NULL, 1, 1, 'dept_3_kb/longrule.docx', '2026-06-04 13:21:25', '2026-06-10 05:02:16', 'INDEXED', 'GENERATED', 'EXAM_GENERATED', '题目生成完成', '生成成功，共3道题\n\n【AI分析结果】\n{\"question_types\":{\"fill_blank\":1,\"multiple_choice\":0,\"single_choice\":2,\"subjective\":0,\"true_false\":1},\"reason\":\"知识点较基础，适合选择题和判断题。\",\"suitable_types\":[\"single_choice\",\"true_false\",\"fill_blank\"],\"total_knowledge_points\":4}', NULL);
INSERT INTO `file` VALUES (78, 'test.docx', 'resources/rule/总公司/南京分公司/人事部门/test/v4/test.docx', 16182, 'application/vnd.openxmlformats-officedocument.word', '.docx', NULL, 1, 6, NULL, 1, 'rule', NULL, 0, 1, 'dept_6_kb/test.docx', '2026-06-10 05:02:17', '2026-06-10 05:06:05', 'DELETED', 'GENERATED', 'DELETED', '文件已软删除', '生成成功，共4道题', NULL);
INSERT INTO `file` VALUES (79, '参考样例.pdf', 'resources/rule/总公司/参考样例/v8/参考样例.pdf', 3588003, 'application/pdf', '.pdf', NULL, 1, 1, NULL, 1, 'rule', NULL, 1, 1, 'dept_1_kb/参考样例.pdf', '2026-06-10 05:10:01', '2026-06-10 05:20:07', 'INDEXED', 'FAILED', 'EXAM_GENERATE_FAILED', '题目生成失败: 生成失败[AI端错误]: 生成题目失败: POST请求失败: I/O error on POST request for \"http://localhost:5001/exam/generate-smart\": Unexpected end of file from server', '生成失败[AI端错误]: 生成题目失败: POST请求失败: I/O error on POST request for \"http://localhost:5001/exam/generate-smart\": Unexpected end of file from server', NULL);
INSERT INTO `file` VALUES (80, 'test.docx', 'resources/rule/总公司/南京分公司/人事部门/test/v5/test.docx', 16182, 'application/vnd.openxmlformats-officedocument.word', '.docx', NULL, 1, 6, NULL, 1, 'rule', NULL, 0, 1, 'dept_6_kb/test.docx', '2026-06-10 06:19:01', '2026-06-10 06:34:49', 'DELETED', 'GENERATED', 'DELETED', '文件已软删除', '生成成功，共9道题\n\n【AI分析结果】\n{\"question_types\":{\"fill_blank\":2,\"multiple_choice\":0,\"single_choice\":5,\"subjective\":0,\"true_false\":3},\"reason\":\"知识点较具体，适合单选、判断和填空题。\",\"suitable_types\":[\"single_choice\",\"true_false\",\"fill_blank\"],\"total_knowledge_points\":10}', NULL);

-- ----------------------------
-- Table structure for operation_log
-- ----------------------------
DROP TABLE IF EXISTS `operation_log`;
CREATE TABLE `operation_log`  (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '日志 ID',
  `user_id` bigint NULL DEFAULT NULL COMMENT '操作用户 ID',
  `username` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '用户名',
  `operator_type` tinyint NULL DEFAULT NULL COMMENT '操作人类型：1 系统管理员，2 部门管理员，3 普通用户',
  `operation_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '操作类型',
  `operation_desc` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '操作描述',
  `target_id` bigint NULL DEFAULT NULL COMMENT '目标 ID',
  `target_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '目标类型',
  `result` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT 'SUCCESS' COMMENT '操作结果：SUCCESS, FAIL',
  `detail` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '操作详情（JSON格式）',
  `ip_address` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT 'IP 地址',
  `user_agent` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '用户代理',
  `create_time` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '操作时间',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `idx_user_id`(`user_id` ASC) USING BTREE,
  INDEX `idx_operator_type`(`operator_type` ASC) USING BTREE,
  INDEX `idx_operation_type`(`operation_type` ASC) USING BTREE,
  INDEX `idx_create_time`(`create_time` ASC) USING BTREE,
  CONSTRAINT `fk_operation_log_user` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '操作日志表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of operation_log
-- ----------------------------

-- ----------------------------
-- Table structure for permission
-- ----------------------------
DROP TABLE IF EXISTS `permission`;
CREATE TABLE `permission`  (
  `id` bigint NOT NULL COMMENT '权限ID (=前端permissionTree的key值)',
  `uuid` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '唯一标识符',
  `permission_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '权限名称',
  `permission_code` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '权限编码',
  `parent_id` bigint NULL DEFAULT NULL COMMENT '父权限ID',
  `type` tinyint NULL DEFAULT 1 COMMENT '1菜单 2按钮 3接口',
  `path` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '路由路径',
  `icon` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '图标',
  `sort_order` int NULL DEFAULT 0 COMMENT '排序',
  `status` tinyint NULL DEFAULT 1 COMMENT '1启用0禁用',
  `create_time` datetime NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` datetime NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `uk_uuid`(`uuid` ASC) USING BTREE,
  UNIQUE INDEX `uk_code`(`permission_code` ASC) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '权限表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of permission
-- ----------------------------
INSERT INTO `permission` VALUES (1, 'k01', '制度文件查看和学习', 'read', NULL, 1, '/read', 'FileTextOutlined', 1, 1, '2026-04-17 14:17:11', '2026-04-17 14:17:11');
INSERT INTO `permission` VALUES (2, 'k02', '制度文件管理', 'manage', NULL, 1, '/manage', 'FolderOutlined', 2, 1, '2026-04-17 14:17:11', '2026-04-17 14:17:11');
INSERT INTO `permission` VALUES (3, 'k03', '知识问答', 'qa', NULL, 1, '/qa', 'MessageOutlined', 3, 1, '2026-04-17 14:17:11', '2026-04-17 14:17:11');
INSERT INTO `permission` VALUES (4, 'k04', '考察和训练', 'exam', NULL, 1, '/exam', 'FileSearchOutlined', 4, 1, '2026-04-17 14:17:11', '2026-04-17 14:17:11');
INSERT INTO `permission` VALUES (5, 'k05', '纲要学习', 'mind', NULL, 1, '/mind', 'UnorderedListOutlined', 5, 1, '2026-04-17 14:17:11', '2026-04-17 14:17:11');
INSERT INTO `permission` VALUES (6, 'k06', '综合看板', 'dashboard', NULL, 1, '/dashboard', 'DashboardOutlined', 6, 1, '2026-04-17 14:17:11', '2026-04-17 14:17:11');
INSERT INTO `permission` VALUES (7, 'k07', '权限管理', 'permission', NULL, 1, '/permission', 'TeamOutlined', 7, 1, '2026-04-17 14:17:11', '2026-04-17 14:17:11');
INSERT INTO `permission` VALUES (8, 'k08', '查看文件列表', 'read:view', 1, 2, NULL, NULL, 1, 1, '2026-04-17 14:17:11', '2026-04-17 14:17:11');
INSERT INTO `permission` VALUES (9, 'k09', '阅读文档', 'read:read', 1, 2, NULL, NULL, 2, 1, '2026-04-17 14:17:11', '2026-04-17 14:17:11');
INSERT INTO `permission` VALUES (10, 'k10', '上传文件', 'read:upload', 1, 2, NULL, NULL, 3, 1, '2026-04-17 14:17:11', '2026-04-17 14:17:11');
INSERT INTO `permission` VALUES (11, 'k11', '下载文件', 'read:download', 1, 2, NULL, NULL, 4, 1, '2026-04-17 14:17:11', '2026-04-17 14:17:11');
INSERT INTO `permission` VALUES (12, 'k12', '收藏功能', 'read:favorite', 1, 2, NULL, NULL, 5, 1, '2026-04-17 14:17:11', '2026-04-17 14:17:11');
INSERT INTO `permission` VALUES (13, 'k13', '管理文件', 'manage:file', 2, 2, NULL, NULL, 1, 1, '2026-04-17 14:17:11', '2026-04-17 14:17:11');
INSERT INTO `permission` VALUES (14, 'k14', '知识库同步', 'manage:sync', 2, 2, NULL, NULL, 2, 1, '2026-04-17 14:17:11', '2026-04-17 14:17:11');
INSERT INTO `permission` VALUES (15, 'k15', '题库维护', 'manage:question', 2, 2, NULL, NULL, 3, 1, '2026-04-17 14:17:11', '2026-04-17 14:17:11');
INSERT INTO `permission` VALUES (16, 'k16', '智能对话', 'qa:chat', 3, 2, NULL, NULL, 1, 1, '2026-04-17 14:17:11', '2026-04-17 14:17:11');
INSERT INTO `permission` VALUES (17, 'k17', 'FAQ管理', 'qa:faq', 3, 2, NULL, NULL, 2, 1, '2026-04-17 14:17:11', '2026-04-17 14:17:11');
INSERT INTO `permission` VALUES (18, 'k18', 'AI出题', 'exam:ai', 4, 2, NULL, NULL, 1, 1, '2026-04-17 14:17:11', '2026-04-17 14:17:11');
INSERT INTO `permission` VALUES (19, 'k19', '题库管理', 'exam:bank', 4, 2, NULL, NULL, 2, 1, '2026-04-17 14:17:11', '2026-04-17 14:17:11');
INSERT INTO `permission` VALUES (20, 'k20', '智能组卷', 'exam:paper', 4, 2, NULL, NULL, 3, 1, '2026-04-17 14:17:11', '2026-04-17 14:17:11');
INSERT INTO `permission` VALUES (21, 'k21', '互动训练', 'exam:train', 4, 2, NULL, NULL, 4, 1, '2026-04-17 14:17:11', '2026-04-17 14:17:11');
INSERT INTO `permission` VALUES (22, 'k22', '纲要生成', 'mind:generate', 5, 2, NULL, NULL, 1, 1, '2026-04-17 14:17:11', '2026-04-17 14:17:11');
INSERT INTO `permission` VALUES (23, 'k23', '智能预警', 'dashboard:alert', 6, 2, NULL, NULL, 1, 1, '2026-04-17 14:17:11', '2026-04-17 14:17:11');
INSERT INTO `permission` VALUES (24, 'k24', '决策支持', 'dashboard:decision', 6, 2, NULL, NULL, 2, 1, '2026-04-17 14:17:11', '2026-04-17 14:17:11');
INSERT INTO `permission` VALUES (25, 'k25', '角色管理', 'role', 7, 2, NULL, NULL, 1, 1, '2026-04-17 14:17:11', '2026-04-17 14:17:11');
INSERT INTO `permission` VALUES (26, 'k26', '用户管理', 'user', 7, 2, NULL, NULL, 2, 1, '2026-04-17 14:17:11', '2026-04-17 14:17:11');
INSERT INTO `permission` VALUES (27, 'k27', '互动学习', 'mind:learn', 5, 2, NULL, NULL, 2, 1, '2026-04-17 14:17:11', '2026-04-17 14:17:11');
INSERT INTO `permission` VALUES (33, 'k33', '日志管理', 'log:manage', 6, 1, '/logs', 'FileTextOutlined', 3, 1, '2026-04-17 14:17:11', '2026-04-17 14:17:11');
INSERT INTO `permission` VALUES (34, 'k34', '日志查询', 'log:query', 33, 2, NULL, NULL, 1, 1, '2026-04-17 14:17:11', '2026-04-17 14:17:11');
INSERT INTO `permission` VALUES (35, 'k35', '系统配置', 'config:manage', 6, 1, '/config', 'SettingOutlined', 4, 1, '2026-04-17 14:17:11', '2026-04-17 14:17:11');
INSERT INTO `permission` VALUES (36, 'k36', '配置查询', 'config:query', 35, 2, NULL, NULL, 1, 1, '2026-04-17 14:17:11', '2026-04-17 14:17:11');
INSERT INTO `permission` VALUES (37, 'k37', '配置修改', 'config:update', 35, 2, NULL, NULL, 2, 1, '2026-04-17 14:17:11', '2026-04-17 14:17:11');
INSERT INTO `permission` VALUES (38, 'k38', '用户管理(详细)', 'user:manage', 7, 1, NULL, NULL, 5, 1, '2026-04-17 14:17:11', '2026-04-17 14:17:11');
INSERT INTO `permission` VALUES (39, 'k39', '用户查询', 'user:query', 38, 2, NULL, NULL, 1, 1, '2026-04-17 14:17:11', '2026-04-17 14:17:11');
INSERT INTO `permission` VALUES (40, 'k40', '用户创建', 'user:create', 38, 2, NULL, NULL, 2, 1, '2026-04-17 14:17:11', '2026-04-17 14:17:11');
INSERT INTO `permission` VALUES (41, 'k41', '用户修改', 'user:update', 38, 2, NULL, NULL, 3, 1, '2026-04-17 14:17:11', '2026-04-17 14:17:11');
INSERT INTO `permission` VALUES (42, 'k42', '用户删除', 'user:delete', 38, 2, NULL, NULL, 4, 1, '2026-04-17 14:17:11', '2026-04-17 14:17:11');
INSERT INTO `permission` VALUES (43, 'k43', '角色管理(详细)', 'role:manage', 7, 1, NULL, NULL, 6, 1, '2026-04-17 14:17:11', '2026-04-17 14:17:11');
INSERT INTO `permission` VALUES (44, 'k44', '角色查询', 'role:query', 43, 2, NULL, NULL, 1, 1, '2026-04-17 14:17:11', '2026-04-17 14:17:11');
INSERT INTO `permission` VALUES (45, 'k45', '角色创建', 'role:create', 43, 2, NULL, NULL, 2, 1, '2026-04-17 14:17:11', '2026-04-17 14:17:11');
INSERT INTO `permission` VALUES (46, 'k46', '角色修改', 'role:update', 43, 2, NULL, NULL, 3, 1, '2026-04-17 14:17:11', '2026-04-17 14:17:11');
INSERT INTO `permission` VALUES (47, 'k47', '角色删除', 'role:delete', 43, 2, NULL, NULL, 4, 1, '2026-04-17 14:17:11', '2026-04-17 14:17:11');
INSERT INTO `permission` VALUES (48, 'k48', '权限管理(详细)', 'permission:manage', 7, 1, NULL, NULL, 7, 1, '2026-04-17 14:17:11', '2026-04-17 14:17:11');
INSERT INTO `permission` VALUES (49, 'k49', '权限查询', 'permission:query', 48, 2, NULL, NULL, 1, 1, '2026-04-17 14:17:11', '2026-04-17 14:17:11');
INSERT INTO `permission` VALUES (53, 'k53', '超级管理员', 'super_admin', NULL, 1, NULL, NULL, 0, 1, '2026-04-17 14:17:11', '2026-04-17 14:17:11');
INSERT INTO `permission` VALUES (54, 'k54', '管理员', 'admin', NULL, 1, NULL, NULL, 0, 1, '2026-04-17 14:17:11', '2026-04-17 14:17:11');
INSERT INTO `permission` VALUES (55, 'k55', '公司管理', 'company:manage', 7, 1, '/companies', 'BankOutlined', 3, 1, '2026-04-18 11:01:52', '2026-04-18 11:01:52');
INSERT INTO `permission` VALUES (60, 'k60', '部门管理', 'dept:manage', 7, 1, '/departments', 'ApartmentOutlined', 4, 1, '2026-04-18 11:01:52', '2026-04-18 11:01:52');
INSERT INTO `permission` VALUES (65, 'k65', '组织管理', 'organization:manage', 7, 1, '/organization', 'ApartmentOutlined', 3, 1, '2026-04-23 00:00:00', '2026-04-23 00:00:00');
INSERT INTO `permission` VALUES (66, 'k66', '文件审批', 'read:approve', 1, 2, NULL, NULL, 6, 1, '2026-05-02 00:00:00', '2026-05-02 00:00:00');
INSERT INTO `permission` VALUES (67, 'k67', '试卷考核', 'exam:exam', 4, 2, NULL, NULL, 5, 1, '2026-05-10 21:22:13', '2026-05-10 21:22:13');
INSERT INTO `permission` VALUES (68, 'k68', '题目管理与审批', 'read:questionBank', 1, 2, NULL, NULL, 7, 1, '2026-05-31 00:00:00', '2026-05-31 00:00:00');

-- ----------------------------
-- Table structure for question
-- ----------------------------
DROP TABLE IF EXISTS `question`;
CREATE TABLE `question`  (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `question_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '题目UUID',
  `question_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '题目类型：single_choice | multiple_choice | true_false | fill_blank | subjective',
  `difficulty` int NULL DEFAULT 3 COMMENT '难度等级',
  `tags` json NULL COMMENT '知识点标签',
  `score` decimal(5, 2) NOT NULL COMMENT '分值',
  `version` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '1.0' COMMENT '版本号',
  `document_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '原始文档ID',
  `exclude_stems` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '题干内容，用于AI去重',
  `knowledge_base_path` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '知识库路径，关联knowledge_base_path表的name字段',
  `source_context` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT 'AI出题参考的原文切片/上下文',
  `chunk_ids` json NULL COMMENT '切片ID列表',
  `source_chunks_used` int NULL DEFAULT 0 COMMENT '使用的源切片数量',
  `exam_count` int NULL DEFAULT 0 COMMENT '出题次数',
  `correct_count` int NULL DEFAULT 0 COMMENT '回答正确次数',
  `last_exam_time` datetime NULL DEFAULT NULL COMMENT '最后作答时间',
  `page_numbers` json NULL COMMENT '页码',
  `content` json NOT NULL COMMENT '题目内容',
  `status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT 'pending' COMMENT '审核状态：pending | approved | rejected',
  `reviewer_comment` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '审核评论',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `is_deleted` int NOT NULL DEFAULT 0 COMMENT '软删除标志：0表示正常，1表示已删除',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `uk_question_id`(`question_id` ASC) USING BTREE,
  INDEX `idx_question_type`(`question_type` ASC) USING BTREE,
  INDEX `idx_difficulty`(`difficulty` ASC) USING BTREE,
  INDEX `idx_status`(`status` ASC) USING BTREE,
  INDEX `idx_created_at`(`created_at` ASC) USING BTREE,
  INDEX `idx_knowledge_base_path`(`knowledge_base_path` ASC) USING BTREE,
  INDEX `idx_question_is_deleted`(`is_deleted` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 831 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '题目表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of question
-- ----------------------------
INSERT INTO `question` VALUES (755, '2fd2bd3b-a863-4fbc-abe0-9e5a644daeab', 'single_choice', 3, NULL, 2.00, '1.0', '72', '根据文档内容，市场状态的计算公式是以下哪一项？', NULL, NULL, '[\"dept_1_kb/1.docx_79\"]', 71, 0, 0, NULL, NULL, '{\"data\": {\"options\": [{\"key\": \"A\", \"content\": \"市场状态=指标值+权重\"}, {\"key\": \"B\", \"content\": \"市场状态=二级指标均值×权重\"}, {\"key\": \"C\", \"content\": \"市场状态=指标值×权重\"}, {\"key\": \"D\", \"content\": \"市场状态=指标值÷权重\"}]}, \"stem\": \"根据文档内容，市场状态的计算公式是以下哪一项？\", \"answer\": \"B\", \"explanation\": \"根据文档中提到的「市场状态=+二级指标均值\\\\*权重」，正确答案为 B。\", \"referenced_chunk_ids\": null}', 'pending', NULL, '2026-06-08 02:35:42', '2026-06-08 02:35:42', 0);
INSERT INTO `question` VALUES (756, '7fb13194-3b54-4d57-b1e8-4359bd3415cb', 'single_choice', 3, NULL, 2.00, '1.0', '72', '根据附件2中关于状态评价办法与标准的内容，以下哪一项是状态评价的核心目标？', NULL, NULL, '[\"dept_1_kb/1.docx_91\"]', 71, 0, 0, NULL, NULL, '{\"data\": {\"options\": [{\"key\": \"A\", \"content\": \"提高设备运行效率\"}, {\"key\": \"B\", \"content\": \"确定设备的健康状态和风险等级\"}, {\"key\": \"C\", \"content\": \"降低设备维护成本\"}, {\"key\": \"D\", \"content\": \"优化设备采购计划\"}]}, \"stem\": \"根据附件2中关于状态评价办法与标准的内容，以下哪一项是状态评价的核心目标？\", \"answer\": \"B\", \"explanation\": \"附件2明确指出，状态评价的核心目标是确定设备的健康状态和风险等级，以指导后续的运维决策。\", \"referenced_chunk_ids\": null}', 'pending', NULL, '2026-06-08 02:35:42', '2026-06-08 02:35:42', 0);
INSERT INTO `question` VALUES (757, 'ab8cc55d-b304-42d2-b337-c89e7b27012d', 'single_choice', 3, NULL, 2.00, '1.0', '72', '根据文档内容，零售价格指数的计算公式是？', NULL, NULL, '[\"dept_1_kb/1.docx_60\"]', 71, 0, 0, NULL, NULL, '{\"data\": {\"options\": [{\"key\": \"A\", \"content\": \"实际零售价格 + 零售指导价格\"}, {\"key\": \"B\", \"content\": \"实际零售价格 / 零售指导价格 * 100%\"}, {\"key\": \"C\", \"content\": \"实际零售价格 - 零售指导价格\"}, {\"key\": \"D\", \"content\": \"实际零售价格 * 零售指导价格\"}]}, \"stem\": \"根据文档内容，零售价格指数的计算公式是？\", \"answer\": \"B\", \"explanation\": \"根据文档中的公式描述，零售价格指数的计算公式为：实际零售价格除以零售指导价格再乘以100%。\", \"referenced_chunk_ids\": null}', 'pending', NULL, '2026-06-08 02:35:42', '2026-06-08 02:35:42', 0);
INSERT INTO `question` VALUES (758, '01b2e0e7-07fe-42fa-8eb4-a576834e29c7', 'single_choice', 3, NULL, 2.00, '1.0', '72', '根据文档内容，重购率的计算公式是以下哪一项？', NULL, NULL, '[\"dept_1_kb/1.docx_75\"]', 71, 0, 0, NULL, NULL, '{\"data\": {\"options\": [{\"key\": \"A\", \"content\": \"品规连续两周订货客户数 + 上周订货客户数\"}, {\"key\": \"B\", \"content\": \"品规连续两周订货客户数 / 上周订货客户数 * 100%\"}, {\"key\": \"C\", \"content\": \"上周订货客户数 / 品规连续两周订货客户数 * 100%\"}, {\"key\": \"D\", \"content\": \"品规连续两周订货客户数 - 上周订货客户数\"}]}, \"stem\": \"根据文档内容，重购率的计算公式是以下哪一项？\", \"answer\": \"B\", \"explanation\": \"根据文档内容，重购率的公式为：品规连续两周订货客户数除以上周订货客户数再乘以100%。\", \"referenced_chunk_ids\": null}', 'pending', NULL, '2026-06-08 02:35:42', '2026-06-08 02:35:42', 0);
INSERT INTO `question` VALUES (759, 'b40eb0fe-3cc5-4f83-85dc-afd195545803', 'single_choice', 3, NULL, 2.00, '1.0', '72', '根据品规属性聚类评价方法，以下哪一项是计算特定品规聚类整体市场状态评价结果的主要依据？', NULL, NULL, '[\"dept_1_kb/1.docx_90\"]', 71, 0, 0, NULL, NULL, '{\"data\": {\"options\": [{\"key\": \"A\", \"content\": \"各品规的市场地位和护卫的销量加权平均\"}, {\"key\": \"B\", \"content\": \"单一品规的市场状态结果\"}, {\"key\": \"C\", \"content\": \"仅考虑价类和创新品类属性\"}, {\"key\": \"D\", \"content\": \"仅根据工业企业品牌进行分类\"}]}, \"stem\": \"根据品规属性聚类评价方法，以下哪一项是计算特定品规聚类整体市场状态评价结果的主要依据？\", \"answer\": \"A\", \"explanation\": \"根据文档内容，品规属性聚类评价方法中，特定品规聚类的整体市场状态评价结果是通过以特定聚类内市场地位为主导和护卫的各品规市场状态结果按销量进行加权平均得到的。\", \"referenced_chunk_ids\": null}', 'pending', NULL, '2026-06-08 02:35:42', '2026-06-08 02:35:42', 0);
INSERT INTO `question` VALUES (760, '45c5feff-9ea4-4273-945b-296b8e14df10', 'single_choice', 3, NULL, 2.00, '1.0', '72', '根据文档内容，下周可供货源量的计算公式是以下哪一项？', NULL, NULL, '[\"1.docx_34\"]', 71, 0, 0, NULL, NULL, '{\"data\": {\"options\": [{\"key\": \"A\", \"content\": \"期末库存量 - 本周确定到货量\"}, {\"key\": \"B\", \"content\": \"期末库存量 + 本周确定到货量\"}, {\"key\": \"C\", \"content\": \"期末库存量 × 本周确定到货量\"}, {\"key\": \"D\", \"content\": \"期末库存量 ÷ 本周确定到货量\"}]}, \"stem\": \"根据文档内容，下周可供货源量的计算公式是以下哪一项？\", \"answer\": \"B\", \"explanation\": \"根据文档内容，下周可供货源量的计算公式为：期末库存量 + 本周确定到货量。\", \"referenced_chunk_ids\": null}', 'pending', NULL, '2026-06-08 02:35:42', '2026-06-08 02:35:42', 0);
INSERT INTO `question` VALUES (761, 'd51954de-b4aa-44f7-a25a-ac2996c2c633', 'single_choice', 3, NULL, 2.00, '1.0', '72', '根据文档内容，以下哪项属于‘适用范围’所涵盖的工作内容？', NULL, NULL, '[\"1.docx_2\"]', 71, 0, 0, NULL, NULL, '{\"data\": {\"options\": [{\"key\": \"A\", \"content\": \"全省地市公司的财务审计工作\"}, {\"key\": \"B\", \"content\": \"全省地市公司货源投放工作的全过程\"}, {\"key\": \"C\", \"content\": \"全省地市公司的员工招聘流程\"}, {\"key\": \"D\", \"content\": \"全省地市公司的客户投诉处理\"}]}, \"stem\": \"根据文档内容，以下哪项属于‘适用范围’所涵盖的工作内容？\", \"answer\": \"B\", \"explanation\": \"文档中明确指出，适用范围适用于全省地市公司货源投放工作所涉及的基础工作、投放准备、投放规则、投放策略制定、投放评估与优化以及库存管理和投放策略控制等全过程。\", \"referenced_chunk_ids\": null}', 'pending', NULL, '2026-06-08 02:35:42', '2026-06-08 02:35:42', 0);
INSERT INTO `question` VALUES (762, 'e121891d-7b9d-4534-b9da-d1a2267194e8', 'true_false', 3, NULL, 1.00, '1.0', '72', '市场状态的计算公式为：市场状态=+二级指标均值*权重。', NULL, NULL, '[\"dept_1_kb/1.docx_79\"]', 71, 0, 0, NULL, NULL, '{\"data\": {}, \"stem\": \"市场状态的计算公式为：市场状态=+二级指标均值*权重。\", \"answer\": \"对\", \"explanation\": \"根据文档内容，市场状态的计算公式确实为：市场状态=+二级指标均值*权重。\", \"referenced_chunk_ids\": null}', 'pending', NULL, '2026-06-08 02:35:42', '2026-06-08 02:35:42', 0);
INSERT INTO `question` VALUES (763, 'df498a21-09d9-4ad5-a74d-b076cb633a23', 'true_false', 3, NULL, 1.00, '1.0', '72', '附件2主要描述了状态评价办法与标准的相关内容。', NULL, NULL, '[\"dept_1_kb/1.docx_91\"]', 71, 0, 0, NULL, NULL, '{\"data\": {}, \"stem\": \"附件2主要描述了状态评价办法与标准的相关内容。\", \"answer\": \"对\", \"explanation\": \"根据文档内容，附件2的主题明确为“3.状态评价办法与标准”，因此该陈述正确。\", \"referenced_chunk_ids\": null}', 'pending', NULL, '2026-06-08 02:35:42', '2026-06-08 02:35:42', 0);
INSERT INTO `question` VALUES (764, 'd326ec09-934a-4a32-b5a1-6505693ff428', 'true_false', 3, NULL, 1.00, '1.0', '72', '零售价格指数的计算公式为实际零售价格除以零售指导价格再乘以100%。', NULL, NULL, '[\"dept_1_kb/1.docx_60\"]', 71, 0, 0, NULL, NULL, '{\"data\": {}, \"stem\": \"零售价格指数的计算公式为实际零售价格除以零售指导价格再乘以100%。\", \"answer\": \"对\", \"explanation\": \"根据文档内容，零售价格指数的公式是实际零售价格除以零售指导价格再乘以100%。\", \"referenced_chunk_ids\": null}', 'pending', NULL, '2026-06-08 02:35:42', '2026-06-08 02:35:42', 0);
INSERT INTO `question` VALUES (765, 'e1e09cc7-a874-475e-9f14-46feb9af2628', 'true_false', 3, NULL, 1.00, '1.0', '72', '重购率的计算公式为：品规连续两周订货客户数除以上周订货客户数，再乘以100%。', NULL, NULL, '[\"dept_1_kb/1.docx_75\"]', 71, 0, 0, NULL, NULL, '{\"data\": {}, \"stem\": \"重购率的计算公式为：品规连续两周订货客户数除以上周订货客户数，再乘以100%。\", \"answer\": \"对\", \"explanation\": \"根据文档内容，重购率的公式明确为“品规连续两周订货客户数/上周订货客户数×100%”，因此该陈述正确。\", \"referenced_chunk_ids\": null}', 'pending', NULL, '2026-06-08 02:35:42', '2026-06-08 02:35:42', 0);
INSERT INTO `question` VALUES (766, 'c6774b6d-74e6-4b71-8306-4105444dd962', 'true_false', 3, NULL, 1.00, '1.0', '72', '单客户月度投放限量是指公司对单客户单月最高供货量。', NULL, NULL, '[\"dept_1_kb/1.docx_20\"]', 71, 0, 0, NULL, NULL, '{\"data\": {}, \"stem\": \"单客户月度投放限量是指公司对单客户单月最高供货量。\", \"answer\": \"对\", \"explanation\": \"根据文档内容，单客户月度投放限量的定义是公司对单客户单月最高供货量，因此该陈述正确。\", \"referenced_chunk_ids\": null}', 'pending', NULL, '2026-06-08 02:35:42', '2026-06-08 02:35:42', 0);
INSERT INTO `question` VALUES (767, '52772025-e327-49ee-ae0d-5988339a1236', 'true_false', 3, NULL, 1.00, '1.0', '72', '品规属性聚类评价方法中，特定聚类的整体市场状态评价结果是通过以特定聚类内市场地位为主导和护卫的各品规市场状态结果按销量进行加权平均得到的。', NULL, NULL, '[\"dept_1_kb/1.docx_90\"]', 71, 0, 0, NULL, NULL, '{\"data\": {}, \"stem\": \"品规属性聚类评价方法中，特定聚类的整体市场状态评价结果是通过以特定聚类内市场地位为主导和护卫的各品规市场状态结果按销量进行加权平均得到的。\", \"answer\": \"对\", \"explanation\": \"根据文档内容，品规属性聚类评价方法中，特定聚类的整体市场状态评价结果确实是通过以特定聚类内市场地位为主导和护卫的各品规市场状态结果按销量进行加权平均得到的。\", \"referenced_chunk_ids\": null}', 'pending', NULL, '2026-06-08 02:35:42', '2026-06-08 02:35:42', 0);
INSERT INTO `question` VALUES (768, 'fc512f8c-46e8-4d58-b6e5-b4172a0b311b', 'true_false', 3, NULL, 1.00, '1.0', '72', '下周可供货源量的计算公式是：期末库存量加上本周确定到货量。', NULL, NULL, '[\"1.docx_34\"]', 71, 0, 0, NULL, NULL, '{\"data\": {\"options\": [{\"key\": \"T\", \"content\": \"正确\"}, {\"key\": \"F\", \"content\": \"错误\"}]}, \"stem\": \"下周可供货源量的计算公式是：期末库存量加上本周确定到货量。\", \"answer\": \"T\"}', 'approved', '', '2026-06-08 02:35:43', '2026-06-08 12:15:20', 0);
INSERT INTO `question` VALUES (769, '7699dfb0-e03e-4e9a-8653-450d101a85d3', 'true_false', 3, NULL, 1.00, '1.0', '72', '一级指标合计权重不低于70%。', NULL, NULL, '[\"dept_1_kb/1.docx_86\"]', 71, 0, 0, NULL, NULL, '{\"data\": {}, \"stem\": \"一级指标合计权重不低于70%。\", \"answer\": \"对\", \"explanation\": \"根据文档内容，一级指标合计权重不低于70%。\", \"referenced_chunk_ids\": null}', 'approved', '', '2026-06-08 02:35:43', '2026-06-08 14:45:43', 0);
INSERT INTO `question` VALUES (770, 'f139af44-277a-4b6e-88e0-dbd2539b24b6', 'true_false', 3, NULL, 1.00, '1.0', '72', '该适用范围仅适用于全省地市公司的货源投放工作，不包括其他相关环节。', NULL, NULL, '[\"1.docx_2\"]', 71, 0, 0, NULL, NULL, '{\"data\": {}, \"stem\": \"该适用范围仅适用于全省地市公司的货源投放工作，不包括其他相关环节。\", \"answer\": \"错\", \"explanation\": \"根据文档内容，适用范围包括货源投放工作的全过程，如基础工作、投放准备、投放规则、投放策略制定、投放评估与优化以及库存管理和投放策略控制等。因此，该陈述是错误的。\", \"referenced_chunk_ids\": null}', 'approved', '', '2026-06-08 02:35:43', '2026-06-08 14:45:44', 0);
INSERT INTO `question` VALUES (771, 'd009ac1a-b415-4b51-ab57-4cf10fb16c55', 'true_false', 3, NULL, 1.00, '1.0', '72', '市场状态分为五种类型，分别是俏、紧、平、松、软。', NULL, NULL, '[\"dept_1_kb/1.docx_22\"]', 71, 0, 0, NULL, NULL, '{\"data\": {}, \"stem\": \"市场状态分为五种类型，分别是俏、紧、平、松、软。\", \"answer\": \"对\", \"explanation\": \"根据文档内容，市场状态确实分为‘俏、紧、平、松、软’五种类型。\", \"referenced_chunk_ids\": null}', 'approved', '', '2026-06-08 02:35:43', '2026-06-08 14:45:45', 0);
INSERT INTO `question` VALUES (772, '88eaf2d7-4adb-4daf-9978-3113e754b7d5', 'fill_blank', 3, NULL, 2.00, '1.0', '72', '零售价格指数的计算公式为：___。', NULL, NULL, '[\"dept_1_kb/1.docx_60\"]', 71, 0, 0, NULL, NULL, '{\"data\": {\"blank_count\": 1}, \"stem\": \"零售价格指数的计算公式为：___。\", \"answer\": [[\"实际零售价格/零售指导价格\\\\*100%\"]], \"explanation\": \"根据文档内容，零售价格指数的计算公式是实际零售价格除以零售指导价格再乘以100%。\", \"referenced_chunk_ids\": null}', 'approved', '', '2026-06-08 02:35:43', '2026-06-08 14:45:46', 0);
INSERT INTO `question` VALUES (773, 'aeeb9f27-2d6c-48f9-9bc9-ddb188ffae4a', 'fill_blank', 3, NULL, 2.00, '1.0', '72', '重购率的计算公式为：___/上周订货客户数×100%。', NULL, NULL, '[\"dept_1_kb/1.docx_75\"]', 71, 0, 0, NULL, NULL, '{\"data\": {\"blank_count\": 1}, \"stem\": \"重购率的计算公式为：___/上周订货客户数×100%。\", \"answer\": [[\"品规连续两周订货客户数\"]], \"explanation\": \"根据文档内容，重购率的计算公式是品规连续两周订货客户数除以上周订货客户数再乘以100%。\", \"referenced_chunk_ids\": null}', 'approved', '', '2026-06-08 02:35:43', '2026-06-08 14:45:46', 0);
INSERT INTO `question` VALUES (774, 'bff12010-d8ba-4444-8aa7-be9dfb0e81a0', 'fill_blank', 3, NULL, 2.00, '1.0', '72', '公司对单客户单月最高供货量称为___。', NULL, NULL, '[\"dept_1_kb/1.docx_20\"]', 71, 0, 0, NULL, NULL, '{\"data\": {\"blank_count\": 1}, \"stem\": \"公司对单客户单月最高供货量称为___。\", \"answer\": [[\"单客户月度投放限量\"]], \"explanation\": \"根据文档内容，单客户月度投放限量指的是公司对单客户单月最高供货量。\", \"referenced_chunk_ids\": null}', 'approved', '', '2026-06-08 02:35:43', '2026-06-08 14:45:47', 0);
INSERT INTO `question` VALUES (775, '9934bef2-ba39-4626-950a-7dcd59456291', 'fill_blank', 3, NULL, 2.00, '1.0', '72', '品规属性聚类评价方法中，特定品规聚类的市场状态评价结果是通过以特定聚类内市场地位为主导和护卫的各品规市场状态结果按___进行加权平均得到的。', NULL, NULL, '[\"dept_1_kb/1.docx_90\"]', 71, 0, 0, NULL, NULL, '{\"data\": {\"blank_count\": 1}, \"stem\": \"品规属性聚类评价方法中，特定品规聚类的市场状态评价结果是通过以特定聚类内市场地位为主导和护卫的各品规市场状态结果按___进行加权平均得到的。\", \"answer\": [[\"销量\"]], \"explanation\": \"根据文档内容，品规属性聚类评价方法中，特定品规聚类的市场状态评价结果是通过以特定聚类内市场地位为主导和护卫的各品规市场状态结果按销量进行加权平均得到的。\", \"referenced_chunk_ids\": null}', 'approved', '', '2026-06-08 02:35:43', '2026-06-08 14:45:47', 0);
INSERT INTO `question` VALUES (776, 'cb2b1545-8224-4a84-86d2-75a65225688c', 'fill_blank', 3, NULL, 2.00, '1.0', '72', '下周可供货源量的计算公式为：期末库存量+___。', NULL, NULL, '[\"1.docx_34\"]', 71, 0, 0, NULL, NULL, '{\"data\": {\"blank_count\": 1}, \"stem\": \"下周可供货源量的计算公式为：期末库存量+___。\", \"answer\": [[\"本周确定到货量\"]], \"explanation\": \"根据文档内容，下周可供货源量的计算公式是期末库存量加上本周确定到货量。\", \"referenced_chunk_ids\": null}', 'pending', NULL, '2026-06-08 02:35:43', '2026-06-08 02:35:43', 0);
INSERT INTO `question` VALUES (777, 'd6bf010f-2b38-4c25-8926-f4af6fdcb721', 'fill_blank', 4, NULL, 2.00, '1.0', '72', '根据文档内容，一级指标合计权重应不低于___%。', NULL, NULL, '[\"dept_1_kb/1.docx_86\"]', 71, 0, 0, NULL, NULL, '{\"data\": {\"blank_count\": 1}, \"stem\": \"根据文档内容，一级指标合计权重应不低于___%。\", \"answer\": [[\"70\"]], \"explanation\": \"根据文档中明确指出的【一级指标合计权重不低于70%】这一核心知识点进行填空。\", \"referenced_chunk_ids\": null}', 'pending', NULL, '2026-06-08 02:35:43', '2026-06-08 12:03:56', 0);
INSERT INTO `question` VALUES (778, '1b407311-293f-4608-ac2c-20064601f5da', 'fill_blank', 3, NULL, 2.00, '1.0', '72', '本文件适用于全省地市公司______工作所涉及的______、投放准备、投放规则、投放策略制定、投放评估与优化以及库存管理和投放策略控制等全过程。', NULL, NULL, '[\"1.docx_2\"]', 71, 0, 0, NULL, NULL, '{\"data\": {\"blank_count\": 2}, \"stem\": \"本文件适用于全省地市公司______工作所涉及的______、投放准备、投放规则、投放策略制定、投放评估与优化以及库存管理和投放策略控制等全过程。\", \"answer\": [[\"货源投放\"], [\"基础工作\"]], \"explanation\": \"根据文档内容，适用范围明确提到适用于全省地市公司货源投放工作所涉及的基础工作、投放准备、投放规则、投放策略制定、投放评估与优化以及库存管理和投放策略控制等全过程。\", \"referenced_chunk_ids\": null}', 'approved', '', '2026-06-08 02:35:43', '2026-06-08 14:45:48', 0);
INSERT INTO `question` VALUES (779, 'cf28d857-a4fe-42ba-9958-c3a3bf85703c', 'fill_blank', 3, NULL, 2.00, '1.0', '72', '市场状态分为___种类型，分别是___。', NULL, NULL, '[\"dept_1_kb/1.docx_22\"]', 71, 0, 0, NULL, NULL, '{\"data\": {\"blank_count\": 2}, \"stem\": \"市场状态分为___种类型，分别是___。\", \"answer\": \"五,俏、紧、平、松、软\"}', 'approved', '', '2026-06-08 02:35:43', '2026-06-08 12:15:03', 0);
INSERT INTO `question` VALUES (788, '7a82a846-08e8-4f0b-987c-d5d51183a4d2', 'single_choice', 3, NULL, 2.00, '1.0', '72', '根据文档内容，当销量小于等于购进量时，终端动销率的计算公式是？', NULL, NULL, '[\"1.docx_62\"]', 30, 0, 0, NULL, NULL, '{\"data\": {\"options\": [{\"key\": \"A\", \"content\": \"([1+(销量－购进量)/期初库存]/2)*100%\"}, {\"key\": \"B\", \"content\": \"(销量/购进量/2)*100%\"}, {\"key\": \"C\", \"content\": \"销量/期初库存*100%\"}, {\"key\": \"D\", \"content\": \"(销量+购进量)/2*100%\"}]}, \"stem\": \"根据文档内容，当销量小于等于购进量时，终端动销率的计算公式是？\", \"answer\": \"B\", \"explanation\": \"根据文档中的说明，当销量小于等于购进量时，终端动销率的公式为（销量/购进量/2）*100%。\", \"referenced_chunk_ids\": null}', 'pending', NULL, '2026-06-09 06:36:10', '2026-06-09 06:36:10', 0);
INSERT INTO `question` VALUES (789, '7d3eb4bd-322d-4a33-abbd-4c185d8d43db', 'single_choice', 3, NULL, 2.00, '1.0', '72', '根据文档内容，确定指标评分标准时，主要依据是什么？', NULL, NULL, '[\"1.docx_82\"]', 30, 0, 0, NULL, NULL, '{\"data\": {\"options\": [{\"key\": \"A\", \"content\": \"主观判断\"}, {\"key\": \"B\", \"content\": \"历史数值和散点图分析\"}, {\"key\": \"C\", \"content\": \"专家经验\"}, {\"key\": \"D\", \"content\": \"随机设定\"}]}, \"stem\": \"根据文档内容，确定指标评分标准时，主要依据是什么？\", \"answer\": \"B\", \"explanation\": \"根据文档内容，指标评分标准的确定方法是通过收集整理各指标的历史数值，并利用散点图进行研究来确定。\", \"referenced_chunk_ids\": null}', 'pending', NULL, '2026-06-09 06:36:10', '2026-06-09 06:36:10', 0);
INSERT INTO `question` VALUES (790, '1c0e9421-f0cd-442b-8d44-8705a885f5f1', 'single_choice', 3, NULL, 2.00, '1.0', '72', '根据文档内容，紧俏品规的确定依据不包括以下哪一项？', NULL, NULL, '[\"1.docx_16\"]', 30, 0, 0, NULL, NULL, '{\"data\": {\"options\": [{\"key\": \"A\", \"content\": \"零售价格\"}, {\"key\": \"B\", \"content\": \"市场流通价格\"}, {\"key\": \"C\", \"content\": \"社会库存\"}, {\"key\": \"D\", \"content\": \"产品重量\"}]}, \"stem\": \"根据文档内容，紧俏品规的确定依据不包括以下哪一项？\", \"answer\": \"D\", \"explanation\": \"根据文档内容，紧俏品规的确定依据包括零售价格、市场流通价格、社会库存、社会存销比、订货面、订足面以及订单满足率等指标。而产品重量并未提及作为依据。\", \"referenced_chunk_ids\": null}', 'pending', NULL, '2026-06-09 06:36:10', '2026-06-09 06:36:10', 0);
INSERT INTO `question` VALUES (791, 'c2be90cc-7513-4c5b-964b-4978d480b82f', 'fill_blank', 3, NULL, 2.00, '1.0', '72', '终端动销率公式中，当销量大于购进量时，计算公式为___；当销量小于等于购进量时，计算公式为___。', NULL, NULL, '[\"1.docx_62\"]', 30, 0, 0, NULL, NULL, '{\"data\": {\"blank_count\": 2}, \"stem\": \"终端动销率公式中，当销量大于购进量时，计算公式为___；当销量小于等于购进量时，计算公式为___。\", \"answer\": [[\"{[1+(销量－购进量)/期初库存]/2}*100%\"], [\"(销量/购进量/2)*100%\"]], \"explanation\": \"根据文档内容，终端动销率公式的计算方式依据销量与购进量的关系而不同。\", \"referenced_chunk_ids\": null}', 'pending', NULL, '2026-06-09 06:36:10', '2026-06-09 06:36:10', 0);
INSERT INTO `question` VALUES (792, 'dccd788d-8935-4a86-bbea-12ce63d21c33', 'fill_blank', 3, NULL, 2.00, '1.0', '72', '根据文档内容，确定指标评分标准时，通常需要收集整理各指标的___，并利用___进行研究。', NULL, NULL, '[\"1.docx_82\"]', 30, 0, 0, NULL, NULL, '{\"data\": {\"blank_count\": 2}, \"stem\": \"根据文档内容，确定指标评分标准时，通常需要收集整理各指标的___，并利用___进行研究。\", \"answer\": [[\"历史数值\"], [\"散点图\"]], \"explanation\": \"文档中明确提到，确定指标评分标准时需要收集整理各指标的历史数值，并利用散点图进行研究。\", \"referenced_chunk_ids\": null}', 'pending', NULL, '2026-06-09 06:36:10', '2026-06-09 06:36:10', 0);
INSERT INTO `question` VALUES (793, '3a68a5c8-98c2-4b8a-9543-fc893b9d33d6', 'single_choice', 3, NULL, 2.00, '1.0', '72', '根据文档内容，确定指标评分标准时，主要依据是什么？', NULL, NULL, '[\"1.docx_82\"]', 30, 0, 0, NULL, NULL, '{\"data\": {\"options\": [{\"key\": \"A\", \"content\": \"历史数值和散点图分析\"}, {\"key\": \"B\", \"content\": \"主观经验判断\"}, {\"key\": \"C\", \"content\": \"随机设定\"}, {\"key\": \"D\", \"content\": \"固定评分公式\"}]}, \"stem\": \"根据文档内容，确定指标评分标准时，主要依据是什么？\", \"answer\": \"A\", \"explanation\": \"根据文档内容，确定指标评分标准的方法是通过收集整理各指标的历史数值，并利用散点图进行研究。\", \"referenced_chunk_ids\": null}', 'pending', NULL, '2026-06-09 06:42:02', '2026-06-09 06:42:02', 0);
INSERT INTO `question` VALUES (794, '960b946c-b64a-48b6-81e7-f2856bf3eb68', 'single_choice', 3, NULL, 2.00, '1.0', '72', '根据文档内容，紧俏品规的确定依据不包括以下哪一项？', NULL, NULL, '[\"1.docx_16\"]', 30, 0, 0, NULL, NULL, '{\"data\": {\"options\": [{\"key\": \"A\", \"content\": \"零售价格\"}, {\"key\": \"B\", \"content\": \"市场流通价格\"}, {\"key\": \"C\", \"content\": \"社会库存\"}, {\"key\": \"D\", \"content\": \"产品重量\"}]}, \"stem\": \"根据文档内容，紧俏品规的确定依据不包括以下哪一项？\", \"answer\": \"D\", \"explanation\": \"根据文档内容，紧俏品规的确定依据包括零售价格、市场流通价格、社会库存、社会存销比、订货面、订足面以及订单满足率等指标。而产品重量并未提及作为依据。\", \"referenced_chunk_ids\": null}', 'pending', NULL, '2026-06-09 06:42:02', '2026-06-09 06:42:02', 0);
INSERT INTO `question` VALUES (795, '1a3c882c-92cf-486c-abf0-45779cac62b6', 'true_false', 3, NULL, 1.00, '1.0', '72', '根据文档内容，当销量小于等于购进量时，终端动销率的计算公式为（销量/购进量/2）×100%。', NULL, NULL, '[\"1.docx_62\"]', 30, 0, 0, NULL, NULL, '{\"data\": {}, \"stem\": \"根据文档内容，当销量小于等于购进量时，终端动销率的计算公式为（销量/购进量/2）×100%。\", \"answer\": \"true\", \"explanation\": \"根据文档内容，当销量小于等于购进量时，终端动销率的计算公式确实为（销量/购进量/2）×100%。\", \"referenced_chunk_ids\": null}', 'pending', NULL, '2026-06-09 06:42:02', '2026-06-09 06:42:02', 0);
INSERT INTO `question` VALUES (796, '8e8f3630-9709-440a-b20b-5d3a5cea746a', 'fill_blank', 3, NULL, 2.00, '1.0', '72', '终端动销率的计算公式中，当销量大于购进量时，公式为：___。', NULL, NULL, '[\"1.docx_62\"]', 30, 0, 0, NULL, NULL, '{\"data\": {\"blank_count\": 1}, \"stem\": \"终端动销率的计算公式中，当销量大于购进量时，公式为：___。\", \"answer\": [[\"{[1+(销量－购进量)/期初库存]/2}*100%\"]], \"explanation\": \"根据文档内容，当销量大于购进量时，终端动销率的公式为：{[1+(销量－购进量)/期初库存]/2}*100%。\", \"referenced_chunk_ids\": null}', 'pending', NULL, '2026-06-09 06:42:02', '2026-06-09 06:42:02', 0);
INSERT INTO `question` VALUES (797, 'f6d19cba-2b25-4984-9c8c-2fe78f59967c', 'fill_blank', 3, NULL, 2.00, '1.0', '72', '根据文档内容，确定指标评分标准时，通常需要收集整理各指标的___，并利用___进行研究。', NULL, NULL, '[\"1.docx_82\"]', 30, 0, 0, NULL, NULL, '{\"data\": {\"blank_count\": 2}, \"stem\": \"根据文档内容，确定指标评分标准时，通常需要收集整理各指标的___，并利用___进行研究。\", \"answer\": [[\"历史数值\"], [\"散点图\"]], \"explanation\": \"文档中提到，确定指标评分标准时需要收集整理各指标的历史数值，并利用散点图进行研究。\", \"referenced_chunk_ids\": null}', 'pending', NULL, '2026-06-09 06:42:02', '2026-06-09 06:42:02', 0);
INSERT INTO `question` VALUES (798, 'aae7e30c-40c9-4c20-ba86-a29205bb9a59', 'single_choice', 3, NULL, 2.00, '1.0', '71', '在吸烟场所巡查中，以下哪一项是需要重点关注的内容？', NULL, NULL, '[\"3.docx_104\"]', 30, 0, 0, NULL, NULL, '{\"data\": {\"options\": [{\"key\": \"A\", \"content\": \"标识标牌的防盗\"}, {\"key\": \"B\", \"content\": \"吸烟场所的保洁\"}, {\"key\": \"C\", \"content\": \"设施设备的报修\"}, {\"key\": \"D\", \"content\": \"电气线路的故障报修\"}]}, \"stem\": \"在吸烟场所巡查中，以下哪一项是需要重点关注的内容？\", \"answer\": \"B\", \"explanation\": \"根据文档内容，吸烟场所巡查主要关注的是吸烟场所的保洁情况，确保其干净、整洁。其他选项虽然也是维护管理的一部分，但不属于吸烟场所巡查的核心内容。\", \"referenced_chunk_ids\": null}', 'pending', NULL, '2026-06-09 06:52:03', '2026-06-09 06:52:03', 0);
INSERT INTO `question` VALUES (799, '85cf6a34-fcc1-4b91-80cc-f746b7768204', 'single_choice', 3, NULL, 2.00, '1.0', '71', '根据文档内容，吸烟室、吸烟区（亭）、吸烟点的日常维护责任方是？', NULL, NULL, '[\"3.docx_125\"]', 30, 0, 0, NULL, NULL, '{\"data\": {\"options\": [{\"key\": \"A\", \"content\": \"吸烟者\"}, {\"key\": \"B\", \"content\": \"该区域公共场所的管理方\"}, {\"key\": \"C\", \"content\": \"政府相关部门\"}, {\"key\": \"D\", \"content\": \"物业管理公司\"}]}, \"stem\": \"根据文档内容，吸烟室、吸烟区（亭）、吸烟点的日常维护责任方是？\", \"answer\": \"B\", \"explanation\": \"根据文档内容，吸烟室、吸烟区（亭）、吸烟点的日常维护原则上由该区域公共场所的管理方负责。\", \"referenced_chunk_ids\": null}', 'pending', NULL, '2026-06-09 06:52:03', '2026-06-09 06:52:03', 0);
INSERT INTO `question` VALUES (800, 'fdc1a340-12ae-459f-8fad-840348fc4445', 'multiple_choice', 3, NULL, 4.00, '1.0', '71', '根据文档内容，以下哪项是加强吸烟场所维护的主要目的？', NULL, NULL, '[\"3.docx_122\"]', 30, 0, 0, NULL, NULL, '{\"data\": {\"options\": [{\"key\": \"A\", \"content\": \"提高吸烟场所的建设速度\"}, {\"key\": \"B\", \"content\": \"确保各类型吸烟场所及其设施设备处于良好状态\"}, {\"key\": \"C\", \"content\": \"降低吸烟场所的运营成本\"}, {\"key\": \"D\", \"content\": \"增加吸烟场所的数量\"}]}, \"stem\": \"根据文档内容，以下哪项是加强吸烟场所维护的主要目的？\", \"answer\": \"B\", \"explanation\": \"根据文档第一条内容，加强吸烟场所维护的主要目的是确保各类型吸烟场所及其设施设备处于良好状态。\", \"referenced_chunk_ids\": null}', 'pending', NULL, '2026-06-09 06:52:03', '2026-06-09 06:52:03', 0);
INSERT INTO `question` VALUES (801, '9a4e820d-c5df-4dd0-94c2-005bc82c27fe', 'multiple_choice', 3, NULL, 4.00, '1.0', '71', '根据文档内容，以下哪项属于吸烟场所巡查的主要内容？', NULL, NULL, '[\"3.docx_104\"]', 30, 0, 0, NULL, NULL, '{\"data\": {\"options\": [{\"key\": \"A\", \"content\": \"标识标牌保洁\"}, {\"key\": \"B\", \"content\": \"电气线路防盗\"}, {\"key\": \"C\", \"content\": \"设施设备报修\"}, {\"key\": \"D\", \"content\": \"吸烟场所巡查\"}]}, \"stem\": \"根据文档内容，以下哪项属于吸烟场所巡查的主要内容？\", \"answer\": \"D\", \"explanation\": \"根据文档内容，吸烟场所巡查是日常维护管理的重要组成部分，直接与该知识点相关。其他选项虽然也涉及巡查内容，但并非专门针对吸烟场所的巡查。\", \"referenced_chunk_ids\": null}', 'pending', NULL, '2026-06-09 06:52:03', '2026-06-09 06:52:03', 0);
INSERT INTO `question` VALUES (802, '8a48cbc5-b574-41ac-925e-9c799a008d21', 'true_false', 3, NULL, 1.00, '1.0', '71', '加强吸烟场所维护的目的是为了确保各类型吸烟场所及其设施设备处于良好状态，保障文明吸烟环境功能作用的最大发挥。', NULL, NULL, '[\"3.docx_122\"]', 30, 0, 0, NULL, NULL, '{\"data\": {}, \"stem\": \"加强吸烟场所维护的目的是为了确保各类型吸烟场所及其设施设备处于良好状态，保障文明吸烟环境功能作用的最大发挥。\", \"answer\": \"true\", \"explanation\": \"根据文档内容，第一条明确指出加强吸烟场所、设施设备的日常维护是为了确保其处于良好状态，保障文明吸烟环境功能作用的最大发挥。\", \"referenced_chunk_ids\": null}', 'pending', NULL, '2026-06-09 06:52:03', '2026-06-09 06:52:03', 0);
INSERT INTO `question` VALUES (803, '2237a3e2-1334-45a9-acd5-96cb63a04bd8', 'true_false', 3, NULL, 1.00, '1.0', '71', '吸烟场所巡查的主要内容包括标识标牌的防盗、保洁和报修。', NULL, NULL, '[\"3.docx_104\"]', 30, 0, 0, NULL, NULL, '{\"data\": {}, \"stem\": \"吸烟场所巡查的主要内容包括标识标牌的防盗、保洁和报修。\", \"answer\": \"false\", \"explanation\": \"根据文档内容，吸烟场所巡查的内容包括吸烟场所巡查、吸烟场所保洁和标识标牌巡查等，而标识标牌防盗、保洁和报修属于标识标牌巡查的范畴。因此，该说法不完全准确。\", \"referenced_chunk_ids\": null}', 'pending', NULL, '2026-06-09 06:52:03', '2026-06-09 06:52:03', 0);
INSERT INTO `question` VALUES (804, '9d4ed327-5b6a-424f-961f-8d93fde33b5e', 'fill_blank', 3, NULL, 2.00, '1.0', '71', '为加强吸烟场所、设施设备的日常维护，规范维护标准及流程，确保各类型吸烟场所及其设施设备处于良好状态，保障文明吸烟环境功能作用的最大发挥，进一步提高消费者满意度，特制定本标准。因此，加强吸烟场所维护的目的是确保设施设备处于___，并最大发挥___的功能作用。', NULL, NULL, '[\"3.docx_122\"]', 30, 0, 0, NULL, NULL, '{\"data\": {\"blank_count\": 2}, \"stem\": \"为加强吸烟场所、设施设备的日常维护，规范维护标准及流程，确保各类型吸烟场所及其设施设备处于良好状态，保障文明吸烟环境功能作用的最大发挥，进一步提高消费者满意度，特制定本标准。因此，加强吸烟场所维护的目的是确保设施设备处于___，并最大发挥___的功能作用。\", \"answer\": [[\"良好状态\"], [\"文明吸烟环境\"]], \"explanation\": \"根据文档内容，加强吸烟场所维护的目的是确保设施设备处于良好状态，并最大化发挥文明吸烟环境的功能作用。\", \"referenced_chunk_ids\": null}', 'pending', NULL, '2026-06-09 06:52:03', '2026-06-09 06:52:03', 0);
INSERT INTO `question` VALUES (805, '5bfd8890-8e5a-4229-8cbe-94c2d5ae21a3', 'fill_blank', 3, NULL, 2.00, '1.0', '71', '吸烟场所巡查的主要内容包括设施设备巡查、电气线路巡查以及___。', NULL, NULL, '[\"3.docx_104\"]', 30, 0, 0, NULL, NULL, '{\"data\": {\"blank_count\": 1}, \"stem\": \"吸烟场所巡查的主要内容包括设施设备巡查、电气线路巡查以及___。\", \"answer\": [[\"标识标牌巡查\"]], \"explanation\": \"根据文档内容，吸烟场所巡查的内容包括设施设备巡查、电气线路巡查以及标识标牌巡查。\", \"referenced_chunk_ids\": null}', 'pending', NULL, '2026-06-09 06:52:03', '2026-06-09 06:52:03', 0);
INSERT INTO `question` VALUES (806, '754e9316-dd15-4a41-b094-cf88862a79d8', 'subjective', 3, NULL, 10.00, '1.0', '71', '请简述加强吸烟场所维护的主要目的及意义。', NULL, NULL, '[\"3.docx_122\"]', 30, 0, 0, NULL, NULL, '{\"data\": {}, \"stem\": \"请简述加强吸烟场所维护的主要目的及意义。\", \"answer\": [\"为加强吸烟场所、设施设备的日常维护，规范维护标准及流程，确保各类型吸烟场所及其设施设备处于良好状态，保障文明吸烟环境功能作用的最大发挥，进一步提高消费者满意度。\"], \"explanation\": \"根据文档内容，加强吸烟场所维护的核心目的是确保设施设备处于良好状态，并保障文明吸烟环境的功能作用得到最大发挥，从而提升消费者满意度。\", \"referenced_chunk_ids\": null}', 'approved', '', '2026-06-09 06:52:03', '2026-06-09 14:56:42', 0);
INSERT INTO `question` VALUES (807, '9199bdf2-d609-4cfd-b2d5-b8d37e6d6ef4', 'single_choice', 3, NULL, 2.00, '1.0', '71', '根据第二章建设原则，以下哪一项是建设过程中需要遵循的核心原则？', NULL, NULL, '[\"dept_1_kb/3.docx_3\"]', 70, 0, 0, NULL, NULL, '{\"data\": {\"options\": [{\"key\": \"A\", \"content\": \"以经济利益为唯一目标\"}, {\"key\": \"B\", \"content\": \"注重可持续发展与资源节约\"}, {\"key\": \"C\", \"content\": \"忽略环境保护要求\"}, {\"key\": \"D\", \"content\": \"追求短期效益最大化\"}]}, \"stem\": \"根据第二章建设原则，以下哪一项是建设过程中需要遵循的核心原则？\", \"answer\": \"B\", \"explanation\": \"根据第二章建设原则的内容，建设过程中应注重可持续发展与资源节约，这是核心原则之一。\", \"referenced_chunk_ids\": null}', 'pending', NULL, '2026-06-10 04:58:48', '2026-06-10 04:58:48', 0);
INSERT INTO `question` VALUES (808, '3eee6def-abb3-4cb8-80d4-c76b496df602', 'multiple_choice', 3, NULL, 4.00, '1.0', '71', '以下哪一项是第二章建设原则的核心主题？', NULL, NULL, '[\"dept_1_kb/3.docx_3\"]', 70, 0, 0, NULL, NULL, '{\"data\": {\"options\": [{\"key\": \"A\", \"content\": \"建设原则的定义\"}, {\"key\": \"B\", \"content\": \"第二章建设原则\"}, {\"key\": \"C\", \"content\": \"建设原则的应用场景\"}, {\"key\": \"D\", \"content\": \"建设原则的分类\"}]}, \"stem\": \"以下哪一项是第二章建设原则的核心主题？\", \"answer\": \"B\", \"explanation\": \"根据文档内容，第二章建设原则的主题直接明确为“第二章建设原则”。\", \"referenced_chunk_ids\": null}', 'pending', NULL, '2026-06-10 04:58:48', '2026-06-10 04:58:48', 0);
INSERT INTO `question` VALUES (809, 'dd0b2c24-952d-4d72-8cd6-24991f909826', 'true_false', 3, NULL, 1.00, '1.0', '71', '第二章建设原则是整个文档的核心内容。', NULL, NULL, '[\"dept_1_kb/3.docx_3\"]', 70, 0, 0, NULL, NULL, '{\"data\": {}, \"stem\": \"第二章建设原则是整个文档的核心内容。\", \"answer\": \"true\", \"explanation\": \"根据文档内容，第二章建设原则是文档的重要组成部分，且主题明确提及该章节。\", \"referenced_chunk_ids\": null}', 'pending', NULL, '2026-06-10 04:58:48', '2026-06-10 04:58:48', 0);
INSERT INTO `question` VALUES (810, 'ea97cb1e-97ed-46ec-aed3-3fb06c36092c', 'subjective', 3, NULL, 10.00, '1.0', '71', '请简述第二章建设原则的核心内容及其重要性。', NULL, NULL, '[\"dept_1_kb/3.docx_3\"]', 70, 0, 0, NULL, NULL, '{\"data\": {}, \"stem\": \"请简述第二章建设原则的核心内容及其重要性。\", \"answer\": [\"第二章建设原则是整个项目实施的基础，强调了科学规划、合理布局和可持续发展的重要性。其核心内容包括遵循规范、注重实效、确保安全和环保等原则，旨在为建设工作提供明确的方向和指导。\"], \"explanation\": \"根据文档内容，第二章建设原则明确了建设工作的核心指导思想和具体要求，是确保项目顺利推进的关键依据。\", \"referenced_chunk_ids\": null}', 'pending', NULL, '2026-06-10 04:58:48', '2026-06-10 04:58:48', 0);
INSERT INTO `question` VALUES (811, '45004d1c-f5b6-478b-8b8b-eefa690bcc7f', 'single_choice', 3, NULL, 2.00, '1.0', '76', '以下哪项是多部门联合部署安全工作的核心目标？', NULL, NULL, '[\"longrule.docx_0\"]', 3, 0, 0, NULL, NULL, '{\"data\": {\"options\": [{\"key\": \"A\", \"content\": \"提高教育系统的财政预算\"}, {\"key\": \"B\", \"content\": \"全面提升校园安全治理能力与治理水平\"}, {\"key\": \"C\", \"content\": \"扩大公安部门的执法范围\"}, {\"key\": \"D\", \"content\": \"降低学校的安全管理责任\"}]}, \"stem\": \"以下哪项是多部门联合部署安全工作的核心目标？\", \"answer\": \"B\", \"explanation\": \"根据文档内容，多部门联合部署安全工作的核心目标是全面提升校园安全治理能力与治理水平。\", \"referenced_chunk_ids\": null}', 'pending', NULL, '2026-06-10 04:58:54', '2026-06-10 13:15:11', 1);
INSERT INTO `question` VALUES (812, 'cf8b6725-f392-4da3-a6a8-fdb4bb1192d4', 'single_choice', 3, NULL, 2.00, '1.0', '76', '根据文档内容，为确保学生每天校内体育活动时间落实到位，采取的主要措施是？', NULL, NULL, '[\"longrule.docx_2\"]', 3, 0, 0, NULL, NULL, '{\"data\": {\"options\": [{\"key\": \"A\", \"content\": \"减少课程安排\"}, {\"key\": \"B\", \"content\": \"通过‘晒课表’强化跟踪督导\"}, {\"key\": \"C\", \"content\": \"增加课外辅导\"}, {\"key\": \"D\", \"content\": \"延长放学时间\"}]}, \"stem\": \"根据文档内容，为确保学生每天校内体育活动时间落实到位，采取的主要措施是？\", \"answer\": \"B\", \"explanation\": \"文档中明确提到通过‘晒课表’强化跟踪督导，以确保学生每天校内体育活动时间落实到位。\", \"referenced_chunk_ids\": null}', 'pending', NULL, '2026-06-10 04:58:54', '2026-06-10 13:15:11', 1);
INSERT INTO `question` VALUES (813, '7ca1c184-9624-4305-970f-4f2874e36124', 'true_false', 3, NULL, 1.00, '1.0', '76', '教育部、应急管理部、市场监管总局、公安部联合部署2026年全国中小学、幼儿园安全工作，体现了多部门联合部署安全工作的特点。', NULL, NULL, '[\"longrule.docx_0\"]', 3, 0, 0, NULL, NULL, '{\"data\": {}, \"stem\": \"教育部、应急管理部、市场监管总局、公安部联合部署2026年全国中小学、幼儿园安全工作，体现了多部门联合部署安全工作的特点。\", \"answer\": \"true\", \"explanation\": \"根据文档内容，多个部门联合部署安全工作，旨在全面提升校园安全治理能力与治理水平，这直接体现了多部门联合部署安全工作的核心知识点。\", \"referenced_chunk_ids\": null}', 'pending', NULL, '2026-06-10 04:58:54', '2026-06-10 13:15:11', 1);
INSERT INTO `question` VALUES (814, 'cfd86837-ab82-47a7-9bb4-4ff3ed10818b', 'fill_blank', 3, NULL, 2.00, '1.0', '76', '2026年全国中小学、幼儿园安全工作由教育部、应急管理部、市场监管总局、公安部___部署，要求各地聚焦重点任务，从严排查整治，全面提升校园安全治理能力与治理水平。', NULL, NULL, '[\"longrule.docx_0\"]', 3, 0, 0, NULL, NULL, '{\"data\": {\"blank_count\": 1}, \"stem\": \"2026年全国中小学、幼儿园安全工作由教育部、应急管理部、市场监管总局、公安部___部署，要求各地聚焦重点任务，从严排查整治，全面提升校园安全治理能力与治理水平。\", \"answer\": [[\"联合\"]], \"explanation\": \"根据文档内容，多部门联合部署安全工作是核心知识点，因此填空处应为“联合”。\", \"referenced_chunk_ids\": null}', 'pending', NULL, '2026-06-10 04:58:54', '2026-06-10 13:15:11', 1);
INSERT INTO `question` VALUES (815, '6695c610-f9f7-4bc9-aa00-99b5361ee670', 'single_choice', 3, NULL, 2.00, '1.0', '76', '根据文档内容，以下哪一项是多部门联合部署安全工作的核心目标？', NULL, NULL, '[\"longrule.docx_0\"]', 3, 0, 0, NULL, NULL, '{\"data\": {\"options\": [{\"key\": \"A\", \"content\": \"提升校园安全治理能力与治理水平\"}, {\"key\": \"B\", \"content\": \"减少学校安全事故数量\"}, {\"key\": \"C\", \"content\": \"降低教育经费投入\"}, {\"key\": \"D\", \"content\": \"简化学校管理流程\"}]}, \"stem\": \"根据文档内容，以下哪一项是多部门联合部署安全工作的核心目标？\", \"answer\": \"A\", \"explanation\": \"文档中明确指出，多部门联合部署安全工作的核心目标是‘全面提升校园安全治理能力与治理水平’。\", \"referenced_chunk_ids\": null}', 'pending', NULL, '2026-06-10 05:02:16', '2026-06-10 05:02:16', 0);
INSERT INTO `question` VALUES (816, '77f208cf-e153-487e-82e6-9a75a39a952c', 'single_choice', 3, NULL, 2.00, '1.0', '76', '根据文档内容，为确保学生每天校内体育活动时间落实到位，采取的主要措施是？', NULL, NULL, '[\"longrule.docx_2\"]', 3, 0, 0, NULL, NULL, '{\"data\": {\"options\": [{\"key\": \"A\", \"content\": \"减少课程安排\"}, {\"key\": \"B\", \"content\": \"通过‘晒课表’强化跟踪督导\"}, {\"key\": \"C\", \"content\": \"增加文化课时\"}, {\"key\": \"D\", \"content\": \"限制课外活动\"}]}, \"stem\": \"根据文档内容，为确保学生每天校内体育活动时间落实到位，采取的主要措施是？\", \"answer\": \"B\", \"explanation\": \"文档中明确提到通过‘晒课表’强化跟踪督导，以确保学生每天校内体育活动时间落实到位。\", \"referenced_chunk_ids\": null}', 'pending', NULL, '2026-06-10 05:02:16', '2026-06-10 05:02:16', 0);
INSERT INTO `question` VALUES (817, 'd7b1d74a-f635-4791-bae8-8f0db71e1f07', 'true_false', 3, NULL, 1.00, '1.0', '76', '教育部、应急管理部、市场监管总局、公安部联合部署了2026年全国中小学、幼儿园安全工作。', NULL, NULL, '[\"longrule.docx_0\"]', 3, 0, 0, NULL, NULL, '{\"data\": {}, \"stem\": \"教育部、应急管理部、市场监管总局、公安部联合部署了2026年全国中小学、幼儿园安全工作。\", \"answer\": \"true\", \"explanation\": \"根据文档内容，四部门确实联合部署了2026年的校园安全工作。\", \"referenced_chunk_ids\": null}', 'pending', NULL, '2026-06-10 05:02:16', '2026-06-10 05:02:16', 0);
INSERT INTO `question` VALUES (818, 'dd7c6ff8-faad-47ea-a844-e22b5090d219', 'single_choice', 3, NULL, 2.00, '1.0', '78', '根据第一章总则，以下哪项是该文档的核心目标？', NULL, NULL, '[\"test.docx_0\"]', 22, 0, 0, NULL, NULL, '{\"data\": {\"options\": [{\"key\": \"A\", \"content\": \"明确组织架构\"}, {\"key\": \"B\", \"content\": \"规范操作流程\"}, {\"key\": \"C\", \"content\": \"确立管理原则\"}, {\"key\": \"D\", \"content\": \"界定适用范围\"}]}, \"stem\": \"根据第一章总则，以下哪项是该文档的核心目标？\", \"answer\": \"D\", \"explanation\": \"根据第一章总则的内容，文档的核心目标在于明确其适用范围。\", \"referenced_chunk_ids\": null}', 'pending', NULL, '2026-06-10 05:05:47', '2026-06-10 05:05:47', 0);
INSERT INTO `question` VALUES (819, '030d2975-00f0-4ad0-aa3e-a12667ab9647', 'true_false', 3, NULL, 1.00, '1.0', '78', '第一章总则中提到的制度是针对所有员工的，不包括临时工。', NULL, NULL, '[\"test.docx_0\"]', 22, 0, 0, NULL, NULL, '{\"data\": {}, \"stem\": \"第一章总则中提到的制度是针对所有员工的，不包括临时工。\", \"answer\": \"false\", \"explanation\": \"根据文档内容，第一章总则并未明确排除临时工，因此该陈述不正确。\", \"referenced_chunk_ids\": null}', 'pending', NULL, '2026-06-10 05:05:47', '2026-06-10 05:05:47', 0);
INSERT INTO `question` VALUES (820, 'a79742d8-4914-41c4-9c0e-1710859e5195', 'fill_blank', 3, NULL, 2.00, '1.0', '78', '第一章总则中提到，制定本规定的主要目的是为了规范___和___。', NULL, NULL, '[\"test.docx_0\"]', 22, 0, 0, NULL, NULL, '{\"data\": {\"blank_count\": 2}, \"stem\": \"第一章总则中提到，制定本规定的主要目的是为了规范___和___。\", \"answer\": [[\"管理行为\"], [\"工作流程\"]], \"explanation\": \"根据文档内容，第一章总则明确了制定规定的目的是为了规范管理行为和工作流程。\", \"referenced_chunk_ids\": null}', 'pending', NULL, '2026-06-10 05:05:47', '2026-06-10 05:05:47', 0);
INSERT INTO `question` VALUES (821, '4c1907fa-81c8-4244-9d87-f7affe38b621', 'subjective', 3, NULL, 10.00, '1.0', '78', '请简述第一章总则中提到的核心原则，并结合实际应用场景说明其重要性。', NULL, NULL, '[\"test.docx_0\"]', 22, 0, 0, NULL, NULL, '{\"data\": {}, \"stem\": \"请简述第一章总则中提到的核心原则，并结合实际应用场景说明其重要性。\", \"answer\": \"核心原则包括：1. 以用户需求为导向；2. 保证信息的准确性与可靠性；3. 遵循法律法规和行业规范。在实际应用中，这些原则确保了系统的有效性和合规性，避免因错误信息或违规操作导致的风险。\", \"explanation\": \"根据文档内容，第一章总则明确了系统设计和运营中的核心原则，这些原则为后续章节提供了指导依据。\", \"referenced_chunk_ids\": null}', 'approved', '', '2026-06-10 05:05:47', '2026-06-10 13:24:52', 0);
INSERT INTO `question` VALUES (822, 'bbf40e1d-77d6-4622-adb4-cd859864ea83', 'single_choice', 3, NULL, 2.00, '1.0', '80', '根据第一章总则的内容，以下哪一项是该章节的核心目的？', NULL, NULL, '[\"test.docx_0\"]', 22, 0, 0, NULL, NULL, '{\"data\": {\"options\": [{\"key\": \"A\", \"content\": \"明确具体实施步骤\"}, {\"key\": \"B\", \"content\": \"概述整体框架和原则\"}, {\"key\": \"C\", \"content\": \"详细说明技术细节\"}, {\"key\": \"D\", \"content\": \"提供操作指南\"}]}, \"stem\": \"根据第一章总则的内容，以下哪一项是该章节的核心目的？\", \"answer\": \"B\", \"explanation\": \"第一章总则的主要目的是概述整体框架和原则，为后续内容奠定基础。\", \"referenced_chunk_ids\": null}', 'pending', NULL, '2026-06-10 06:24:40', '2026-06-10 06:24:40', 0);
INSERT INTO `question` VALUES (823, '38469924-eae4-42ea-8357-882ad5f6a313', 'single_choice', 3, NULL, 2.00, '1.0', '80', '根据文档内容，住宿登记坚持哪项原则？', NULL, NULL, '[\"test.docx_3\"]', 22, 0, 0, NULL, NULL, '{\"data\": {\"options\": [{\"key\": \"A\", \"content\": \"实名、实数、实时、实情\"}, {\"key\": \"B\", \"content\": \"实名、实数、实时、实人\"}, {\"key\": \"C\", \"content\": \"实名、实数、实情、实人\"}, {\"key\": \"D\", \"content\": \"实名、实数、实情、实时\"}]}, \"stem\": \"根据文档内容，住宿登记坚持哪项原则？\", \"answer\": \"A\", \"explanation\": \"根据文档内容，住宿登记坚持的是‘实名、实数、实时、实情’原则。\", \"referenced_chunk_ids\": null}', 'pending', NULL, '2026-06-10 06:24:40', '2026-06-10 06:24:40', 0);
INSERT INTO `question` VALUES (824, '409c8cc2-7bcd-46ce-9e86-c4d817f3a704', 'single_choice', 3, NULL, 2.00, '1.0', '80', '根据文档内容，管理人员在日常监督检查中需要定期核查以下哪项内容？', NULL, NULL, '[\"test.docx_5\"]', 22, 0, 0, NULL, NULL, '{\"data\": {\"options\": [{\"key\": \"A\", \"content\": \"员工考勤记录\"}, {\"key\": \"B\", \"content\": \"登记台账、系统上传记录\"}, {\"key\": \"C\", \"content\": \"财务报表\"}, {\"key\": \"D\", \"content\": \"客户投诉记录\"}]}, \"stem\": \"根据文档内容，管理人员在日常监督检查中需要定期核查以下哪项内容？\", \"answer\": \"B\", \"explanation\": \"根据文档第五条内容，管理人员负责日常监督检查，定期核查登记台账、系统上传记录。\", \"referenced_chunk_ids\": null}', 'pending', NULL, '2026-06-10 06:24:40', '2026-06-10 06:24:40', 0);
INSERT INTO `question` VALUES (825, '9d59e7c5-edfc-4517-9fb5-780b389b66fb', 'single_choice', 3, NULL, 2.00, '1.0', '80', '根据文档内容，谁是住宿登记的第一责任人？', NULL, NULL, '[\"test.docx_4\"]', 22, 0, 0, NULL, NULL, '{\"data\": {\"options\": [{\"key\": \"A\", \"content\": \"安保人员\"}, {\"key\": \"B\", \"content\": \"前台工作人员\"}, {\"key\": \"C\", \"content\": \"经理\"}, {\"key\": \"D\", \"content\": \"客户\"}]}, \"stem\": \"根据文档内容，谁是住宿登记的第一责任人？\", \"answer\": \"B\", \"explanation\": \"根据文档第四条，前台工作人员被明确为住宿登记的第一责任人。\", \"referenced_chunk_ids\": null}', 'pending', NULL, '2026-06-10 06:24:40', '2026-06-10 06:24:40', 0);
INSERT INTO `question` VALUES (826, 'ea6a7f44-9077-4f19-b10e-8239a5198f4d', 'single_choice', 3, NULL, 2.00, '1.0', '80', '根据文档内容，当发现人证不符、证件伪造或冒用证件时，应采取的措施是？', NULL, NULL, '[\"test.docx_8\"]', 22, 0, 0, NULL, NULL, '{\"data\": {\"options\": [{\"key\": \"A\", \"content\": \"允许入住并记录信息\"}, {\"key\": \"B\", \"content\": \"一律不予入住并立即上报属地公安机关\"}, {\"key\": \"C\", \"content\": \"暂时允许入住并后续核查\"}, {\"key\": \"D\", \"content\": \"要求重新提供证件\"}]}, \"stem\": \"根据文档内容，当发现人证不符、证件伪造或冒用证件时，应采取的措施是？\", \"answer\": \"B\", \"explanation\": \"根据文档第八条明确规定，发现人证不符、证件伪造、冒用证件的，一律不予入住，并立即上报属地公安机关。\", \"referenced_chunk_ids\": null}', 'pending', NULL, '2026-06-10 06:24:40', '2026-06-10 06:24:40', 0);
INSERT INTO `question` VALUES (827, 'c58d752c-b7f1-48a6-9d5d-54d1d3aba62a', 'true_false', 3, NULL, 1.00, '1.0', '80', '第一章总则中提到的制度是针对所有员工的，没有例外情况。', NULL, NULL, '[\"test.docx_0\"]', 22, 0, 0, NULL, NULL, '{\"data\": {}, \"stem\": \"第一章总则中提到的制度是针对所有员工的，没有例外情况。\", \"answer\": \"false\", \"explanation\": \"根据文档内容，第一章总则并未明确提及所有员工均无例外的情况，因此该陈述不正确。\", \"referenced_chunk_ids\": null}', 'pending', NULL, '2026-06-10 06:24:40', '2026-06-10 06:24:40', 0);
INSERT INTO `question` VALUES (828, '98d7f08e-a538-42fa-b501-c5aa0b5ef9d8', 'true_false', 3, NULL, 1.00, '1.0', '80', '根据文档内容，住宿登记必须坚持实名、实数、实时、实情原则。', NULL, NULL, '[\"test.docx_3\"]', 22, 0, 0, NULL, NULL, '{\"data\": {}, \"stem\": \"根据文档内容，住宿登记必须坚持实名、实数、实时、实情原则。\", \"answer\": \"true\", \"explanation\": \"文档中明确提到住宿登记坚持‘实名、实数、实时、实情’原则。\", \"referenced_chunk_ids\": null}', 'pending', NULL, '2026-06-10 06:24:40', '2026-06-10 06:24:40', 0);
INSERT INTO `question` VALUES (829, '07fc1bfb-bef7-4554-b825-639fed682ae9', 'true_false', 3, NULL, 1.00, '1.0', '80', '管理人员的日常监督检查职责包括定期核查登记台账和系统上传记录。', NULL, NULL, '[\"test.docx_5\"]', 22, 0, 0, NULL, NULL, '{\"data\": {}, \"stem\": \"管理人员的日常监督检查职责包括定期核查登记台账和系统上传记录。\", \"answer\": \"true\", \"explanation\": \"根据文档内容，管理人员负责日常监督检查，并需要定期核查登记台账和系统上传记录。\", \"referenced_chunk_ids\": null}', 'pending', NULL, '2026-06-10 06:24:40', '2026-06-10 06:24:40', 0);
INSERT INTO `question` VALUES (830, '508c9b41-3e9e-43df-98df-51111e124b0a', 'fill_blank', 3, NULL, 2.00, '1.0', '80', '住宿登记坚持____、实数、实时、实情原则，做到一人一证、人证相符、逐人登记、及时上传。', NULL, NULL, '[\"test.docx_3\"]', 22, 0, 0, NULL, NULL, '{\"data\": {\"blank_count\": 1}, \"stem\": \"住宿登记坚持____、实数、实时、实情原则，做到一人一证、人证相符、逐人登记、及时上传。\", \"answer\": [[\"实名\"]], \"explanation\": \"根据文档内容，住宿登记坚持实名、实数、实时、实情原则。\", \"referenced_chunk_ids\": null}', 'pending', NULL, '2026-06-10 06:24:40', '2026-06-10 06:24:40', 0);

-- ----------------------------
-- Table structure for role
-- ----------------------------
DROP TABLE IF EXISTS `role`;
CREATE TABLE `role`  (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '角色 ID',
  `uuid` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT 'uuid()' COMMENT '唯一标识符（用于角色判断和数据交互）',
  `role_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '角色名称',
  `role_code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '角色编码',
  `role_type` tinyint NULL DEFAULT 3 COMMENT '角色类型：1 超级管理员角色，2 部门管理员角色，3 普通用户角色',
  `description` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '角色描述',
  `status` tinyint NULL DEFAULT 1 COMMENT '状态：1 启用，0 禁用',
  `sort_order` int NULL DEFAULT 0 COMMENT '排序号',
  `create_time` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `uk_uuid`(`uuid` ASC) USING BTREE,
  UNIQUE INDEX `uk_role_code`(`role_code` ASC) USING BTREE,
  INDEX `idx_status`(`status` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '角色表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of role
-- ----------------------------
INSERT INTO `role` VALUES (1, 'dad50ea8-392f-11f1-8d4f-7cb566b7fb8c', '系统管理员', 'admin', 1, '系统管理员，拥有所有权限', 1, 1, '2026-04-16 09:01:52', '2026-04-16 09:01:52');
INSERT INTO `role` VALUES (2, 'dad51391-392f-11f1-8d4f-7cb566b7fb8c', '部门管理员', 'dept_admin', 2, '部门管理员，管理本部门事务', 1, 2, '2026-04-16 09:01:52', '2026-04-16 09:01:52');
INSERT INTO `role` VALUES (3, 'dad5150d-392f-11f1-8d4f-7cb566b7fb8c', '普通用户', 'general_user', 3, '普通用户，基础使用权限', 1, 3, '2026-04-16 09:01:52', '2026-04-16 09:01:52');

-- ----------------------------
-- Table structure for role_permission
-- ----------------------------
DROP TABLE IF EXISTS `role_permission`;
CREATE TABLE `role_permission`  (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `role_id` bigint NOT NULL COMMENT '角色 ID',
  `permission_id` bigint NOT NULL COMMENT '权限 ID',
  `create_time` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `uk_role_permission`(`role_id` ASC, `permission_id` ASC) USING BTREE,
  INDEX `idx_role_id`(`role_id` ASC) USING BTREE,
  INDEX `idx_permission_id`(`permission_id` ASC) USING BTREE,
  CONSTRAINT `fk_role_permission_permission` FOREIGN KEY (`permission_id`) REFERENCES `permission` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT,
  CONSTRAINT `fk_role_permission_role` FOREIGN KEY (`role_id`) REFERENCES `role` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 725 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '角色权限关联表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of role_permission
-- ----------------------------
INSERT INTO `role_permission` VALUES (509, 2, 1, '2026-05-17 10:21:30');
INSERT INTO `role_permission` VALUES (510, 2, 8, '2026-05-17 10:21:30');
INSERT INTO `role_permission` VALUES (511, 2, 9, '2026-05-17 10:21:30');
INSERT INTO `role_permission` VALUES (512, 2, 10, '2026-05-17 10:21:30');
INSERT INTO `role_permission` VALUES (513, 2, 12, '2026-05-17 10:21:30');
INSERT INTO `role_permission` VALUES (514, 2, 66, '2026-05-17 10:21:30');
INSERT INTO `role_permission` VALUES (515, 2, 2, '2026-05-17 10:21:30');
INSERT INTO `role_permission` VALUES (516, 2, 13, '2026-05-17 10:21:30');
INSERT INTO `role_permission` VALUES (517, 2, 14, '2026-05-17 10:21:30');
INSERT INTO `role_permission` VALUES (518, 2, 15, '2026-05-17 10:21:30');
INSERT INTO `role_permission` VALUES (519, 2, 3, '2026-05-17 10:21:30');
INSERT INTO `role_permission` VALUES (520, 2, 16, '2026-05-17 10:21:30');
INSERT INTO `role_permission` VALUES (521, 2, 17, '2026-05-17 10:21:30');
INSERT INTO `role_permission` VALUES (522, 2, 4, '2026-05-17 10:21:30');
INSERT INTO `role_permission` VALUES (523, 2, 18, '2026-05-17 10:21:30');
INSERT INTO `role_permission` VALUES (524, 2, 19, '2026-05-17 10:21:30');
INSERT INTO `role_permission` VALUES (525, 2, 20, '2026-05-17 10:21:30');
INSERT INTO `role_permission` VALUES (526, 2, 21, '2026-05-17 10:21:30');
INSERT INTO `role_permission` VALUES (527, 2, 67, '2026-05-17 10:21:30');
INSERT INTO `role_permission` VALUES (552, 3, 8, '2026-05-30 01:28:26');
INSERT INTO `role_permission` VALUES (553, 3, 9, '2026-05-30 01:28:26');
INSERT INTO `role_permission` VALUES (554, 3, 10, '2026-05-30 01:28:26');
INSERT INTO `role_permission` VALUES (555, 3, 16, '2026-05-30 01:28:26');
INSERT INTO `role_permission` VALUES (556, 3, 21, '2026-05-30 01:28:26');
INSERT INTO `role_permission` VALUES (557, 3, 67, '2026-05-30 01:28:26');
INSERT INTO `role_permission` VALUES (558, 3, 1, '2026-05-30 01:28:26');
INSERT INTO `role_permission` VALUES (559, 3, 3, '2026-05-30 01:28:26');
INSERT INTO `role_permission` VALUES (560, 3, 4, '2026-05-30 01:28:26');
INSERT INTO `role_permission` VALUES (705, 1, 8, '2026-06-03 02:30:09');
INSERT INTO `role_permission` VALUES (706, 1, 9, '2026-06-03 02:30:09');
INSERT INTO `role_permission` VALUES (707, 1, 10, '2026-06-03 02:30:09');
INSERT INTO `role_permission` VALUES (708, 1, 13, '2026-06-03 02:30:09');
INSERT INTO `role_permission` VALUES (709, 1, 16, '2026-06-03 02:30:09');
INSERT INTO `role_permission` VALUES (710, 1, 20, '2026-06-03 02:30:09');
INSERT INTO `role_permission` VALUES (711, 1, 25, '2026-06-03 02:30:09');
INSERT INTO `role_permission` VALUES (712, 1, 26, '2026-06-03 02:30:09');
INSERT INTO `role_permission` VALUES (713, 1, 48, '2026-06-03 02:30:09');
INSERT INTO `role_permission` VALUES (714, 1, 65, '2026-06-03 02:30:09');
INSERT INTO `role_permission` VALUES (715, 1, 66, '2026-06-03 02:30:09');
INSERT INTO `role_permission` VALUES (716, 1, 67, '2026-06-03 02:30:09');
INSERT INTO `role_permission` VALUES (717, 1, 68, '2026-06-03 02:30:09');
INSERT INTO `role_permission` VALUES (718, 1, 18, '2026-06-03 02:30:09');
INSERT INTO `role_permission` VALUES (719, 1, 1, '2026-06-03 02:30:09');
INSERT INTO `role_permission` VALUES (720, 1, 3, '2026-06-03 02:30:09');
INSERT INTO `role_permission` VALUES (721, 1, 4, '2026-06-03 02:30:10');
INSERT INTO `role_permission` VALUES (722, 1, 7, '2026-06-03 02:30:10');
INSERT INTO `role_permission` VALUES (723, 1, 55, '2026-06-03 02:30:10');
INSERT INTO `role_permission` VALUES (724, 1, 60, '2026-06-03 02:30:10');

-- ----------------------------
-- Table structure for system_config
-- ----------------------------
DROP TABLE IF EXISTS `system_config`;
CREATE TABLE `system_config`  (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `config_key` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '配置键',
  `config_value` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '配置值',
  `config_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT 'STRING' COMMENT '配置类型：STRING, NUMBER, BOOLEAN, JSON',
  `description` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '配置描述',
  `is_system` tinyint NULL DEFAULT 0 COMMENT '是否系统配置：1 是（不可删除），0 否',
  `create_time` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `uk_config_key`(`config_key` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '系统配置表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of system_config
-- ----------------------------
INSERT INTO `system_config` VALUES (1, 'system_name', '知识管理系统', 'STRING', '系统名称', 1, '2026-04-16 09:01:52', '2026-04-16 09:01:52');
INSERT INTO `system_config` VALUES (2, 'system_version', '1.0.0', 'STRING', '系统版本', 1, '2026-04-16 09:01:52', '2026-04-16 09:01:52');
INSERT INTO `system_config` VALUES (3, 'default_user_role', 'general_user', 'STRING', '默认用户角色编码', 1, '2026-04-16 09:01:52', '2026-04-16 09:01:52');
INSERT INTO `system_config` VALUES (4, 'session_timeout', '7200', 'NUMBER', '会话超时时间（秒）', 1, '2026-04-16 09:01:52', '2026-04-16 09:01:52');
INSERT INTO `system_config` VALUES (5, 'password_expire_days', '90', 'NUMBER', '密码过期天数', 1, '2026-04-16 09:01:52', '2026-04-16 09:01:52');
INSERT INTO `system_config` VALUES (6, 'login_fail_limit', '5', 'NUMBER', '登录失败限制次数', 1, '2026-04-16 09:01:52', '2026-04-16 09:01:52');

-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user`  (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '用户 ID',
  `username` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '用户名',
  `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '密码（bcrypt加密）',
  `real_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '真实姓名',
  `email` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '邮箱',
  `phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '手机号',
  `avatar` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '头像',
  `user_type` tinyint NOT NULL DEFAULT 3 COMMENT '用户类型：1 系统管理员，2 部门管理员，3 普通用户',
  `status` tinyint NULL DEFAULT 1 COMMENT '状态：1 启用，0 禁用',
  `dept_id` bigint NULL DEFAULT NULL COMMENT '所属部门 ID',
  `last_login_time` datetime NULL DEFAULT NULL COMMENT '最后登录时间',
  `create_time` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `uk_username`(`username` ASC) USING BTREE,
  UNIQUE INDEX `uk_email`(`email` ASC) USING BTREE,
  UNIQUE INDEX `uk_phone`(`phone` ASC) USING BTREE,
  INDEX `idx_user_type`(`user_type` ASC) USING BTREE,
  INDEX `idx_dept_id`(`dept_id` ASC) USING BTREE,
  INDEX `idx_status`(`status` ASC) USING BTREE,
  CONSTRAINT `fk_user_dept` FOREIGN KEY (`dept_id`) REFERENCES `department` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 10 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '用户表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of user
-- ----------------------------
INSERT INTO `user` VALUES (1, 'admin', '$2a$10$o/mdlaGbhm7Fm0yrYFGICODFyqYUu/cd9Nj1xzc/qD9r3ukNZQr8W', '系统管理员', 'admin@system.com', '13800000000', NULL, 1, 1, 1, NULL, '2026-04-16 09:05:15', '2026-05-10 19:08:59');
INSERT INTO `user` VALUES (2, 'dept_admin', '$2a$10$o/mdlaGbhm7Fm0yrYFGICODFyqYUu/cd9Nj1xzc/qD9r3ukNZQr8W', '技术部门管理员', 'dept@tech.com', '13800000001', NULL, 2, 1, 3, NULL, '2026-04-16 09:05:15', '2026-05-17 16:52:37');
INSERT INTO `user` VALUES (3, 'user', '$2a$10$o/mdlaGbhm7Fm0yrYFGICODFyqYUu/cd9Nj1xzc/qD9r3ukNZQr8W', '普通用户', 'user@tech.com', '13800000002', NULL, 3, 1, 1, NULL, '2026-04-16 09:05:15', '2026-04-16 09:12:17');
INSERT INTO `user` VALUES (4, 'user_1', '$2a$10$o/mdlaGbhm7Fm0yrYFGICODFyqYUu/cd9Nj1xzc/qD9r3ukNZQr8W', '用户1', 'user_1@example.com', '13800000003', NULL, 3, 1, 1, NULL, '2026-04-16 19:30:00', '2026-04-16 19:30:00');
INSERT INTO `user` VALUES (5, 'user_2', '$2a$10$o/mdlaGbhm7Fm0yrYFGICODFyqYUu/cd9Nj1xzc/qD9r3ukNZQr8W', '用户2', 'user_2@example.com', '13800000004', NULL, 3, 1, 2, NULL, '2026-04-16 19:30:00', '2026-04-16 19:30:00');
INSERT INTO `user` VALUES (6, 'user_3', '$2a$10$o/mdlaGbhm7Fm0yrYFGICODFyqYUu/cd9Nj1xzc/qD9r3ukNZQr8W', '用户3', 'user_3@example.com', '13800000005', NULL, 3, 1, 3, NULL, '2026-04-16 19:30:00', '2026-04-16 19:30:00');
INSERT INTO `user` VALUES (7, 'dept_admin_purchase', '$2a$10$o/mdlaGbhm7Fm0yrYFGICODFyqYUu/cd9Nj1xzc/qD9r3ukNZQr8W', '采购部门管理员', 'dept_admin_purchase@example.com', '13800000006', NULL, 2, 1, 4, NULL, '2026-04-16 19:30:00', '2026-05-17 16:52:32');
INSERT INTO `user` VALUES (8, 'adminhr', '$2a$10$o/mdlaGbhm7Fm0yrYFGICODFyqYUu/cd9Nj1xzc/qD9r3ukNZQr8W', '人事部门管理员', 'dept_admin_hr@example.com', '13800000007', NULL, 2, 1, 6, NULL, '2026-04-16 19:30:00', '2026-05-17 16:52:12');
INSERT INTO `user` VALUES (9, 'dept_admin_public', '$2a$10$o/mdlaGbhm7Fm0yrYFGICODFyqYUu/cd9Nj1xzc/qD9r3ukNZQr8W', '公共部门管理员', 'dept_admin_public@example.com', '13800000008', NULL, 2, 1, 7, NULL, '2026-04-16 19:30:00', '2026-05-17 16:52:23');

-- ----------------------------
-- Table structure for user_answer
-- ----------------------------
DROP TABLE IF EXISTS `user_answer`;
CREATE TABLE `user_answer`  (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `user_id` bigint NOT NULL COMMENT '用户ID',
  `question_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '题目UUID',
  `question_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '题目类型：single_choice | multiple_choice | true_false | fill_blank | subjective',
  `answer_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT 'practice' COMMENT '答题类型：formal_exam-正式考试，mock_exam-模拟考，practice-日常练习',
  `paper_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '试卷ID（考试答题时关联）',
  `session_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '会话ID（日常练习时关联对话上下文）',
  `user_answer` json NOT NULL COMMENT '用户答案（JSON格式，支持各种题型）',
  `score` decimal(5, 2) NULL DEFAULT 0.00 COMMENT '得分',
  `max_score` decimal(5, 2) NULL DEFAULT NULL COMMENT '题目满分',
  `is_correct` tinyint NULL DEFAULT NULL COMMENT '是否正确：0-错误，1-正确，2-部分正确',
  `grading_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT 'auto' COMMENT '批改类型：auto-自动批改，manual-人工批改，llm-AI批改',
  `feedback` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '批改反馈/评语',
  `graded_by` bigint NULL DEFAULT NULL COMMENT '批阅人ID',
  `graded_at` datetime NULL DEFAULT NULL COMMENT '批阅时间',
  `time_spent` int NULL DEFAULT 0 COMMENT '单题答题耗时（秒）',
  `paper_time_spent` int NULL DEFAULT 0 COMMENT '试卷总耗时（秒，仅考试场景使用）',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '答题时间',
  `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `uk_user_question_type`(`user_id` ASC, `question_id` ASC, `paper_id` ASC, `answer_type` ASC) USING BTREE COMMENT '用户-题目-试卷-答题类型唯一索引',
  INDEX `idx_user_id`(`user_id` ASC) USING BTREE,
  INDEX `idx_question_id`(`question_id` ASC) USING BTREE,
  INDEX `idx_paper_id`(`paper_id` ASC) USING BTREE,
  INDEX `idx_answer_type`(`answer_type` ASC) USING BTREE,
  INDEX `idx_created_at`(`created_at` ASC) USING BTREE,
  CONSTRAINT `fk_user_answer_question` FOREIGN KEY (`question_id`) REFERENCES `question` (`question_id`) ON DELETE CASCADE ON UPDATE RESTRICT,
  CONSTRAINT `fk_user_answer_user` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 402 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '用户答题记录表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of user_answer
-- ----------------------------
INSERT INTO `user_answer` VALUES (378, 1, 'dd7c6ff8-faad-47ea-a844-e22b5090d219', 'single_choice', 'formal_exam', '35402037-40f1-4119-b1d6-6ed68d7268f8', NULL, '\"A\"', 0.00, 2.00, 0, 'ai', '正确答案: None', NULL, NULL, 0, 0, '2026-06-10 05:27:19', '2026-06-10 05:27:19');
INSERT INTO `user_answer` VALUES (379, 1, 'a79742d8-4914-41c4-9c0e-1710859e5195', 'fill_blank', 'formal_exam', '35402037-40f1-4119-b1d6-6ed68d7268f8', NULL, '[\"1\", \"1\"]', 0.00, 2.00, 0, 'ai', NULL, NULL, NULL, 0, 0, '2026-06-10 05:27:19', '2026-06-10 05:27:19');
INSERT INTO `user_answer` VALUES (383, 1, 'ea6a7f44-9077-4f19-b10e-8239a5198f4d', 'single_choice', 'formal_exam', 'a310b3e9-e1c6-4afb-9945-abd7565cfcb5', NULL, '\"B\"', 0.00, 2.00, 0, 'ai', '正确答案: None', NULL, NULL, 0, 0, '2026-06-10 06:37:47', '2026-06-10 06:37:47');
INSERT INTO `user_answer` VALUES (384, 1, '9d59e7c5-edfc-4517-9fb5-780b389b66fb', 'single_choice', 'formal_exam', 'a310b3e9-e1c6-4afb-9945-abd7565cfcb5', NULL, '\"B\"', 0.00, 2.00, 0, 'ai', '正确答案: None', NULL, NULL, 0, 0, '2026-06-10 06:37:47', '2026-06-10 06:37:47');
INSERT INTO `user_answer` VALUES (385, 1, '409c8cc2-7bcd-46ce-9e86-c4d817f3a704', 'single_choice', 'formal_exam', 'a310b3e9-e1c6-4afb-9945-abd7565cfcb5', NULL, '\"B\"', 0.00, 2.00, 0, 'ai', '正确答案: None', NULL, NULL, 0, 0, '2026-06-10 06:37:47', '2026-06-10 06:37:47');
INSERT INTO `user_answer` VALUES (386, 1, 'ea6a7f44-9077-4f19-b10e-8239a5198f4d', 'single_choice', 'formal_exam', 'd55c332f-4de2-42ec-9859-d3dc2f68c8b5', NULL, '\"B\"', 0.00, 2.00, 0, 'ai', '正确答案: None', NULL, NULL, 0, 0, '2026-06-10 10:47:18', '2026-06-10 10:47:18');
INSERT INTO `user_answer` VALUES (387, 1, '9d59e7c5-edfc-4517-9fb5-780b389b66fb', 'single_choice', 'formal_exam', 'd55c332f-4de2-42ec-9859-d3dc2f68c8b5', NULL, '\"B\"', 0.00, 2.00, 0, 'ai', '正确答案: None', NULL, NULL, 0, 0, '2026-06-10 10:47:18', '2026-06-10 10:47:18');
INSERT INTO `user_answer` VALUES (388, 1, '409c8cc2-7bcd-46ce-9e86-c4d817f3a704', 'single_choice', 'formal_exam', 'd55c332f-4de2-42ec-9859-d3dc2f68c8b5', NULL, '\"\"', 0.00, 2.00, 0, 'ai', '正确答案: None', NULL, NULL, 0, 0, '2026-06-10 10:47:18', '2026-06-10 10:47:18');
INSERT INTO `user_answer` VALUES (391, 1, 'ea6a7f44-9077-4f19-b10e-8239a5198f4d', 'single_choice', 'formal_exam', '75d386fc-e4e4-46cd-89d2-513daa4c7c48', NULL, '\"B\"', 0.00, 2.00, 0, 'ai', '正确答案: None', NULL, NULL, 0, 0, '2026-06-10 10:51:08', '2026-06-10 10:51:08');
INSERT INTO `user_answer` VALUES (392, 1, '9d59e7c5-edfc-4517-9fb5-780b389b66fb', 'single_choice', 'formal_exam', '75d386fc-e4e4-46cd-89d2-513daa4c7c48', NULL, '\"\"', 0.00, 2.00, 0, 'ai', '正确答案: None', NULL, NULL, 0, 0, '2026-06-10 10:51:08', '2026-06-10 10:51:08');
INSERT INTO `user_answer` VALUES (393, 1, 'ea6a7f44-9077-4f19-b10e-8239a5198f4d', 'single_choice', 'formal_exam', 'cab7be14-dd8f-4e02-9bef-13d9a14ab89e', NULL, '\"B\"', 0.00, 2.00, 0, 'ai', '正确答案: None', NULL, NULL, 0, 0, '2026-06-10 10:52:08', '2026-06-10 10:52:08');
INSERT INTO `user_answer` VALUES (394, 1, '9d59e7c5-edfc-4517-9fb5-780b389b66fb', 'single_choice', 'formal_exam', 'cab7be14-dd8f-4e02-9bef-13d9a14ab89e', NULL, '\"B\"', 0.00, 2.00, 0, 'ai', '正确答案: None', NULL, NULL, 0, 0, '2026-06-10 10:52:08', '2026-06-10 10:52:08');
INSERT INTO `user_answer` VALUES (395, 1, '409c8cc2-7bcd-46ce-9e86-c4d817f3a704', 'single_choice', 'formal_exam', 'cab7be14-dd8f-4e02-9bef-13d9a14ab89e', NULL, '\"B\"', 0.00, 2.00, 0, 'ai', '正确答案: None', NULL, NULL, 0, 0, '2026-06-10 10:52:08', '2026-06-10 10:52:08');
INSERT INTO `user_answer` VALUES (396, 1, 'ea6a7f44-9077-4f19-b10e-8239a5198f4d', 'single_choice', 'formal_exam', '92b2dcf6-ba57-4798-8a1c-33e249ed7e20', NULL, '\"B\"', 0.00, 2.00, 0, 'ai', '正确答案: None', NULL, NULL, 0, 0, '2026-06-10 11:09:19', '2026-06-10 11:09:19');
INSERT INTO `user_answer` VALUES (397, 1, '9d59e7c5-edfc-4517-9fb5-780b389b66fb', 'single_choice', 'formal_exam', '92b2dcf6-ba57-4798-8a1c-33e249ed7e20', NULL, '\"A\"', 0.00, 2.00, 0, 'ai', '正确答案: None', NULL, NULL, 0, 0, '2026-06-10 11:09:19', '2026-06-10 11:09:19');
INSERT INTO `user_answer` VALUES (398, 1, '409c8cc2-7bcd-46ce-9e86-c4d817f3a704', 'single_choice', 'formal_exam', '92b2dcf6-ba57-4798-8a1c-33e249ed7e20', NULL, '\"A\"', 0.00, 2.00, 0, 'ai', '正确答案: None', NULL, NULL, 0, 0, '2026-06-10 11:09:19', '2026-06-10 11:09:19');
INSERT INTO `user_answer` VALUES (399, 1, 'ea6a7f44-9077-4f19-b10e-8239a5198f4d', 'single_choice', 'formal_exam', '4e1c48d5-2019-48b6-a31b-2fea3ebf1b6f', NULL, '\"B\"', 0.00, 2.00, 0, 'ai', '正确答案: None', NULL, NULL, 0, 0, '2026-06-10 11:11:49', '2026-06-10 11:11:49');
INSERT INTO `user_answer` VALUES (400, 1, '9d59e7c5-edfc-4517-9fb5-780b389b66fb', 'single_choice', 'formal_exam', '4e1c48d5-2019-48b6-a31b-2fea3ebf1b6f', NULL, '\"B\"', 0.00, 2.00, 0, 'ai', '正确答案: None', NULL, NULL, 0, 0, '2026-06-10 11:11:49', '2026-06-10 11:11:49');

-- ----------------------------
-- Table structure for user_role
-- ----------------------------
DROP TABLE IF EXISTS `user_role`;
CREATE TABLE `user_role`  (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `user_id` bigint NOT NULL COMMENT '用户 ID',
  `role_id` bigint NOT NULL COMMENT '角色 ID',
  `create_time` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `uk_user_role`(`user_id` ASC, `role_id` ASC) USING BTREE,
  INDEX `idx_user_id`(`user_id` ASC) USING BTREE,
  INDEX `idx_role_id`(`role_id` ASC) USING BTREE,
  CONSTRAINT `fk_user_role_role` FOREIGN KEY (`role_id`) REFERENCES `role` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT,
  CONSTRAINT `fk_user_role_user` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 10 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '用户角色关联表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of user_role
-- ----------------------------
INSERT INTO `user_role` VALUES (1, 1, 1, '2026-04-16 09:05:15');
INSERT INTO `user_role` VALUES (2, 2, 2, '2026-04-16 09:05:15');
INSERT INTO `user_role` VALUES (3, 3, 3, '2026-04-16 09:05:15');
INSERT INTO `user_role` VALUES (4, 4, 3, '2026-04-16 19:30:00');
INSERT INTO `user_role` VALUES (5, 5, 3, '2026-04-16 19:30:00');
INSERT INTO `user_role` VALUES (6, 6, 3, '2026-04-16 19:30:00');
INSERT INTO `user_role` VALUES (7, 7, 2, '2026-04-16 19:30:00');
INSERT INTO `user_role` VALUES (8, 8, 2, '2026-04-16 19:30:00');
INSERT INTO `user_role` VALUES (9, 9, 2, '2026-04-16 19:30:00');

-- ----------------------------
-- Table structure for wrong_question_collection
-- ----------------------------
DROP TABLE IF EXISTS `wrong_question_collection`;
CREATE TABLE `wrong_question_collection`  (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `user_id` bigint NOT NULL COMMENT '用户ID',
  `answer_id` bigint NULL DEFAULT NULL COMMENT '答题记录ID',
  `question_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '题目ID',
  `note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '备注',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `uk_user_answer`(`user_id` ASC, `answer_id` ASC) USING BTREE,
  INDEX `idx_user_id`(`user_id` ASC) USING BTREE,
  INDEX `idx_answer_id`(`answer_id` ASC) USING BTREE,
  INDEX `idx_question_id`(`question_id` ASC) USING BTREE,
  INDEX `idx_user_question`(`user_id` ASC, `question_id` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '错题收藏表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of wrong_question_collection
-- ----------------------------
INSERT INTO `wrong_question_collection` VALUES (1, 1, NULL, '2d4cbe7f-0c72-49ed-815c-bcd38a025f4e', NULL, '2026-05-11 08:03:46', '2026-05-11 08:03:46');

-- ----------------------------
-- View structure for v_role_permission
-- ----------------------------
DROP VIEW IF EXISTS `v_role_permission`;
CREATE ALGORITHM = UNDEFINED SQL SECURITY DEFINER VIEW `v_role_permission` AS select `r`.`id` AS `role_id`,`r`.`uuid` AS `role_uuid`,`r`.`role_name` AS `role_name`,`r`.`role_code` AS `role_code`,`r`.`role_type` AS `role_type`,`r`.`description` AS `description`,`r`.`status` AS `status`,`p`.`id` AS `permission_id`,`p`.`uuid` AS `permission_uuid`,`p`.`permission_name` AS `permission_name`,`p`.`permission_code` AS `permission_code`,`p`.`type` AS `permission_type`,`p`.`parent_id` AS `parent_id`,`p`.`path` AS `path`,`p`.`icon` AS `icon`,`p`.`sort_order` AS `sort_order` from ((`role` `r` join `role_permission` `rp` on((`r`.`id` = `rp`.`role_id`))) join `permission` `p` on(((`rp`.`permission_id` = `p`.`id`) and (`p`.`status` = 1)))) where (`r`.`status` = 1);

-- ----------------------------
-- View structure for v_user_info
-- ----------------------------
DROP VIEW IF EXISTS `v_user_info`;
CREATE ALGORITHM = UNDEFINED SQL SECURITY DEFINER VIEW `v_user_info` AS select `u`.`id` AS `id`,`u`.`username` AS `username`,`u`.`real_name` AS `real_name`,`u`.`email` AS `email`,`u`.`phone` AS `phone`,`u`.`avatar` AS `avatar`,`u`.`user_type` AS `user_type`,(case `u`.`user_type` when 1 then '系统管理员' when 2 then '部门管理员' else '普通用户' end) AS `user_type_name`,`u`.`status` AS `status`,(case `u`.`status` when 1 then '启用' else '禁用' end) AS `status_name`,`u`.`dept_id` AS `dept_id`,`d`.`dept_name` AS `dept_name`,`d`.`dept_code` AS `dept_code`,`u`.`last_login_time` AS `last_login_time`,`u`.`create_time` AS `create_time`,`u`.`update_time` AS `update_time`,group_concat(distinct `r`.`role_name` separator ',') AS `role_names`,group_concat(distinct `r`.`role_code` separator ',') AS `role_codes`,(select count(distinct `da`.`dept_id`) from `dept_admin` `da` where ((`da`.`user_id` = `u`.`id`) and (`da`.`status` = 1))) AS `managed_dept_count` from (((`user` `u` left join `department` `d` on((`u`.`dept_id` = `d`.`id`))) left join `user_role` `ur` on((`u`.`id` = `ur`.`user_id`))) left join `role` `r` on((`ur`.`role_id` = `r`.`id`))) group by `u`.`id`;

-- ----------------------------
-- View structure for v_user_permission
-- ----------------------------
DROP VIEW IF EXISTS `v_user_permission`;
CREATE ALGORITHM = UNDEFINED SQL SECURITY DEFINER VIEW `v_user_permission` AS select `u`.`id` AS `user_id`,`u`.`username` AS `username`,`u`.`user_type` AS `user_type`,`r`.`id` AS `role_id`,`r`.`uuid` AS `role_uuid`,`r`.`role_name` AS `role_name`,`r`.`role_code` AS `role_code`,`p`.`id` AS `permission_id`,`p`.`uuid` AS `permission_uuid`,`p`.`permission_name` AS `permission_name`,`p`.`permission_code` AS `permission_code`,`p`.`type` AS `permission_type`,`p`.`path` AS `path` from ((((`user` `u` join `user_role` `ur` on((`u`.`id` = `ur`.`user_id`))) join `role` `r` on(((`ur`.`role_id` = `r`.`id`) and (`r`.`status` = 1)))) join `role_permission` `rp` on((`r`.`id` = `rp`.`role_id`))) join `permission` `p` on(((`rp`.`permission_id` = `p`.`id`) and (`p`.`status` = 1)))) where (`u`.`status` = 1);

-- ----------------------------
-- Triggers structure for table question
-- ----------------------------
DROP TRIGGER IF EXISTS `trg_question_question_id`;
delimiter ;;
CREATE TRIGGER `trg_question_question_id` BEFORE INSERT ON `question` FOR EACH ROW BEGIN
  IF NEW.question_id IS NULL OR NEW.question_id = '' THEN
    SET NEW.question_id = UUID();
  END IF;
END
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table role
-- ----------------------------
DROP TRIGGER IF EXISTS `trg_role_uuid`;
delimiter ;;
CREATE TRIGGER `trg_role_uuid` BEFORE INSERT ON `role` FOR EACH ROW BEGIN
  IF NEW.uuid IS NULL OR NEW.uuid = '' THEN
    SET NEW.uuid = UUID();
  END IF;
END
;;
delimiter ;

SET FOREIGN_KEY_CHECKS = 1;
