feat: 初始化考培练系统项目
- 从服务器拉取完整代码 - 按框架规范整理项目结构 - 配置 Drone CI 测试环境部署 - 包含后端(FastAPI)、前端(Vue3)、管理端 技术栈: Vue3 + TypeScript + FastAPI + MySQL
This commit is contained in:
817
知识库/backups/updates/backup_20250926_044558_database.sql
Normal file
817
知识库/backups/updates/backup_20250926_044558_database.sql
Normal file
@@ -0,0 +1,817 @@
|
||||
-- MySQL dump 10.13 Distrib 8.0.43, for Linux (x86_64)
|
||||
--
|
||||
-- Host: localhost Database: kaopeilian
|
||||
-- ------------------------------------------------------
|
||||
-- Server version 8.0.43
|
||||
|
||||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
||||
/*!50503 SET NAMES utf8mb4 */;
|
||||
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
|
||||
/*!40103 SET TIME_ZONE='+00:00' */;
|
||||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
|
||||
--
|
||||
-- Table structure for table `course_exam_settings`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `course_exam_settings`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `course_exam_settings` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`course_id` int NOT NULL COMMENT '课程ID',
|
||||
`single_choice_count` int NOT NULL DEFAULT '10' COMMENT '单选题数量',
|
||||
`multiple_choice_count` int NOT NULL DEFAULT '5' COMMENT '多选题数量',
|
||||
`true_false_count` int NOT NULL DEFAULT '5' COMMENT '判断题数量',
|
||||
`fill_blank_count` int NOT NULL DEFAULT '0' COMMENT '填空题数量',
|
||||
`duration_minutes` int NOT NULL DEFAULT '60' COMMENT '考试时长(分钟)',
|
||||
`difficulty_level` int NOT NULL DEFAULT '3' COMMENT '难度系数(1-5)',
|
||||
`passing_score` int NOT NULL DEFAULT '60' COMMENT '及格分数',
|
||||
`is_enabled` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是否启用',
|
||||
`show_answer_immediately` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否立即显示答案',
|
||||
`allow_retake` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是否允许重考',
|
||||
`max_retake_times` int DEFAULT NULL COMMENT '最大重考次数',
|
||||
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`is_deleted` tinyint(1) NOT NULL DEFAULT '0',
|
||||
`deleted_at` datetime DEFAULT NULL,
|
||||
`deleted_by` int DEFAULT NULL COMMENT '删除人ID',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `course_id` (`course_id`),
|
||||
KEY `ix_course_exam_settings_id` (`id`),
|
||||
CONSTRAINT `course_exam_settings_ibfk_1` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='课程考试设置表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `course_exam_settings`
|
||||
--
|
||||
|
||||
LOCK TABLES `course_exam_settings` WRITE;
|
||||
/*!40000 ALTER TABLE `course_exam_settings` DISABLE KEYS */;
|
||||
INSERT INTO `course_exam_settings` VALUES (1,1,5,3,2,0,60,2,80,1,1,1,3,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(2,2,4,2,2,2,45,1,75,1,1,1,3,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(3,3,3,2,3,2,50,2,80,1,0,1,2,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(4,4,4,3,2,1,55,2,85,1,1,1,3,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(5,5,5,2,2,1,40,1,70,1,1,1,5,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(6,6,3,2,3,2,45,1,75,1,1,1,3,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(7,7,4,2,2,2,50,2,80,1,0,1,2,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(8,8,5,3,2,0,60,3,85,1,1,1,2,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(9,9,4,2,4,0,50,2,80,1,1,1,3,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(10,10,3,2,3,2,45,1,75,1,1,1,3,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(11,11,5,3,2,0,60,3,90,1,0,1,2,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(12,12,4,2,4,0,40,1,70,1,1,1,5,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL);
|
||||
/*!40000 ALTER TABLE `course_exam_settings` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `course_materials`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `course_materials`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `course_materials` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`course_id` int NOT NULL COMMENT '所属课程ID',
|
||||
`name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '资料名称',
|
||||
`description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '资料描述',
|
||||
`file_url` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '文件URL',
|
||||
`file_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '文件类型',
|
||||
`file_size` int NOT NULL COMMENT '文件大小(字节)',
|
||||
`sort_order` int DEFAULT '0' COMMENT '排序序号',
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_course_id` (`course_id`),
|
||||
KEY `idx_is_deleted` (`is_deleted`),
|
||||
CONSTRAINT `course_materials_ibfk_1` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='课程资料表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `course_materials`
|
||||
--
|
||||
|
||||
LOCK TABLES `course_materials` WRITE;
|
||||
/*!40000 ALTER TABLE `course_materials` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `course_materials` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `courses`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `courses`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `courses` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '课程名称',
|
||||
`description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '课程描述',
|
||||
`category` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '课程分类',
|
||||
`status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'draft' COMMENT '课程状态',
|
||||
`cover_image` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '封面图片',
|
||||
`duration_hours` decimal(5,2) DEFAULT NULL COMMENT '课程时长(小时)',
|
||||
`difficulty_level` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '难度等级',
|
||||
`tags` json DEFAULT NULL COMMENT '标签列表',
|
||||
`published_at` datetime DEFAULT NULL COMMENT '发布时间',
|
||||
`publisher_id` int DEFAULT NULL COMMENT '发布人ID',
|
||||
`sort_order` int DEFAULT '0' COMMENT '排序',
|
||||
`is_featured` tinyint(1) DEFAULT '0' COMMENT '是否推荐',
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_status` (`status`),
|
||||
KEY `idx_category` (`category`),
|
||||
KEY `idx_is_featured` (`is_featured`),
|
||||
KEY `idx_is_deleted` (`is_deleted`),
|
||||
KEY `idx_sort_order` (`sort_order`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='课程信息表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `courses`
|
||||
--
|
||||
|
||||
LOCK TABLES `courses` WRITE;
|
||||
/*!40000 ALTER TABLE `courses` DISABLE KEYS */;
|
||||
INSERT INTO `courses` VALUES (1,'皮肤生理学基础','学习皮肤结构、功能和常见问题,为专业护理打下坚实基础','technology','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(2,'医美产品知识与应用','全面了解各类医美产品的成分、功效和适用人群,掌握产品推荐技巧','technology','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(3,'美容仪器操作与维护','掌握各类美容仪器的操作方法、注意事项和日常维护保养','technology','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(4,'医美项目介绍与咨询','详细了解各类医美项目的原理、效果和适应症,提升咨询专业度','business','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(5,'轻医美销售技巧','学习专业的销售话术、客户需求分析和成交技巧,提升业绩能力','business','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(6,'客户服务与投诉处理','提升服务意识,掌握客户投诉处理的方法和技巧,维护品牌形象','management','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(7,'社媒营销与私域运营','学习如何通过社交媒体进行品牌推广和客户维护,建立私域流量','business','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(8,'门店运营管理','学习门店日常管理、团队建设和业绩管理的方法和技巧','management','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(9,'卫生消毒与感染控制','学习医美机构的卫生标准和消毒流程,确保服务安全合规','general','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(10,'美容心理学','了解客户心理需求,掌握沟通技巧,提升服务满意度','general','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(11,'法律法规与行业规范','学习医美行业相关法律法规,确保合规经营','general','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(12,'新员工入职培训','新员工必修课程,包含企业文化、基础知识和操作规范','general','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24');
|
||||
/*!40000 ALTER TABLE `courses` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `exam_results`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `exam_results`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `exam_results` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`exam_id` int NOT NULL COMMENT '考试ID',
|
||||
`question_id` int NOT NULL COMMENT '题目ID',
|
||||
`user_answer` json DEFAULT NULL COMMENT '用户答案',
|
||||
`is_correct` tinyint(1) NOT NULL COMMENT '是否正确',
|
||||
`score` decimal(5,2) NOT NULL COMMENT '考试得分',
|
||||
`answer_time` int DEFAULT NULL COMMENT '答题时长(秒)',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_exam_id` (`exam_id`),
|
||||
KEY `idx_question_id` (`question_id`),
|
||||
CONSTRAINT `exam_results_ibfk_1` FOREIGN KEY (`exam_id`) REFERENCES `exams` (`id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `exam_results_ibfk_2` FOREIGN KEY (`question_id`) REFERENCES `questions` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='考试结果表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `exam_results`
|
||||
--
|
||||
|
||||
LOCK TABLES `exam_results` WRITE;
|
||||
/*!40000 ALTER TABLE `exam_results` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `exam_results` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `exams`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `exams`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `exams` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`user_id` int NOT NULL COMMENT '用户ID',
|
||||
`course_id` int NOT NULL COMMENT '课程ID',
|
||||
`exam_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '考试名称',
|
||||
`question_count` int DEFAULT NULL COMMENT '题目数量',
|
||||
`total_score` decimal(5,2) DEFAULT NULL COMMENT '总分',
|
||||
`pass_score` decimal(5,2) DEFAULT NULL COMMENT '及格分',
|
||||
`start_time` datetime DEFAULT NULL COMMENT '开始时间',
|
||||
`end_time` datetime DEFAULT NULL COMMENT '结束时间',
|
||||
`duration_minutes` int DEFAULT NULL COMMENT '考试时长(分钟)',
|
||||
`score` decimal(5,2) DEFAULT NULL COMMENT '得分',
|
||||
`is_passed` tinyint(1) DEFAULT '0' COMMENT '是否通过',
|
||||
`status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'pending' COMMENT '考试状态',
|
||||
`questions` json DEFAULT NULL COMMENT '题目数据(JSON格式)',
|
||||
`answers` json DEFAULT NULL COMMENT '答案数据(JSON格式)',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_user_id` (`user_id`),
|
||||
KEY `idx_course_id` (`course_id`),
|
||||
KEY `idx_status` (`status`),
|
||||
CONSTRAINT `exams_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `exams_ibfk_2` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='考试记录表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `exams`
|
||||
--
|
||||
|
||||
LOCK TABLES `exams` WRITE;
|
||||
/*!40000 ALTER TABLE `exams` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `exams` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `growth_paths`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `growth_paths`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `growth_paths` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '成长路径名称',
|
||||
`description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '路径描述',
|
||||
`target_role` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '目标角色',
|
||||
`courses` json DEFAULT NULL COMMENT '课程列表',
|
||||
`estimated_duration_days` int DEFAULT NULL COMMENT '预计完成天数',
|
||||
`is_active` tinyint(1) DEFAULT '1' COMMENT '是否启用',
|
||||
`sort_order` int DEFAULT '0' COMMENT '排序顺序',
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_is_active` (`is_active`),
|
||||
KEY `idx_is_deleted` (`is_deleted`),
|
||||
KEY `idx_sort_order` (`sort_order`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='成长路径表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `growth_paths`
|
||||
--
|
||||
|
||||
LOCK TABLES `growth_paths` WRITE;
|
||||
/*!40000 ALTER TABLE `growth_paths` DISABLE KEYS */;
|
||||
INSERT INTO `growth_paths` VALUES (1,'美容顾问成长路径','从初级美容顾问到资深顾问的完整成长路径,包含专业技能和销售能力提升','资深美容顾问',NULL,NULL,1,0,0,NULL,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(2,'美容技师进阶路径','美容技师的技能进阶路径,从基础护理到高级项目操作','高级美容技师',NULL,NULL,1,0,0,NULL,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(3,'管理岗位培养路径','从一线员工到管理岗位的培养路径,包含领导力和管理技能','店长/区域经理',NULL,NULL,1,0,0,NULL,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(4,'医美咨询师专业路径','医美咨询师的专业发展路径,深度掌握医美项目知识','资深医美咨询师',NULL,NULL,1,0,0,NULL,'2025-09-23 02:39:48','2025-09-23 02:39:48');
|
||||
/*!40000 ALTER TABLE `growth_paths` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `knowledge_points`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `knowledge_points`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `knowledge_points` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`course_id` int DEFAULT NULL COMMENT '所属课程ID',
|
||||
`name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '知识点名称',
|
||||
`description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '知识点描述',
|
||||
`parent_id` int DEFAULT NULL COMMENT '父知识点ID',
|
||||
`level` int DEFAULT '1' COMMENT '层级深度',
|
||||
`path` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '知识点路径',
|
||||
`sort_order` int DEFAULT '0' COMMENT '排序顺序',
|
||||
`weight` decimal(3,2) DEFAULT '1.00' COMMENT '权重',
|
||||
`is_required` tinyint(1) DEFAULT '1' COMMENT '是否必修',
|
||||
`estimated_hours` decimal(4,2) DEFAULT NULL COMMENT '预计学习时间(小时)',
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_course_id` (`course_id`),
|
||||
KEY `idx_parent_id` (`parent_id`),
|
||||
KEY `idx_is_deleted` (`is_deleted`),
|
||||
KEY `idx_sort_order` (`sort_order`),
|
||||
CONSTRAINT `knowledge_points_ibfk_1` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `knowledge_points_ibfk_2` FOREIGN KEY (`parent_id`) REFERENCES `knowledge_points` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='知识点表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `knowledge_points`
|
||||
--
|
||||
|
||||
LOCK TABLES `knowledge_points` WRITE;
|
||||
/*!40000 ALTER TABLE `knowledge_points` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `knowledge_points` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `material_knowledge_points`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `material_knowledge_points`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `material_knowledge_points` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`material_id` int NOT NULL COMMENT '资料ID',
|
||||
`knowledge_point_id` int NOT NULL COMMENT '知识点ID',
|
||||
`sort_order` int DEFAULT '0' COMMENT '排序顺序',
|
||||
`is_ai_generated` tinyint(1) DEFAULT '0' COMMENT '是否AI生成',
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `idx_material_knowledge` (`material_id`,`knowledge_point_id`),
|
||||
KEY `idx_material_id` (`material_id`),
|
||||
KEY `idx_knowledge_point_id` (`knowledge_point_id`),
|
||||
CONSTRAINT `material_knowledge_points_ibfk_1` FOREIGN KEY (`material_id`) REFERENCES `course_materials` (`id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `material_knowledge_points_ibfk_2` FOREIGN KEY (`knowledge_point_id`) REFERENCES `knowledge_points` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='资料知识点关联表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `material_knowledge_points`
|
||||
--
|
||||
|
||||
LOCK TABLES `material_knowledge_points` WRITE;
|
||||
/*!40000 ALTER TABLE `material_knowledge_points` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `material_knowledge_points` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `position_courses`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `position_courses`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `position_courses` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`position_id` int NOT NULL COMMENT '岗位ID',
|
||||
`course_id` int NOT NULL COMMENT '课程ID',
|
||||
`course_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'required' COMMENT '课程类型(必修/选修)',
|
||||
`priority` int DEFAULT '0' COMMENT '优先级',
|
||||
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`is_deleted` tinyint(1) NOT NULL DEFAULT '0',
|
||||
`deleted_at` datetime DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uix_position_course` (`position_id`,`course_id`,`is_deleted`),
|
||||
KEY `course_id` (`course_id`),
|
||||
KEY `ix_position_courses_id` (`id`),
|
||||
CONSTRAINT `position_courses_ibfk_1` FOREIGN KEY (`position_id`) REFERENCES `positions` (`id`),
|
||||
CONSTRAINT `position_courses_ibfk_2` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='岗位课程关联表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `position_courses`
|
||||
--
|
||||
|
||||
LOCK TABLES `position_courses` WRITE;
|
||||
/*!40000 ALTER TABLE `position_courses` DISABLE KEYS */;
|
||||
INSERT INTO `position_courses` VALUES (1,1,6,'required',1,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(2,1,8,'required',2,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(3,1,11,'required',3,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(4,1,12,'required',4,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(5,3,1,'required',1,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(6,3,2,'required',2,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(7,3,5,'required',3,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(8,3,6,'required',4,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(9,3,10,'required',5,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(10,3,12,'required',6,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(11,4,1,'required',1,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(12,4,2,'required',2,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(13,4,4,'required',3,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(14,4,5,'required',4,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(15,4,9,'required',5,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(16,4,12,'required',6,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(17,5,1,'required',1,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(18,5,2,'required',2,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(19,5,3,'required',3,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(20,5,9,'required',4,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(21,5,12,'required',5,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(22,7,6,'required',1,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(23,7,10,'required',2,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(24,7,12,'required',3,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL);
|
||||
/*!40000 ALTER TABLE `position_courses` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `position_members`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `position_members`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `position_members` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`position_id` int NOT NULL COMMENT '岗位ID',
|
||||
`user_id` int NOT NULL COMMENT '用户ID',
|
||||
`role` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '在岗位中的角色',
|
||||
`joined_at` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '加入时间',
|
||||
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`is_deleted` tinyint(1) NOT NULL DEFAULT '0',
|
||||
`deleted_at` datetime DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uix_position_user` (`position_id`,`user_id`,`is_deleted`),
|
||||
KEY `user_id` (`user_id`),
|
||||
KEY `ix_position_members_id` (`id`),
|
||||
CONSTRAINT `position_members_ibfk_1` FOREIGN KEY (`position_id`) REFERENCES `positions` (`id`),
|
||||
CONSTRAINT `position_members_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='岗位成员关联表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `position_members`
|
||||
--
|
||||
|
||||
LOCK TABLES `position_members` WRITE;
|
||||
/*!40000 ALTER TABLE `position_members` DISABLE KEYS */;
|
||||
INSERT INTO `position_members` VALUES (1,1,3,NULL,'2025-09-22 18:42:32','2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(2,1,4,NULL,'2025-09-22 18:42:32','2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(3,3,5,NULL,'2025-09-22 18:42:32','2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(4,4,6,NULL,'2025-09-22 18:42:32','2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(5,5,7,NULL,'2025-09-22 18:42:32','2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(6,7,8,NULL,'2025-09-22 18:42:32','2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL);
|
||||
/*!40000 ALTER TABLE `position_members` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `positions`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `positions`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `positions` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '岗位名称',
|
||||
`code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '岗位代码',
|
||||
`description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '岗位描述',
|
||||
`parent_id` int DEFAULT NULL COMMENT '上级岗位ID',
|
||||
`status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'active' COMMENT '岗位状态',
|
||||
`skills` json DEFAULT NULL COMMENT '核心技能',
|
||||
`level` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '岗位级别',
|
||||
`sort_order` int DEFAULT '0' COMMENT '排序',
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `code` (`code`),
|
||||
KEY `parent_id` (`parent_id`),
|
||||
KEY `idx_positions_name` (`name`),
|
||||
CONSTRAINT `positions_ibfk_1` FOREIGN KEY (`parent_id`) REFERENCES `positions` (`id`) ON DELETE SET NULL
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='岗位信息表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `positions`
|
||||
--
|
||||
|
||||
LOCK TABLES `positions` WRITE;
|
||||
/*!40000 ALTER TABLE `positions` DISABLE KEYS */;
|
||||
INSERT INTO `positions` VALUES (1,'区域经理','region_manager','负责多家门店的运营管理和业绩达成,制定区域发展战略',NULL,'active',NULL,'expert',0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(2,'店长','store_manager','负责门店日常运营管理,团队建设和业绩达成',NULL,'active',NULL,'senior',0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(3,'美容顾问','beauty_consultant','为客户提供专业的美容咨询和个性化方案设计',NULL,'active',NULL,'intermediate',0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(4,'医美咨询师','medical_beauty_consultant','提供医疗美容项目咨询和专业方案制定',NULL,'active',NULL,'senior',0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(5,'美容技师','beauty_therapist','为客户提供专业的美容护理和技术服务',NULL,'active',NULL,'intermediate',0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(6,'美容护士','beauty_nurse','协助医生进行医美项目操作,负责术后护理指导',NULL,'active',NULL,'intermediate',0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(7,'前台接待','receptionist','负责客户接待、预约管理和前台事务处理',NULL,'active',NULL,'junior',0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(8,'市场专员','marketing_specialist','负责门店营销活动策划、执行和客户维护',NULL,'active',NULL,'intermediate',0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24');
|
||||
/*!40000 ALTER TABLE `positions` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `questions`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `questions`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `questions` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`course_id` int NOT NULL COMMENT '所属课程ID',
|
||||
`question_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '题目类型',
|
||||
`title` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '题目标题',
|
||||
`content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '题目内容',
|
||||
`options` json DEFAULT NULL COMMENT '选项内容',
|
||||
`correct_answer` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '正确答案',
|
||||
`explanation` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '答案解析',
|
||||
`score` float DEFAULT '10' COMMENT '题目分值',
|
||||
`difficulty` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'medium' COMMENT '难度等级',
|
||||
`tags` json DEFAULT NULL COMMENT '题目标签',
|
||||
`usage_count` int DEFAULT '0' COMMENT '使用次数',
|
||||
`correct_count` int DEFAULT '0' COMMENT '答对次数',
|
||||
`is_active` tinyint(1) DEFAULT '1' COMMENT '是否启用',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_course_id` (`course_id`),
|
||||
KEY `idx_question_type` (`question_type`),
|
||||
KEY `idx_difficulty` (`difficulty`),
|
||||
KEY `idx_is_active` (`is_active`),
|
||||
CONSTRAINT `questions_ibfk_1` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='题目表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `questions`
|
||||
--
|
||||
|
||||
LOCK TABLES `questions` WRITE;
|
||||
/*!40000 ALTER TABLE `questions` DISABLE KEYS */;
|
||||
INSERT INTO `questions` VALUES (1,1,'single_choice','皮肤的最外层是什么?',NULL,'[{\"text\": \"表皮\", \"label\": \"A\"}, {\"text\": \"真皮\", \"label\": \"B\"}, {\"text\": \"皮下组织\", \"label\": \"C\"}, {\"text\": \"角质层\", \"label\": \"D\"}]','A','A选项是表皮,这是皮肤的最外层,起到保护作用',10,'easy',NULL,0,0,1,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(2,2,'single_choice','透明质酸的主要功效是什么?',NULL,'[{\"text\": \"美白淡斑\", \"label\": \"A\"}, {\"text\": \"保湿补水\", \"label\": \"B\"}, {\"text\": \"紧致提升\", \"label\": \"C\"}, {\"text\": \"去除皱纹\", \"label\": \"D\"}]','B','B选项是保湿补水,透明质酸具有强大的保湿能力',10,'easy',NULL,0,0,1,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(3,3,'multiple_choice','射频美容仪的禁忌症包括哪些?',NULL,'[{\"text\": \"孕期和哺乳期\", \"label\": \"A\"}, {\"text\": \"皮肤过敏\", \"label\": \"B\"}, {\"text\": \"心脏起搏器\", \"label\": \"C\"}, {\"text\": \"轻微痤疮\", \"label\": \"D\"}]','A,C','A和C选项都是射频美容仪的禁忌症,需要特别注意',15,'medium',NULL,0,0,1,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(4,4,'true_false','水光针适合所有肤质的客户',NULL,'[{\"text\": \"正确\", \"label\": \"A\"}, {\"text\": \"错误\", \"label\": \"B\"}]','B','水光针虽然适用范围广,但仍有一些禁忌症和不适合的肤质',10,'easy',NULL,0,0,1,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(5,4,'fill_blank','肉毒素注射后____小时内不能平躺','肉毒素注射后【】小时内不能平躺,以免影响药物分布效果。',NULL,'4','肉毒素注射后4小时内不能平躺,以免影响药物分布',10,'medium',NULL,0,0,1,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(6,5,'single_choice','客户咨询时最重要的是什么?',NULL,'[{\"text\": \"倾听客户需求\", \"label\": \"A\"}, {\"text\": \"推荐最贵的产品\", \"label\": \"B\"}, {\"text\": \"快速成交\", \"label\": \"C\"}, {\"text\": \"展示专业知识\", \"label\": \"D\"}]','A','A选项是倾听客户需求,这是专业咨询的基础',10,'easy',NULL,0,0,1,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(7,6,'single_choice','处理客户投诉的第一步是什么?',NULL,'[{\"text\": \"解释原因\", \"label\": \"A\"}, {\"text\": \"耐心倾听\", \"label\": \"B\"}, {\"text\": \"提供补偿\", \"label\": \"C\"}, {\"text\": \"转交上级\", \"label\": \"D\"}]','B','B选项是耐心倾听,让客户充分表达不满是处理投诉的第一步',10,'easy',NULL,0,0,1,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(8,7,'true_false','社交媒体营销只需要发布产品信息',NULL,'[{\"text\": \"正确\", \"label\": \"A\"}, {\"text\": \"错误\", \"label\": \"B\"}]','B','社交媒体营销需要内容多样化,包括教育内容、互动内容等',10,'easy',NULL,0,0,1,'2025-09-23 02:39:48','2025-09-23 02:39:48');
|
||||
/*!40000 ALTER TABLE `questions` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `teams`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `teams`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `teams` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '团队名称',
|
||||
`code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '团队代码',
|
||||
`description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '团队描述',
|
||||
`team_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '团队类型',
|
||||
`is_active` tinyint(1) DEFAULT '1' COMMENT '是否激活',
|
||||
`leader_id` int DEFAULT NULL COMMENT '负责人ID',
|
||||
`parent_id` int DEFAULT NULL COMMENT '父团队ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `name` (`name`),
|
||||
UNIQUE KEY `code` (`code`),
|
||||
KEY `leader_id` (`leader_id`),
|
||||
KEY `parent_id` (`parent_id`),
|
||||
KEY `idx_team_type` (`team_type`),
|
||||
KEY `idx_is_active` (`is_active`),
|
||||
CONSTRAINT `teams_ibfk_1` FOREIGN KEY (`leader_id`) REFERENCES `users` (`id`) ON DELETE SET NULL,
|
||||
CONSTRAINT `teams_ibfk_2` FOREIGN KEY (`parent_id`) REFERENCES `teams` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='团队信息表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `teams`
|
||||
--
|
||||
|
||||
LOCK TABLES `teams` WRITE;
|
||||
/*!40000 ALTER TABLE `teams` DISABLE KEYS */;
|
||||
INSERT INTO `teams` VALUES (1,'管理层','MANAGEMENT','负责公司整体战略规划和运营管理','department',1,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(2,'北京运营团队','BJ_OPERATIONS','负责北京地区所有门店的运营管理','department',1,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(3,'上海运营团队','SH_OPERATIONS','负责上海地区所有门店的运营管理','department',1,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(4,'技术培训部','TECH_TRAINING','负责员工技术培训和考核','department',1,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(5,'客服质量部','QUALITY_SERVICE','负责客户服务质量监督和改进','department',1,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(6,'新员工培训小组','NEW_EMPLOYEE_TRAINING','专门负责新员工入职培训','study_group',1,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL);
|
||||
/*!40000 ALTER TABLE `teams` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `training_messages`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `training_messages`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `training_messages` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`session_id` int NOT NULL COMMENT '会话ID',
|
||||
`role` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '消息角色',
|
||||
`type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '消息类型',
|
||||
`content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '消息内容',
|
||||
`voice_url` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '语音文件URL',
|
||||
`voice_duration` int DEFAULT NULL COMMENT '语音时长(秒)',
|
||||
`message_metadata` json DEFAULT NULL COMMENT '消息元数据',
|
||||
`coze_message_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Coze消息ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_session_id` (`session_id`),
|
||||
KEY `idx_role` (`role`),
|
||||
CONSTRAINT `training_messages_ibfk_1` FOREIGN KEY (`session_id`) REFERENCES `training_sessions` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='培训消息表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `training_messages`
|
||||
--
|
||||
|
||||
LOCK TABLES `training_messages` WRITE;
|
||||
/*!40000 ALTER TABLE `training_messages` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `training_messages` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `training_reports`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `training_reports`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `training_reports` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`session_id` int NOT NULL COMMENT '会话ID',
|
||||
`user_id` int NOT NULL COMMENT '用户ID',
|
||||
`overall_score` decimal(5,2) DEFAULT NULL COMMENT '总体评分',
|
||||
`dimension_scores` json DEFAULT NULL COMMENT '各维度得分',
|
||||
`strengths` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '优势点',
|
||||
`weaknesses` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '待改进点',
|
||||
`suggestions` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '改进建议',
|
||||
`detailed_analysis` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '详细分析',
|
||||
`transcript` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '对话记录',
|
||||
`statistics` json DEFAULT NULL COMMENT '统计数据',
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `session_id` (`session_id`),
|
||||
KEY `idx_user_id` (`user_id`),
|
||||
CONSTRAINT `training_reports_ibfk_1` FOREIGN KEY (`session_id`) REFERENCES `training_sessions` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='培训报告表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `training_reports`
|
||||
--
|
||||
|
||||
LOCK TABLES `training_reports` WRITE;
|
||||
/*!40000 ALTER TABLE `training_reports` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `training_reports` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `training_scenes`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `training_scenes`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `training_scenes` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '场景名称',
|
||||
`description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '场景描述',
|
||||
`category` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '场景分类',
|
||||
`ai_config` json DEFAULT NULL COMMENT 'AI配置',
|
||||
`prompt_template` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '提示模板',
|
||||
`evaluation_criteria` json DEFAULT NULL COMMENT '评估标准',
|
||||
`status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'active' COMMENT '场景状态',
|
||||
`is_public` tinyint(1) DEFAULT '1' COMMENT '是否公开',
|
||||
`required_level` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '所需用户等级',
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_status` (`status`),
|
||||
KEY `idx_category` (`category`),
|
||||
KEY `idx_is_public` (`is_public`),
|
||||
KEY `idx_is_deleted` (`is_deleted`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='培训场景表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `training_scenes`
|
||||
--
|
||||
|
||||
LOCK TABLES `training_scenes` WRITE;
|
||||
/*!40000 ALTER TABLE `training_scenes` DISABLE KEYS */;
|
||||
INSERT INTO `training_scenes` VALUES (1,'客户咨询模拟','模拟真实的客户咨询场景,练习专业咨询技巧','客户服务',NULL,NULL,NULL,'ACTIVE',1,NULL,0,NULL,NULL,NULL,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(2,'产品推荐演练','针对不同客户需求进行产品推荐的实战演练','销售技巧',NULL,NULL,NULL,'ACTIVE',1,NULL,0,NULL,NULL,NULL,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(3,'投诉处理训练','模拟各种客户投诉情况,训练处理技巧和话术','客户服务',NULL,NULL,NULL,'ACTIVE',1,NULL,0,NULL,NULL,NULL,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(4,'项目操作指导','美容项目操作的标准流程指导和安全注意事项','技术指导',NULL,NULL,NULL,'ACTIVE',1,NULL,0,NULL,NULL,NULL,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(5,'团队管理讨论','管理岗位的团队建设和绩效管理讨论','管理培训',NULL,NULL,NULL,'ACTIVE',1,NULL,0,NULL,NULL,NULL,'2025-09-23 02:39:48','2025-09-23 02:39:48');
|
||||
/*!40000 ALTER TABLE `training_scenes` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `training_sessions`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `training_sessions`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `training_sessions` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`user_id` int NOT NULL COMMENT '用户ID',
|
||||
`scene_id` int NOT NULL COMMENT '场景ID',
|
||||
`coze_conversation_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Coze对话ID',
|
||||
`start_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '开始时间',
|
||||
`end_time` datetime DEFAULT NULL COMMENT '结束时间',
|
||||
`duration_seconds` int DEFAULT NULL COMMENT '持续时长(秒)',
|
||||
`status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'active' COMMENT '会话状态',
|
||||
`session_config` json DEFAULT NULL COMMENT '会话配置',
|
||||
`total_score` decimal(5,2) DEFAULT NULL COMMENT '总分',
|
||||
`evaluation_result` json DEFAULT NULL COMMENT '评估结果详情',
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_user_id` (`user_id`),
|
||||
KEY `idx_scene_id` (`scene_id`),
|
||||
KEY `idx_status` (`status`),
|
||||
CONSTRAINT `training_sessions_ibfk_1` FOREIGN KEY (`scene_id`) REFERENCES `training_scenes` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='培训会话表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `training_sessions`
|
||||
--
|
||||
|
||||
LOCK TABLES `training_sessions` WRITE;
|
||||
/*!40000 ALTER TABLE `training_sessions` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `training_sessions` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `user_teams`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `user_teams`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `user_teams` (
|
||||
`user_id` int NOT NULL COMMENT '用户ID',
|
||||
`team_id` int NOT NULL COMMENT '团队ID',
|
||||
`role` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '在团队中的角色',
|
||||
`joined_at` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '加入时间',
|
||||
PRIMARY KEY (`user_id`,`team_id`),
|
||||
KEY `team_id` (`team_id`),
|
||||
CONSTRAINT `user_teams_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `user_teams_ibfk_2` FOREIGN KEY (`team_id`) REFERENCES `teams` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='用户团队关联表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `user_teams`
|
||||
--
|
||||
|
||||
LOCK TABLES `user_teams` WRITE;
|
||||
/*!40000 ALTER TABLE `user_teams` DISABLE KEYS */;
|
||||
INSERT INTO `user_teams` VALUES (1,1,'leader','2025-09-22 18:42:32'),(2,1,'member','2025-09-22 18:42:32'),(3,2,'leader','2025-09-22 18:42:32'),(4,3,'leader','2025-09-22 18:42:32'),(5,2,'member','2025-09-22 18:42:32'),(5,4,'member','2025-09-22 18:42:32'),(6,2,'member','2025-09-22 18:42:32'),(6,4,'member','2025-09-22 18:42:32'),(7,3,'member','2025-09-22 18:42:32'),(7,4,'member','2025-09-22 18:42:32'),(8,3,'member','2025-09-22 18:42:32'),(8,6,'member','2025-09-22 18:42:32');
|
||||
/*!40000 ALTER TABLE `user_teams` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `users`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `users`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `users` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`username` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '用户名',
|
||||
`email` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '邮箱',
|
||||
`phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '手机号',
|
||||
`password_hash` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '密码哈希',
|
||||
`full_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '真实姓名',
|
||||
`gender` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '性别',
|
||||
`avatar_url` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '头像URL',
|
||||
`bio` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '个人简介',
|
||||
`school` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '学校',
|
||||
`major` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '专业',
|
||||
`role` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'trainee' COMMENT '用户角色',
|
||||
`is_active` tinyint(1) DEFAULT '1' COMMENT '是否激活',
|
||||
`is_verified` tinyint(1) DEFAULT '0' COMMENT '是否验证',
|
||||
`last_login_at` datetime DEFAULT NULL COMMENT '最后登录时间',
|
||||
`password_changed_at` datetime DEFAULT NULL COMMENT '密码修改时间',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `username` (`username`),
|
||||
UNIQUE KEY `email` (`email`),
|
||||
UNIQUE KEY `phone` (`phone`),
|
||||
KEY `idx_role` (`role`),
|
||||
KEY `idx_is_active` (`is_active`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='用户信息表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `users`
|
||||
--
|
||||
|
||||
LOCK TABLES `users` WRITE;
|
||||
/*!40000 ALTER TABLE `users` DISABLE KEYS */;
|
||||
INSERT INTO `users` VALUES (1,'superadmin','superadmin@ruimei.com','13800138001','$2b$12$jFhkYU3.Cd1kAfr64/073eayPquAr0z9WWUQEdOyFRmAqcxz.i10C','超级管理员','male',NULL,'负责系统整体管理和运营','睿美医疗美容学院','医疗美容管理','admin',1,0,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(2,'admin','admin@ruimei.com','13800138002','$2b$12$jFhkYU3.Cd1kAfr64/073eayPquAr0z9WWUQEdOyFRmAqcxz.i10C','系统管理员','female',NULL,'负责日常系统管理工作','睿美医疗美容学院','医疗美容技术','admin',1,0,'2025-09-25 18:51:58',NULL,'2025-09-23 02:38:24','2025-09-25 18:51:58',0,NULL),(3,'manager_beijing','manager.bj@ruimei.com','13800138003','$2b$12$jFhkYU3.Cd1kAfr64/073eayPquAr0z9WWUQEdOyFRmAqcxz.i10C','北京区域经理','male',NULL,'负责北京地区门店管理','北京医科大学','临床医学','manager',1,0,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(4,'manager_shanghai','manager.sh@ruimei.com','13800138004','$2b$12$jFhkYU3.Cd1kAfr64/073eayPquAr0z9WWUQEdOyFRmAqcxz.i10C','上海区域经理','female',NULL,'负责上海地区门店管理','复旦大学医学院','医疗美容','manager',1,0,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(5,'consultant_001','consultant001@ruimei.com','13800138005','$2b$12$jFhkYU3.Cd1kAfr64/073eayPquAr0z9WWUQEdOyFRmAqcxz.i10C','资深美容顾问','female',NULL,'专业美容咨询师,5年从业经验','上海健康医学院','医疗美容技术','trainee',1,0,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(6,'nurse_001','nurse001@ruimei.com','13800138006','$2b$12$jFhkYU3.Cd1kAfr64/073eayPquAr0z9WWUQEdOyFRmAqcxz.i10C','美容护士','female',NULL,'持证美容护士,专业技术过硬','首都医科大学','护理学','trainee',1,0,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(7,'therapist_001','therapist001@ruimei.com','13800138007','$2b$12$jFhkYU3.Cd1kAfr64/073eayPquAr0z9WWUQEdOyFRmAqcxz.i10C','美容技师','female',NULL,'专业美容技师,擅长面部护理','北京卫生职业学院','医疗美容技术','trainee',1,0,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(8,'receptionist_001','front001@ruimei.com','13800138008','$2b$12$jFhkYU3.Cd1kAfr64/073eayPquAr0z9WWUQEdOyFRmAqcxz.i10C','前台接待','female',NULL,'负责客户接待和预约管理','北京商贸职业学院','商务管理','trainee',1,0,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL);
|
||||
/*!40000 ALTER TABLE `users` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Temporary view structure for view `v_user_course_progress`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `v_user_course_progress`;
|
||||
/*!50001 DROP VIEW IF EXISTS `v_user_course_progress`*/;
|
||||
SET @saved_cs_client = @@character_set_client;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
/*!50001 CREATE VIEW `v_user_course_progress` AS SELECT
|
||||
1 AS `user_id`,
|
||||
1 AS `username`,
|
||||
1 AS `course_id`,
|
||||
1 AS `course_name`,
|
||||
1 AS `exam_count`,
|
||||
1 AS `avg_score`,
|
||||
1 AS `best_score`*/;
|
||||
SET character_set_client = @saved_cs_client;
|
||||
|
||||
--
|
||||
-- Final view structure for view `v_user_course_progress`
|
||||
--
|
||||
|
||||
/*!50001 DROP VIEW IF EXISTS `v_user_course_progress`*/;
|
||||
/*!50001 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50001 SET @saved_cs_results = @@character_set_results */;
|
||||
/*!50001 SET @saved_col_connection = @@collation_connection */;
|
||||
/*!50001 SET character_set_client = latin1 */;
|
||||
/*!50001 SET character_set_results = latin1 */;
|
||||
/*!50001 SET collation_connection = latin1_swedish_ci */;
|
||||
/*!50001 CREATE ALGORITHM=UNDEFINED */
|
||||
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
|
||||
/*!50001 VIEW `v_user_course_progress` AS select `u`.`id` AS `user_id`,`u`.`username` AS `username`,`c`.`id` AS `course_id`,`c`.`name` AS `course_name`,count(distinct `e`.`id`) AS `exam_count`,avg(`e`.`score`) AS `avg_score`,max(`e`.`score`) AS `best_score` from ((`users` `u` join `courses` `c`) left join `exams` `e` on(((`e`.`user_id` = `u`.`id`) and (`e`.`course_id` = `c`.`id`) and (`e`.`status` = 'submitted')))) group by `u`.`id`,`c`.`id` */;
|
||||
/*!50001 SET character_set_client = @saved_cs_client */;
|
||||
/*!50001 SET character_set_results = @saved_cs_results */;
|
||||
/*!50001 SET collation_connection = @saved_col_connection */;
|
||||
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
|
||||
|
||||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
||||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
||||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
-- Dump completed on 2025-09-25 20:45:58
|
||||
817
知识库/backups/updates/backup_20250926_051946_database.sql
Normal file
817
知识库/backups/updates/backup_20250926_051946_database.sql
Normal file
@@ -0,0 +1,817 @@
|
||||
-- MySQL dump 10.13 Distrib 8.0.43, for Linux (x86_64)
|
||||
--
|
||||
-- Host: localhost Database: kaopeilian
|
||||
-- ------------------------------------------------------
|
||||
-- Server version 8.0.43
|
||||
|
||||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
||||
/*!50503 SET NAMES utf8mb4 */;
|
||||
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
|
||||
/*!40103 SET TIME_ZONE='+00:00' */;
|
||||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
|
||||
--
|
||||
-- Table structure for table `course_exam_settings`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `course_exam_settings`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `course_exam_settings` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`course_id` int NOT NULL COMMENT '课程ID',
|
||||
`single_choice_count` int NOT NULL DEFAULT '10' COMMENT '单选题数量',
|
||||
`multiple_choice_count` int NOT NULL DEFAULT '5' COMMENT '多选题数量',
|
||||
`true_false_count` int NOT NULL DEFAULT '5' COMMENT '判断题数量',
|
||||
`fill_blank_count` int NOT NULL DEFAULT '0' COMMENT '填空题数量',
|
||||
`duration_minutes` int NOT NULL DEFAULT '60' COMMENT '考试时长(分钟)',
|
||||
`difficulty_level` int NOT NULL DEFAULT '3' COMMENT '难度系数(1-5)',
|
||||
`passing_score` int NOT NULL DEFAULT '60' COMMENT '及格分数',
|
||||
`is_enabled` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是否启用',
|
||||
`show_answer_immediately` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否立即显示答案',
|
||||
`allow_retake` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是否允许重考',
|
||||
`max_retake_times` int DEFAULT NULL COMMENT '最大重考次数',
|
||||
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`is_deleted` tinyint(1) NOT NULL DEFAULT '0',
|
||||
`deleted_at` datetime DEFAULT NULL,
|
||||
`deleted_by` int DEFAULT NULL COMMENT '删除人ID',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `course_id` (`course_id`),
|
||||
KEY `ix_course_exam_settings_id` (`id`),
|
||||
CONSTRAINT `course_exam_settings_ibfk_1` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='课程考试设置表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `course_exam_settings`
|
||||
--
|
||||
|
||||
LOCK TABLES `course_exam_settings` WRITE;
|
||||
/*!40000 ALTER TABLE `course_exam_settings` DISABLE KEYS */;
|
||||
INSERT INTO `course_exam_settings` VALUES (1,1,5,3,2,0,60,2,80,1,1,1,3,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(2,2,4,2,2,2,45,1,75,1,1,1,3,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(3,3,3,2,3,2,50,2,80,1,0,1,2,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(4,4,4,3,2,1,55,2,85,1,1,1,3,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(5,5,5,2,2,1,40,1,70,1,1,1,5,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(6,6,3,2,3,2,45,1,75,1,1,1,3,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(7,7,4,2,2,2,50,2,80,1,0,1,2,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(8,8,5,3,2,0,60,3,85,1,1,1,2,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(9,9,4,2,4,0,50,2,80,1,1,1,3,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(10,10,3,2,3,2,45,1,75,1,1,1,3,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(11,11,5,3,2,0,60,3,90,1,0,1,2,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(12,12,4,2,4,0,40,1,70,1,1,1,5,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL);
|
||||
/*!40000 ALTER TABLE `course_exam_settings` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `course_materials`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `course_materials`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `course_materials` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`course_id` int NOT NULL COMMENT '所属课程ID',
|
||||
`name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '资料名称',
|
||||
`description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '资料描述',
|
||||
`file_url` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '文件URL',
|
||||
`file_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '文件类型',
|
||||
`file_size` int NOT NULL COMMENT '文件大小(字节)',
|
||||
`sort_order` int DEFAULT '0' COMMENT '排序序号',
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_course_id` (`course_id`),
|
||||
KEY `idx_is_deleted` (`is_deleted`),
|
||||
CONSTRAINT `course_materials_ibfk_1` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='课程资料表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `course_materials`
|
||||
--
|
||||
|
||||
LOCK TABLES `course_materials` WRITE;
|
||||
/*!40000 ALTER TABLE `course_materials` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `course_materials` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `courses`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `courses`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `courses` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '课程名称',
|
||||
`description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '课程描述',
|
||||
`category` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '课程分类',
|
||||
`status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'draft' COMMENT '课程状态',
|
||||
`cover_image` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '封面图片',
|
||||
`duration_hours` decimal(5,2) DEFAULT NULL COMMENT '课程时长(小时)',
|
||||
`difficulty_level` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '难度等级',
|
||||
`tags` json DEFAULT NULL COMMENT '标签列表',
|
||||
`published_at` datetime DEFAULT NULL COMMENT '发布时间',
|
||||
`publisher_id` int DEFAULT NULL COMMENT '发布人ID',
|
||||
`sort_order` int DEFAULT '0' COMMENT '排序',
|
||||
`is_featured` tinyint(1) DEFAULT '0' COMMENT '是否推荐',
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_status` (`status`),
|
||||
KEY `idx_category` (`category`),
|
||||
KEY `idx_is_featured` (`is_featured`),
|
||||
KEY `idx_is_deleted` (`is_deleted`),
|
||||
KEY `idx_sort_order` (`sort_order`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='课程信息表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `courses`
|
||||
--
|
||||
|
||||
LOCK TABLES `courses` WRITE;
|
||||
/*!40000 ALTER TABLE `courses` DISABLE KEYS */;
|
||||
INSERT INTO `courses` VALUES (1,'皮肤生理学基础','学习皮肤结构、功能和常见问题,为专业护理打下坚实基础','technology','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(2,'医美产品知识与应用','全面了解各类医美产品的成分、功效和适用人群,掌握产品推荐技巧','technology','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(3,'美容仪器操作与维护','掌握各类美容仪器的操作方法、注意事项和日常维护保养','technology','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(4,'医美项目介绍与咨询','详细了解各类医美项目的原理、效果和适应症,提升咨询专业度','business','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(5,'轻医美销售技巧','学习专业的销售话术、客户需求分析和成交技巧,提升业绩能力','business','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(6,'客户服务与投诉处理','提升服务意识,掌握客户投诉处理的方法和技巧,维护品牌形象','management','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(7,'社媒营销与私域运营','学习如何通过社交媒体进行品牌推广和客户维护,建立私域流量','business','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(8,'门店运营管理','学习门店日常管理、团队建设和业绩管理的方法和技巧','management','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(9,'卫生消毒与感染控制','学习医美机构的卫生标准和消毒流程,确保服务安全合规','general','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(10,'美容心理学','了解客户心理需求,掌握沟通技巧,提升服务满意度','general','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(11,'法律法规与行业规范','学习医美行业相关法律法规,确保合规经营','general','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(12,'新员工入职培训','新员工必修课程,包含企业文化、基础知识和操作规范','general','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24');
|
||||
/*!40000 ALTER TABLE `courses` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `exam_results`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `exam_results`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `exam_results` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`exam_id` int NOT NULL COMMENT '考试ID',
|
||||
`question_id` int NOT NULL COMMENT '题目ID',
|
||||
`user_answer` json DEFAULT NULL COMMENT '用户答案',
|
||||
`is_correct` tinyint(1) NOT NULL COMMENT '是否正确',
|
||||
`score` decimal(5,2) NOT NULL COMMENT '考试得分',
|
||||
`answer_time` int DEFAULT NULL COMMENT '答题时长(秒)',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_exam_id` (`exam_id`),
|
||||
KEY `idx_question_id` (`question_id`),
|
||||
CONSTRAINT `exam_results_ibfk_1` FOREIGN KEY (`exam_id`) REFERENCES `exams` (`id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `exam_results_ibfk_2` FOREIGN KEY (`question_id`) REFERENCES `questions` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='考试结果表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `exam_results`
|
||||
--
|
||||
|
||||
LOCK TABLES `exam_results` WRITE;
|
||||
/*!40000 ALTER TABLE `exam_results` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `exam_results` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `exams`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `exams`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `exams` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`user_id` int NOT NULL COMMENT '用户ID',
|
||||
`course_id` int NOT NULL COMMENT '课程ID',
|
||||
`exam_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '考试名称',
|
||||
`question_count` int DEFAULT NULL COMMENT '题目数量',
|
||||
`total_score` decimal(5,2) DEFAULT NULL COMMENT '总分',
|
||||
`pass_score` decimal(5,2) DEFAULT NULL COMMENT '及格分',
|
||||
`start_time` datetime DEFAULT NULL COMMENT '开始时间',
|
||||
`end_time` datetime DEFAULT NULL COMMENT '结束时间',
|
||||
`duration_minutes` int DEFAULT NULL COMMENT '考试时长(分钟)',
|
||||
`score` decimal(5,2) DEFAULT NULL COMMENT '得分',
|
||||
`is_passed` tinyint(1) DEFAULT '0' COMMENT '是否通过',
|
||||
`status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'pending' COMMENT '考试状态',
|
||||
`questions` json DEFAULT NULL COMMENT '题目数据(JSON格式)',
|
||||
`answers` json DEFAULT NULL COMMENT '答案数据(JSON格式)',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_user_id` (`user_id`),
|
||||
KEY `idx_course_id` (`course_id`),
|
||||
KEY `idx_status` (`status`),
|
||||
CONSTRAINT `exams_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `exams_ibfk_2` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='考试记录表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `exams`
|
||||
--
|
||||
|
||||
LOCK TABLES `exams` WRITE;
|
||||
/*!40000 ALTER TABLE `exams` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `exams` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `growth_paths`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `growth_paths`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `growth_paths` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '成长路径名称',
|
||||
`description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '路径描述',
|
||||
`target_role` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '目标角色',
|
||||
`courses` json DEFAULT NULL COMMENT '课程列表',
|
||||
`estimated_duration_days` int DEFAULT NULL COMMENT '预计完成天数',
|
||||
`is_active` tinyint(1) DEFAULT '1' COMMENT '是否启用',
|
||||
`sort_order` int DEFAULT '0' COMMENT '排序顺序',
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_is_active` (`is_active`),
|
||||
KEY `idx_is_deleted` (`is_deleted`),
|
||||
KEY `idx_sort_order` (`sort_order`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='成长路径表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `growth_paths`
|
||||
--
|
||||
|
||||
LOCK TABLES `growth_paths` WRITE;
|
||||
/*!40000 ALTER TABLE `growth_paths` DISABLE KEYS */;
|
||||
INSERT INTO `growth_paths` VALUES (1,'美容顾问成长路径','从初级美容顾问到资深顾问的完整成长路径,包含专业技能和销售能力提升','资深美容顾问',NULL,NULL,1,0,0,NULL,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(2,'美容技师进阶路径','美容技师的技能进阶路径,从基础护理到高级项目操作','高级美容技师',NULL,NULL,1,0,0,NULL,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(3,'管理岗位培养路径','从一线员工到管理岗位的培养路径,包含领导力和管理技能','店长/区域经理',NULL,NULL,1,0,0,NULL,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(4,'医美咨询师专业路径','医美咨询师的专业发展路径,深度掌握医美项目知识','资深医美咨询师',NULL,NULL,1,0,0,NULL,'2025-09-23 02:39:48','2025-09-23 02:39:48');
|
||||
/*!40000 ALTER TABLE `growth_paths` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `knowledge_points`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `knowledge_points`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `knowledge_points` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`course_id` int DEFAULT NULL COMMENT '所属课程ID',
|
||||
`name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '知识点名称',
|
||||
`description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '知识点描述',
|
||||
`parent_id` int DEFAULT NULL COMMENT '父知识点ID',
|
||||
`level` int DEFAULT '1' COMMENT '层级深度',
|
||||
`path` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '知识点路径',
|
||||
`sort_order` int DEFAULT '0' COMMENT '排序顺序',
|
||||
`weight` decimal(3,2) DEFAULT '1.00' COMMENT '权重',
|
||||
`is_required` tinyint(1) DEFAULT '1' COMMENT '是否必修',
|
||||
`estimated_hours` decimal(4,2) DEFAULT NULL COMMENT '预计学习时间(小时)',
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_course_id` (`course_id`),
|
||||
KEY `idx_parent_id` (`parent_id`),
|
||||
KEY `idx_is_deleted` (`is_deleted`),
|
||||
KEY `idx_sort_order` (`sort_order`),
|
||||
CONSTRAINT `knowledge_points_ibfk_1` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `knowledge_points_ibfk_2` FOREIGN KEY (`parent_id`) REFERENCES `knowledge_points` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='知识点表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `knowledge_points`
|
||||
--
|
||||
|
||||
LOCK TABLES `knowledge_points` WRITE;
|
||||
/*!40000 ALTER TABLE `knowledge_points` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `knowledge_points` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `material_knowledge_points`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `material_knowledge_points`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `material_knowledge_points` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`material_id` int NOT NULL COMMENT '资料ID',
|
||||
`knowledge_point_id` int NOT NULL COMMENT '知识点ID',
|
||||
`sort_order` int DEFAULT '0' COMMENT '排序顺序',
|
||||
`is_ai_generated` tinyint(1) DEFAULT '0' COMMENT '是否AI生成',
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `idx_material_knowledge` (`material_id`,`knowledge_point_id`),
|
||||
KEY `idx_material_id` (`material_id`),
|
||||
KEY `idx_knowledge_point_id` (`knowledge_point_id`),
|
||||
CONSTRAINT `material_knowledge_points_ibfk_1` FOREIGN KEY (`material_id`) REFERENCES `course_materials` (`id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `material_knowledge_points_ibfk_2` FOREIGN KEY (`knowledge_point_id`) REFERENCES `knowledge_points` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='资料知识点关联表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `material_knowledge_points`
|
||||
--
|
||||
|
||||
LOCK TABLES `material_knowledge_points` WRITE;
|
||||
/*!40000 ALTER TABLE `material_knowledge_points` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `material_knowledge_points` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `position_courses`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `position_courses`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `position_courses` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`position_id` int NOT NULL COMMENT '岗位ID',
|
||||
`course_id` int NOT NULL COMMENT '课程ID',
|
||||
`course_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'required' COMMENT '课程类型(必修/选修)',
|
||||
`priority` int DEFAULT '0' COMMENT '优先级',
|
||||
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`is_deleted` tinyint(1) NOT NULL DEFAULT '0',
|
||||
`deleted_at` datetime DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uix_position_course` (`position_id`,`course_id`,`is_deleted`),
|
||||
KEY `course_id` (`course_id`),
|
||||
KEY `ix_position_courses_id` (`id`),
|
||||
CONSTRAINT `position_courses_ibfk_1` FOREIGN KEY (`position_id`) REFERENCES `positions` (`id`),
|
||||
CONSTRAINT `position_courses_ibfk_2` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='岗位课程关联表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `position_courses`
|
||||
--
|
||||
|
||||
LOCK TABLES `position_courses` WRITE;
|
||||
/*!40000 ALTER TABLE `position_courses` DISABLE KEYS */;
|
||||
INSERT INTO `position_courses` VALUES (1,1,6,'required',1,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(2,1,8,'required',2,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(3,1,11,'required',3,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(4,1,12,'required',4,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(5,3,1,'required',1,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(6,3,2,'required',2,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(7,3,5,'required',3,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(8,3,6,'required',4,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(9,3,10,'required',5,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(10,3,12,'required',6,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(11,4,1,'required',1,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(12,4,2,'required',2,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(13,4,4,'required',3,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(14,4,5,'required',4,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(15,4,9,'required',5,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(16,4,12,'required',6,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(17,5,1,'required',1,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(18,5,2,'required',2,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(19,5,3,'required',3,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(20,5,9,'required',4,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(21,5,12,'required',5,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(22,7,6,'required',1,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(23,7,10,'required',2,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(24,7,12,'required',3,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL);
|
||||
/*!40000 ALTER TABLE `position_courses` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `position_members`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `position_members`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `position_members` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`position_id` int NOT NULL COMMENT '岗位ID',
|
||||
`user_id` int NOT NULL COMMENT '用户ID',
|
||||
`role` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '在岗位中的角色',
|
||||
`joined_at` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '加入时间',
|
||||
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`is_deleted` tinyint(1) NOT NULL DEFAULT '0',
|
||||
`deleted_at` datetime DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uix_position_user` (`position_id`,`user_id`,`is_deleted`),
|
||||
KEY `user_id` (`user_id`),
|
||||
KEY `ix_position_members_id` (`id`),
|
||||
CONSTRAINT `position_members_ibfk_1` FOREIGN KEY (`position_id`) REFERENCES `positions` (`id`),
|
||||
CONSTRAINT `position_members_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='岗位成员关联表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `position_members`
|
||||
--
|
||||
|
||||
LOCK TABLES `position_members` WRITE;
|
||||
/*!40000 ALTER TABLE `position_members` DISABLE KEYS */;
|
||||
INSERT INTO `position_members` VALUES (1,1,3,NULL,'2025-09-22 18:42:32','2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(2,1,4,NULL,'2025-09-22 18:42:32','2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(3,3,5,NULL,'2025-09-22 18:42:32','2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(4,4,6,NULL,'2025-09-22 18:42:32','2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(5,5,7,NULL,'2025-09-22 18:42:32','2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(6,7,8,NULL,'2025-09-22 18:42:32','2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL);
|
||||
/*!40000 ALTER TABLE `position_members` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `positions`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `positions`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `positions` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '岗位名称',
|
||||
`code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '岗位代码',
|
||||
`description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '岗位描述',
|
||||
`parent_id` int DEFAULT NULL COMMENT '上级岗位ID',
|
||||
`status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'active' COMMENT '岗位状态',
|
||||
`skills` json DEFAULT NULL COMMENT '核心技能',
|
||||
`level` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '岗位级别',
|
||||
`sort_order` int DEFAULT '0' COMMENT '排序',
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `code` (`code`),
|
||||
KEY `parent_id` (`parent_id`),
|
||||
KEY `idx_positions_name` (`name`),
|
||||
CONSTRAINT `positions_ibfk_1` FOREIGN KEY (`parent_id`) REFERENCES `positions` (`id`) ON DELETE SET NULL
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='岗位信息表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `positions`
|
||||
--
|
||||
|
||||
LOCK TABLES `positions` WRITE;
|
||||
/*!40000 ALTER TABLE `positions` DISABLE KEYS */;
|
||||
INSERT INTO `positions` VALUES (1,'区域经理','region_manager','负责多家门店的运营管理和业绩达成,制定区域发展战略',NULL,'active',NULL,'expert',0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(2,'店长','store_manager','负责门店日常运营管理,团队建设和业绩达成',NULL,'active',NULL,'senior',0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(3,'美容顾问','beauty_consultant','为客户提供专业的美容咨询和个性化方案设计',NULL,'active',NULL,'intermediate',0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(4,'医美咨询师','medical_beauty_consultant','提供医疗美容项目咨询和专业方案制定',NULL,'active',NULL,'senior',0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(5,'美容技师','beauty_therapist','为客户提供专业的美容护理和技术服务',NULL,'active',NULL,'intermediate',0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(6,'美容护士','beauty_nurse','协助医生进行医美项目操作,负责术后护理指导',NULL,'active',NULL,'intermediate',0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(7,'前台接待','receptionist','负责客户接待、预约管理和前台事务处理',NULL,'active',NULL,'junior',0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(8,'市场专员','marketing_specialist','负责门店营销活动策划、执行和客户维护',NULL,'active',NULL,'intermediate',0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24');
|
||||
/*!40000 ALTER TABLE `positions` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `questions`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `questions`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `questions` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`course_id` int NOT NULL COMMENT '所属课程ID',
|
||||
`question_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '题目类型',
|
||||
`title` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '题目标题',
|
||||
`content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '题目内容',
|
||||
`options` json DEFAULT NULL COMMENT '选项内容',
|
||||
`correct_answer` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '正确答案',
|
||||
`explanation` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '答案解析',
|
||||
`score` float DEFAULT '10' COMMENT '题目分值',
|
||||
`difficulty` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'medium' COMMENT '难度等级',
|
||||
`tags` json DEFAULT NULL COMMENT '题目标签',
|
||||
`usage_count` int DEFAULT '0' COMMENT '使用次数',
|
||||
`correct_count` int DEFAULT '0' COMMENT '答对次数',
|
||||
`is_active` tinyint(1) DEFAULT '1' COMMENT '是否启用',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_course_id` (`course_id`),
|
||||
KEY `idx_question_type` (`question_type`),
|
||||
KEY `idx_difficulty` (`difficulty`),
|
||||
KEY `idx_is_active` (`is_active`),
|
||||
CONSTRAINT `questions_ibfk_1` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='题目表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `questions`
|
||||
--
|
||||
|
||||
LOCK TABLES `questions` WRITE;
|
||||
/*!40000 ALTER TABLE `questions` DISABLE KEYS */;
|
||||
INSERT INTO `questions` VALUES (1,1,'single_choice','皮肤的最外层是什么?',NULL,'[{\"text\": \"表皮\", \"label\": \"A\"}, {\"text\": \"真皮\", \"label\": \"B\"}, {\"text\": \"皮下组织\", \"label\": \"C\"}, {\"text\": \"角质层\", \"label\": \"D\"}]','A','A选项是表皮,这是皮肤的最外层,起到保护作用',10,'easy',NULL,0,0,1,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(2,2,'single_choice','透明质酸的主要功效是什么?',NULL,'[{\"text\": \"美白淡斑\", \"label\": \"A\"}, {\"text\": \"保湿补水\", \"label\": \"B\"}, {\"text\": \"紧致提升\", \"label\": \"C\"}, {\"text\": \"去除皱纹\", \"label\": \"D\"}]','B','B选项是保湿补水,透明质酸具有强大的保湿能力',10,'easy',NULL,0,0,1,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(3,3,'multiple_choice','射频美容仪的禁忌症包括哪些?',NULL,'[{\"text\": \"孕期和哺乳期\", \"label\": \"A\"}, {\"text\": \"皮肤过敏\", \"label\": \"B\"}, {\"text\": \"心脏起搏器\", \"label\": \"C\"}, {\"text\": \"轻微痤疮\", \"label\": \"D\"}]','A,C','A和C选项都是射频美容仪的禁忌症,需要特别注意',15,'medium',NULL,0,0,1,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(4,4,'true_false','水光针适合所有肤质的客户',NULL,'[{\"text\": \"正确\", \"label\": \"A\"}, {\"text\": \"错误\", \"label\": \"B\"}]','B','水光针虽然适用范围广,但仍有一些禁忌症和不适合的肤质',10,'easy',NULL,0,0,1,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(5,4,'fill_blank','肉毒素注射后____小时内不能平躺','肉毒素注射后【】小时内不能平躺,以免影响药物分布效果。',NULL,'4','肉毒素注射后4小时内不能平躺,以免影响药物分布',10,'medium',NULL,0,0,1,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(6,5,'single_choice','客户咨询时最重要的是什么?',NULL,'[{\"text\": \"倾听客户需求\", \"label\": \"A\"}, {\"text\": \"推荐最贵的产品\", \"label\": \"B\"}, {\"text\": \"快速成交\", \"label\": \"C\"}, {\"text\": \"展示专业知识\", \"label\": \"D\"}]','A','A选项是倾听客户需求,这是专业咨询的基础',10,'easy',NULL,0,0,1,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(7,6,'single_choice','处理客户投诉的第一步是什么?',NULL,'[{\"text\": \"解释原因\", \"label\": \"A\"}, {\"text\": \"耐心倾听\", \"label\": \"B\"}, {\"text\": \"提供补偿\", \"label\": \"C\"}, {\"text\": \"转交上级\", \"label\": \"D\"}]','B','B选项是耐心倾听,让客户充分表达不满是处理投诉的第一步',10,'easy',NULL,0,0,1,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(8,7,'true_false','社交媒体营销只需要发布产品信息',NULL,'[{\"text\": \"正确\", \"label\": \"A\"}, {\"text\": \"错误\", \"label\": \"B\"}]','B','社交媒体营销需要内容多样化,包括教育内容、互动内容等',10,'easy',NULL,0,0,1,'2025-09-23 02:39:48','2025-09-23 02:39:48');
|
||||
/*!40000 ALTER TABLE `questions` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `teams`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `teams`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `teams` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '团队名称',
|
||||
`code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '团队代码',
|
||||
`description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '团队描述',
|
||||
`team_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '团队类型',
|
||||
`is_active` tinyint(1) DEFAULT '1' COMMENT '是否激活',
|
||||
`leader_id` int DEFAULT NULL COMMENT '负责人ID',
|
||||
`parent_id` int DEFAULT NULL COMMENT '父团队ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `name` (`name`),
|
||||
UNIQUE KEY `code` (`code`),
|
||||
KEY `leader_id` (`leader_id`),
|
||||
KEY `parent_id` (`parent_id`),
|
||||
KEY `idx_team_type` (`team_type`),
|
||||
KEY `idx_is_active` (`is_active`),
|
||||
CONSTRAINT `teams_ibfk_1` FOREIGN KEY (`leader_id`) REFERENCES `users` (`id`) ON DELETE SET NULL,
|
||||
CONSTRAINT `teams_ibfk_2` FOREIGN KEY (`parent_id`) REFERENCES `teams` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='团队信息表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `teams`
|
||||
--
|
||||
|
||||
LOCK TABLES `teams` WRITE;
|
||||
/*!40000 ALTER TABLE `teams` DISABLE KEYS */;
|
||||
INSERT INTO `teams` VALUES (1,'管理层','MANAGEMENT','负责公司整体战略规划和运营管理','department',1,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(2,'北京运营团队','BJ_OPERATIONS','负责北京地区所有门店的运营管理','department',1,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(3,'上海运营团队','SH_OPERATIONS','负责上海地区所有门店的运营管理','department',1,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(4,'技术培训部','TECH_TRAINING','负责员工技术培训和考核','department',1,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(5,'客服质量部','QUALITY_SERVICE','负责客户服务质量监督和改进','department',1,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(6,'新员工培训小组','NEW_EMPLOYEE_TRAINING','专门负责新员工入职培训','study_group',1,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL);
|
||||
/*!40000 ALTER TABLE `teams` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `training_messages`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `training_messages`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `training_messages` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`session_id` int NOT NULL COMMENT '会话ID',
|
||||
`role` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '消息角色',
|
||||
`type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '消息类型',
|
||||
`content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '消息内容',
|
||||
`voice_url` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '语音文件URL',
|
||||
`voice_duration` int DEFAULT NULL COMMENT '语音时长(秒)',
|
||||
`message_metadata` json DEFAULT NULL COMMENT '消息元数据',
|
||||
`coze_message_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Coze消息ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_session_id` (`session_id`),
|
||||
KEY `idx_role` (`role`),
|
||||
CONSTRAINT `training_messages_ibfk_1` FOREIGN KEY (`session_id`) REFERENCES `training_sessions` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='培训消息表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `training_messages`
|
||||
--
|
||||
|
||||
LOCK TABLES `training_messages` WRITE;
|
||||
/*!40000 ALTER TABLE `training_messages` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `training_messages` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `training_reports`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `training_reports`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `training_reports` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`session_id` int NOT NULL COMMENT '会话ID',
|
||||
`user_id` int NOT NULL COMMENT '用户ID',
|
||||
`overall_score` decimal(5,2) DEFAULT NULL COMMENT '总体评分',
|
||||
`dimension_scores` json DEFAULT NULL COMMENT '各维度得分',
|
||||
`strengths` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '优势点',
|
||||
`weaknesses` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '待改进点',
|
||||
`suggestions` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '改进建议',
|
||||
`detailed_analysis` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '详细分析',
|
||||
`transcript` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '对话记录',
|
||||
`statistics` json DEFAULT NULL COMMENT '统计数据',
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `session_id` (`session_id`),
|
||||
KEY `idx_user_id` (`user_id`),
|
||||
CONSTRAINT `training_reports_ibfk_1` FOREIGN KEY (`session_id`) REFERENCES `training_sessions` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='培训报告表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `training_reports`
|
||||
--
|
||||
|
||||
LOCK TABLES `training_reports` WRITE;
|
||||
/*!40000 ALTER TABLE `training_reports` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `training_reports` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `training_scenes`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `training_scenes`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `training_scenes` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '场景名称',
|
||||
`description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '场景描述',
|
||||
`category` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '场景分类',
|
||||
`ai_config` json DEFAULT NULL COMMENT 'AI配置',
|
||||
`prompt_template` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '提示模板',
|
||||
`evaluation_criteria` json DEFAULT NULL COMMENT '评估标准',
|
||||
`status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'active' COMMENT '场景状态',
|
||||
`is_public` tinyint(1) DEFAULT '1' COMMENT '是否公开',
|
||||
`required_level` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '所需用户等级',
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_status` (`status`),
|
||||
KEY `idx_category` (`category`),
|
||||
KEY `idx_is_public` (`is_public`),
|
||||
KEY `idx_is_deleted` (`is_deleted`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='培训场景表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `training_scenes`
|
||||
--
|
||||
|
||||
LOCK TABLES `training_scenes` WRITE;
|
||||
/*!40000 ALTER TABLE `training_scenes` DISABLE KEYS */;
|
||||
INSERT INTO `training_scenes` VALUES (1,'客户咨询模拟','模拟真实的客户咨询场景,练习专业咨询技巧','客户服务',NULL,NULL,NULL,'ACTIVE',1,NULL,0,NULL,NULL,NULL,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(2,'产品推荐演练','针对不同客户需求进行产品推荐的实战演练','销售技巧',NULL,NULL,NULL,'ACTIVE',1,NULL,0,NULL,NULL,NULL,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(3,'投诉处理训练','模拟各种客户投诉情况,训练处理技巧和话术','客户服务',NULL,NULL,NULL,'ACTIVE',1,NULL,0,NULL,NULL,NULL,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(4,'项目操作指导','美容项目操作的标准流程指导和安全注意事项','技术指导',NULL,NULL,NULL,'ACTIVE',1,NULL,0,NULL,NULL,NULL,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(5,'团队管理讨论','管理岗位的团队建设和绩效管理讨论','管理培训',NULL,NULL,NULL,'ACTIVE',1,NULL,0,NULL,NULL,NULL,'2025-09-23 02:39:48','2025-09-23 02:39:48');
|
||||
/*!40000 ALTER TABLE `training_scenes` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `training_sessions`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `training_sessions`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `training_sessions` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`user_id` int NOT NULL COMMENT '用户ID',
|
||||
`scene_id` int NOT NULL COMMENT '场景ID',
|
||||
`coze_conversation_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Coze对话ID',
|
||||
`start_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '开始时间',
|
||||
`end_time` datetime DEFAULT NULL COMMENT '结束时间',
|
||||
`duration_seconds` int DEFAULT NULL COMMENT '持续时长(秒)',
|
||||
`status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'active' COMMENT '会话状态',
|
||||
`session_config` json DEFAULT NULL COMMENT '会话配置',
|
||||
`total_score` decimal(5,2) DEFAULT NULL COMMENT '总分',
|
||||
`evaluation_result` json DEFAULT NULL COMMENT '评估结果详情',
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_user_id` (`user_id`),
|
||||
KEY `idx_scene_id` (`scene_id`),
|
||||
KEY `idx_status` (`status`),
|
||||
CONSTRAINT `training_sessions_ibfk_1` FOREIGN KEY (`scene_id`) REFERENCES `training_scenes` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='培训会话表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `training_sessions`
|
||||
--
|
||||
|
||||
LOCK TABLES `training_sessions` WRITE;
|
||||
/*!40000 ALTER TABLE `training_sessions` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `training_sessions` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `user_teams`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `user_teams`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `user_teams` (
|
||||
`user_id` int NOT NULL COMMENT '用户ID',
|
||||
`team_id` int NOT NULL COMMENT '团队ID',
|
||||
`role` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '在团队中的角色',
|
||||
`joined_at` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '加入时间',
|
||||
PRIMARY KEY (`user_id`,`team_id`),
|
||||
KEY `team_id` (`team_id`),
|
||||
CONSTRAINT `user_teams_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `user_teams_ibfk_2` FOREIGN KEY (`team_id`) REFERENCES `teams` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='用户团队关联表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `user_teams`
|
||||
--
|
||||
|
||||
LOCK TABLES `user_teams` WRITE;
|
||||
/*!40000 ALTER TABLE `user_teams` DISABLE KEYS */;
|
||||
INSERT INTO `user_teams` VALUES (1,1,'leader','2025-09-22 18:42:32'),(2,1,'member','2025-09-22 18:42:32'),(3,2,'leader','2025-09-22 18:42:32'),(4,3,'leader','2025-09-22 18:42:32'),(5,2,'member','2025-09-22 18:42:32'),(5,4,'member','2025-09-22 18:42:32'),(6,2,'member','2025-09-22 18:42:32'),(6,4,'member','2025-09-22 18:42:32'),(7,3,'member','2025-09-22 18:42:32'),(7,4,'member','2025-09-22 18:42:32'),(8,3,'member','2025-09-22 18:42:32'),(8,6,'member','2025-09-22 18:42:32');
|
||||
/*!40000 ALTER TABLE `user_teams` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `users`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `users`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `users` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`username` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '用户名',
|
||||
`email` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '邮箱',
|
||||
`phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '手机号',
|
||||
`password_hash` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '密码哈希',
|
||||
`full_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '真实姓名',
|
||||
`gender` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '性别',
|
||||
`avatar_url` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '头像URL',
|
||||
`bio` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '个人简介',
|
||||
`school` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '学校',
|
||||
`major` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '专业',
|
||||
`role` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'trainee' COMMENT '用户角色',
|
||||
`is_active` tinyint(1) DEFAULT '1' COMMENT '是否激活',
|
||||
`is_verified` tinyint(1) DEFAULT '0' COMMENT '是否验证',
|
||||
`last_login_at` datetime DEFAULT NULL COMMENT '最后登录时间',
|
||||
`password_changed_at` datetime DEFAULT NULL COMMENT '密码修改时间',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `username` (`username`),
|
||||
UNIQUE KEY `email` (`email`),
|
||||
UNIQUE KEY `phone` (`phone`),
|
||||
KEY `idx_role` (`role`),
|
||||
KEY `idx_is_active` (`is_active`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='用户信息表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `users`
|
||||
--
|
||||
|
||||
LOCK TABLES `users` WRITE;
|
||||
/*!40000 ALTER TABLE `users` DISABLE KEYS */;
|
||||
INSERT INTO `users` VALUES (1,'superadmin','superadmin@ruimei.com','13800138001','$2b$12$jFhkYU3.Cd1kAfr64/073eayPquAr0z9WWUQEdOyFRmAqcxz.i10C','超级管理员','male',NULL,'负责系统整体管理和运营','睿美医疗美容学院','医疗美容管理','admin',1,0,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(2,'admin','admin@ruimei.com','13800138002','$2b$12$jFhkYU3.Cd1kAfr64/073eayPquAr0z9WWUQEdOyFRmAqcxz.i10C','系统管理员','female',NULL,'负责日常系统管理工作','睿美医疗美容学院','医疗美容技术','admin',1,0,'2025-09-25 18:51:58',NULL,'2025-09-23 02:38:24','2025-09-25 18:51:58',0,NULL),(3,'manager_beijing','manager.bj@ruimei.com','13800138003','$2b$12$jFhkYU3.Cd1kAfr64/073eayPquAr0z9WWUQEdOyFRmAqcxz.i10C','北京区域经理','male',NULL,'负责北京地区门店管理','北京医科大学','临床医学','manager',1,0,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(4,'manager_shanghai','manager.sh@ruimei.com','13800138004','$2b$12$jFhkYU3.Cd1kAfr64/073eayPquAr0z9WWUQEdOyFRmAqcxz.i10C','上海区域经理','female',NULL,'负责上海地区门店管理','复旦大学医学院','医疗美容','manager',1,0,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(5,'consultant_001','consultant001@ruimei.com','13800138005','$2b$12$jFhkYU3.Cd1kAfr64/073eayPquAr0z9WWUQEdOyFRmAqcxz.i10C','资深美容顾问','female',NULL,'专业美容咨询师,5年从业经验','上海健康医学院','医疗美容技术','trainee',1,0,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(6,'nurse_001','nurse001@ruimei.com','13800138006','$2b$12$jFhkYU3.Cd1kAfr64/073eayPquAr0z9WWUQEdOyFRmAqcxz.i10C','美容护士','female',NULL,'持证美容护士,专业技术过硬','首都医科大学','护理学','trainee',1,0,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(7,'therapist_001','therapist001@ruimei.com','13800138007','$2b$12$jFhkYU3.Cd1kAfr64/073eayPquAr0z9WWUQEdOyFRmAqcxz.i10C','美容技师','female',NULL,'专业美容技师,擅长面部护理','北京卫生职业学院','医疗美容技术','trainee',1,0,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(8,'receptionist_001','front001@ruimei.com','13800138008','$2b$12$jFhkYU3.Cd1kAfr64/073eayPquAr0z9WWUQEdOyFRmAqcxz.i10C','前台接待','female',NULL,'负责客户接待和预约管理','北京商贸职业学院','商务管理','trainee',1,0,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL);
|
||||
/*!40000 ALTER TABLE `users` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Temporary view structure for view `v_user_course_progress`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `v_user_course_progress`;
|
||||
/*!50001 DROP VIEW IF EXISTS `v_user_course_progress`*/;
|
||||
SET @saved_cs_client = @@character_set_client;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
/*!50001 CREATE VIEW `v_user_course_progress` AS SELECT
|
||||
1 AS `user_id`,
|
||||
1 AS `username`,
|
||||
1 AS `course_id`,
|
||||
1 AS `course_name`,
|
||||
1 AS `exam_count`,
|
||||
1 AS `avg_score`,
|
||||
1 AS `best_score`*/;
|
||||
SET character_set_client = @saved_cs_client;
|
||||
|
||||
--
|
||||
-- Final view structure for view `v_user_course_progress`
|
||||
--
|
||||
|
||||
/*!50001 DROP VIEW IF EXISTS `v_user_course_progress`*/;
|
||||
/*!50001 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50001 SET @saved_cs_results = @@character_set_results */;
|
||||
/*!50001 SET @saved_col_connection = @@collation_connection */;
|
||||
/*!50001 SET character_set_client = latin1 */;
|
||||
/*!50001 SET character_set_results = latin1 */;
|
||||
/*!50001 SET collation_connection = latin1_swedish_ci */;
|
||||
/*!50001 CREATE ALGORITHM=UNDEFINED */
|
||||
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
|
||||
/*!50001 VIEW `v_user_course_progress` AS select `u`.`id` AS `user_id`,`u`.`username` AS `username`,`c`.`id` AS `course_id`,`c`.`name` AS `course_name`,count(distinct `e`.`id`) AS `exam_count`,avg(`e`.`score`) AS `avg_score`,max(`e`.`score`) AS `best_score` from ((`users` `u` join `courses` `c`) left join `exams` `e` on(((`e`.`user_id` = `u`.`id`) and (`e`.`course_id` = `c`.`id`) and (`e`.`status` = 'submitted')))) group by `u`.`id`,`c`.`id` */;
|
||||
/*!50001 SET character_set_client = @saved_cs_client */;
|
||||
/*!50001 SET character_set_results = @saved_cs_results */;
|
||||
/*!50001 SET collation_connection = @saved_col_connection */;
|
||||
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
|
||||
|
||||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
||||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
||||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
-- Dump completed on 2025-09-25 21:19:47
|
||||
1025
知识库/backups/updates/backup_20251016_075849_database.sql
Normal file
1025
知识库/backups/updates/backup_20251016_075849_database.sql
Normal file
File diff suppressed because one or more lines are too long
783
知识库/backups/updates/backup_before_import_20251016_060537.sql
Normal file
783
知识库/backups/updates/backup_before_import_20251016_060537.sql
Normal file
@@ -0,0 +1,783 @@
|
||||
mysqldump: [Warning] Using a password on the command line interface can be insecure.
|
||||
-- MySQL dump 10.13 Distrib 8.0.43, for Linux (x86_64)
|
||||
--
|
||||
-- Host: localhost Database: kaopeilian
|
||||
-- ------------------------------------------------------
|
||||
-- Server version 8.0.43
|
||||
|
||||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
||||
/*!50503 SET NAMES utf8mb4 */;
|
||||
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
|
||||
/*!40103 SET TIME_ZONE='+00:00' */;
|
||||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
|
||||
--
|
||||
-- Table structure for table `course_exam_settings`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `course_exam_settings`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `course_exam_settings` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`course_id` int NOT NULL COMMENT '课程ID',
|
||||
`single_choice_count` int NOT NULL DEFAULT '10' COMMENT '单选题数量',
|
||||
`multiple_choice_count` int NOT NULL DEFAULT '5' COMMENT '多选题数量',
|
||||
`true_false_count` int NOT NULL DEFAULT '5' COMMENT '判断题数量',
|
||||
`fill_blank_count` int NOT NULL DEFAULT '0' COMMENT '填空题数量',
|
||||
`duration_minutes` int NOT NULL DEFAULT '60' COMMENT '考试时长(分钟)',
|
||||
`difficulty_level` int NOT NULL DEFAULT '3' COMMENT '难度系数(1-5)',
|
||||
`passing_score` int NOT NULL DEFAULT '60' COMMENT '及格分数',
|
||||
`is_enabled` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是否启用',
|
||||
`show_answer_immediately` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否立即显示答案',
|
||||
`allow_retake` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是否允许重考',
|
||||
`max_retake_times` int DEFAULT NULL COMMENT '最大重考次数',
|
||||
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`is_deleted` tinyint(1) NOT NULL DEFAULT '0',
|
||||
`deleted_at` datetime DEFAULT NULL,
|
||||
`deleted_by` int DEFAULT NULL COMMENT '删除人ID',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `course_id` (`course_id`),
|
||||
KEY `ix_course_exam_settings_id` (`id`),
|
||||
CONSTRAINT `course_exam_settings_ibfk_1` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='课程考试设置表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `course_exam_settings`
|
||||
--
|
||||
|
||||
LOCK TABLES `course_exam_settings` WRITE;
|
||||
/*!40000 ALTER TABLE `course_exam_settings` DISABLE KEYS */;
|
||||
INSERT INTO `course_exam_settings` VALUES (1,1,5,3,2,0,60,2,80,1,1,1,3,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(2,2,4,2,2,2,45,1,75,1,1,1,3,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(3,3,3,2,3,2,50,2,80,1,0,1,2,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(4,4,4,3,2,1,55,2,85,1,1,1,3,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(5,5,5,2,2,1,40,1,70,1,1,1,5,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(6,6,3,2,3,2,45,1,75,1,1,1,3,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(7,7,4,2,2,2,50,2,80,1,0,1,2,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(8,8,5,3,2,0,60,3,85,1,1,1,2,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(9,9,4,2,4,0,50,2,80,1,1,1,3,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(10,10,3,2,3,2,45,1,75,1,1,1,3,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(11,11,5,3,2,0,60,3,90,1,0,1,2,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(12,12,4,2,4,0,40,1,70,1,1,1,5,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL);
|
||||
/*!40000 ALTER TABLE `course_exam_settings` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `course_materials`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `course_materials`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `course_materials` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`course_id` int NOT NULL COMMENT '所属课程ID',
|
||||
`name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '资料名称',
|
||||
`description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '资料描述',
|
||||
`file_url` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '文件URL',
|
||||
`file_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '文件类型',
|
||||
`file_size` int NOT NULL COMMENT '文件大小(字节)',
|
||||
`sort_order` int DEFAULT '0' COMMENT '排序序号',
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_course_id` (`course_id`),
|
||||
KEY `idx_is_deleted` (`is_deleted`),
|
||||
CONSTRAINT `course_materials_ibfk_1` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='课程资料表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `course_materials`
|
||||
--
|
||||
|
||||
LOCK TABLES `course_materials` WRITE;
|
||||
/*!40000 ALTER TABLE `course_materials` DISABLE KEYS */;
|
||||
INSERT INTO `course_materials` VALUES (16,1,'000012.pdf','','/static/uploads/courses/1/20250927112719_26f92ba8.pdf','pdf',433422,0,1,'2025-09-29 11:27:36','2025-09-27 11:27:20','2025-09-29 11:27:36',NULL,NULL);
|
||||
/*!40000 ALTER TABLE `course_materials` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `courses`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `courses`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `courses` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '课程名称',
|
||||
`description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '课程描述',
|
||||
`category` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '课程分类',
|
||||
`status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'draft' COMMENT '课程状态',
|
||||
`cover_image` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '封面图片',
|
||||
`duration_hours` decimal(5,2) DEFAULT NULL COMMENT '课程时长(小时)',
|
||||
`difficulty_level` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '难度等级',
|
||||
`tags` json DEFAULT NULL COMMENT '标签列表',
|
||||
`published_at` datetime DEFAULT NULL COMMENT '发布时间',
|
||||
`publisher_id` int DEFAULT NULL COMMENT '发布人ID',
|
||||
`sort_order` int DEFAULT '0' COMMENT '排序',
|
||||
`is_featured` tinyint(1) DEFAULT '0' COMMENT '是否推荐',
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_status` (`status`),
|
||||
KEY `idx_category` (`category`),
|
||||
KEY `idx_is_featured` (`is_featured`),
|
||||
KEY `idx_is_deleted` (`is_deleted`),
|
||||
KEY `idx_sort_order` (`sort_order`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='课程信息表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `courses`
|
||||
--
|
||||
|
||||
LOCK TABLES `courses` WRITE;
|
||||
/*!40000 ALTER TABLE `courses` DISABLE KEYS */;
|
||||
INSERT INTO `courses` VALUES (1,'皮肤生理学基础','学习皮肤结构、功能和常见问题,为专业护理打下坚实基础','technology','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,2,'2025-09-23 02:38:24','2025-09-27 12:25:37'),(2,'医美产品知识与应用','全面了解各类医美产品的成分、功效和适用人群,掌握产品推荐技巧','technology','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(3,'美容仪器操作与维护','掌握各类美容仪器的操作方法、注意事项和日常维护保养','technology','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(4,'医美项目介绍与咨询','详细了解各类医美项目的原理、效果和适应症,提升咨询专业度','business','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(5,'轻医美销售技巧','学习专业的销售话术、客户需求分析和成交技巧,提升业绩能力','business','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(6,'客户服务与投诉处理','提升服务意识,掌握客户投诉处理的方法和技巧,维护品牌形象','management','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(7,'社媒营销与私域运营','学习如何通过社交媒体进行品牌推广和客户维护,建立私域流量','business','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(8,'门店运营管理','学习门店日常管理、团队建设和业绩管理的方法和技巧','management','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,2,'2025-09-23 02:38:24','2025-09-27 03:22:26'),(9,'卫生消毒与感染控制','学习医美机构的卫生标准和消毒流程,确保服务安全合规','general','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(10,'美容心理学','了解客户心理需求,掌握沟通技巧,提升服务满意度','general','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(11,'法律法规与行业规范','学习医美行业相关法律法规,确保合规经营','general','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(12,'新员工入职培训','新员工必修课程,包含企业文化、基础知识和操作规范','general','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24');
|
||||
/*!40000 ALTER TABLE `courses` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `exam_results`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `exam_results`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `exam_results` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`exam_id` int NOT NULL COMMENT '考试ID',
|
||||
`question_id` int NOT NULL COMMENT '题目ID',
|
||||
`user_answer` json DEFAULT NULL COMMENT '用户答案',
|
||||
`is_correct` tinyint(1) NOT NULL COMMENT '是否正确',
|
||||
`score` decimal(5,2) NOT NULL COMMENT '考试得分',
|
||||
`answer_time` int DEFAULT NULL COMMENT '答题时长(秒)',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_exam_id` (`exam_id`),
|
||||
KEY `idx_question_id` (`question_id`),
|
||||
CONSTRAINT `exam_results_ibfk_1` FOREIGN KEY (`exam_id`) REFERENCES `exams` (`id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `exam_results_ibfk_2` FOREIGN KEY (`question_id`) REFERENCES `questions` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='考试结果表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `exam_results`
|
||||
--
|
||||
|
||||
LOCK TABLES `exam_results` WRITE;
|
||||
/*!40000 ALTER TABLE `exam_results` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `exam_results` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `exams`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `exams`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `exams` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`user_id` int NOT NULL COMMENT '用户ID',
|
||||
`course_id` int NOT NULL COMMENT '课程ID',
|
||||
`exam_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '考试名称',
|
||||
`question_count` int DEFAULT NULL COMMENT '题目数量',
|
||||
`total_score` decimal(5,2) DEFAULT NULL COMMENT '总分',
|
||||
`pass_score` decimal(5,2) DEFAULT NULL COMMENT '及格分',
|
||||
`start_time` datetime DEFAULT NULL COMMENT '开始时间',
|
||||
`end_time` datetime DEFAULT NULL COMMENT '结束时间',
|
||||
`duration_minutes` int DEFAULT NULL COMMENT '考试时长(分钟)',
|
||||
`score` decimal(5,2) DEFAULT NULL COMMENT '得分',
|
||||
`is_passed` tinyint(1) DEFAULT '0' COMMENT '是否通过',
|
||||
`status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'pending' COMMENT '考试状态',
|
||||
`questions` json DEFAULT NULL COMMENT '题目数据(JSON格式)',
|
||||
`answers` json DEFAULT NULL COMMENT '答案数据(JSON格式)',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_user_id` (`user_id`),
|
||||
KEY `idx_course_id` (`course_id`),
|
||||
KEY `idx_status` (`status`),
|
||||
CONSTRAINT `exams_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `exams_ibfk_2` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='考试记录表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `exams`
|
||||
--
|
||||
|
||||
LOCK TABLES `exams` WRITE;
|
||||
/*!40000 ALTER TABLE `exams` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `exams` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `growth_paths`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `growth_paths`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `growth_paths` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '成长路径名称',
|
||||
`description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '路径描述',
|
||||
`target_role` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '目标角色',
|
||||
`courses` json DEFAULT NULL COMMENT '课程列表',
|
||||
`estimated_duration_days` int DEFAULT NULL COMMENT '预计完成天数',
|
||||
`is_active` tinyint(1) DEFAULT '1' COMMENT '是否启用',
|
||||
`sort_order` int DEFAULT '0' COMMENT '排序顺序',
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_is_active` (`is_active`),
|
||||
KEY `idx_is_deleted` (`is_deleted`),
|
||||
KEY `idx_sort_order` (`sort_order`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='成长路径表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `growth_paths`
|
||||
--
|
||||
|
||||
LOCK TABLES `growth_paths` WRITE;
|
||||
/*!40000 ALTER TABLE `growth_paths` DISABLE KEYS */;
|
||||
INSERT INTO `growth_paths` VALUES (1,'美容顾问成长路径','从初级美容顾问到资深顾问的完整成长路径,包含专业技能和销售能力提升','资深美容顾问',NULL,NULL,1,0,0,NULL,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(2,'美容技师进阶路径','美容技师的技能进阶路径,从基础护理到高级项目操作','高级美容技师',NULL,NULL,1,0,0,NULL,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(3,'管理岗位培养路径','从一线员工到管理岗位的培养路径,包含领导力和管理技能','店长/区域经理',NULL,NULL,1,0,0,NULL,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(4,'医美咨询师专业路径','医美咨询师的专业发展路径,深度掌握医美项目知识','资深医美咨询师',NULL,NULL,1,0,0,NULL,'2025-09-23 02:39:48','2025-09-23 02:39:48');
|
||||
/*!40000 ALTER TABLE `growth_paths` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `knowledge_points`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `knowledge_points`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `knowledge_points` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`course_id` int DEFAULT NULL COMMENT '所属课程ID',
|
||||
`name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '知识点名称',
|
||||
`description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '知识点描述',
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`material_id` int NOT NULL COMMENT '关联资料ID(必填)',
|
||||
`type` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT '理论知识' COMMENT '知识点类型(中文)',
|
||||
`source` tinyint(1) DEFAULT '0' COMMENT '来源:0=手动,1=AI分析',
|
||||
`topic_relation` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '与主题的关系描述',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_course_id` (`course_id`),
|
||||
KEY `idx_is_deleted` (`is_deleted`),
|
||||
KEY `material_id` (`material_id`),
|
||||
CONSTRAINT `knowledge_points_ibfk_1` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `knowledge_points_ibfk_2` FOREIGN KEY (`material_id`) REFERENCES `course_materials` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=57021 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='知识点表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `knowledge_points`
|
||||
--
|
||||
|
||||
LOCK TABLES `knowledge_points` WRITE;
|
||||
/*!40000 ALTER TABLE `knowledge_points` DISABLE KEYS */;
|
||||
INSERT INTO `knowledge_points` VALUES (477,1,'能量聚焦技术与治疗效果','能量更聚焦更精准。MFU微聚焦技术+SD协同聚点技术。更舒适、更无副作用。大幅降低疼痛和浮肿等副作用,达到最佳抗衰效果。',0,NULL,NULL,NULL,'2025-09-27 20:20:59','2025-09-27 20:20:59',16,'技巧方法',1,'这一段详细介绍了该SAAS产品在能量聚焦技术上的创新,以及这些技术如何提升治疗的精准性、舒适度和效果,与SAAS主题中的技术优势和用户体验相关。'),(478,1,'多深度治疗与全面抗衰','针对多种皮肤深度,达到不同层次。4刀4炮(专利4合1炮头),不同治疗头。更全面、更有效。满足面部不同抗衰需求。',0,NULL,NULL,NULL,'2025-09-27 20:20:59','2025-09-27 20:20:59',16,'技巧方法',1,'这一段阐述了该SAAS产品通过多深度治疗和专利炮头技术,实现对不同皮肤层次的全面覆盖,从而满足多样化的抗衰需求,与SAAS主题中的产品功能和应用范围相关。'),(479,1,'医美合规适应症超声刀的特点与优势','国内首款医美合规适应症超声刀,安全、合规、有证。更安全、更放心。不像之前的超声刀基本都是假的,做了没效果或者有风险。',0,NULL,NULL,NULL,'2025-09-27 20:20:59','2025-09-27 20:20:59',16,'理论知识',1,'这一段描述了该SAAS产品作为医美合规超声刀的独有特征和带来的安全优势,强调了其合规性和可靠性,与SAAS主题中的产品特性和市场定位相关。');
|
||||
/*!40000 ALTER TABLE `knowledge_points` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `position_courses`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `position_courses`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `position_courses` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`position_id` int NOT NULL COMMENT '岗位ID',
|
||||
`course_id` int NOT NULL COMMENT '课程ID',
|
||||
`course_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'required' COMMENT '课程类型(必修/选修)',
|
||||
`priority` int DEFAULT '0' COMMENT '优先级',
|
||||
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`is_deleted` tinyint(1) NOT NULL DEFAULT '0',
|
||||
`deleted_at` datetime DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uix_position_course` (`position_id`,`course_id`,`is_deleted`),
|
||||
KEY `course_id` (`course_id`),
|
||||
KEY `ix_position_courses_id` (`id`),
|
||||
CONSTRAINT `position_courses_ibfk_1` FOREIGN KEY (`position_id`) REFERENCES `positions` (`id`),
|
||||
CONSTRAINT `position_courses_ibfk_2` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='岗位课程关联表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `position_courses`
|
||||
--
|
||||
|
||||
LOCK TABLES `position_courses` WRITE;
|
||||
/*!40000 ALTER TABLE `position_courses` DISABLE KEYS */;
|
||||
INSERT INTO `position_courses` VALUES (1,1,6,'required',1,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(2,1,8,'required',2,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(3,1,11,'required',3,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(4,1,12,'required',4,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(5,3,1,'required',1,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(6,3,2,'required',2,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(7,3,5,'required',3,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(8,3,6,'required',4,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(9,3,10,'required',5,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(10,3,12,'required',6,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(11,4,1,'required',1,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(12,4,2,'required',2,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(13,4,4,'required',3,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(14,4,5,'required',4,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(15,4,9,'required',5,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(16,4,12,'required',6,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(17,5,1,'required',1,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(18,5,2,'required',2,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(19,5,3,'required',3,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(20,5,9,'required',4,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(21,5,12,'required',5,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(22,7,6,'required',1,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(23,7,10,'required',2,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(24,7,12,'required',3,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL);
|
||||
/*!40000 ALTER TABLE `position_courses` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `position_members`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `position_members`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `position_members` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`position_id` int NOT NULL COMMENT '岗位ID',
|
||||
`user_id` int NOT NULL COMMENT '用户ID',
|
||||
`role` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '在岗位中的角色',
|
||||
`joined_at` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '加入时间',
|
||||
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`is_deleted` tinyint(1) NOT NULL DEFAULT '0',
|
||||
`deleted_at` datetime DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uix_position_user` (`position_id`,`user_id`,`is_deleted`),
|
||||
KEY `user_id` (`user_id`),
|
||||
KEY `ix_position_members_id` (`id`),
|
||||
CONSTRAINT `position_members_ibfk_1` FOREIGN KEY (`position_id`) REFERENCES `positions` (`id`),
|
||||
CONSTRAINT `position_members_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='岗位成员关联表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `position_members`
|
||||
--
|
||||
|
||||
LOCK TABLES `position_members` WRITE;
|
||||
/*!40000 ALTER TABLE `position_members` DISABLE KEYS */;
|
||||
INSERT INTO `position_members` VALUES (1,1,3,NULL,'2025-09-22 18:42:32','2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(2,1,4,NULL,'2025-09-22 18:42:32','2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(3,3,5,NULL,'2025-09-22 18:42:32','2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(4,4,6,NULL,'2025-09-22 18:42:32','2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(5,5,7,NULL,'2025-09-22 18:42:32','2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(6,7,8,NULL,'2025-09-22 18:42:32','2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(7,1,1,NULL,'2025-09-26 14:49:24','2025-09-26 14:49:24','2025-09-26 14:49:24',NULL,NULL,0,NULL);
|
||||
/*!40000 ALTER TABLE `position_members` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `positions`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `positions`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `positions` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '岗位名称',
|
||||
`code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '岗位代码',
|
||||
`description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '岗位描述',
|
||||
`parent_id` int DEFAULT NULL COMMENT '上级岗位ID',
|
||||
`status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'active' COMMENT '岗位状态',
|
||||
`skills` json DEFAULT NULL COMMENT '核心技能',
|
||||
`level` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '岗位级别',
|
||||
`sort_order` int DEFAULT '0' COMMENT '排序',
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `code` (`code`),
|
||||
KEY `parent_id` (`parent_id`),
|
||||
KEY `idx_positions_name` (`name`),
|
||||
CONSTRAINT `positions_ibfk_1` FOREIGN KEY (`parent_id`) REFERENCES `positions` (`id`) ON DELETE SET NULL
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='岗位信息表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `positions`
|
||||
--
|
||||
|
||||
LOCK TABLES `positions` WRITE;
|
||||
/*!40000 ALTER TABLE `positions` DISABLE KEYS */;
|
||||
INSERT INTO `positions` VALUES (1,'区域经理','region_manager','负责多家门店的运营管理和业绩达成,制定区域发展战略',NULL,'active',NULL,'expert',0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(2,'店长','store_manager','负责门店日常运营管理,团队建设和业绩达成',NULL,'active',NULL,'senior',0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(3,'美容顾问','beauty_consultant','为客户提供专业的美容咨询和个性化方案设计',NULL,'active',NULL,'intermediate',0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(4,'医美咨询师','medical_beauty_consultant','提供医疗美容项目咨询和专业方案制定',NULL,'active',NULL,'senior',0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(5,'美容技师','beauty_therapist','为客户提供专业的美容护理和技术服务',NULL,'active',NULL,'intermediate',0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(6,'美容护士','beauty_nurse','协助医生进行医美项目操作,负责术后护理指导',NULL,'active',NULL,'intermediate',0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(7,'前台接待','receptionist','负责客户接待、预约管理和前台事务处理',NULL,'active',NULL,'junior',0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(8,'市场专员','marketing_specialist','负责门店营销活动策划、执行和客户维护',NULL,'active',NULL,'intermediate',0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24');
|
||||
/*!40000 ALTER TABLE `positions` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `questions`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `questions`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `questions` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`course_id` int NOT NULL COMMENT '所属课程ID',
|
||||
`question_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '题目类型',
|
||||
`title` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '题目标题',
|
||||
`content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '题目内容',
|
||||
`options` json DEFAULT NULL COMMENT '选项内容',
|
||||
`correct_answer` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '正确答案',
|
||||
`explanation` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '答案解析',
|
||||
`score` float DEFAULT '10' COMMENT '题目分值',
|
||||
`difficulty` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'medium' COMMENT '难度等级',
|
||||
`tags` json DEFAULT NULL COMMENT '题目标签',
|
||||
`usage_count` int DEFAULT '0' COMMENT '使用次数',
|
||||
`correct_count` int DEFAULT '0' COMMENT '答对次数',
|
||||
`is_active` tinyint(1) DEFAULT '1' COMMENT '是否启用',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_course_id` (`course_id`),
|
||||
KEY `idx_question_type` (`question_type`),
|
||||
KEY `idx_difficulty` (`difficulty`),
|
||||
KEY `idx_is_active` (`is_active`),
|
||||
CONSTRAINT `questions_ibfk_1` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='题目表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `questions`
|
||||
--
|
||||
|
||||
LOCK TABLES `questions` WRITE;
|
||||
/*!40000 ALTER TABLE `questions` DISABLE KEYS */;
|
||||
INSERT INTO `questions` VALUES (1,1,'single_choice','皮肤的最外层是什么?',NULL,'[{\"text\": \"表皮\", \"label\": \"A\"}, {\"text\": \"真皮\", \"label\": \"B\"}, {\"text\": \"皮下组织\", \"label\": \"C\"}, {\"text\": \"角质层\", \"label\": \"D\"}]','A','A选项是表皮,这是皮肤的最外层,起到保护作用',10,'easy',NULL,0,0,1,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(2,2,'single_choice','透明质酸的主要功效是什么?',NULL,'[{\"text\": \"美白淡斑\", \"label\": \"A\"}, {\"text\": \"保湿补水\", \"label\": \"B\"}, {\"text\": \"紧致提升\", \"label\": \"C\"}, {\"text\": \"去除皱纹\", \"label\": \"D\"}]','B','B选项是保湿补水,透明质酸具有强大的保湿能力',10,'easy',NULL,0,0,1,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(3,3,'multiple_choice','射频美容仪的禁忌症包括哪些?',NULL,'[{\"text\": \"孕期和哺乳期\", \"label\": \"A\"}, {\"text\": \"皮肤过敏\", \"label\": \"B\"}, {\"text\": \"心脏起搏器\", \"label\": \"C\"}, {\"text\": \"轻微痤疮\", \"label\": \"D\"}]','A,C','A和C选项都是射频美容仪的禁忌症,需要特别注意',15,'medium',NULL,0,0,1,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(4,4,'true_false','水光针适合所有肤质的客户',NULL,'[{\"text\": \"正确\", \"label\": \"A\"}, {\"text\": \"错误\", \"label\": \"B\"}]','B','水光针虽然适用范围广,但仍有一些禁忌症和不适合的肤质',10,'easy',NULL,0,0,1,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(5,4,'fill_blank','肉毒素注射后____小时内不能平躺','肉毒素注射后【】小时内不能平躺,以免影响药物分布效果。',NULL,'4','肉毒素注射后4小时内不能平躺,以免影响药物分布',10,'medium',NULL,0,0,1,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(6,5,'single_choice','客户咨询时最重要的是什么?',NULL,'[{\"text\": \"倾听客户需求\", \"label\": \"A\"}, {\"text\": \"推荐最贵的产品\", \"label\": \"B\"}, {\"text\": \"快速成交\", \"label\": \"C\"}, {\"text\": \"展示专业知识\", \"label\": \"D\"}]','A','A选项是倾听客户需求,这是专业咨询的基础',10,'easy',NULL,0,0,1,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(7,6,'single_choice','处理客户投诉的第一步是什么?',NULL,'[{\"text\": \"解释原因\", \"label\": \"A\"}, {\"text\": \"耐心倾听\", \"label\": \"B\"}, {\"text\": \"提供补偿\", \"label\": \"C\"}, {\"text\": \"转交上级\", \"label\": \"D\"}]','B','B选项是耐心倾听,让客户充分表达不满是处理投诉的第一步',10,'easy',NULL,0,0,1,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(8,7,'true_false','社交媒体营销只需要发布产品信息',NULL,'[{\"text\": \"正确\", \"label\": \"A\"}, {\"text\": \"错误\", \"label\": \"B\"}]','B','社交媒体营销需要内容多样化,包括教育内容、互动内容等',10,'easy',NULL,0,0,1,'2025-09-23 02:39:48','2025-09-23 02:39:48');
|
||||
/*!40000 ALTER TABLE `questions` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `teams`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `teams`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `teams` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '团队名称',
|
||||
`code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '团队代码',
|
||||
`description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '团队描述',
|
||||
`team_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '团队类型',
|
||||
`is_active` tinyint(1) DEFAULT '1' COMMENT '是否激活',
|
||||
`leader_id` int DEFAULT NULL COMMENT '负责人ID',
|
||||
`parent_id` int DEFAULT NULL COMMENT '父团队ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `name` (`name`),
|
||||
UNIQUE KEY `code` (`code`),
|
||||
KEY `leader_id` (`leader_id`),
|
||||
KEY `parent_id` (`parent_id`),
|
||||
KEY `idx_team_type` (`team_type`),
|
||||
KEY `idx_is_active` (`is_active`),
|
||||
CONSTRAINT `teams_ibfk_1` FOREIGN KEY (`leader_id`) REFERENCES `users` (`id`) ON DELETE SET NULL,
|
||||
CONSTRAINT `teams_ibfk_2` FOREIGN KEY (`parent_id`) REFERENCES `teams` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='团队信息表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `teams`
|
||||
--
|
||||
|
||||
LOCK TABLES `teams` WRITE;
|
||||
/*!40000 ALTER TABLE `teams` DISABLE KEYS */;
|
||||
INSERT INTO `teams` VALUES (1,'管理层','MANAGEMENT','负责公司整体战略规划和运营管理','department',1,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(2,'北京运营团队','BJ_OPERATIONS','负责北京地区所有门店的运营管理','department',1,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(3,'上海运营团队','SH_OPERATIONS','负责上海地区所有门店的运营管理','department',1,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(4,'技术培训部','TECH_TRAINING','负责员工技术培训和考核','department',1,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(5,'客服质量部','QUALITY_SERVICE','负责客户服务质量监督和改进','department',1,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(6,'新员工培训小组','NEW_EMPLOYEE_TRAINING','专门负责新员工入职培训','study_group',1,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL);
|
||||
/*!40000 ALTER TABLE `teams` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `training_messages`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `training_messages`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `training_messages` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`session_id` int NOT NULL COMMENT '会话ID',
|
||||
`role` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '消息角色',
|
||||
`type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '消息类型',
|
||||
`content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '消息内容',
|
||||
`voice_url` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '语音文件URL',
|
||||
`voice_duration` int DEFAULT NULL COMMENT '语音时长(秒)',
|
||||
`message_metadata` json DEFAULT NULL COMMENT '消息元数据',
|
||||
`coze_message_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Coze消息ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_session_id` (`session_id`),
|
||||
KEY `idx_role` (`role`),
|
||||
CONSTRAINT `training_messages_ibfk_1` FOREIGN KEY (`session_id`) REFERENCES `training_sessions` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='培训消息表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `training_messages`
|
||||
--
|
||||
|
||||
LOCK TABLES `training_messages` WRITE;
|
||||
/*!40000 ALTER TABLE `training_messages` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `training_messages` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `training_reports`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `training_reports`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `training_reports` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`session_id` int NOT NULL COMMENT '会话ID',
|
||||
`user_id` int NOT NULL COMMENT '用户ID',
|
||||
`overall_score` decimal(5,2) DEFAULT NULL COMMENT '总体评分',
|
||||
`dimension_scores` json DEFAULT NULL COMMENT '各维度得分',
|
||||
`strengths` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '优势点',
|
||||
`weaknesses` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '待改进点',
|
||||
`suggestions` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '改进建议',
|
||||
`detailed_analysis` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '详细分析',
|
||||
`transcript` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '对话记录',
|
||||
`statistics` json DEFAULT NULL COMMENT '统计数据',
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `session_id` (`session_id`),
|
||||
KEY `idx_user_id` (`user_id`),
|
||||
CONSTRAINT `training_reports_ibfk_1` FOREIGN KEY (`session_id`) REFERENCES `training_sessions` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='培训报告表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `training_reports`
|
||||
--
|
||||
|
||||
LOCK TABLES `training_reports` WRITE;
|
||||
/*!40000 ALTER TABLE `training_reports` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `training_reports` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `training_scenes`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `training_scenes`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `training_scenes` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '场景名称',
|
||||
`description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '场景描述',
|
||||
`category` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '场景分类',
|
||||
`ai_config` json DEFAULT NULL COMMENT 'AI配置',
|
||||
`prompt_template` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '提示模板',
|
||||
`evaluation_criteria` json DEFAULT NULL COMMENT '评估标准',
|
||||
`status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'active' COMMENT '场景状态',
|
||||
`is_public` tinyint(1) DEFAULT '1' COMMENT '是否公开',
|
||||
`required_level` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '所需用户等级',
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_status` (`status`),
|
||||
KEY `idx_category` (`category`),
|
||||
KEY `idx_is_public` (`is_public`),
|
||||
KEY `idx_is_deleted` (`is_deleted`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='培训场景表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `training_scenes`
|
||||
--
|
||||
|
||||
LOCK TABLES `training_scenes` WRITE;
|
||||
/*!40000 ALTER TABLE `training_scenes` DISABLE KEYS */;
|
||||
INSERT INTO `training_scenes` VALUES (1,'客户咨询模拟','模拟真实的客户咨询场景,练习专业咨询技巧','客户服务',NULL,NULL,NULL,'ACTIVE',1,NULL,0,NULL,NULL,NULL,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(2,'产品推荐演练','针对不同客户需求进行产品推荐的实战演练','销售技巧',NULL,NULL,NULL,'ACTIVE',1,NULL,0,NULL,NULL,NULL,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(3,'投诉处理训练','模拟各种客户投诉情况,训练处理技巧和话术','客户服务',NULL,NULL,NULL,'ACTIVE',1,NULL,0,NULL,NULL,NULL,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(4,'项目操作指导','美容项目操作的标准流程指导和安全注意事项','技术指导',NULL,NULL,NULL,'ACTIVE',1,NULL,0,NULL,NULL,NULL,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(5,'团队管理讨论','管理岗位的团队建设和绩效管理讨论','管理培训',NULL,NULL,NULL,'ACTIVE',1,NULL,0,NULL,NULL,NULL,'2025-09-23 02:39:48','2025-09-23 02:39:48');
|
||||
/*!40000 ALTER TABLE `training_scenes` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `training_sessions`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `training_sessions`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `training_sessions` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`user_id` int NOT NULL COMMENT '用户ID',
|
||||
`scene_id` int NOT NULL COMMENT '场景ID',
|
||||
`coze_conversation_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Coze对话ID',
|
||||
`start_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '开始时间',
|
||||
`end_time` datetime DEFAULT NULL COMMENT '结束时间',
|
||||
`duration_seconds` int DEFAULT NULL COMMENT '持续时长(秒)',
|
||||
`status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'active' COMMENT '会话状态',
|
||||
`session_config` json DEFAULT NULL COMMENT '会话配置',
|
||||
`total_score` decimal(5,2) DEFAULT NULL COMMENT '总分',
|
||||
`evaluation_result` json DEFAULT NULL COMMENT '评估结果详情',
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_user_id` (`user_id`),
|
||||
KEY `idx_scene_id` (`scene_id`),
|
||||
KEY `idx_status` (`status`),
|
||||
CONSTRAINT `training_sessions_ibfk_1` FOREIGN KEY (`scene_id`) REFERENCES `training_scenes` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='培训会话表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `training_sessions`
|
||||
--
|
||||
|
||||
LOCK TABLES `training_sessions` WRITE;
|
||||
/*!40000 ALTER TABLE `training_sessions` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `training_sessions` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `user_teams`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `user_teams`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `user_teams` (
|
||||
`user_id` int NOT NULL COMMENT '用户ID',
|
||||
`team_id` int NOT NULL COMMENT '团队ID',
|
||||
`role` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '在团队中的角色',
|
||||
`joined_at` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '加入时间',
|
||||
PRIMARY KEY (`user_id`,`team_id`),
|
||||
KEY `team_id` (`team_id`),
|
||||
CONSTRAINT `user_teams_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `user_teams_ibfk_2` FOREIGN KEY (`team_id`) REFERENCES `teams` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='用户团队关联表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `user_teams`
|
||||
--
|
||||
|
||||
LOCK TABLES `user_teams` WRITE;
|
||||
/*!40000 ALTER TABLE `user_teams` DISABLE KEYS */;
|
||||
INSERT INTO `user_teams` VALUES (1,1,'leader','2025-09-22 18:42:32'),(2,1,'member','2025-09-22 18:42:32'),(3,2,'leader','2025-09-22 18:42:32'),(4,3,'leader','2025-09-22 18:42:32'),(5,2,'member','2025-09-22 18:42:32'),(5,4,'member','2025-09-22 18:42:32'),(6,2,'member','2025-09-22 18:42:32'),(6,4,'member','2025-09-22 18:42:32'),(7,3,'member','2025-09-22 18:42:32'),(7,4,'member','2025-09-22 18:42:32'),(8,3,'member','2025-09-22 18:42:32'),(8,6,'member','2025-09-22 18:42:32');
|
||||
/*!40000 ALTER TABLE `user_teams` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `users`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `users`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `users` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`username` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '用户名',
|
||||
`email` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '邮箱',
|
||||
`phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '手机号',
|
||||
`password_hash` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '密码哈希',
|
||||
`full_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '真实姓名',
|
||||
`gender` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '性别',
|
||||
`avatar_url` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '头像URL',
|
||||
`bio` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '个人简介',
|
||||
`school` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '学校',
|
||||
`major` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '专业',
|
||||
`role` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'trainee' COMMENT '用户角色',
|
||||
`is_active` tinyint(1) DEFAULT '1' COMMENT '是否激活',
|
||||
`is_verified` tinyint(1) DEFAULT '0' COMMENT '是否验证',
|
||||
`last_login_at` datetime DEFAULT NULL COMMENT '最后登录时间',
|
||||
`password_changed_at` datetime DEFAULT NULL COMMENT '密码修改时间',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `username` (`username`),
|
||||
UNIQUE KEY `email` (`email`),
|
||||
UNIQUE KEY `phone` (`phone`),
|
||||
KEY `idx_role` (`role`),
|
||||
KEY `idx_is_active` (`is_active`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='用户信息表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `users`
|
||||
--
|
||||
|
||||
LOCK TABLES `users` WRITE;
|
||||
/*!40000 ALTER TABLE `users` DISABLE KEYS */;
|
||||
INSERT INTO `users` VALUES (1,'superadmin','superadmin@ruimei.com','13800138001','$2b$12$jFhkYU3.Cd1kAfr64/073eayPquAr0z9WWUQEdOyFRmAqcxz.i10C','超级管理员','male',NULL,'负责系统整体管理和运营','睿美医疗美容学院','医疗美容管理','admin',1,0,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(2,'admin','admin@ruimei.com','13800138002','$2b$12$jFhkYU3.Cd1kAfr64/073eayPquAr0z9WWUQEdOyFRmAqcxz.i10C','系统管理员','female',NULL,'负责日常系统管理工作','睿美医疗美容学院','医疗美容技术','admin',1,0,'2025-09-29 18:24:47',NULL,'2025-09-23 02:38:24','2025-09-29 18:24:47',0,NULL),(3,'manager_beijing','manager.bj@ruimei.com','13800138003','$2b$12$jFhkYU3.Cd1kAfr64/073eayPquAr0z9WWUQEdOyFRmAqcxz.i10C','北京区域经理','male',NULL,'负责北京地区门店管理','北京医科大学','临床医学','manager',1,0,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(4,'manager_shanghai','manager.sh@ruimei.com','13800138004','$2b$12$jFhkYU3.Cd1kAfr64/073eayPquAr0z9WWUQEdOyFRmAqcxz.i10C','上海区域经理','female',NULL,'负责上海地区门店管理','复旦大学医学院','医疗美容','manager',1,0,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(5,'consultant_001','consultant001@ruimei.com','13800138005','$2b$12$jFhkYU3.Cd1kAfr64/073eayPquAr0z9WWUQEdOyFRmAqcxz.i10C','资深美容顾问','female',NULL,'专业美容咨询师,5年从业经验','上海健康医学院','医疗美容技术','trainee',1,0,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(6,'nurse_001','nurse001@ruimei.com','13800138006','$2b$12$jFhkYU3.Cd1kAfr64/073eayPquAr0z9WWUQEdOyFRmAqcxz.i10C','美容护士','female',NULL,'持证美容护士,专业技术过硬','首都医科大学','护理学','trainee',1,0,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(7,'therapist_001','therapist001@ruimei.com','13800138007','$2b$12$jFhkYU3.Cd1kAfr64/073eayPquAr0z9WWUQEdOyFRmAqcxz.i10C','美容技师','female',NULL,'专业美容技师,擅长面部护理','北京卫生职业学院','医疗美容技术','trainee',1,0,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(8,'receptionist_001','front001@ruimei.com','13800138008','$2b$12$jFhkYU3.Cd1kAfr64/073eayPquAr0z9WWUQEdOyFRmAqcxz.i10C','前台接待','female',NULL,'负责客户接待和预约管理','北京商贸职业学院','商务管理','trainee',1,0,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL);
|
||||
/*!40000 ALTER TABLE `users` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Temporary view structure for view `v_user_course_progress`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `v_user_course_progress`;
|
||||
/*!50001 DROP VIEW IF EXISTS `v_user_course_progress`*/;
|
||||
SET @saved_cs_client = @@character_set_client;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
/*!50001 CREATE VIEW `v_user_course_progress` AS SELECT
|
||||
1 AS `user_id`,
|
||||
1 AS `username`,
|
||||
1 AS `course_id`,
|
||||
1 AS `course_name`,
|
||||
1 AS `exam_count`,
|
||||
1 AS `avg_score`,
|
||||
1 AS `best_score`*/;
|
||||
SET character_set_client = @saved_cs_client;
|
||||
|
||||
--
|
||||
-- Final view structure for view `v_user_course_progress`
|
||||
--
|
||||
|
||||
/*!50001 DROP VIEW IF EXISTS `v_user_course_progress`*/;
|
||||
/*!50001 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50001 SET @saved_cs_results = @@character_set_results */;
|
||||
/*!50001 SET @saved_col_connection = @@collation_connection */;
|
||||
/*!50001 SET character_set_client = latin1 */;
|
||||
/*!50001 SET character_set_results = latin1 */;
|
||||
/*!50001 SET collation_connection = latin1_swedish_ci */;
|
||||
/*!50001 CREATE ALGORITHM=UNDEFINED */
|
||||
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
|
||||
/*!50001 VIEW `v_user_course_progress` AS select `u`.`id` AS `user_id`,`u`.`username` AS `username`,`c`.`id` AS `course_id`,`c`.`name` AS `course_name`,count(distinct `e`.`id`) AS `exam_count`,avg(`e`.`score`) AS `avg_score`,max(`e`.`score`) AS `best_score` from ((`users` `u` join `courses` `c`) left join `exams` `e` on(((`e`.`user_id` = `u`.`id`) and (`e`.`course_id` = `c`.`id`) and (`e`.`status` = 'submitted')))) group by `u`.`id`,`c`.`id` */;
|
||||
/*!50001 SET character_set_client = @saved_cs_client */;
|
||||
/*!50001 SET character_set_results = @saved_cs_results */;
|
||||
/*!50001 SET collation_connection = @saved_col_connection */;
|
||||
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
|
||||
|
||||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
||||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
||||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
-- Dump completed on 2025-10-15 22:05:37
|
||||
169
知识库/backups/updates/sql/backup_before_init_20250923_011804.sql
Normal file
169
知识库/backups/updates/sql/backup_before_init_20250923_011804.sql
Normal file
@@ -0,0 +1,169 @@
|
||||
-- MySQL dump 10.13 Distrib 8.0.43, for Linux (aarch64)
|
||||
--
|
||||
-- Host: localhost Database: kaopeilian
|
||||
-- ------------------------------------------------------
|
||||
-- Server version 8.0.43
|
||||
|
||||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
||||
/*!50503 SET NAMES utf8mb4 */;
|
||||
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
|
||||
/*!40103 SET TIME_ZONE='+00:00' */;
|
||||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
|
||||
--
|
||||
-- Table structure for table `positions`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `positions`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `positions` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(100) NOT NULL,
|
||||
`code` varchar(100) NOT NULL,
|
||||
`description` text,
|
||||
`parent_id` int DEFAULT NULL,
|
||||
`status` varchar(20) NOT NULL DEFAULT 'active',
|
||||
`skills` json DEFAULT NULL,
|
||||
`level` varchar(20) DEFAULT NULL,
|
||||
`sort_order` int DEFAULT '0',
|
||||
`is_deleted` tinyint(1) DEFAULT '0',
|
||||
`deleted_at` datetime DEFAULT NULL,
|
||||
`created_by` int DEFAULT NULL,
|
||||
`updated_by` int DEFAULT NULL,
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `code` (`code`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `positions`
|
||||
--
|
||||
|
||||
LOCK TABLES `positions` WRITE;
|
||||
/*!40000 ALTER TABLE `positions` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `positions` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `teams`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `teams`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `teams` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(100) NOT NULL,
|
||||
`code` varchar(50) NOT NULL,
|
||||
`description` text,
|
||||
`team_type` varchar(50) DEFAULT 'department',
|
||||
`is_active` tinyint(1) DEFAULT '1',
|
||||
`leader_id` int DEFAULT NULL,
|
||||
`parent_id` int DEFAULT NULL,
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`is_deleted` tinyint(1) DEFAULT '0',
|
||||
`deleted_at` datetime DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `name` (`name`),
|
||||
UNIQUE KEY `code` (`code`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `teams`
|
||||
--
|
||||
|
||||
LOCK TABLES `teams` WRITE;
|
||||
/*!40000 ALTER TABLE `teams` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `teams` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `user_teams`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `user_teams`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `user_teams` (
|
||||
`user_id` int NOT NULL,
|
||||
`team_id` int NOT NULL,
|
||||
`role` varchar(50) DEFAULT 'member',
|
||||
`joined_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`user_id`,`team_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `user_teams`
|
||||
--
|
||||
|
||||
LOCK TABLES `user_teams` WRITE;
|
||||
/*!40000 ALTER TABLE `user_teams` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `user_teams` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `users`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `users`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `users` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`username` varchar(50) NOT NULL,
|
||||
`email` varchar(100) NOT NULL,
|
||||
`phone` varchar(20) DEFAULT NULL,
|
||||
`password_hash` varchar(200) NOT NULL,
|
||||
`full_name` varchar(100) DEFAULT NULL,
|
||||
`gender` varchar(10) DEFAULT NULL,
|
||||
`avatar_url` varchar(500) DEFAULT NULL,
|
||||
`bio` text,
|
||||
`school` varchar(100) DEFAULT NULL,
|
||||
`major` varchar(100) DEFAULT NULL,
|
||||
`role` varchar(20) DEFAULT 'trainee',
|
||||
`is_active` tinyint(1) DEFAULT '1',
|
||||
`is_verified` tinyint(1) DEFAULT '0',
|
||||
`last_login_at` datetime DEFAULT NULL,
|
||||
`password_changed_at` datetime DEFAULT NULL,
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`is_deleted` tinyint(1) DEFAULT '0',
|
||||
`deleted_at` datetime DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `username` (`username`),
|
||||
UNIQUE KEY `email` (`email`),
|
||||
UNIQUE KEY `phone` (`phone`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `users`
|
||||
--
|
||||
|
||||
LOCK TABLES `users` WRITE;
|
||||
/*!40000 ALTER TABLE `users` DISABLE KEYS */;
|
||||
INSERT INTO `users` VALUES (4,'admin','admin@kaopeilian.com',NULL,'$2b$12$FKQNB3wdhTL/8N6sDfOPtOrmZskqoHtWVzGJKv8A/r9IyCfh1RNs.','系统管理员',NULL,NULL,NULL,NULL,NULL,'admin',1,1,'2025-09-22 17:01:01',NULL,'2025-09-22 16:58:25','2025-09-22 17:01:01',0,NULL);
|
||||
/*!40000 ALTER TABLE `users` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
|
||||
|
||||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
||||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
||||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
-- Dump completed on 2025-09-22 17:18:04
|
||||
@@ -0,0 +1,824 @@
|
||||
-- MySQL dump 10.13 Distrib 8.0.43, for Linux (aarch64)
|
||||
--
|
||||
-- Host: localhost Database: kaopeilian
|
||||
-- ------------------------------------------------------
|
||||
-- Server version 8.0.43
|
||||
|
||||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
||||
/*!50503 SET NAMES utf8mb4 */;
|
||||
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
|
||||
/*!40103 SET TIME_ZONE='+00:00' */;
|
||||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
|
||||
--
|
||||
-- Table structure for table `course_exam_settings`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `course_exam_settings`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `course_exam_settings` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`course_id` int NOT NULL COMMENT '课程ID',
|
||||
`single_choice_count` int NOT NULL DEFAULT '10' COMMENT 'å•选题数é‡',
|
||||
`multiple_choice_count` int NOT NULL DEFAULT '5' COMMENT '多选题数é‡',
|
||||
`true_false_count` int NOT NULL DEFAULT '5' COMMENT '判æ–题数é‡',
|
||||
`fill_blank_count` int NOT NULL DEFAULT '0' COMMENT '填空题数é‡',
|
||||
`duration_minutes` int NOT NULL DEFAULT '60' COMMENT '考试时长(分钟)',
|
||||
`difficulty_level` int NOT NULL DEFAULT '3' COMMENT '难度系数(1-5)',
|
||||
`passing_score` int NOT NULL DEFAULT '60' COMMENT 'åŠæ ¼åˆ†æ•°',
|
||||
`is_enabled` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是å¦å¯ç”¨',
|
||||
`show_answer_immediately` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是å¦ç«‹å³æ˜¾ç¤ºç”案',
|
||||
`allow_retake` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是å¦å…许é‡è€ƒ',
|
||||
`max_retake_times` int DEFAULT NULL COMMENT '最大é‡è€ƒæ¬¡æ•°',
|
||||
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`is_deleted` tinyint(1) NOT NULL DEFAULT '0',
|
||||
`deleted_at` datetime DEFAULT NULL,
|
||||
`deleted_by` int DEFAULT NULL COMMENT 'åˆ é™¤äººID',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `course_id` (`course_id`),
|
||||
KEY `ix_course_exam_settings_id` (`id`),
|
||||
CONSTRAINT `course_exam_settings_ibfk_1` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='课程考试设置表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `course_exam_settings`
|
||||
--
|
||||
|
||||
LOCK TABLES `course_exam_settings` WRITE;
|
||||
/*!40000 ALTER TABLE `course_exam_settings` DISABLE KEYS */;
|
||||
INSERT INTO `course_exam_settings` VALUES (1,1,11,0,0,0,10,3,60,1,0,1,3,'2025-09-22 17:37:11','2025-09-22 17:37:11',2,2,0,NULL,NULL);
|
||||
/*!40000 ALTER TABLE `course_exam_settings` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `course_materials`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `course_materials`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `course_materials` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`course_id` int NOT NULL COMMENT '课程ID',
|
||||
`name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '资料åç§°',
|
||||
`description` text COLLATE utf8mb4_unicode_ci COMMENT '资料æè¿°',
|
||||
`file_url` varchar(500) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '文件URL',
|
||||
`file_type` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '文件类型',
|
||||
`file_size` int NOT NULL COMMENT '文件大å°(å—节)',
|
||||
`sort_order` int DEFAULT '0' COMMENT '排åºé¡ºåº',
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是å¦åˆ 除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT 'åˆ é™¤æ—¶é—´',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_course_id` (`course_id`),
|
||||
KEY `idx_is_deleted` (`is_deleted`),
|
||||
CONSTRAINT `course_materials_ibfk_1` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='课程资料表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `course_materials`
|
||||
--
|
||||
|
||||
LOCK TABLES `course_materials` WRITE;
|
||||
/*!40000 ALTER TABLE `course_materials` DISABLE KEYS */;
|
||||
INSERT INTO `course_materials` VALUES (1,1,'Python基础教程.pdf','Python编程基础教程文档','/uploads/python-basics.pdf','pdf',2048000,0,1,'2025-09-22 18:06:20','2025-09-22 17:18:23','2025-09-22 18:30:51'),(2,1,'课程视频1','第一章节视频教程','/uploads/video1.mp4','mp4',104857600,0,1,'2025-09-22 18:06:24','2025-09-22 17:18:23','2025-09-22 18:30:51'),(3,1,'美拉美测试-小.pdf','','/static/uploads/courses/1/20250923020629_18c59f4c.pdf','pdf',169193,0,0,NULL,'2025-09-22 18:06:29','2025-09-22 18:06:29');
|
||||
/*!40000 ALTER TABLE `course_materials` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `courses`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `courses`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `courses` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '课程åç§°',
|
||||
`description` text COLLATE utf8mb4_unicode_ci COMMENT '课程æè¿°',
|
||||
`category` enum('technology','management','business','general') COLLATE utf8mb4_unicode_ci DEFAULT 'general' COMMENT '课程分类',
|
||||
`status` enum('draft','published','archived') COLLATE utf8mb4_unicode_ci DEFAULT 'draft' COMMENT '课程状æ€',
|
||||
`cover_image` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'å°é¢å›¾ç‰‡URL',
|
||||
`duration_hours` float DEFAULT NULL COMMENT '课程时长(å°æ—¶)',
|
||||
`difficulty_level` int DEFAULT NULL COMMENT '难度ç‰çº§(1-5)',
|
||||
`tags` json DEFAULT NULL COMMENT 'æ ‡ç¾åˆ—表',
|
||||
`published_at` datetime DEFAULT NULL COMMENT 'å‘布时间',
|
||||
`publisher_id` int DEFAULT NULL COMMENT 'å‘布人ID',
|
||||
`sort_order` int DEFAULT '0' COMMENT '排åºé¡ºåº',
|
||||
`is_featured` tinyint(1) DEFAULT '0' COMMENT 'æ˜¯å¦æŽ¨è',
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是å¦åˆ 除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT 'åˆ é™¤æ—¶é—´',
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_status` (`status`),
|
||||
KEY `idx_category` (`category`),
|
||||
KEY `idx_is_featured` (`is_featured`),
|
||||
KEY `idx_is_deleted` (`is_deleted`),
|
||||
KEY `idx_sort_order` (`sort_order`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='课程表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `courses`
|
||||
--
|
||||
|
||||
LOCK TABLES `courses` WRITE;
|
||||
/*!40000 ALTER TABLE `courses` DISABLE KEYS */;
|
||||
INSERT INTO `courses` VALUES (1,'皮肤生理学基础','学习皮肤结构、功能和常见问题,为专业护理打下基础','technology','published',NULL,16,2,'[\"皮肤学\", \"基础理论\", \"必修课\"]','2025-09-22 17:18:23',NULL,100,1,0,NULL,NULL,2,'2025-09-22 17:18:23','2025-09-22 17:45:36'),(2,'医美产品知识与应用','全面了解各类医美产品的成分、功效和适用人群','technology','published',NULL,20,3,'[\"产品知识\", \"医美\", \"专业技能\"]','2025-09-22 17:18:23',NULL,110,1,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:45:36'),(3,'美容仪器操作与维护','掌握各类美容仪器的操作方法、注意事项和日常维护','technology','published',NULL,24,3,'[\"仪器操作\", \"实操技能\", \"设备维护\"]','2025-09-22 17:18:23',NULL,120,0,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:45:36'),(4,'医美项目介绍与咨询','详细了解各类医美项目的原理、效果和适应症','technology','published',NULL,30,4,'[\"医美项目\", \"专业咨询\", \"风险告知\"]','2025-09-22 17:18:23',NULL,170,1,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:45:36'),(5,'轻医美销售技巧','学习专业的销售话术、客户需求分析和成交技巧','business','published',NULL,16,2,'[\"销售技巧\", \"客户沟通\", \"业绩提升\"]','2025-09-22 17:18:23',NULL,130,1,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:45:36'),(6,'客户服务与投诉处理','提升服务意识,掌握客户投诉处理的方法和技巧','business','published',NULL,12,2,'[\"客户服务\", \"危机处理\", \"沟通技巧\"]','2025-09-22 17:18:23',NULL,140,0,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:45:36'),(7,'社媒营销与私域运营','学习如何通过社交媒体进行品牌推广和客户维护','business','published',NULL,16,2,'[\"社媒营销\", \"私域流量\", \"客户维护\"]','2025-09-22 17:18:23',NULL,180,0,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:45:36'),(8,'门店运营管理','学习门店日常管理、团队建设和业绩管理','management','published',NULL,20,3,'[\"门店管理\", \"团队管理\", \"运营策略\"]','2025-09-22 17:18:23',NULL,160,0,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:45:36'),(9,'卫生消毒与感染控制','学习医美机构的卫生标准和消毒流程,确保服务安全','general','published',NULL,8,1,'[\"卫生安全\", \"消毒规范\", \"合规管理\"]','2025-09-22 17:18:23',NULL,150,1,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:45:36'),(10,'Python编程基础','Python语言入门课程,适合零基础学员','technology','published',NULL,40,2,'[\"Python\", \"编程基础\", \"入门\"]','2025-09-22 17:18:23',NULL,200,0,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:45:36'),(11,'数据分析基础','学习数据分析方法和工具,提升数据驱动决策能力','technology','published',NULL,32,3,'[\"数据分析\", \"Excel\", \"可视化\"]','2025-09-22 17:18:23',NULL,210,0,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:45:36');
|
||||
/*!40000 ALTER TABLE `courses` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `exam_results`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `exam_results`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `exam_results` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`exam_id` int NOT NULL COMMENT '考试ID',
|
||||
`question_id` int NOT NULL COMMENT '题目ID',
|
||||
`user_answer` text COLLATE utf8mb4_unicode_ci COMMENT 'ç”¨æˆ·ç”æ¡ˆ',
|
||||
`is_correct` tinyint(1) DEFAULT '0' COMMENT 'æ˜¯å¦æ£ç¡®',
|
||||
`score` float DEFAULT '0' COMMENT '得分',
|
||||
`answer_time` int DEFAULT NULL COMMENT 'ç”题时长(秒)',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_exam_id` (`exam_id`),
|
||||
KEY `idx_question_id` (`question_id`),
|
||||
CONSTRAINT `exam_results_ibfk_1` FOREIGN KEY (`exam_id`) REFERENCES `exams` (`id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `exam_results_ibfk_2` FOREIGN KEY (`question_id`) REFERENCES `questions` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='考试结果详情表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `exam_results`
|
||||
--
|
||||
|
||||
LOCK TABLES `exam_results` WRITE;
|
||||
/*!40000 ALTER TABLE `exam_results` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `exam_results` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `exams`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `exams`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `exams` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`user_id` int NOT NULL COMMENT '用户ID',
|
||||
`course_id` int NOT NULL COMMENT '课程ID',
|
||||
`exam_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '考试åç§°',
|
||||
`question_count` int DEFAULT '10' COMMENT '题目数é‡',
|
||||
`total_score` float DEFAULT '100' COMMENT '总分',
|
||||
`pass_score` float DEFAULT '60' COMMENT 'åŠæ ¼åˆ†',
|
||||
`start_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '开始时间',
|
||||
`end_time` datetime DEFAULT NULL COMMENT 'ç»“æŸæ—¶é—´',
|
||||
`duration_minutes` int DEFAULT '60' COMMENT '考试时长(分钟)',
|
||||
`score` float DEFAULT NULL COMMENT '得分',
|
||||
`is_passed` tinyint(1) DEFAULT NULL COMMENT '是å¦é€šè¿‡',
|
||||
`status` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT 'started' COMMENT '状æ€: started, submitted, timeout',
|
||||
`questions` json DEFAULT NULL COMMENT '题目数æ®ï¼ˆJSONæ ¼å¼ï¼‰',
|
||||
`answers` json DEFAULT NULL COMMENT 'ç”æ¡ˆæ•°æ®ï¼ˆJSONæ ¼å¼ï¼‰',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_user_id` (`user_id`),
|
||||
KEY `idx_course_id` (`course_id`),
|
||||
KEY `idx_status` (`status`),
|
||||
CONSTRAINT `exams_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `exams_ibfk_2` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='考试记录表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `exams`
|
||||
--
|
||||
|
||||
LOCK TABLES `exams` WRITE;
|
||||
/*!40000 ALTER TABLE `exams` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `exams` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `growth_paths`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `growth_paths`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `growth_paths` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '路径åç§°',
|
||||
`description` text COLLATE utf8mb4_unicode_ci COMMENT '路径æè¿°',
|
||||
`target_role` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'ç›®æ ‡è§’è‰²',
|
||||
`courses` json DEFAULT NULL COMMENT '课程列表[{course_id, order, is_required}]',
|
||||
`estimated_duration_days` int DEFAULT NULL COMMENT '预计完æˆå¤©æ•°',
|
||||
`is_active` tinyint(1) DEFAULT '1' COMMENT '是å¦å¯ç”¨',
|
||||
`sort_order` int DEFAULT '0' COMMENT '排åºé¡ºåº',
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是å¦åˆ 除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT 'åˆ é™¤æ—¶é—´',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_is_active` (`is_active`),
|
||||
KEY `idx_is_deleted` (`is_deleted`),
|
||||
KEY `idx_sort_order` (`sort_order`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='æˆé•¿è·¯å¾„表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `growth_paths`
|
||||
--
|
||||
|
||||
LOCK TABLES `growth_paths` WRITE;
|
||||
/*!40000 ALTER TABLE `growth_paths` DISABLE KEYS */;
|
||||
INSERT INTO `growth_paths` VALUES (1,'Python工程师成长路径','从入门到精通的Python学习路径','Python开发工程师','[{\"order\": 1, \"course_id\": 1, \"is_required\": true}, {\"order\": 2, \"course_id\": 4, \"is_required\": true}]',90,1,0,0,NULL,'2025-09-22 17:18:23','2025-09-22 18:30:51'),(2,'技术管理者路径','技术人员转型管理岗位','技术经理','[{\"order\": 1, \"course_id\": 2, \"is_required\": true}, {\"order\": 2, \"course_id\": 3, \"is_required\": false}]',60,1,0,0,NULL,'2025-09-22 17:18:23','2025-09-22 18:30:51');
|
||||
/*!40000 ALTER TABLE `growth_paths` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `knowledge_points`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `knowledge_points`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `knowledge_points` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`course_id` int NOT NULL COMMENT '课程ID',
|
||||
`name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '知识点åç§°',
|
||||
`description` text COLLATE utf8mb4_unicode_ci COMMENT '知识点æè¿°',
|
||||
`parent_id` int DEFAULT NULL COMMENT '父知识点ID',
|
||||
`level` int DEFAULT '1' COMMENT '层级深度',
|
||||
`path` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '路径(如: 1.2.3)',
|
||||
`sort_order` int DEFAULT '0' COMMENT '排åºé¡ºåº',
|
||||
`weight` float DEFAULT '1' COMMENT 'æƒé‡',
|
||||
`is_required` tinyint(1) DEFAULT '1' COMMENT '是å¦å¿…ä¿®',
|
||||
`estimated_hours` float DEFAULT NULL COMMENT '预计å¦ä¹ æ—¶é—´(å°æ—¶)',
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是å¦åˆ 除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT 'åˆ é™¤æ—¶é—´',
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_course_id` (`course_id`),
|
||||
KEY `idx_parent_id` (`parent_id`),
|
||||
KEY `idx_is_deleted` (`is_deleted`),
|
||||
KEY `idx_sort_order` (`sort_order`),
|
||||
CONSTRAINT `knowledge_points_ibfk_1` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `knowledge_points_ibfk_2` FOREIGN KEY (`parent_id`) REFERENCES `knowledge_points` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='知识点表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `knowledge_points`
|
||||
--
|
||||
|
||||
LOCK TABLES `knowledge_points` WRITE;
|
||||
/*!40000 ALTER TABLE `knowledge_points` DISABLE KEYS */;
|
||||
INSERT INTO `knowledge_points` VALUES (1,1,'Python环境搭建','学习如何安装和配置Python开发环境',NULL,1,NULL,0,1,1,2,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 18:23:19'),(2,1,'Python基础语法','学习Python的基本语法规则',NULL,1,NULL,0,2,1,8,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 18:23:19'),(3,1,'变量和数据类型','了解Python中的变量和基本数据类型',2,2,NULL,0,1.5,1,3,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 18:23:19'),(4,1,'控制流程','学习条件语句和循环结构',2,2,NULL,0,1.5,1,4,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 18:23:19'),(5,1,'立刻到家啦手机发的','拉克丝大姐夫;阿斯利康大姐夫\n',NULL,1,NULL,0,1,1,NULL,0,NULL,2,NULL,'2025-09-22 17:36:46','2025-09-22 17:36:46');
|
||||
/*!40000 ALTER TABLE `knowledge_points` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `material_knowledge_points`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `material_knowledge_points`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `material_knowledge_points` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`material_id` int NOT NULL COMMENT '资料ID',
|
||||
`knowledge_point_id` int NOT NULL COMMENT '知识点ID',
|
||||
`sort_order` int DEFAULT '0' COMMENT '排åºé¡ºåº',
|
||||
`is_ai_generated` tinyint(1) DEFAULT '0' COMMENT '是å¦AI生æˆ',
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是å¦åˆ 除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT 'åˆ é™¤æ—¶é—´',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `idx_material_knowledge` (`material_id`,`knowledge_point_id`),
|
||||
KEY `idx_material_id` (`material_id`),
|
||||
KEY `idx_knowledge_point_id` (`knowledge_point_id`),
|
||||
CONSTRAINT `material_knowledge_points_ibfk_1` FOREIGN KEY (`material_id`) REFERENCES `course_materials` (`id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `material_knowledge_points_ibfk_2` FOREIGN KEY (`knowledge_point_id`) REFERENCES `knowledge_points` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='资料知识点关è”表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `material_knowledge_points`
|
||||
--
|
||||
|
||||
LOCK TABLES `material_knowledge_points` WRITE;
|
||||
/*!40000 ALTER TABLE `material_knowledge_points` DISABLE KEYS */;
|
||||
INSERT INTO `material_knowledge_points` VALUES (1,1,5,1,0,0,NULL,'2025-09-22 17:36:46','2025-09-22 17:36:46');
|
||||
/*!40000 ALTER TABLE `material_knowledge_points` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `position_courses`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `position_courses`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `position_courses` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`position_id` int NOT NULL COMMENT 'å²—ä½ID',
|
||||
`course_id` int NOT NULL COMMENT '课程ID',
|
||||
`course_type` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'required' COMMENT '课程类型',
|
||||
`priority` int DEFAULT '0' COMMENT '优先级/排åº',
|
||||
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`is_deleted` tinyint(1) NOT NULL DEFAULT '0',
|
||||
`deleted_at` datetime DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uix_position_course` (`position_id`,`course_id`,`is_deleted`),
|
||||
KEY `course_id` (`course_id`),
|
||||
KEY `ix_position_courses_id` (`id`),
|
||||
CONSTRAINT `position_courses_ibfk_1` FOREIGN KEY (`position_id`) REFERENCES `positions` (`id`),
|
||||
CONSTRAINT `position_courses_ibfk_2` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='å²—ä½è¯¾ç¨‹å…³è”表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `position_courses`
|
||||
--
|
||||
|
||||
LOCK TABLES `position_courses` WRITE;
|
||||
/*!40000 ALTER TABLE `position_courses` DISABLE KEYS */;
|
||||
INSERT INTO `position_courses` VALUES (1,2,8,'required',1,'2025-09-22 17:18:23','2025-09-22 17:18:23',NULL,NULL,0,NULL),(2,2,5,'required',2,'2025-09-22 17:18:23','2025-09-22 17:18:23',NULL,NULL,0,NULL),(3,2,6,'required',3,'2025-09-22 17:18:23','2025-09-22 17:18:23',NULL,NULL,0,NULL),(4,2,9,'required',4,'2025-09-22 17:18:23','2025-09-22 17:18:23',NULL,NULL,0,NULL),(5,3,1,'required',1,'2025-09-22 17:18:23','2025-09-22 17:18:23',NULL,NULL,0,NULL),(6,3,2,'required',2,'2025-09-22 17:18:23','2025-09-22 17:18:23',NULL,NULL,0,NULL),(7,3,5,'required',3,'2025-09-22 17:18:23','2025-09-22 17:18:23',NULL,NULL,0,NULL),(8,3,6,'required',4,'2025-09-22 17:18:23','2025-09-22 17:18:23',NULL,NULL,0,NULL),(9,3,7,'optional',5,'2025-09-22 17:18:23','2025-09-22 17:18:23',NULL,NULL,0,NULL),(10,4,1,'required',1,'2025-09-22 17:18:23','2025-09-22 17:37:05',NULL,NULL,1,NULL),(11,4,3,'required',2,'2025-09-22 17:18:23','2025-09-22 17:18:23',NULL,NULL,0,NULL),(12,4,9,'required',3,'2025-09-22 17:18:23','2025-09-22 17:18:23',NULL,NULL,0,NULL);
|
||||
/*!40000 ALTER TABLE `position_courses` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `position_members`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `position_members`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `position_members` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`position_id` int NOT NULL COMMENT 'å²—ä½ID',
|
||||
`user_id` int NOT NULL COMMENT '用户ID',
|
||||
`role` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'æˆå‘˜è§’è‰²ï¼ˆé¢„ç•™å—æ®µï¼‰',
|
||||
`joined_at` datetime DEFAULT CURRENT_TIMESTAMP COMMENT 'åŠ å…¥æ—¶é—´',
|
||||
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`is_deleted` tinyint(1) NOT NULL DEFAULT '0',
|
||||
`deleted_at` datetime DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uix_position_user` (`position_id`,`user_id`,`is_deleted`),
|
||||
KEY `user_id` (`user_id`),
|
||||
KEY `ix_position_members_id` (`id`),
|
||||
CONSTRAINT `position_members_ibfk_1` FOREIGN KEY (`position_id`) REFERENCES `positions` (`id`),
|
||||
CONSTRAINT `position_members_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='岗使ˆå‘˜å…³è”表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `position_members`
|
||||
--
|
||||
|
||||
LOCK TABLES `position_members` WRITE;
|
||||
/*!40000 ALTER TABLE `position_members` DISABLE KEYS */;
|
||||
INSERT INTO `position_members` VALUES (1,2,2,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23','2025-09-22 17:18:23',NULL,NULL,0,NULL),(2,3,3,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23','2025-09-22 17:18:23',NULL,NULL,0,NULL),(3,3,1,NULL,'2025-09-22 17:46:13','2025-09-22 17:46:13','2025-09-22 17:46:13',NULL,NULL,0,NULL);
|
||||
/*!40000 ALTER TABLE `position_members` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `positions`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `positions`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `positions` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'å²—ä½åç§°',
|
||||
`code` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'å²—ä½ç¼–ç ',
|
||||
`description` text COLLATE utf8mb4_unicode_ci COMMENT 'å²—ä½æè¿°',
|
||||
`parent_id` int DEFAULT NULL COMMENT '上级岗ä½ID',
|
||||
`status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'active' COMMENT '状æ€: active/inactive',
|
||||
`skills` json DEFAULT NULL COMMENT 'æ ¸å¿ƒæŠ€èƒ½',
|
||||
`level` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'å²—ä½ç‰çº§: junior/intermediate/senior/expert',
|
||||
`sort_order` int DEFAULT '0' COMMENT '排åº',
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是å¦åˆ 除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT 'åˆ é™¤æ—¶é—´',
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `code` (`code`),
|
||||
KEY `parent_id` (`parent_id`),
|
||||
KEY `idx_positions_name` (`name`),
|
||||
CONSTRAINT `positions_ibfk_1` FOREIGN KEY (`parent_id`) REFERENCES `positions` (`id`) ON DELETE SET NULL
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='å²—ä½è¡¨';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `positions`
|
||||
--
|
||||
|
||||
LOCK TABLES `positions` WRITE;
|
||||
/*!40000 ALTER TABLE `positions` DISABLE KEYS */;
|
||||
INSERT INTO `positions` VALUES (1,'区域经理','region_manager','负责多家门店的运营管理和业绩达成',NULL,'active','[\"团队管理\", \"业绩分析\", \"战略规划\", \"客户关系\"]','expert',10,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:45:36'),(2,'店长','store_manager','负责门店日常运营管理,团队建设和业绩达成',1,'active','[\"门店管理\", \"团队建设\", \"销售管理\", \"客户维护\"]','senior',20,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:45:36'),(3,'美容顾问','beauty_consultant','为客户提供专业的美容咨询和方案设计',2,'active','[\"产品知识\", \"销售技巧\", \"方案设计\", \"客户沟通\"]','intermediate',30,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:45:36'),(4,'医美咨询师','medical_beauty_consultant','提供医疗美容项目咨询和方案制定',2,'active','[\"医美知识\", \"风险评估\", \"方案设计\", \"合规意识\"]','senior',35,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:45:36'),(5,'美容技师','beauty_therapist','为客户提供专业的美容护理服务',2,'active','[\"护肤技术\", \"仪器操作\", \"手法技巧\", \"服务意识\"]','intermediate',40,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:45:36'),(6,'护士','nurse','协助医生进行医美项目操作,负责术后护理',2,'active','[\"护理技术\", \"无菌操作\", \"应急处理\", \"医疗知识\"]','intermediate',45,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:45:36'),(7,'前台接待','receptionist','负责客户接待、预约管理和前台事务',2,'active','[\"接待礼仪\", \"沟通能力\", \"信息管理\", \"服务意识\"]','junior',50,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:45:36'),(8,'市场专员','marketing_specialist','负责门店营销活动策划和执行',2,'active','[\"活动策划\", \"社媒运营\", \"数据分析\", \"创意设计\"]','intermediate',60,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:45:36');
|
||||
/*!40000 ALTER TABLE `positions` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `questions`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `questions`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `questions` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`course_id` int NOT NULL COMMENT '课程ID',
|
||||
`question_type` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '题目类型: single_choice, multiple_choice, true_false, fill_blank, essay',
|
||||
`title` text COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'é¢˜ç›®æ ‡é¢˜',
|
||||
`content` text COLLATE utf8mb4_unicode_ci COMMENT '题目内容',
|
||||
`options` json DEFAULT NULL COMMENT '选项(JSONæ ¼å¼ï¼‰',
|
||||
`correct_answer` text COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'æ£ç¡®ç”案',
|
||||
`explanation` text COLLATE utf8mb4_unicode_ci COMMENT 'ç”æ¡ˆè§£é‡Š',
|
||||
`score` float DEFAULT '10' COMMENT '分值',
|
||||
`difficulty` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT 'medium' COMMENT '难度ç‰çº§: easy, medium, hard',
|
||||
`tags` json DEFAULT NULL COMMENT 'æ ‡ç¾ï¼ˆJSONæ ¼å¼ï¼‰',
|
||||
`usage_count` int DEFAULT '0' COMMENT '使用次数',
|
||||
`correct_count` int DEFAULT '0' COMMENT 'ç”对次数',
|
||||
`is_active` tinyint(1) DEFAULT '1' COMMENT '是å¦å¯ç”¨',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_course_id` (`course_id`),
|
||||
KEY `idx_question_type` (`question_type`),
|
||||
KEY `idx_difficulty` (`difficulty`),
|
||||
KEY `idx_is_active` (`is_active`),
|
||||
CONSTRAINT `questions_ibfk_1` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='题目表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `questions`
|
||||
--
|
||||
|
||||
LOCK TABLES `questions` WRITE;
|
||||
/*!40000 ALTER TABLE `questions` DISABLE KEYS */;
|
||||
INSERT INTO `questions` VALUES (1,1,'single_choice','Python中哪个关键字用于定义函数?',NULL,'{\"A\": \"def\", \"B\": \"function\", \"C\": \"fun\", \"D\": \"define\"}','A','Python使用def关键字来定义函数',10,'easy','[\"python\", \"基础\", \"函数\"]',0,0,1,'2025-09-22 17:18:23','2025-09-22 18:30:51'),(2,1,'single_choice','Python中列表和元组的主要区别是什么?',NULL,'{\"A\": \"列表是有åºçš„ï¼Œå…ƒç»„æ˜¯æ— åºçš„\", \"B\": \"列表å¯å˜ï¼Œå…ƒç»„ä¸å¯å˜\", \"C\": \"列表åªèƒ½å˜å‚¨æ•°å—,元组å¯ä»¥å˜å‚¨ä»»ä½•类型\", \"D\": \"没有区别\"}','B','列表是可变的(mutable),而元组是不可变的(immutable)',10,'medium','[\"python\", \"æ•°æ®ç»“æž„\"]',0,0,1,'2025-09-22 17:18:23','2025-09-22 18:30:51'),(3,1,'true_false','Python是一种编译型语言',NULL,NULL,'false','Python是一种解释型语言,不需要编译成机器码',10,'easy','[\"python\", \"基础\"]',0,0,1,'2025-09-22 17:18:23','2025-09-22 18:30:51'),(4,1,'fill_blank','Python中使用____关键字定义类',NULL,NULL,'class','使用class关键字定义类',10,'easy','[\"python\", \"é¢å‘对象\"]',0,0,1,'2025-09-22 17:18:23','2025-09-22 18:30:51');
|
||||
/*!40000 ALTER TABLE `questions` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `teams`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `teams`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `teams` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '团队åç§°',
|
||||
`code` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '团队代ç ',
|
||||
`description` text COLLATE utf8mb4_unicode_ci COMMENT '团队æè¿°',
|
||||
`team_type` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT 'department' COMMENT '团队类型: department, project, study_group',
|
||||
`is_active` tinyint(1) DEFAULT '1' COMMENT 'æ˜¯å¦æ¿€æ´»',
|
||||
`leader_id` int DEFAULT NULL COMMENT '负责人ID',
|
||||
`parent_id` int DEFAULT NULL COMMENT '父团队ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是å¦åˆ 除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT 'åˆ é™¤æ—¶é—´',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `name` (`name`),
|
||||
UNIQUE KEY `code` (`code`),
|
||||
KEY `leader_id` (`leader_id`),
|
||||
KEY `parent_id` (`parent_id`),
|
||||
KEY `idx_team_type` (`team_type`),
|
||||
KEY `idx_is_active` (`is_active`),
|
||||
CONSTRAINT `teams_ibfk_1` FOREIGN KEY (`leader_id`) REFERENCES `users` (`id`) ON DELETE SET NULL,
|
||||
CONSTRAINT `teams_ibfk_2` FOREIGN KEY (`parent_id`) REFERENCES `teams` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='团队表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `teams`
|
||||
--
|
||||
|
||||
LOCK TABLES `teams` WRITE;
|
||||
/*!40000 ALTER TABLE `teams` DISABLE KEYS */;
|
||||
INSERT INTO `teams` VALUES (1,'技术部','TECH','负责技术研发和维护','department',1,2,NULL,'2025-09-22 17:18:23','2025-09-22 18:30:51',0,NULL),(2,'产品部','PROD','负责产品设计和规划','department',1,2,NULL,'2025-09-22 17:18:23','2025-09-22 18:30:51',0,NULL),(3,'Python学习小组','PY_GROUP','Python技术学习交流','study_group',1,2,NULL,'2025-09-22 17:18:23','2025-09-22 18:30:51',0,NULL);
|
||||
/*!40000 ALTER TABLE `teams` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `training_messages`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `training_messages`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `training_messages` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`session_id` int NOT NULL COMMENT '会è¯ID',
|
||||
`role` enum('USER','ASSISTANT','SYSTEM') COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '消æ¯è§’色',
|
||||
`type` enum('TEXT','VOICE','SYSTEM') COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '消æ¯ç±»åž‹',
|
||||
`content` text COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '消æ¯å†…容',
|
||||
`voice_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'è¯éŸ³æ–‡ä»¶URL',
|
||||
`voice_duration` float DEFAULT NULL COMMENT 'è¯éŸ³æ—¶é•¿ï¼ˆç§’)',
|
||||
`message_metadata` json DEFAULT NULL COMMENT '消æ¯å…ƒæ•°æ®',
|
||||
`coze_message_id` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Coze消æ¯ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_session_id` (`session_id`),
|
||||
KEY `idx_role` (`role`),
|
||||
CONSTRAINT `training_messages_ibfk_1` FOREIGN KEY (`session_id`) REFERENCES `training_sessions` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='陪练消æ¯è¡¨';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `training_messages`
|
||||
--
|
||||
|
||||
LOCK TABLES `training_messages` WRITE;
|
||||
/*!40000 ALTER TABLE `training_messages` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `training_messages` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `training_reports`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `training_reports`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `training_reports` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`session_id` int NOT NULL COMMENT '会è¯ID',
|
||||
`user_id` int NOT NULL COMMENT '用户ID',
|
||||
`overall_score` float NOT NULL COMMENT '总体得分',
|
||||
`dimension_scores` json NOT NULL COMMENT 'å„维度得分',
|
||||
`strengths` json NOT NULL COMMENT '优势点',
|
||||
`weaknesses` json NOT NULL COMMENT '待改进点',
|
||||
`suggestions` json NOT NULL COMMENT '改进建议',
|
||||
`detailed_analysis` text COLLATE utf8mb4_unicode_ci COMMENT '详细分æž',
|
||||
`transcript` text COLLATE utf8mb4_unicode_ci COMMENT 'å¯¹è¯æ–‡æœ¬è®°å½•',
|
||||
`statistics` json DEFAULT NULL COMMENT '统计数æ®',
|
||||
`created_by` bigint DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` bigint DEFAULT NULL COMMENT '更新人ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `session_id` (`session_id`),
|
||||
KEY `idx_user_id` (`user_id`),
|
||||
CONSTRAINT `training_reports_ibfk_1` FOREIGN KEY (`session_id`) REFERENCES `training_sessions` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='陪练报告表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `training_reports`
|
||||
--
|
||||
|
||||
LOCK TABLES `training_reports` WRITE;
|
||||
/*!40000 ALTER TABLE `training_reports` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `training_reports` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `training_scenes`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `training_scenes`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `training_scenes` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '场景åç§°',
|
||||
`description` text COLLATE utf8mb4_unicode_ci COMMENT '场景æè¿°',
|
||||
`category` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '场景分类',
|
||||
`ai_config` json DEFAULT NULL COMMENT 'AIé…置(如Coze Bot IDç‰ï¼‰',
|
||||
`prompt_template` text COLLATE utf8mb4_unicode_ci COMMENT 'æç¤ºè¯æ¨¡æ¿',
|
||||
`evaluation_criteria` json DEFAULT NULL COMMENT 'è¯„ä¼°æ ‡å‡†',
|
||||
`status` enum('DRAFT','ACTIVE','INACTIVE') COLLATE utf8mb4_unicode_ci DEFAULT 'DRAFT' COMMENT '场景状æ€',
|
||||
`is_public` tinyint(1) DEFAULT '1' COMMENT '是å¦å…¬å¼€',
|
||||
`required_level` int DEFAULT NULL COMMENT '所需用户ç‰çº§',
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是å¦åˆ 除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT 'åˆ é™¤æ—¶é—´',
|
||||
`created_by` bigint DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` bigint DEFAULT NULL COMMENT '更新人ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_status` (`status`),
|
||||
KEY `idx_category` (`category`),
|
||||
KEY `idx_is_public` (`is_public`),
|
||||
KEY `idx_is_deleted` (`is_deleted`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='陪练场景表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `training_scenes`
|
||||
--
|
||||
|
||||
LOCK TABLES `training_scenes` WRITE;
|
||||
/*!40000 ALTER TABLE `training_scenes` DISABLE KEYS */;
|
||||
INSERT INTO `training_scenes` VALUES (1,'Python编程助手','帮助学员解决Python编程问题','技术辅导','{\"bot_id\": \"python_assistant_bot\"}',NULL,NULL,'ACTIVE',1,NULL,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 18:30:51'),(2,'面试模拟','模拟技术面试场景','职业发展','{\"bot_id\": \"interview_simulator_bot\"}',NULL,NULL,'ACTIVE',1,NULL,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 18:30:51'),(3,'项目讨论','项目方案讨论和优化','项目管理','{\"bot_id\": \"project_discussion_bot\"}',NULL,NULL,'DRAFT',1,NULL,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 18:30:51');
|
||||
/*!40000 ALTER TABLE `training_scenes` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `training_sessions`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `training_sessions`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `training_sessions` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`user_id` int NOT NULL COMMENT '用户ID',
|
||||
`scene_id` int NOT NULL COMMENT '场景ID',
|
||||
`coze_conversation_id` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Coze会è¯ID',
|
||||
`start_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '开始时间',
|
||||
`end_time` datetime DEFAULT NULL COMMENT 'ç»“æŸæ—¶é—´',
|
||||
`duration_seconds` int DEFAULT NULL COMMENT 'æŒç»æ—¶é•¿ï¼ˆç§’)',
|
||||
`status` enum('CREATED','IN_PROGRESS','COMPLETED','CANCELLED','ERROR') COLLATE utf8mb4_unicode_ci DEFAULT 'CREATED' COMMENT '会è¯çжæ€',
|
||||
`session_config` json DEFAULT NULL COMMENT '会è¯é…ç½®',
|
||||
`total_score` float DEFAULT NULL COMMENT '总分',
|
||||
`evaluation_result` json DEFAULT NULL COMMENT '评估结果详情',
|
||||
`created_by` bigint DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` bigint DEFAULT NULL COMMENT '更新人ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_user_id` (`user_id`),
|
||||
KEY `idx_scene_id` (`scene_id`),
|
||||
KEY `idx_status` (`status`),
|
||||
CONSTRAINT `training_sessions_ibfk_1` FOREIGN KEY (`scene_id`) REFERENCES `training_scenes` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='陪练会è¯è¡¨';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `training_sessions`
|
||||
--
|
||||
|
||||
LOCK TABLES `training_sessions` WRITE;
|
||||
/*!40000 ALTER TABLE `training_sessions` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `training_sessions` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `user_teams`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `user_teams`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `user_teams` (
|
||||
`user_id` int NOT NULL,
|
||||
`team_id` int NOT NULL,
|
||||
`role` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT 'member' COMMENT '团队角色: member, leader',
|
||||
`joined_at` datetime DEFAULT CURRENT_TIMESTAMP COMMENT 'åŠ å…¥æ—¶é—´',
|
||||
PRIMARY KEY (`user_id`,`team_id`),
|
||||
KEY `team_id` (`team_id`),
|
||||
CONSTRAINT `user_teams_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `user_teams_ibfk_2` FOREIGN KEY (`team_id`) REFERENCES `teams` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='用户团队关è”表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `user_teams`
|
||||
--
|
||||
|
||||
LOCK TABLES `user_teams` WRITE;
|
||||
/*!40000 ALTER TABLE `user_teams` DISABLE KEYS */;
|
||||
INSERT INTO `user_teams` VALUES (2,1,'leader','2025-09-22 17:18:23'),(2,2,'leader','2025-09-22 17:18:23'),(3,1,'member','2025-09-22 17:18:23'),(3,3,'member','2025-09-22 17:18:23');
|
||||
/*!40000 ALTER TABLE `user_teams` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `users`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `users`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `users` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`username` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '用户å',
|
||||
`email` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '邮箱',
|
||||
`phone` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '手机å·',
|
||||
`password_hash` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '密ç 哈希',
|
||||
`full_name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'å§“å',
|
||||
`gender` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '性别: male/female',
|
||||
`avatar_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '头åƒURL',
|
||||
`bio` text COLLATE utf8mb4_unicode_ci COMMENT '个人简介',
|
||||
`school` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '妿 ¡',
|
||||
`major` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '专业',
|
||||
`role` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT 'trainee' COMMENT '系统角色: admin, manager, trainee',
|
||||
`is_active` tinyint(1) DEFAULT '1' COMMENT 'æ˜¯å¦æ¿€æ´»',
|
||||
`is_verified` tinyint(1) DEFAULT '0' COMMENT '是å¦éªŒè¯',
|
||||
`last_login_at` datetime DEFAULT NULL COMMENT '最åŽç™»å½•æ—¶é—´',
|
||||
`password_changed_at` datetime DEFAULT NULL COMMENT '密ç 修改时间',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是å¦åˆ 除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT 'åˆ é™¤æ—¶é—´',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `username` (`username`),
|
||||
UNIQUE KEY `email` (`email`),
|
||||
UNIQUE KEY `phone` (`phone`),
|
||||
KEY `idx_role` (`role`),
|
||||
KEY `idx_is_active` (`is_active`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='用户表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `users`
|
||||
--
|
||||
|
||||
LOCK TABLES `users` WRITE;
|
||||
/*!40000 ALTER TABLE `users` DISABLE KEYS */;
|
||||
INSERT INTO `users` VALUES (1,'superadmin','superadmin@kaopeilian.com','13800000001','$2b$12$LQv3c1yqBWVHxkd0LHAkCOYz6TtxMQJqhN8/LewKyNiQdP/sQj6C6','超级管理员',NULL,NULL,NULL,NULL,NULL,'admin',1,1,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:45:36',0,NULL),(2,'admin','admin@kaopeilian.com','13800000002','$2b$12$NEGFEN8951QMRQMauW53Qe2VLOajCRrTbpFZzyn9RjtlLDVvXawl.','系统管理员','male',NULL,NULL,'李会计','是的发','admin',1,1,'2025-09-22 17:43:37',NULL,'2025-09-22 17:18:23','2025-09-22 17:45:58',0,NULL),(3,'testuser','testuser@kaopeilian.com','13800000003','$2b$12$LQv3c1yqBWVHxkd0LHAkCOYz6TtxMQJqhN8/LewKyNiQdP/sQj6C6','测试学员',NULL,NULL,NULL,NULL,NULL,'trainee',1,1,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:45:36',0,NULL);
|
||||
/*!40000 ALTER TABLE `users` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Temporary view structure for view `v_user_course_progress`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `v_user_course_progress`;
|
||||
/*!50001 DROP VIEW IF EXISTS `v_user_course_progress`*/;
|
||||
SET @saved_cs_client = @@character_set_client;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
/*!50001 CREATE VIEW `v_user_course_progress` AS SELECT
|
||||
1 AS `user_id`,
|
||||
1 AS `username`,
|
||||
1 AS `course_id`,
|
||||
1 AS `course_name`,
|
||||
1 AS `exam_count`,
|
||||
1 AS `avg_score`,
|
||||
1 AS `best_score`*/;
|
||||
SET character_set_client = @saved_cs_client;
|
||||
|
||||
--
|
||||
-- Dumping routines for database 'kaopeilian'
|
||||
--
|
||||
|
||||
--
|
||||
-- Final view structure for view `v_user_course_progress`
|
||||
--
|
||||
|
||||
/*!50001 DROP VIEW IF EXISTS `v_user_course_progress`*/;
|
||||
/*!50001 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50001 SET @saved_cs_results = @@character_set_results */;
|
||||
/*!50001 SET @saved_col_connection = @@collation_connection */;
|
||||
/*!50001 SET character_set_client = latin1 */;
|
||||
/*!50001 SET character_set_results = latin1 */;
|
||||
/*!50001 SET collation_connection = latin1_swedish_ci */;
|
||||
/*!50001 CREATE ALGORITHM=UNDEFINED */
|
||||
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
|
||||
/*!50001 VIEW `v_user_course_progress` AS select `u`.`id` AS `user_id`,`u`.`username` AS `username`,`c`.`id` AS `course_id`,`c`.`name` AS `course_name`,count(distinct `e`.`id`) AS `exam_count`,avg(`e`.`score`) AS `avg_score`,max(`e`.`score`) AS `best_score` from ((`users` `u` join `courses` `c`) left join `exams` `e` on(((`e`.`user_id` = `u`.`id`) and (`e`.`course_id` = `c`.`id`) and (`e`.`status` = 'submitted')))) group by `u`.`id`,`c`.`id` */;
|
||||
/*!50001 SET character_set_client = @saved_cs_client */;
|
||||
/*!50001 SET character_set_results = @saved_cs_results */;
|
||||
/*!50001 SET collation_connection = @saved_col_connection */;
|
||||
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
|
||||
|
||||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
||||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
||||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
-- Dump completed on 2025-09-22 18:36:04
|
||||
@@ -0,0 +1,822 @@
|
||||
-- MySQL dump 10.13 Distrib 8.0.43, for Linux (aarch64)
|
||||
--
|
||||
-- Host: localhost Database: kaopeilian
|
||||
-- ------------------------------------------------------
|
||||
-- Server version 8.0.43
|
||||
|
||||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
||||
/*!50503 SET NAMES utf8mb4 */;
|
||||
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
|
||||
/*!40103 SET TIME_ZONE='+00:00' */;
|
||||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
|
||||
--
|
||||
-- Table structure for table `course_exam_settings`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `course_exam_settings`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `course_exam_settings` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`course_id` int NOT NULL COMMENT '课程ID',
|
||||
`single_choice_count` int NOT NULL DEFAULT '10' COMMENT 'å•选题数é‡',
|
||||
`multiple_choice_count` int NOT NULL DEFAULT '5' COMMENT '多选题数é‡',
|
||||
`true_false_count` int NOT NULL DEFAULT '5' COMMENT '判æ–题数é‡',
|
||||
`fill_blank_count` int NOT NULL DEFAULT '0' COMMENT '填空题数é‡',
|
||||
`duration_minutes` int NOT NULL DEFAULT '60' COMMENT '考试时长(分钟)',
|
||||
`difficulty_level` int NOT NULL DEFAULT '3' COMMENT '难度系数(1-5)',
|
||||
`passing_score` int NOT NULL DEFAULT '60' COMMENT 'åŠæ ¼åˆ†æ•°',
|
||||
`is_enabled` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是å¦å¯ç”¨',
|
||||
`show_answer_immediately` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是å¦ç«‹å³æ˜¾ç¤ºç”案',
|
||||
`allow_retake` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是å¦å…许é‡è€ƒ',
|
||||
`max_retake_times` int DEFAULT NULL COMMENT '最大é‡è€ƒæ¬¡æ•°',
|
||||
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`is_deleted` tinyint(1) NOT NULL DEFAULT '0',
|
||||
`deleted_at` datetime DEFAULT NULL,
|
||||
`deleted_by` int DEFAULT NULL COMMENT 'åˆ é™¤äººID',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `course_id` (`course_id`),
|
||||
KEY `ix_course_exam_settings_id` (`id`),
|
||||
CONSTRAINT `course_exam_settings_ibfk_1` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='课程考试设置表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `course_exam_settings`
|
||||
--
|
||||
|
||||
LOCK TABLES `course_exam_settings` WRITE;
|
||||
/*!40000 ALTER TABLE `course_exam_settings` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `course_exam_settings` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `course_materials`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `course_materials`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `course_materials` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`course_id` int NOT NULL COMMENT '课程ID',
|
||||
`name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '资料åç§°',
|
||||
`description` text COLLATE utf8mb4_unicode_ci COMMENT '资料æè¿°',
|
||||
`file_url` varchar(500) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '文件URL',
|
||||
`file_type` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '文件类型',
|
||||
`file_size` int NOT NULL COMMENT '文件大å°(å—节)',
|
||||
`sort_order` int DEFAULT '0' COMMENT '排åºé¡ºåº',
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是å¦åˆ 除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT 'åˆ é™¤æ—¶é—´',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_course_id` (`course_id`),
|
||||
KEY `idx_is_deleted` (`is_deleted`),
|
||||
CONSTRAINT `course_materials_ibfk_1` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='课程资料表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `course_materials`
|
||||
--
|
||||
|
||||
LOCK TABLES `course_materials` WRITE;
|
||||
/*!40000 ALTER TABLE `course_materials` DISABLE KEYS */;
|
||||
INSERT INTO `course_materials` VALUES (1,1,'Python基础教程.pdf','Python编程基础教程文档','/uploads/python-basics.pdf','pdf',2048000,0,0,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23'),(2,1,'课程视频1','ç¬¬ä¸€ç« èŠ‚è§†é¢‘æ•™ç¨‹','/uploads/video1.mp4','mp4',104857600,0,0,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23');
|
||||
/*!40000 ALTER TABLE `course_materials` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `courses`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `courses`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `courses` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '课程åç§°',
|
||||
`description` text COLLATE utf8mb4_unicode_ci COMMENT '课程æè¿°',
|
||||
`category` enum('technology','management','business','general') COLLATE utf8mb4_unicode_ci DEFAULT 'general' COMMENT '课程分类',
|
||||
`status` enum('draft','published','archived') COLLATE utf8mb4_unicode_ci DEFAULT 'draft' COMMENT '课程状æ€',
|
||||
`cover_image` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'å°é¢å›¾ç‰‡URL',
|
||||
`duration_hours` float DEFAULT NULL COMMENT '课程时长(å°æ—¶)',
|
||||
`difficulty_level` int DEFAULT NULL COMMENT '难度ç‰çº§(1-5)',
|
||||
`tags` json DEFAULT NULL COMMENT 'æ ‡ç¾åˆ—表',
|
||||
`published_at` datetime DEFAULT NULL COMMENT 'å‘布时间',
|
||||
`publisher_id` int DEFAULT NULL COMMENT 'å‘布人ID',
|
||||
`sort_order` int DEFAULT '0' COMMENT '排åºé¡ºåº',
|
||||
`is_featured` tinyint(1) DEFAULT '0' COMMENT 'æ˜¯å¦æŽ¨è',
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是å¦åˆ 除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT 'åˆ é™¤æ—¶é—´',
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_status` (`status`),
|
||||
KEY `idx_category` (`category`),
|
||||
KEY `idx_is_featured` (`is_featured`),
|
||||
KEY `idx_is_deleted` (`is_deleted`),
|
||||
KEY `idx_sort_order` (`sort_order`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='课程表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `courses`
|
||||
--
|
||||
|
||||
LOCK TABLES `courses` WRITE;
|
||||
/*!40000 ALTER TABLE `courses` DISABLE KEYS */;
|
||||
INSERT INTO `courses` VALUES (1,'皮肤生ç†å¦åŸºç¡€','å¦ä¹ 皮肤结构ã€åŠŸèƒ½å’Œå¸¸è§é—®é¢˜ï¼Œä¸ºä¸“ä¸šæŠ¤ç†æ‰“下基础','technology','published',NULL,16,2,'[\"皮肤å¦\", \"基础ç†è®º\", \"必修课\"]','2025-09-22 17:18:23',NULL,100,1,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23'),(2,'医美产å“知识与应用','å…¨é¢äº†è§£å„类医美产å“çš„æˆåˆ†ã€åŠŸæ•ˆå’Œé€‚ç”¨äººç¾¤','technology','published',NULL,20,3,'[\"产å“知识\", \"医美\", \"专业技能\"]','2025-09-22 17:18:23',NULL,110,1,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23'),(3,'美容仪器æ“作与维护','掌æ¡å„类美容仪器的æ“ä½œæ–¹æ³•ã€æ³¨æ„事项和日常维护','technology','published',NULL,24,3,'[\"仪器æ“作\", \"å®žæ“æŠ€èƒ½\", \"设备维护\"]','2025-09-22 17:18:23',NULL,120,0,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23'),(4,'医美项目介ç»ä¸Žå’¨è¯¢','详细了解å„类医美项目的原ç†ã€æ•ˆæžœå’Œé€‚应症','technology','published',NULL,30,4,'[\"医美项目\", \"专业咨询\", \"风险告知\"]','2025-09-22 17:18:23',NULL,170,1,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23'),(5,'轻医美销售技巧','å¦ä¹ ä¸“ä¸šçš„é”€å”®è¯æœ¯ã€å®¢æˆ·éœ€æ±‚分æžå’Œæˆäº¤æŠ€å·§','business','published',NULL,16,2,'[\"销售技巧\", \"客户沟通\", \"业绩æå‡\"]','2025-09-22 17:18:23',NULL,130,1,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23'),(6,'客户æœåŠ¡ä¸ŽæŠ•è¯‰å¤„ç†','æå‡æœåŠ¡æ„识,掌æ¡å®¢æˆ·æŠ•诉处ç†çš„æ–¹æ³•和技巧','business','published',NULL,12,2,'[\"客户æœåŠ¡\", \"屿œºå¤„ç†\", \"沟通技巧\"]','2025-09-22 17:18:23',NULL,140,0,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23'),(7,'社媒è¥é”€ä¸Žç§åŸŸè¿è¥','å¦ä¹ 如何通过社交媒体进行å“牌推广和客户维护','business','published',NULL,16,2,'[\"社媒è¥é”€\", \"ç§åŸŸæµé‡\", \"客户维护\"]','2025-09-22 17:18:23',NULL,180,0,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23'),(8,'门店è¿è¥ç®¡ç†','å¦ä¹ 门店日常管ç†ã€å›¢é˜Ÿå»ºè®¾å’Œä¸šç»©ç®¡ç†','management','published',NULL,20,3,'[\"门店管ç†\", \"团队管ç†\", \"è¿è¥ç–ç•¥\"]','2025-09-22 17:18:23',NULL,160,0,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23'),(9,'å«ç”Ÿæ¶ˆæ¯’与感染控制','å¦ä¹ 医美机构的å«ç”Ÿæ ‡å‡†å’Œæ¶ˆæ¯’æµç¨‹ï¼Œç¡®ä¿æœåС安免','general','published',NULL,8,1,'[\"å«ç”Ÿå®‰å…¨\", \"消毒规范\", \"åˆè§„管ç†\"]','2025-09-22 17:18:23',NULL,150,1,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23'),(10,'Python编程基础','Pythonè¯è¨€å…¥é—¨è¯¾ç¨‹ï¼Œé€‚åˆé›¶åŸºç¡€å¦å‘˜','technology','published',NULL,40,2,'[\"Python\", \"编程基础\", \"入门\"]','2025-09-22 17:18:23',NULL,200,0,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23'),(11,'æ•°æ®åˆ†æžåŸºç¡€','å¦ä¹ æ•°æ®åˆ†æžæ–¹æ³•和工具,æå‡æ•°æ®é©±åЍ决ç–能力','technology','published',NULL,32,3,'[\"æ•°æ®åˆ†æž\", \"Excel\", \"å¯è§†åŒ–\"]','2025-09-22 17:18:23',NULL,210,0,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23');
|
||||
/*!40000 ALTER TABLE `courses` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `exam_results`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `exam_results`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `exam_results` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`exam_id` int NOT NULL COMMENT '考试ID',
|
||||
`question_id` int NOT NULL COMMENT '题目ID',
|
||||
`user_answer` text COLLATE utf8mb4_unicode_ci COMMENT 'ç”¨æˆ·ç”æ¡ˆ',
|
||||
`is_correct` tinyint(1) DEFAULT '0' COMMENT 'æ˜¯å¦æ£ç¡®',
|
||||
`score` float DEFAULT '0' COMMENT '得分',
|
||||
`answer_time` int DEFAULT NULL COMMENT 'ç”题时长(秒)',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_exam_id` (`exam_id`),
|
||||
KEY `idx_question_id` (`question_id`),
|
||||
CONSTRAINT `exam_results_ibfk_1` FOREIGN KEY (`exam_id`) REFERENCES `exams` (`id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `exam_results_ibfk_2` FOREIGN KEY (`question_id`) REFERENCES `questions` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='考试结果详情表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `exam_results`
|
||||
--
|
||||
|
||||
LOCK TABLES `exam_results` WRITE;
|
||||
/*!40000 ALTER TABLE `exam_results` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `exam_results` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `exams`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `exams`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `exams` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`user_id` int NOT NULL COMMENT '用户ID',
|
||||
`course_id` int NOT NULL COMMENT '课程ID',
|
||||
`exam_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '考试åç§°',
|
||||
`question_count` int DEFAULT '10' COMMENT '题目数é‡',
|
||||
`total_score` float DEFAULT '100' COMMENT '总分',
|
||||
`pass_score` float DEFAULT '60' COMMENT 'åŠæ ¼åˆ†',
|
||||
`start_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '开始时间',
|
||||
`end_time` datetime DEFAULT NULL COMMENT 'ç»“æŸæ—¶é—´',
|
||||
`duration_minutes` int DEFAULT '60' COMMENT '考试时长(分钟)',
|
||||
`score` float DEFAULT NULL COMMENT '得分',
|
||||
`is_passed` tinyint(1) DEFAULT NULL COMMENT '是å¦é€šè¿‡',
|
||||
`status` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT 'started' COMMENT '状æ€: started, submitted, timeout',
|
||||
`questions` json DEFAULT NULL COMMENT '题目数æ®ï¼ˆJSONæ ¼å¼ï¼‰',
|
||||
`answers` json DEFAULT NULL COMMENT 'ç”æ¡ˆæ•°æ®ï¼ˆJSONæ ¼å¼ï¼‰',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_user_id` (`user_id`),
|
||||
KEY `idx_course_id` (`course_id`),
|
||||
KEY `idx_status` (`status`),
|
||||
CONSTRAINT `exams_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `exams_ibfk_2` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='考试记录表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `exams`
|
||||
--
|
||||
|
||||
LOCK TABLES `exams` WRITE;
|
||||
/*!40000 ALTER TABLE `exams` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `exams` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `growth_paths`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `growth_paths`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `growth_paths` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '路径åç§°',
|
||||
`description` text COLLATE utf8mb4_unicode_ci COMMENT '路径æè¿°',
|
||||
`target_role` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'ç›®æ ‡è§’è‰²',
|
||||
`courses` json DEFAULT NULL COMMENT '课程列表[{course_id, order, is_required}]',
|
||||
`estimated_duration_days` int DEFAULT NULL COMMENT '预计完æˆå¤©æ•°',
|
||||
`is_active` tinyint(1) DEFAULT '1' COMMENT '是å¦å¯ç”¨',
|
||||
`sort_order` int DEFAULT '0' COMMENT '排åºé¡ºåº',
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是å¦åˆ 除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT 'åˆ é™¤æ—¶é—´',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_is_active` (`is_active`),
|
||||
KEY `idx_is_deleted` (`is_deleted`),
|
||||
KEY `idx_sort_order` (`sort_order`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='æˆé•¿è·¯å¾„表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `growth_paths`
|
||||
--
|
||||
|
||||
LOCK TABLES `growth_paths` WRITE;
|
||||
/*!40000 ALTER TABLE `growth_paths` DISABLE KEYS */;
|
||||
INSERT INTO `growth_paths` VALUES (1,'Python工程师æˆé•¿è·¯å¾„','从入门到精通的Pythonå¦ä¹ 路径','Pythonå¼€å‘工程师','[{\"order\": 1, \"course_id\": 1, \"is_required\": true}, {\"order\": 2, \"course_id\": 4, \"is_required\": true}]',90,1,0,0,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23'),(2,'技术管ç†è€…路径','技术人员转型管ç†å²—ä½','技术ç»ç†','[{\"order\": 1, \"course_id\": 2, \"is_required\": true}, {\"order\": 2, \"course_id\": 3, \"is_required\": false}]',60,1,0,0,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23');
|
||||
/*!40000 ALTER TABLE `growth_paths` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `knowledge_points`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `knowledge_points`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `knowledge_points` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`course_id` int NOT NULL COMMENT '课程ID',
|
||||
`name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '知识点åç§°',
|
||||
`description` text COLLATE utf8mb4_unicode_ci COMMENT '知识点æè¿°',
|
||||
`parent_id` int DEFAULT NULL COMMENT '父知识点ID',
|
||||
`level` int DEFAULT '1' COMMENT '层级深度',
|
||||
`path` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '路径(如: 1.2.3)',
|
||||
`sort_order` int DEFAULT '0' COMMENT '排åºé¡ºåº',
|
||||
`weight` float DEFAULT '1' COMMENT 'æƒé‡',
|
||||
`is_required` tinyint(1) DEFAULT '1' COMMENT '是å¦å¿…ä¿®',
|
||||
`estimated_hours` float DEFAULT NULL COMMENT '预计å¦ä¹ æ—¶é—´(å°æ—¶)',
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是å¦åˆ 除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT 'åˆ é™¤æ—¶é—´',
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_course_id` (`course_id`),
|
||||
KEY `idx_parent_id` (`parent_id`),
|
||||
KEY `idx_is_deleted` (`is_deleted`),
|
||||
KEY `idx_sort_order` (`sort_order`),
|
||||
CONSTRAINT `knowledge_points_ibfk_1` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `knowledge_points_ibfk_2` FOREIGN KEY (`parent_id`) REFERENCES `knowledge_points` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='知识点表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `knowledge_points`
|
||||
--
|
||||
|
||||
LOCK TABLES `knowledge_points` WRITE;
|
||||
/*!40000 ALTER TABLE `knowledge_points` DISABLE KEYS */;
|
||||
INSERT INTO `knowledge_points` VALUES (1,1,'Python环境æå»º','å¦ä¹ 如何安装和é…ç½®Pythonå¼€å‘环境',NULL,1,NULL,0,1,1,2,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23'),(2,1,'PythonåŸºç¡€è¯æ³•','å¦ä¹ Pythonçš„åŸºæœ¬è¯æ³•规则',NULL,1,NULL,0,2,1,8,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23'),(3,1,'å˜é‡å’Œæ•°æ®ç±»åž‹','了解Pythonä¸çš„å˜é‡å’ŒåŸºæœ¬æ•°æ®ç±»åž‹',2,2,NULL,0,1.5,1,3,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23'),(4,1,'控制æµç¨‹','å¦ä¹ æ¡ä»¶è¯å¥å’Œå¾ªçŽ¯ç»“æž„',2,2,NULL,0,1.5,1,4,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23');
|
||||
/*!40000 ALTER TABLE `knowledge_points` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `material_knowledge_points`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `material_knowledge_points`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `material_knowledge_points` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`material_id` int NOT NULL COMMENT '资料ID',
|
||||
`knowledge_point_id` int NOT NULL COMMENT '知识点ID',
|
||||
`sort_order` int DEFAULT '0' COMMENT '排åºé¡ºåº',
|
||||
`is_ai_generated` tinyint(1) DEFAULT '0' COMMENT '是å¦AI生æˆ',
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是å¦åˆ 除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT 'åˆ é™¤æ—¶é—´',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `idx_material_knowledge` (`material_id`,`knowledge_point_id`),
|
||||
KEY `idx_material_id` (`material_id`),
|
||||
KEY `idx_knowledge_point_id` (`knowledge_point_id`),
|
||||
CONSTRAINT `material_knowledge_points_ibfk_1` FOREIGN KEY (`material_id`) REFERENCES `course_materials` (`id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `material_knowledge_points_ibfk_2` FOREIGN KEY (`knowledge_point_id`) REFERENCES `knowledge_points` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='资料知识点关è”表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `material_knowledge_points`
|
||||
--
|
||||
|
||||
LOCK TABLES `material_knowledge_points` WRITE;
|
||||
/*!40000 ALTER TABLE `material_knowledge_points` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `material_knowledge_points` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `position_courses`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `position_courses`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `position_courses` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`position_id` int NOT NULL COMMENT 'å²—ä½ID',
|
||||
`course_id` int NOT NULL COMMENT '课程ID',
|
||||
`course_type` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'required' COMMENT '课程类型',
|
||||
`priority` int DEFAULT '0' COMMENT '优先级/排åº',
|
||||
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`is_deleted` tinyint(1) NOT NULL DEFAULT '0',
|
||||
`deleted_at` datetime DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uix_position_course` (`position_id`,`course_id`,`is_deleted`),
|
||||
KEY `course_id` (`course_id`),
|
||||
KEY `ix_position_courses_id` (`id`),
|
||||
CONSTRAINT `position_courses_ibfk_1` FOREIGN KEY (`position_id`) REFERENCES `positions` (`id`),
|
||||
CONSTRAINT `position_courses_ibfk_2` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='å²—ä½è¯¾ç¨‹å…³è”表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `position_courses`
|
||||
--
|
||||
|
||||
LOCK TABLES `position_courses` WRITE;
|
||||
/*!40000 ALTER TABLE `position_courses` DISABLE KEYS */;
|
||||
INSERT INTO `position_courses` VALUES (1,2,8,'required',1,'2025-09-22 17:18:23','2025-09-22 17:18:23',NULL,NULL,0,NULL),(2,2,5,'required',2,'2025-09-22 17:18:23','2025-09-22 17:18:23',NULL,NULL,0,NULL),(3,2,6,'required',3,'2025-09-22 17:18:23','2025-09-22 17:18:23',NULL,NULL,0,NULL),(4,2,9,'required',4,'2025-09-22 17:18:23','2025-09-22 17:18:23',NULL,NULL,0,NULL),(5,3,1,'required',1,'2025-09-22 17:18:23','2025-09-22 17:18:23',NULL,NULL,0,NULL),(6,3,2,'required',2,'2025-09-22 17:18:23','2025-09-22 17:18:23',NULL,NULL,0,NULL),(7,3,5,'required',3,'2025-09-22 17:18:23','2025-09-22 17:18:23',NULL,NULL,0,NULL),(8,3,6,'required',4,'2025-09-22 17:18:23','2025-09-22 17:18:23',NULL,NULL,0,NULL),(9,3,7,'optional',5,'2025-09-22 17:18:23','2025-09-22 17:18:23',NULL,NULL,0,NULL),(10,4,1,'required',1,'2025-09-22 17:18:23','2025-09-22 17:18:23',NULL,NULL,0,NULL),(11,4,3,'required',2,'2025-09-22 17:18:23','2025-09-22 17:18:23',NULL,NULL,0,NULL),(12,4,9,'required',3,'2025-09-22 17:18:23','2025-09-22 17:18:23',NULL,NULL,0,NULL);
|
||||
/*!40000 ALTER TABLE `position_courses` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `position_members`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `position_members`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `position_members` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`position_id` int NOT NULL COMMENT 'å²—ä½ID',
|
||||
`user_id` int NOT NULL COMMENT '用户ID',
|
||||
`role` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'æˆå‘˜è§’è‰²ï¼ˆé¢„ç•™å—æ®µï¼‰',
|
||||
`joined_at` datetime DEFAULT CURRENT_TIMESTAMP COMMENT 'åŠ å…¥æ—¶é—´',
|
||||
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`is_deleted` tinyint(1) NOT NULL DEFAULT '0',
|
||||
`deleted_at` datetime DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uix_position_user` (`position_id`,`user_id`,`is_deleted`),
|
||||
KEY `user_id` (`user_id`),
|
||||
KEY `ix_position_members_id` (`id`),
|
||||
CONSTRAINT `position_members_ibfk_1` FOREIGN KEY (`position_id`) REFERENCES `positions` (`id`),
|
||||
CONSTRAINT `position_members_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='岗使ˆå‘˜å…³è”表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `position_members`
|
||||
--
|
||||
|
||||
LOCK TABLES `position_members` WRITE;
|
||||
/*!40000 ALTER TABLE `position_members` DISABLE KEYS */;
|
||||
INSERT INTO `position_members` VALUES (1,2,2,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23','2025-09-22 17:18:23',NULL,NULL,0,NULL),(2,3,3,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23','2025-09-22 17:18:23',NULL,NULL,0,NULL);
|
||||
/*!40000 ALTER TABLE `position_members` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `positions`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `positions`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `positions` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'å²—ä½åç§°',
|
||||
`code` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'å²—ä½ç¼–ç ',
|
||||
`description` text COLLATE utf8mb4_unicode_ci COMMENT 'å²—ä½æè¿°',
|
||||
`parent_id` int DEFAULT NULL COMMENT '上级岗ä½ID',
|
||||
`status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'active' COMMENT '状æ€: active/inactive',
|
||||
`skills` json DEFAULT NULL COMMENT 'æ ¸å¿ƒæŠ€èƒ½',
|
||||
`level` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'å²—ä½ç‰çº§: junior/intermediate/senior/expert',
|
||||
`sort_order` int DEFAULT '0' COMMENT '排åº',
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是å¦åˆ 除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT 'åˆ é™¤æ—¶é—´',
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `code` (`code`),
|
||||
KEY `parent_id` (`parent_id`),
|
||||
KEY `idx_positions_name` (`name`),
|
||||
CONSTRAINT `positions_ibfk_1` FOREIGN KEY (`parent_id`) REFERENCES `positions` (`id`) ON DELETE SET NULL
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='å²—ä½è¡¨';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `positions`
|
||||
--
|
||||
|
||||
LOCK TABLES `positions` WRITE;
|
||||
/*!40000 ALTER TABLE `positions` DISABLE KEYS */;
|
||||
INSERT INTO `positions` VALUES (1,'区域ç»ç†','region_manager','负责多家门店的è¿è¥ç®¡ç†å’Œä¸šç»©è¾¾æˆ',NULL,'active','[\"团队管ç†\", \"业绩分æž\", \"战略规划\", \"客户关系\"]','expert',10,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23'),(2,'店长','store_manager','负责门店日常è¿è¥ç®¡ç†ï¼Œå›¢é˜Ÿå»ºè®¾å’Œä¸šç»©è¾¾æˆ',1,'active','[\"门店管ç†\", \"团队建设\", \"销售管ç†\", \"客户维护\"]','senior',20,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23'),(3,'美容顾问','beauty_consultant','为客户æä¾›ä¸“业的美容咨询和方案设计',2,'active','[\"产å“知识\", \"销售技巧\", \"方案设计\", \"客户沟通\"]','intermediate',30,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23'),(4,'医美咨询师','medical_beauty_consultant','æä¾›åŒ»ç–—美容项目咨询和方案制定',2,'active','[\"医美知识\", \"风险评估\", \"方案设计\", \"åˆè§„æ„识\"]','senior',35,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23'),(5,'美容技师','beauty_therapist','为客户æä¾›ä¸“ä¸šçš„ç¾Žå®¹æŠ¤ç†æœåŠ¡',2,'active','[\"护肤技术\", \"仪器æ“作\", \"手法技巧\", \"æœåŠ¡æ„识\"]','intermediate',40,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23'),(6,'护士','nurse','å助医生进行医美项目æ“ä½œï¼Œè´Ÿè´£æœ¯åŽæŠ¤ç†',2,'active','[\"æŠ¤ç†æŠ€æœ¯\", \"æ— èŒæ“作\", \"应急处ç†\", \"医疗知识\"]','intermediate',45,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23'),(7,'å‰å°æŽ¥å¾…','receptionist','负责客户接待ã€é¢„约管ç†å’Œå‰å°äº‹åŠ¡',2,'active','[\"接待礼仪\", \"沟通能力\", \"ä¿¡æ¯ç®¡ç†\", \"æœåŠ¡æ„识\"]','junior',50,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23'),(8,'市场专员','marketing_specialist','负责门店è¥é”€æ´»åЍç–划和执行',2,'active','[\"活动ç–划\", \"社媒è¿è¥\", \"æ•°æ®åˆ†æž\", \"创æ„设计\"]','intermediate',60,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23');
|
||||
/*!40000 ALTER TABLE `positions` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `questions`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `questions`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `questions` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`course_id` int NOT NULL COMMENT '课程ID',
|
||||
`question_type` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '题目类型: single_choice, multiple_choice, true_false, fill_blank, essay',
|
||||
`title` text COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'é¢˜ç›®æ ‡é¢˜',
|
||||
`content` text COLLATE utf8mb4_unicode_ci COMMENT '题目内容',
|
||||
`options` json DEFAULT NULL COMMENT '选项(JSONæ ¼å¼ï¼‰',
|
||||
`correct_answer` text COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'æ£ç¡®ç”案',
|
||||
`explanation` text COLLATE utf8mb4_unicode_ci COMMENT 'ç”æ¡ˆè§£é‡Š',
|
||||
`score` float DEFAULT '10' COMMENT '分值',
|
||||
`difficulty` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT 'medium' COMMENT '难度ç‰çº§: easy, medium, hard',
|
||||
`tags` json DEFAULT NULL COMMENT 'æ ‡ç¾ï¼ˆJSONæ ¼å¼ï¼‰',
|
||||
`usage_count` int DEFAULT '0' COMMENT '使用次数',
|
||||
`correct_count` int DEFAULT '0' COMMENT 'ç”对次数',
|
||||
`is_active` tinyint(1) DEFAULT '1' COMMENT '是å¦å¯ç”¨',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_course_id` (`course_id`),
|
||||
KEY `idx_question_type` (`question_type`),
|
||||
KEY `idx_difficulty` (`difficulty`),
|
||||
KEY `idx_is_active` (`is_active`),
|
||||
CONSTRAINT `questions_ibfk_1` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='题目表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `questions`
|
||||
--
|
||||
|
||||
LOCK TABLES `questions` WRITE;
|
||||
/*!40000 ALTER TABLE `questions` DISABLE KEYS */;
|
||||
INSERT INTO `questions` VALUES (1,1,'single_choice','Pythonä¸å“ªä¸ªå…³é”®å—用于定义函数?',NULL,'{\"A\": \"def\", \"B\": \"function\", \"C\": \"fun\", \"D\": \"define\"}','A','Python使用def关键嗿¥å®šä¹‰å‡½æ•°',10,'easy','[\"python\", \"基础\", \"函数\"]',0,0,1,'2025-09-22 17:18:23','2025-09-22 17:18:23'),(2,1,'single_choice','Pythonä¸åˆ—表和元组的主è¦åŒºåˆ«æ˜¯ä»€ä¹ˆï¼Ÿ',NULL,'{\"A\": \"列表是有åºçš„ï¼Œå…ƒç»„æ˜¯æ— åºçš„\", \"B\": \"列表å¯å˜ï¼Œå…ƒç»„ä¸å¯å˜\", \"C\": \"列表åªèƒ½å˜å‚¨æ•°å—,元组å¯ä»¥å˜å‚¨ä»»ä½•类型\", \"D\": \"没有区别\"}','B','列表是å¯å˜çš„(mutable),而元组是ä¸å¯å˜çš„(immutable)',10,'medium','[\"python\", \"æ•°æ®ç»“æž„\"]',0,0,1,'2025-09-22 17:18:23','2025-09-22 17:18:23'),(3,1,'true_false','Python是一ç§ç¼–译型è¯è¨€',NULL,NULL,'false','Python是一ç§è§£é‡Šåž‹è¯è¨€ï¼Œä¸éœ€è¦ç¼–è¯‘æˆæœºå™¨ç ',10,'easy','[\"python\", \"基础\"]',0,0,1,'2025-09-22 17:18:23','2025-09-22 17:18:23'),(4,1,'fill_blank','Pythonä¸ä½¿ç”¨____关键å—定义类',NULL,NULL,'class','使用class关键å—定义类',10,'easy','[\"python\", \"é¢å‘对象\"]',0,0,1,'2025-09-22 17:18:23','2025-09-22 17:18:23');
|
||||
/*!40000 ALTER TABLE `questions` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `teams`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `teams`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `teams` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '团队åç§°',
|
||||
`code` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '团队代ç ',
|
||||
`description` text COLLATE utf8mb4_unicode_ci COMMENT '团队æè¿°',
|
||||
`team_type` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT 'department' COMMENT '团队类型: department, project, study_group',
|
||||
`is_active` tinyint(1) DEFAULT '1' COMMENT 'æ˜¯å¦æ¿€æ´»',
|
||||
`leader_id` int DEFAULT NULL COMMENT '负责人ID',
|
||||
`parent_id` int DEFAULT NULL COMMENT '父团队ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是å¦åˆ 除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT 'åˆ é™¤æ—¶é—´',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `name` (`name`),
|
||||
UNIQUE KEY `code` (`code`),
|
||||
KEY `leader_id` (`leader_id`),
|
||||
KEY `parent_id` (`parent_id`),
|
||||
KEY `idx_team_type` (`team_type`),
|
||||
KEY `idx_is_active` (`is_active`),
|
||||
CONSTRAINT `teams_ibfk_1` FOREIGN KEY (`leader_id`) REFERENCES `users` (`id`) ON DELETE SET NULL,
|
||||
CONSTRAINT `teams_ibfk_2` FOREIGN KEY (`parent_id`) REFERENCES `teams` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='团队表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `teams`
|
||||
--
|
||||
|
||||
LOCK TABLES `teams` WRITE;
|
||||
/*!40000 ALTER TABLE `teams` DISABLE KEYS */;
|
||||
INSERT INTO `teams` VALUES (1,'技术部','TECH','è´Ÿè´£æŠ€æœ¯ç ”å‘和维护','department',1,2,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23',0,NULL),(2,'产å“部','PROD','负责产å“设计和规划','department',1,2,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23',0,NULL),(3,'Pythonå¦ä¹ å°ç»„','PY_GROUP','Python技术å¦ä¹ 交æµ','study_group',1,2,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23',0,NULL);
|
||||
/*!40000 ALTER TABLE `teams` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `training_messages`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `training_messages`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `training_messages` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`session_id` int NOT NULL COMMENT '会è¯ID',
|
||||
`role` enum('USER','ASSISTANT','SYSTEM') COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '消æ¯è§’色',
|
||||
`type` enum('TEXT','VOICE','SYSTEM') COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '消æ¯ç±»åž‹',
|
||||
`content` text COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '消æ¯å†…容',
|
||||
`voice_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'è¯éŸ³æ–‡ä»¶URL',
|
||||
`voice_duration` float DEFAULT NULL COMMENT 'è¯éŸ³æ—¶é•¿ï¼ˆç§’)',
|
||||
`message_metadata` json DEFAULT NULL COMMENT '消æ¯å…ƒæ•°æ®',
|
||||
`coze_message_id` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Coze消æ¯ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_session_id` (`session_id`),
|
||||
KEY `idx_role` (`role`),
|
||||
CONSTRAINT `training_messages_ibfk_1` FOREIGN KEY (`session_id`) REFERENCES `training_sessions` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='陪练消æ¯è¡¨';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `training_messages`
|
||||
--
|
||||
|
||||
LOCK TABLES `training_messages` WRITE;
|
||||
/*!40000 ALTER TABLE `training_messages` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `training_messages` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `training_reports`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `training_reports`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `training_reports` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`session_id` int NOT NULL COMMENT '会è¯ID',
|
||||
`user_id` int NOT NULL COMMENT '用户ID',
|
||||
`overall_score` float NOT NULL COMMENT '总体得分',
|
||||
`dimension_scores` json NOT NULL COMMENT 'å„维度得分',
|
||||
`strengths` json NOT NULL COMMENT '优势点',
|
||||
`weaknesses` json NOT NULL COMMENT '待改进点',
|
||||
`suggestions` json NOT NULL COMMENT '改进建议',
|
||||
`detailed_analysis` text COLLATE utf8mb4_unicode_ci COMMENT '详细分æž',
|
||||
`transcript` text COLLATE utf8mb4_unicode_ci COMMENT 'å¯¹è¯æ–‡æœ¬è®°å½•',
|
||||
`statistics` json DEFAULT NULL COMMENT '统计数æ®',
|
||||
`created_by` bigint DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` bigint DEFAULT NULL COMMENT '更新人ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `session_id` (`session_id`),
|
||||
KEY `idx_user_id` (`user_id`),
|
||||
CONSTRAINT `training_reports_ibfk_1` FOREIGN KEY (`session_id`) REFERENCES `training_sessions` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='陪练报告表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `training_reports`
|
||||
--
|
||||
|
||||
LOCK TABLES `training_reports` WRITE;
|
||||
/*!40000 ALTER TABLE `training_reports` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `training_reports` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `training_scenes`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `training_scenes`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `training_scenes` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '场景åç§°',
|
||||
`description` text COLLATE utf8mb4_unicode_ci COMMENT '场景æè¿°',
|
||||
`category` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '场景分类',
|
||||
`ai_config` json DEFAULT NULL COMMENT 'AIé…置(如Coze Bot IDç‰ï¼‰',
|
||||
`prompt_template` text COLLATE utf8mb4_unicode_ci COMMENT 'æç¤ºè¯æ¨¡æ¿',
|
||||
`evaluation_criteria` json DEFAULT NULL COMMENT 'è¯„ä¼°æ ‡å‡†',
|
||||
`status` enum('DRAFT','ACTIVE','INACTIVE') COLLATE utf8mb4_unicode_ci DEFAULT 'DRAFT' COMMENT '场景状æ€',
|
||||
`is_public` tinyint(1) DEFAULT '1' COMMENT '是å¦å…¬å¼€',
|
||||
`required_level` int DEFAULT NULL COMMENT '所需用户ç‰çº§',
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是å¦åˆ 除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT 'åˆ é™¤æ—¶é—´',
|
||||
`created_by` bigint DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` bigint DEFAULT NULL COMMENT '更新人ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_status` (`status`),
|
||||
KEY `idx_category` (`category`),
|
||||
KEY `idx_is_public` (`is_public`),
|
||||
KEY `idx_is_deleted` (`is_deleted`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='陪练场景表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `training_scenes`
|
||||
--
|
||||
|
||||
LOCK TABLES `training_scenes` WRITE;
|
||||
/*!40000 ALTER TABLE `training_scenes` DISABLE KEYS */;
|
||||
INSERT INTO `training_scenes` VALUES (1,'Python编程助手','帮助å¦å‘˜è§£å†³Python编程问题','技术辅导','{\"bot_id\": \"python_assistant_bot\"}',NULL,NULL,'ACTIVE',1,NULL,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23'),(2,'é¢è¯•模拟','模拟技术é¢è¯•场景','èŒä¸šå‘展','{\"bot_id\": \"interview_simulator_bot\"}',NULL,NULL,'ACTIVE',1,NULL,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23'),(3,'项目讨论','项目方案讨论和优化','项目管ç†','{\"bot_id\": \"project_discussion_bot\"}',NULL,NULL,'DRAFT',1,NULL,0,NULL,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23');
|
||||
/*!40000 ALTER TABLE `training_scenes` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `training_sessions`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `training_sessions`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `training_sessions` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`user_id` int NOT NULL COMMENT '用户ID',
|
||||
`scene_id` int NOT NULL COMMENT '场景ID',
|
||||
`coze_conversation_id` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Coze会è¯ID',
|
||||
`start_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '开始时间',
|
||||
`end_time` datetime DEFAULT NULL COMMENT 'ç»“æŸæ—¶é—´',
|
||||
`duration_seconds` int DEFAULT NULL COMMENT 'æŒç»æ—¶é•¿ï¼ˆç§’)',
|
||||
`status` enum('CREATED','IN_PROGRESS','COMPLETED','CANCELLED','ERROR') COLLATE utf8mb4_unicode_ci DEFAULT 'CREATED' COMMENT '会è¯çжæ€',
|
||||
`session_config` json DEFAULT NULL COMMENT '会è¯é…ç½®',
|
||||
`total_score` float DEFAULT NULL COMMENT '总分',
|
||||
`evaluation_result` json DEFAULT NULL COMMENT '评估结果详情',
|
||||
`created_by` bigint DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` bigint DEFAULT NULL COMMENT '更新人ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_user_id` (`user_id`),
|
||||
KEY `idx_scene_id` (`scene_id`),
|
||||
KEY `idx_status` (`status`),
|
||||
CONSTRAINT `training_sessions_ibfk_1` FOREIGN KEY (`scene_id`) REFERENCES `training_scenes` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='陪练会è¯è¡¨';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `training_sessions`
|
||||
--
|
||||
|
||||
LOCK TABLES `training_sessions` WRITE;
|
||||
/*!40000 ALTER TABLE `training_sessions` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `training_sessions` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `user_teams`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `user_teams`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `user_teams` (
|
||||
`user_id` int NOT NULL,
|
||||
`team_id` int NOT NULL,
|
||||
`role` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT 'member' COMMENT '团队角色: member, leader',
|
||||
`joined_at` datetime DEFAULT CURRENT_TIMESTAMP COMMENT 'åŠ å…¥æ—¶é—´',
|
||||
PRIMARY KEY (`user_id`,`team_id`),
|
||||
KEY `team_id` (`team_id`),
|
||||
CONSTRAINT `user_teams_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `user_teams_ibfk_2` FOREIGN KEY (`team_id`) REFERENCES `teams` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='用户团队关è”表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `user_teams`
|
||||
--
|
||||
|
||||
LOCK TABLES `user_teams` WRITE;
|
||||
/*!40000 ALTER TABLE `user_teams` DISABLE KEYS */;
|
||||
INSERT INTO `user_teams` VALUES (2,1,'leader','2025-09-22 17:18:23'),(2,2,'leader','2025-09-22 17:18:23'),(3,1,'member','2025-09-22 17:18:23'),(3,3,'member','2025-09-22 17:18:23');
|
||||
/*!40000 ALTER TABLE `user_teams` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `users`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `users`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `users` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`username` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '用户å',
|
||||
`email` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '邮箱',
|
||||
`phone` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '手机å·',
|
||||
`password_hash` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '密ç 哈希',
|
||||
`full_name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'å§“å',
|
||||
`gender` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '性别: male/female',
|
||||
`avatar_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '头åƒURL',
|
||||
`bio` text COLLATE utf8mb4_unicode_ci COMMENT '个人简介',
|
||||
`school` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '妿 ¡',
|
||||
`major` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '专业',
|
||||
`role` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT 'trainee' COMMENT '系统角色: admin, manager, trainee',
|
||||
`is_active` tinyint(1) DEFAULT '1' COMMENT 'æ˜¯å¦æ¿€æ´»',
|
||||
`is_verified` tinyint(1) DEFAULT '0' COMMENT '是å¦éªŒè¯',
|
||||
`last_login_at` datetime DEFAULT NULL COMMENT '最åŽç™»å½•æ—¶é—´',
|
||||
`password_changed_at` datetime DEFAULT NULL COMMENT '密ç 修改时间',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是å¦åˆ 除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT 'åˆ é™¤æ—¶é—´',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `username` (`username`),
|
||||
UNIQUE KEY `email` (`email`),
|
||||
UNIQUE KEY `phone` (`phone`),
|
||||
KEY `idx_role` (`role`),
|
||||
KEY `idx_is_active` (`is_active`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='用户表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `users`
|
||||
--
|
||||
|
||||
LOCK TABLES `users` WRITE;
|
||||
/*!40000 ALTER TABLE `users` DISABLE KEYS */;
|
||||
INSERT INTO `users` VALUES (1,'superadmin','superadmin@kaopeilian.com','13800000001','$2b$12$LQv3c1yqBWVHxkd0LHAkCOYz6TtxMQJqhN8/LewKyNiQdP/sQj6C6','超级管ç†å‘˜',NULL,NULL,NULL,NULL,NULL,'admin',1,1,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23',0,NULL),(2,'admin','admin@kaopeilian.com','13800000002','$2b$12$NEGFEN8951QMRQMauW53Qe2VLOajCRrTbpFZzyn9RjtlLDVvXawl.','系统管ç†å‘˜',NULL,NULL,NULL,NULL,NULL,'admin',1,1,'2025-09-22 17:30:31',NULL,'2025-09-22 17:18:23','2025-09-22 17:30:31',0,NULL),(3,'testuser','testuser@kaopeilian.com','13800000003','$2b$12$LQv3c1yqBWVHxkd0LHAkCOYz6TtxMQJqhN8/LewKyNiQdP/sQj6C6','测试å¦å‘˜',NULL,NULL,NULL,NULL,NULL,'trainee',1,1,NULL,NULL,'2025-09-22 17:18:23','2025-09-22 17:18:23',0,NULL);
|
||||
/*!40000 ALTER TABLE `users` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Temporary view structure for view `v_user_course_progress`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `v_user_course_progress`;
|
||||
/*!50001 DROP VIEW IF EXISTS `v_user_course_progress`*/;
|
||||
SET @saved_cs_client = @@character_set_client;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
/*!50001 CREATE VIEW `v_user_course_progress` AS SELECT
|
||||
1 AS `user_id`,
|
||||
1 AS `username`,
|
||||
1 AS `course_id`,
|
||||
1 AS `course_name`,
|
||||
1 AS `exam_count`,
|
||||
1 AS `avg_score`,
|
||||
1 AS `best_score`*/;
|
||||
SET character_set_client = @saved_cs_client;
|
||||
|
||||
--
|
||||
-- Dumping routines for database 'kaopeilian'
|
||||
--
|
||||
|
||||
--
|
||||
-- Final view structure for view `v_user_course_progress`
|
||||
--
|
||||
|
||||
/*!50001 DROP VIEW IF EXISTS `v_user_course_progress`*/;
|
||||
/*!50001 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50001 SET @saved_cs_results = @@character_set_results */;
|
||||
/*!50001 SET @saved_col_connection = @@collation_connection */;
|
||||
/*!50001 SET character_set_client = latin1 */;
|
||||
/*!50001 SET character_set_results = latin1 */;
|
||||
/*!50001 SET collation_connection = latin1_swedish_ci */;
|
||||
/*!50001 CREATE ALGORITHM=UNDEFINED */
|
||||
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
|
||||
/*!50001 VIEW `v_user_course_progress` AS select `u`.`id` AS `user_id`,`u`.`username` AS `username`,`c`.`id` AS `course_id`,`c`.`name` AS `course_name`,count(distinct `e`.`id`) AS `exam_count`,avg(`e`.`score`) AS `avg_score`,max(`e`.`score`) AS `best_score` from ((`users` `u` join `courses` `c`) left join `exams` `e` on(((`e`.`user_id` = `u`.`id`) and (`e`.`course_id` = `c`.`id`) and (`e`.`status` = 'submitted')))) group by `u`.`id`,`c`.`id` */;
|
||||
/*!50001 SET character_set_client = @saved_cs_client */;
|
||||
/*!50001 SET character_set_results = @saved_cs_results */;
|
||||
/*!50001 SET collation_connection = @saved_col_connection */;
|
||||
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
|
||||
|
||||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
||||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
||||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
-- Dump completed on 2025-09-22 17:34:56
|
||||
1906
知识库/backups/updates/sql/full_database_backup_20250923_014658.sql
Normal file
1906
知识库/backups/updates/sql/full_database_backup_20250923_014658.sql
Normal file
File diff suppressed because one or more lines are too long
@@ -0,0 +1,825 @@
|
||||
-- MySQL dump 10.13 Distrib 8.0.43, for Linux (aarch64)
|
||||
--
|
||||
-- Host: localhost Database: kaopeilian
|
||||
-- ------------------------------------------------------
|
||||
-- Server version 8.0.43
|
||||
|
||||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
||||
/*!50503 SET NAMES utf8mb4 */;
|
||||
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
|
||||
/*!40103 SET TIME_ZONE='+00:00' */;
|
||||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
|
||||
--
|
||||
-- Table structure for table `course_exam_settings`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `course_exam_settings`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `course_exam_settings` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`course_id` int NOT NULL COMMENT '课程ID',
|
||||
`single_choice_count` int NOT NULL DEFAULT '10' COMMENT '单选题数量',
|
||||
`multiple_choice_count` int NOT NULL DEFAULT '5' COMMENT '多选题数量',
|
||||
`true_false_count` int NOT NULL DEFAULT '5' COMMENT '判断题数量',
|
||||
`fill_blank_count` int NOT NULL DEFAULT '0' COMMENT '填空题数量',
|
||||
`duration_minutes` int NOT NULL DEFAULT '60' COMMENT '考试时长(分钟)',
|
||||
`difficulty_level` int NOT NULL DEFAULT '3' COMMENT '难度系数(1-5)',
|
||||
`passing_score` int NOT NULL DEFAULT '60' COMMENT '及格分数',
|
||||
`is_enabled` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是否启用',
|
||||
`show_answer_immediately` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否立即显示答案',
|
||||
`allow_retake` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是否允许重考',
|
||||
`max_retake_times` int DEFAULT NULL COMMENT '最大重考次数',
|
||||
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`is_deleted` tinyint(1) NOT NULL DEFAULT '0',
|
||||
`deleted_at` datetime DEFAULT NULL,
|
||||
`deleted_by` int DEFAULT NULL COMMENT '删除人ID',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `course_id` (`course_id`),
|
||||
KEY `ix_course_exam_settings_id` (`id`),
|
||||
CONSTRAINT `course_exam_settings_ibfk_1` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='课程考试设置表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `course_exam_settings`
|
||||
--
|
||||
|
||||
LOCK TABLES `course_exam_settings` WRITE;
|
||||
/*!40000 ALTER TABLE `course_exam_settings` DISABLE KEYS */;
|
||||
INSERT INTO `course_exam_settings` (`id`, `course_id`, `single_choice_count`, `multiple_choice_count`, `true_false_count`, `fill_blank_count`, `duration_minutes`, `difficulty_level`, `passing_score`, `is_enabled`, `show_answer_immediately`, `allow_retake`, `max_retake_times`, `created_at`, `updated_at`, `created_by`, `updated_by`, `is_deleted`, `deleted_at`, `deleted_by`) VALUES (1,1,5,3,2,0,60,2,80,1,1,1,3,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(2,2,4,2,2,2,45,1,75,1,1,1,3,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(3,3,3,2,3,2,50,2,80,1,0,1,2,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(4,4,4,3,2,1,55,2,85,1,1,1,3,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(5,5,5,2,2,1,40,1,70,1,1,1,5,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(6,6,3,2,3,2,45,1,75,1,1,1,3,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(7,7,4,2,2,2,50,2,80,1,0,1,2,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(8,8,5,3,2,0,60,3,85,1,1,1,2,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(9,9,4,2,4,0,50,2,80,1,1,1,3,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(10,10,3,2,3,2,45,1,75,1,1,1,3,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(11,11,5,3,2,0,60,3,90,1,0,1,2,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(12,12,4,2,4,0,40,1,70,1,1,1,5,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL);
|
||||
/*!40000 ALTER TABLE `course_exam_settings` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `course_materials`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `course_materials`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `course_materials` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`course_id` int NOT NULL COMMENT '所属课程ID',
|
||||
`name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '资料名称',
|
||||
`description` text COLLATE utf8mb4_unicode_ci COMMENT '资料描述',
|
||||
`file_url` varchar(500) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '文件URL',
|
||||
`file_type` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '文件类型',
|
||||
`file_size` int NOT NULL COMMENT '文件大小(字节)',
|
||||
`sort_order` int DEFAULT '0' COMMENT '排序序号',
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_course_id` (`course_id`),
|
||||
KEY `idx_is_deleted` (`is_deleted`),
|
||||
CONSTRAINT `course_materials_ibfk_1` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='课程资料表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `course_materials`
|
||||
--
|
||||
|
||||
LOCK TABLES `course_materials` WRITE;
|
||||
/*!40000 ALTER TABLE `course_materials` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `course_materials` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `courses`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `courses`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `courses` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '课程名称',
|
||||
`description` text COLLATE utf8mb4_unicode_ci COMMENT '课程描述',
|
||||
`category` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '课程分类',
|
||||
`status` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT 'draft' COMMENT '课程状态',
|
||||
`cover_image` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '封面图片',
|
||||
`duration_hours` decimal(5,2) DEFAULT NULL COMMENT '课程时长(小时)',
|
||||
`difficulty_level` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '难度等级',
|
||||
`tags` json DEFAULT NULL COMMENT '标签列表',
|
||||
`published_at` datetime DEFAULT NULL COMMENT '发布时间',
|
||||
`publisher_id` int DEFAULT NULL COMMENT '发布人ID',
|
||||
`sort_order` int DEFAULT '0' COMMENT '排序',
|
||||
`is_featured` tinyint(1) DEFAULT '0' COMMENT '是否推荐',
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_status` (`status`),
|
||||
KEY `idx_category` (`category`),
|
||||
KEY `idx_is_featured` (`is_featured`),
|
||||
KEY `idx_is_deleted` (`is_deleted`),
|
||||
KEY `idx_sort_order` (`sort_order`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='课程信息表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `courses`
|
||||
--
|
||||
|
||||
LOCK TABLES `courses` WRITE;
|
||||
/*!40000 ALTER TABLE `courses` DISABLE KEYS */;
|
||||
INSERT INTO `courses` (`id`, `name`, `description`, `category`, `status`, `cover_image`, `duration_hours`, `difficulty_level`, `tags`, `published_at`, `publisher_id`, `sort_order`, `is_featured`, `is_deleted`, `deleted_at`, `created_by`, `updated_by`, `created_at`, `updated_at`) VALUES (1,'皮肤生理学基础','学习皮肤结构、功能和常见问题,为专业护理打下坚实基础','technology','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(2,'医美产品知识与应用','全面了解各类医美产品的成分、功效和适用人群,掌握产品推荐技巧','technology','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(3,'美容仪器操作与维护','掌握各类美容仪器的操作方法、注意事项和日常维护保养','technology','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(4,'医美项目介绍与咨询','详细了解各类医美项目的原理、效果和适应症,提升咨询专业度','business','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(5,'轻医美销售技巧','学习专业的销售话术、客户需求分析和成交技巧,提升业绩能力','business','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(6,'客户服务与投诉处理','提升服务意识,掌握客户投诉处理的方法和技巧,维护品牌形象','management','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(7,'社媒营销与私域运营','学习如何通过社交媒体进行品牌推广和客户维护,建立私域流量','business','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(8,'门店运营管理','学习门店日常管理、团队建设和业绩管理的方法和技巧','management','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(9,'卫生消毒与感染控制','学习医美机构的卫生标准和消毒流程,确保服务安全合规','general','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(10,'美容心理学','了解客户心理需求,掌握沟通技巧,提升服务满意度','general','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(11,'法律法规与行业规范','学习医美行业相关法律法规,确保合规经营','general','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(12,'新员工入职培训','新员工必修课程,包含企业文化、基础知识和操作规范','general','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24');
|
||||
/*!40000 ALTER TABLE `courses` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `exam_results`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `exam_results`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `exam_results` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`exam_id` int NOT NULL COMMENT '考试ID',
|
||||
`question_id` int NOT NULL COMMENT '题目ID',
|
||||
`user_answer` json DEFAULT NULL COMMENT '用户答案',
|
||||
`is_correct` tinyint(1) NOT NULL COMMENT '是否正确',
|
||||
`score` decimal(5,2) NOT NULL COMMENT '考试得分',
|
||||
`answer_time` int DEFAULT NULL COMMENT '答题时长(秒)',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_exam_id` (`exam_id`),
|
||||
KEY `idx_question_id` (`question_id`),
|
||||
CONSTRAINT `exam_results_ibfk_1` FOREIGN KEY (`exam_id`) REFERENCES `exams` (`id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `exam_results_ibfk_2` FOREIGN KEY (`question_id`) REFERENCES `questions` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='考试结果表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `exam_results`
|
||||
--
|
||||
|
||||
LOCK TABLES `exam_results` WRITE;
|
||||
/*!40000 ALTER TABLE `exam_results` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `exam_results` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `exams`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `exams`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `exams` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`user_id` int NOT NULL COMMENT '用户ID',
|
||||
`course_id` int NOT NULL COMMENT '课程ID',
|
||||
`exam_name` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '考试名称',
|
||||
`question_count` int DEFAULT NULL COMMENT '题目数量',
|
||||
`total_score` decimal(5,2) DEFAULT NULL COMMENT '总分',
|
||||
`pass_score` decimal(5,2) DEFAULT NULL COMMENT '及格分',
|
||||
`start_time` datetime DEFAULT NULL COMMENT '开始时间',
|
||||
`end_time` datetime DEFAULT NULL COMMENT '结束时间',
|
||||
`duration_minutes` int DEFAULT NULL COMMENT '考试时长(分钟)',
|
||||
`score` decimal(5,2) DEFAULT NULL COMMENT '得分',
|
||||
`is_passed` tinyint(1) DEFAULT '0' COMMENT '是否通过',
|
||||
`status` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT 'pending' COMMENT '考试状态',
|
||||
`questions` json DEFAULT NULL COMMENT '题目数据(JSON格式)',
|
||||
`answers` json DEFAULT NULL COMMENT '答案数据(JSON格式)',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_user_id` (`user_id`),
|
||||
KEY `idx_course_id` (`course_id`),
|
||||
KEY `idx_status` (`status`),
|
||||
CONSTRAINT `exams_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `exams_ibfk_2` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='考试记录表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `exams`
|
||||
--
|
||||
|
||||
LOCK TABLES `exams` WRITE;
|
||||
/*!40000 ALTER TABLE `exams` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `exams` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `growth_paths`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `growth_paths`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `growth_paths` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '成长路径名称',
|
||||
`description` text COLLATE utf8mb4_unicode_ci COMMENT '路径描述',
|
||||
`target_role` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '目标角色',
|
||||
`courses` json DEFAULT NULL COMMENT '课程列表',
|
||||
`estimated_duration_days` int DEFAULT NULL COMMENT '预计完成天数',
|
||||
`is_active` tinyint(1) DEFAULT '1' COMMENT '是否启用',
|
||||
`sort_order` int DEFAULT '0' COMMENT '排序顺序',
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_is_active` (`is_active`),
|
||||
KEY `idx_is_deleted` (`is_deleted`),
|
||||
KEY `idx_sort_order` (`sort_order`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='成长路径表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `growth_paths`
|
||||
--
|
||||
|
||||
LOCK TABLES `growth_paths` WRITE;
|
||||
/*!40000 ALTER TABLE `growth_paths` DISABLE KEYS */;
|
||||
INSERT INTO `growth_paths` (`id`, `name`, `description`, `target_role`, `courses`, `estimated_duration_days`, `is_active`, `sort_order`, `is_deleted`, `deleted_at`, `created_at`, `updated_at`) VALUES (1,'美容顾问成长路径','从初级美容顾问到资深顾问的完整成长路径,包含专业技能和销售能力提升','资深美容顾问',NULL,NULL,1,0,0,NULL,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(2,'美容技师进阶路径','美容技师的技能进阶路径,从基础护理到高级项目操作','高级美容技师',NULL,NULL,1,0,0,NULL,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(3,'管理岗位培养路径','从一线员工到管理岗位的培养路径,包含领导力和管理技能','店长/区域经理',NULL,NULL,1,0,0,NULL,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(4,'医美咨询师专业路径','医美咨询师的专业发展路径,深度掌握医美项目知识','资深医美咨询师',NULL,NULL,1,0,0,NULL,'2025-09-23 02:39:48','2025-09-23 02:39:48');
|
||||
/*!40000 ALTER TABLE `growth_paths` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `knowledge_points`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `knowledge_points`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `knowledge_points` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`course_id` int DEFAULT NULL COMMENT '所属课程ID',
|
||||
`name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '知识点名称',
|
||||
`description` text COLLATE utf8mb4_unicode_ci COMMENT '知识点描述',
|
||||
`parent_id` int DEFAULT NULL COMMENT '父知识点ID',
|
||||
`level` int DEFAULT '1' COMMENT '层级深度',
|
||||
`path` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '知识点路径',
|
||||
`sort_order` int DEFAULT '0' COMMENT '排序顺序',
|
||||
`weight` decimal(3,2) DEFAULT '1.00' COMMENT '权重',
|
||||
`is_required` tinyint(1) DEFAULT '1' COMMENT '是否必修',
|
||||
`estimated_hours` decimal(4,2) DEFAULT NULL COMMENT '预计学习时间(小时)',
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_course_id` (`course_id`),
|
||||
KEY `idx_parent_id` (`parent_id`),
|
||||
KEY `idx_is_deleted` (`is_deleted`),
|
||||
KEY `idx_sort_order` (`sort_order`),
|
||||
CONSTRAINT `knowledge_points_ibfk_1` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `knowledge_points_ibfk_2` FOREIGN KEY (`parent_id`) REFERENCES `knowledge_points` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='知识点表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `knowledge_points`
|
||||
--
|
||||
|
||||
LOCK TABLES `knowledge_points` WRITE;
|
||||
/*!40000 ALTER TABLE `knowledge_points` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `knowledge_points` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `material_knowledge_points`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `material_knowledge_points`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `material_knowledge_points` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`material_id` int NOT NULL COMMENT '资料ID',
|
||||
`knowledge_point_id` int NOT NULL COMMENT '知识点ID',
|
||||
`sort_order` int DEFAULT '0' COMMENT '排序顺序',
|
||||
`is_ai_generated` tinyint(1) DEFAULT '0' COMMENT '是否AI生成',
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `idx_material_knowledge` (`material_id`,`knowledge_point_id`),
|
||||
KEY `idx_material_id` (`material_id`),
|
||||
KEY `idx_knowledge_point_id` (`knowledge_point_id`),
|
||||
CONSTRAINT `material_knowledge_points_ibfk_1` FOREIGN KEY (`material_id`) REFERENCES `course_materials` (`id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `material_knowledge_points_ibfk_2` FOREIGN KEY (`knowledge_point_id`) REFERENCES `knowledge_points` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='资料知识点关联表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `material_knowledge_points`
|
||||
--
|
||||
|
||||
LOCK TABLES `material_knowledge_points` WRITE;
|
||||
/*!40000 ALTER TABLE `material_knowledge_points` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `material_knowledge_points` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `position_courses`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `position_courses`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `position_courses` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`position_id` int NOT NULL COMMENT '岗位ID',
|
||||
`course_id` int NOT NULL COMMENT '课程ID',
|
||||
`course_type` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'required' COMMENT '课程类型(必修/选修)',
|
||||
`priority` int DEFAULT '0' COMMENT '优先级',
|
||||
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`is_deleted` tinyint(1) NOT NULL DEFAULT '0',
|
||||
`deleted_at` datetime DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uix_position_course` (`position_id`,`course_id`,`is_deleted`),
|
||||
KEY `course_id` (`course_id`),
|
||||
KEY `ix_position_courses_id` (`id`),
|
||||
CONSTRAINT `position_courses_ibfk_1` FOREIGN KEY (`position_id`) REFERENCES `positions` (`id`),
|
||||
CONSTRAINT `position_courses_ibfk_2` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='岗位课程关联表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `position_courses`
|
||||
--
|
||||
|
||||
LOCK TABLES `position_courses` WRITE;
|
||||
/*!40000 ALTER TABLE `position_courses` DISABLE KEYS */;
|
||||
INSERT INTO `position_courses` (`id`, `position_id`, `course_id`, `course_type`, `priority`, `created_at`, `updated_at`, `created_by`, `updated_by`, `is_deleted`, `deleted_at`) VALUES (1,1,6,'required',1,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(2,1,8,'required',2,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(3,1,11,'required',3,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(4,1,12,'required',4,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(5,3,1,'required',1,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(6,3,2,'required',2,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(7,3,5,'required',3,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(8,3,6,'required',4,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(9,3,10,'required',5,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(10,3,12,'required',6,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(11,4,1,'required',1,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(12,4,2,'required',2,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(13,4,4,'required',3,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(14,4,5,'required',4,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(15,4,9,'required',5,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(16,4,12,'required',6,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(17,5,1,'required',1,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(18,5,2,'required',2,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(19,5,3,'required',3,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(20,5,9,'required',4,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(21,5,12,'required',5,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(22,7,6,'required',1,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(23,7,10,'required',2,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(24,7,12,'required',3,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL);
|
||||
/*!40000 ALTER TABLE `position_courses` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `position_members`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `position_members`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `position_members` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`position_id` int NOT NULL COMMENT '岗位ID',
|
||||
`user_id` int NOT NULL COMMENT '用户ID',
|
||||
`role` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '在岗位中的角色',
|
||||
`joined_at` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '加入时间',
|
||||
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`is_deleted` tinyint(1) NOT NULL DEFAULT '0',
|
||||
`deleted_at` datetime DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uix_position_user` (`position_id`,`user_id`,`is_deleted`),
|
||||
KEY `user_id` (`user_id`),
|
||||
KEY `ix_position_members_id` (`id`),
|
||||
CONSTRAINT `position_members_ibfk_1` FOREIGN KEY (`position_id`) REFERENCES `positions` (`id`),
|
||||
CONSTRAINT `position_members_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='岗位成员关联表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `position_members`
|
||||
--
|
||||
|
||||
LOCK TABLES `position_members` WRITE;
|
||||
/*!40000 ALTER TABLE `position_members` DISABLE KEYS */;
|
||||
INSERT INTO `position_members` (`id`, `position_id`, `user_id`, `role`, `joined_at`, `created_at`, `updated_at`, `created_by`, `updated_by`, `is_deleted`, `deleted_at`) VALUES (1,1,3,NULL,'2025-09-22 18:42:32','2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(2,1,4,NULL,'2025-09-22 18:42:32','2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(3,3,5,NULL,'2025-09-22 18:42:32','2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(4,4,6,NULL,'2025-09-22 18:42:32','2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(5,5,7,NULL,'2025-09-22 18:42:32','2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(6,7,8,NULL,'2025-09-22 18:42:32','2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL);
|
||||
/*!40000 ALTER TABLE `position_members` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `positions`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `positions`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `positions` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '岗位名称',
|
||||
`code` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '岗位代码',
|
||||
`description` text COLLATE utf8mb4_unicode_ci COMMENT '岗位描述',
|
||||
`parent_id` int DEFAULT NULL COMMENT '上级岗位ID',
|
||||
`status` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT 'active' COMMENT '岗位状态',
|
||||
`skills` json DEFAULT NULL COMMENT '核心技能',
|
||||
`level` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '岗位级别',
|
||||
`sort_order` int DEFAULT '0' COMMENT '排序',
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `code` (`code`),
|
||||
KEY `parent_id` (`parent_id`),
|
||||
KEY `idx_positions_name` (`name`),
|
||||
CONSTRAINT `positions_ibfk_1` FOREIGN KEY (`parent_id`) REFERENCES `positions` (`id`) ON DELETE SET NULL
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='岗位信息表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `positions`
|
||||
--
|
||||
|
||||
LOCK TABLES `positions` WRITE;
|
||||
/*!40000 ALTER TABLE `positions` DISABLE KEYS */;
|
||||
INSERT INTO `positions` (`id`, `name`, `code`, `description`, `parent_id`, `status`, `skills`, `level`, `sort_order`, `is_deleted`, `deleted_at`, `created_by`, `updated_by`, `created_at`, `updated_at`) VALUES (1,'区域经理','region_manager','负责多家门店的运营管理和业绩达成,制定区域发展战略',NULL,'active',NULL,'expert',0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(2,'店长','store_manager','负责门店日常运营管理,团队建设和业绩达成',NULL,'active',NULL,'senior',0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(3,'美容顾问','beauty_consultant','为客户提供专业的美容咨询和个性化方案设计',NULL,'active',NULL,'intermediate',0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(4,'医美咨询师','medical_beauty_consultant','提供医疗美容项目咨询和专业方案制定',NULL,'active',NULL,'senior',0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(5,'美容技师','beauty_therapist','为客户提供专业的美容护理和技术服务',NULL,'active',NULL,'intermediate',0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(6,'美容护士','beauty_nurse','协助医生进行医美项目操作,负责术后护理指导',NULL,'active',NULL,'intermediate',0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(7,'前台接待','receptionist','负责客户接待、预约管理和前台事务处理',NULL,'active',NULL,'junior',0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(8,'市场专员','marketing_specialist','负责门店营销活动策划、执行和客户维护',NULL,'active',NULL,'intermediate',0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24');
|
||||
/*!40000 ALTER TABLE `positions` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `questions`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `questions`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `questions` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`course_id` int NOT NULL COMMENT '所属课程ID',
|
||||
`question_type` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '题目类型',
|
||||
`title` text COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '题目标题',
|
||||
`content` text COLLATE utf8mb4_unicode_ci COMMENT '题目内容',
|
||||
`options` json DEFAULT NULL COMMENT '选项内容',
|
||||
`correct_answer` text COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '正确答案',
|
||||
`explanation` text COLLATE utf8mb4_unicode_ci COMMENT '答案解析',
|
||||
`score` float DEFAULT '10' COMMENT '题目分值',
|
||||
`difficulty` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT 'medium' COMMENT '难度等级',
|
||||
`tags` json DEFAULT NULL COMMENT '题目标签',
|
||||
`usage_count` int DEFAULT '0' COMMENT '使用次数',
|
||||
`correct_count` int DEFAULT '0' COMMENT '答对次数',
|
||||
`is_active` tinyint(1) DEFAULT '1' COMMENT '是否启用',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_course_id` (`course_id`),
|
||||
KEY `idx_question_type` (`question_type`),
|
||||
KEY `idx_difficulty` (`difficulty`),
|
||||
KEY `idx_is_active` (`is_active`),
|
||||
CONSTRAINT `questions_ibfk_1` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='题目表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `questions`
|
||||
--
|
||||
|
||||
LOCK TABLES `questions` WRITE;
|
||||
/*!40000 ALTER TABLE `questions` DISABLE KEYS */;
|
||||
INSERT INTO `questions` (`id`, `course_id`, `question_type`, `title`, `content`, `options`, `correct_answer`, `explanation`, `score`, `difficulty`, `tags`, `usage_count`, `correct_count`, `is_active`, `created_at`, `updated_at`) VALUES (1,1,'single_choice','皮肤的最外层是什么?',NULL,'[{\"text\": \"表皮\", \"label\": \"A\"}, {\"text\": \"真皮\", \"label\": \"B\"}, {\"text\": \"皮下组织\", \"label\": \"C\"}, {\"text\": \"角质层\", \"label\": \"D\"}]','A','A选项是表皮,这是皮肤的最外层,起到保护作用',10,'easy',NULL,0,0,1,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(2,2,'single_choice','透明质酸的主要功效是什么?',NULL,'[{\"text\": \"美白淡斑\", \"label\": \"A\"}, {\"text\": \"保湿补水\", \"label\": \"B\"}, {\"text\": \"紧致提升\", \"label\": \"C\"}, {\"text\": \"去除皱纹\", \"label\": \"D\"}]','B','B选项是保湿补水,透明质酸具有强大的保湿能力',10,'easy',NULL,0,0,1,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(3,3,'multiple_choice','射频美容仪的禁忌症包括哪些?',NULL,'[{\"text\": \"孕期和哺乳期\", \"label\": \"A\"}, {\"text\": \"皮肤过敏\", \"label\": \"B\"}, {\"text\": \"心脏起搏器\", \"label\": \"C\"}, {\"text\": \"轻微痤疮\", \"label\": \"D\"}]','A,C','A和C选项都是射频美容仪的禁忌症,需要特别注意',15,'medium',NULL,0,0,1,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(4,4,'true_false','水光针适合所有肤质的客户',NULL,'[{\"text\": \"正确\", \"label\": \"A\"}, {\"text\": \"错误\", \"label\": \"B\"}]','B','水光针虽然适用范围广,但仍有一些禁忌症和不适合的肤质',10,'easy',NULL,0,0,1,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(5,4,'fill_blank','肉毒素注射后____小时内不能平躺','肉毒素注射后【】小时内不能平躺,以免影响药物分布效果。',NULL,'4','肉毒素注射后4小时内不能平躺,以免影响药物分布',10,'medium',NULL,0,0,1,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(6,5,'single_choice','客户咨询时最重要的是什么?',NULL,'[{\"text\": \"倾听客户需求\", \"label\": \"A\"}, {\"text\": \"推荐最贵的产品\", \"label\": \"B\"}, {\"text\": \"快速成交\", \"label\": \"C\"}, {\"text\": \"展示专业知识\", \"label\": \"D\"}]','A','A选项是倾听客户需求,这是专业咨询的基础',10,'easy',NULL,0,0,1,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(7,6,'single_choice','处理客户投诉的第一步是什么?',NULL,'[{\"text\": \"解释原因\", \"label\": \"A\"}, {\"text\": \"耐心倾听\", \"label\": \"B\"}, {\"text\": \"提供补偿\", \"label\": \"C\"}, {\"text\": \"转交上级\", \"label\": \"D\"}]','B','B选项是耐心倾听,让客户充分表达不满是处理投诉的第一步',10,'easy',NULL,0,0,1,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(8,7,'true_false','社交媒体营销只需要发布产品信息',NULL,'[{\"text\": \"正确\", \"label\": \"A\"}, {\"text\": \"错误\", \"label\": \"B\"}]','B','社交媒体营销需要内容多样化,包括教育内容、互动内容等',10,'easy',NULL,0,0,1,'2025-09-23 02:39:48','2025-09-23 02:39:48');
|
||||
/*!40000 ALTER TABLE `questions` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `teams`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `teams`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `teams` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '团队名称',
|
||||
`code` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '团队代码',
|
||||
`description` text COLLATE utf8mb4_unicode_ci COMMENT '团队描述',
|
||||
`team_type` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '团队类型',
|
||||
`is_active` tinyint(1) DEFAULT '1' COMMENT '是否激活',
|
||||
`leader_id` int DEFAULT NULL COMMENT '负责人ID',
|
||||
`parent_id` int DEFAULT NULL COMMENT '父团队ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `name` (`name`),
|
||||
UNIQUE KEY `code` (`code`),
|
||||
KEY `leader_id` (`leader_id`),
|
||||
KEY `parent_id` (`parent_id`),
|
||||
KEY `idx_team_type` (`team_type`),
|
||||
KEY `idx_is_active` (`is_active`),
|
||||
CONSTRAINT `teams_ibfk_1` FOREIGN KEY (`leader_id`) REFERENCES `users` (`id`) ON DELETE SET NULL,
|
||||
CONSTRAINT `teams_ibfk_2` FOREIGN KEY (`parent_id`) REFERENCES `teams` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='团队信息表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `teams`
|
||||
--
|
||||
|
||||
LOCK TABLES `teams` WRITE;
|
||||
/*!40000 ALTER TABLE `teams` DISABLE KEYS */;
|
||||
INSERT INTO `teams` (`id`, `name`, `code`, `description`, `team_type`, `is_active`, `leader_id`, `parent_id`, `created_at`, `updated_at`, `is_deleted`, `deleted_at`) VALUES (1,'管理层','MANAGEMENT','负责公司整体战略规划和运营管理','department',1,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(2,'北京运营团队','BJ_OPERATIONS','负责北京地区所有门店的运营管理','department',1,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(3,'上海运营团队','SH_OPERATIONS','负责上海地区所有门店的运营管理','department',1,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(4,'技术培训部','TECH_TRAINING','负责员工技术培训和考核','department',1,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(5,'客服质量部','QUALITY_SERVICE','负责客户服务质量监督和改进','department',1,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(6,'新员工培训小组','NEW_EMPLOYEE_TRAINING','专门负责新员工入职培训','study_group',1,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL);
|
||||
/*!40000 ALTER TABLE `teams` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `training_messages`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `training_messages`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `training_messages` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`session_id` int NOT NULL COMMENT '会话ID',
|
||||
`role` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '消息角色',
|
||||
`type` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '消息类型',
|
||||
`content` text COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '消息内容',
|
||||
`voice_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '语音文件URL',
|
||||
`voice_duration` int DEFAULT NULL COMMENT '语音时长(秒)',
|
||||
`message_metadata` json DEFAULT NULL COMMENT '消息元数据',
|
||||
`coze_message_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Coze消息ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_session_id` (`session_id`),
|
||||
KEY `idx_role` (`role`),
|
||||
CONSTRAINT `training_messages_ibfk_1` FOREIGN KEY (`session_id`) REFERENCES `training_sessions` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='培训消息表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `training_messages`
|
||||
--
|
||||
|
||||
LOCK TABLES `training_messages` WRITE;
|
||||
/*!40000 ALTER TABLE `training_messages` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `training_messages` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `training_reports`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `training_reports`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `training_reports` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`session_id` int NOT NULL COMMENT '会话ID',
|
||||
`user_id` int NOT NULL COMMENT '用户ID',
|
||||
`overall_score` decimal(5,2) DEFAULT NULL COMMENT '总体评分',
|
||||
`dimension_scores` json DEFAULT NULL COMMENT '各维度得分',
|
||||
`strengths` text COLLATE utf8mb4_unicode_ci COMMENT '优势点',
|
||||
`weaknesses` text COLLATE utf8mb4_unicode_ci COMMENT '待改进点',
|
||||
`suggestions` text COLLATE utf8mb4_unicode_ci COMMENT '改进建议',
|
||||
`detailed_analysis` text COLLATE utf8mb4_unicode_ci COMMENT '详细分析',
|
||||
`transcript` text COLLATE utf8mb4_unicode_ci COMMENT '对话记录',
|
||||
`statistics` json DEFAULT NULL COMMENT '统计数据',
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `session_id` (`session_id`),
|
||||
KEY `idx_user_id` (`user_id`),
|
||||
CONSTRAINT `training_reports_ibfk_1` FOREIGN KEY (`session_id`) REFERENCES `training_sessions` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='培训报告表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `training_reports`
|
||||
--
|
||||
|
||||
LOCK TABLES `training_reports` WRITE;
|
||||
/*!40000 ALTER TABLE `training_reports` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `training_reports` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `training_scenes`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `training_scenes`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `training_scenes` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '场景名称',
|
||||
`description` text COLLATE utf8mb4_unicode_ci COMMENT '场景描述',
|
||||
`category` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '场景分类',
|
||||
`ai_config` json DEFAULT NULL COMMENT 'AI配置',
|
||||
`prompt_template` text COLLATE utf8mb4_unicode_ci COMMENT '提示模板',
|
||||
`evaluation_criteria` json DEFAULT NULL COMMENT '评估标准',
|
||||
`status` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT 'active' COMMENT '场景状态',
|
||||
`is_public` tinyint(1) DEFAULT '1' COMMENT '是否公开',
|
||||
`required_level` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '所需用户等级',
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_status` (`status`),
|
||||
KEY `idx_category` (`category`),
|
||||
KEY `idx_is_public` (`is_public`),
|
||||
KEY `idx_is_deleted` (`is_deleted`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='培训场景表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `training_scenes`
|
||||
--
|
||||
|
||||
LOCK TABLES `training_scenes` WRITE;
|
||||
/*!40000 ALTER TABLE `training_scenes` DISABLE KEYS */;
|
||||
INSERT INTO `training_scenes` (`id`, `name`, `description`, `category`, `ai_config`, `prompt_template`, `evaluation_criteria`, `status`, `is_public`, `required_level`, `is_deleted`, `deleted_at`, `created_by`, `updated_by`, `created_at`, `updated_at`) VALUES (1,'客户咨询模拟','模拟真实的客户咨询场景,练习专业咨询技巧','客户服务',NULL,NULL,NULL,'ACTIVE',1,NULL,0,NULL,NULL,NULL,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(2,'产品推荐演练','针对不同客户需求进行产品推荐的实战演练','销售技巧',NULL,NULL,NULL,'ACTIVE',1,NULL,0,NULL,NULL,NULL,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(3,'投诉处理训练','模拟各种客户投诉情况,训练处理技巧和话术','客户服务',NULL,NULL,NULL,'ACTIVE',1,NULL,0,NULL,NULL,NULL,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(4,'项目操作指导','美容项目操作的标准流程指导和安全注意事项','技术指导',NULL,NULL,NULL,'ACTIVE',1,NULL,0,NULL,NULL,NULL,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(5,'团队管理讨论','管理岗位的团队建设和绩效管理讨论','管理培训',NULL,NULL,NULL,'ACTIVE',1,NULL,0,NULL,NULL,NULL,'2025-09-23 02:39:48','2025-09-23 02:39:48');
|
||||
/*!40000 ALTER TABLE `training_scenes` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `training_sessions`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `training_sessions`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `training_sessions` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`user_id` int NOT NULL COMMENT '用户ID',
|
||||
`scene_id` int NOT NULL COMMENT '场景ID',
|
||||
`coze_conversation_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Coze对话ID',
|
||||
`start_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '开始时间',
|
||||
`end_time` datetime DEFAULT NULL COMMENT '结束时间',
|
||||
`duration_seconds` int DEFAULT NULL COMMENT '持续时长(秒)',
|
||||
`status` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT 'active' COMMENT '会话状态',
|
||||
`session_config` json DEFAULT NULL COMMENT '会话配置',
|
||||
`total_score` decimal(5,2) DEFAULT NULL COMMENT '总分',
|
||||
`evaluation_result` json DEFAULT NULL COMMENT '评估结果详情',
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_user_id` (`user_id`),
|
||||
KEY `idx_scene_id` (`scene_id`),
|
||||
KEY `idx_status` (`status`),
|
||||
CONSTRAINT `training_sessions_ibfk_1` FOREIGN KEY (`scene_id`) REFERENCES `training_scenes` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='培训会话表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `training_sessions`
|
||||
--
|
||||
|
||||
LOCK TABLES `training_sessions` WRITE;
|
||||
/*!40000 ALTER TABLE `training_sessions` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `training_sessions` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `user_teams`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `user_teams`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `user_teams` (
|
||||
`user_id` int NOT NULL COMMENT '用户ID',
|
||||
`team_id` int NOT NULL COMMENT '团队ID',
|
||||
`role` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '在团队中的角色',
|
||||
`joined_at` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '加入时间',
|
||||
PRIMARY KEY (`user_id`,`team_id`),
|
||||
KEY `team_id` (`team_id`),
|
||||
CONSTRAINT `user_teams_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `user_teams_ibfk_2` FOREIGN KEY (`team_id`) REFERENCES `teams` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='用户团队关联表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `user_teams`
|
||||
--
|
||||
|
||||
LOCK TABLES `user_teams` WRITE;
|
||||
/*!40000 ALTER TABLE `user_teams` DISABLE KEYS */;
|
||||
INSERT INTO `user_teams` (`user_id`, `team_id`, `role`, `joined_at`) VALUES (1,1,'leader','2025-09-22 18:42:32'),(2,1,'member','2025-09-22 18:42:32'),(3,2,'leader','2025-09-22 18:42:32'),(4,3,'leader','2025-09-22 18:42:32'),(5,2,'member','2025-09-22 18:42:32'),(5,4,'member','2025-09-22 18:42:32'),(6,2,'member','2025-09-22 18:42:32'),(6,4,'member','2025-09-22 18:42:32'),(7,3,'member','2025-09-22 18:42:32'),(7,4,'member','2025-09-22 18:42:32'),(8,3,'member','2025-09-22 18:42:32'),(8,6,'member','2025-09-22 18:42:32');
|
||||
/*!40000 ALTER TABLE `user_teams` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `users`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `users`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `users` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`username` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '用户名',
|
||||
`email` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '邮箱',
|
||||
`phone` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '手机号',
|
||||
`password_hash` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '密码哈希',
|
||||
`full_name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '真实姓名',
|
||||
`gender` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '性别',
|
||||
`avatar_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '头像URL',
|
||||
`bio` text COLLATE utf8mb4_unicode_ci COMMENT '个人简介',
|
||||
`school` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '学校',
|
||||
`major` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '专业',
|
||||
`role` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'trainee' COMMENT '用户角色',
|
||||
`is_active` tinyint(1) DEFAULT '1' COMMENT '是否激活',
|
||||
`is_verified` tinyint(1) DEFAULT '0' COMMENT '是否验证',
|
||||
`last_login_at` datetime DEFAULT NULL COMMENT '最后登录时间',
|
||||
`password_changed_at` datetime DEFAULT NULL COMMENT '密码修改时间',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `username` (`username`),
|
||||
UNIQUE KEY `email` (`email`),
|
||||
UNIQUE KEY `phone` (`phone`),
|
||||
KEY `idx_role` (`role`),
|
||||
KEY `idx_is_active` (`is_active`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='用户信息表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `users`
|
||||
--
|
||||
|
||||
LOCK TABLES `users` WRITE;
|
||||
/*!40000 ALTER TABLE `users` DISABLE KEYS */;
|
||||
INSERT INTO `users` (`id`, `username`, `email`, `phone`, `password_hash`, `full_name`, `gender`, `avatar_url`, `bio`, `school`, `major`, `role`, `is_active`, `is_verified`, `last_login_at`, `password_changed_at`, `created_at`, `updated_at`, `is_deleted`, `deleted_at`) VALUES (1,'superadmin','superadmin@ruimei.com','13800138001','$2b$12$jFhkYU3.Cd1kAfr64/073eayPquAr0z9WWUQEdOyFRmAqcxz.i10C','超级管理员','male',NULL,'负责系统整体管理和运营','睿美医疗美容学院','医疗美容管理','admin',1,0,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(2,'admin','admin@ruimei.com','13800138002','$2b$12$jFhkYU3.Cd1kAfr64/073eayPquAr0z9WWUQEdOyFRmAqcxz.i10C','系统管理员','female',NULL,'负责日常系统管理工作','睿美医疗美容学院','医疗美容技术','admin',1,0,'2025-09-22 18:54:56',NULL,'2025-09-23 02:38:24','2025-09-22 18:54:56',0,NULL),(3,'manager_beijing','manager.bj@ruimei.com','13800138003','$2b$12$jFhkYU3.Cd1kAfr64/073eayPquAr0z9WWUQEdOyFRmAqcxz.i10C','北京区域经理','male',NULL,'负责北京地区门店管理','北京医科大学','临床医学','manager',1,0,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(4,'manager_shanghai','manager.sh@ruimei.com','13800138004','$2b$12$jFhkYU3.Cd1kAfr64/073eayPquAr0z9WWUQEdOyFRmAqcxz.i10C','上海区域经理','female',NULL,'负责上海地区门店管理','复旦大学医学院','医疗美容','manager',1,0,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(5,'consultant_001','consultant001@ruimei.com','13800138005','$2b$12$jFhkYU3.Cd1kAfr64/073eayPquAr0z9WWUQEdOyFRmAqcxz.i10C','资深美容顾问','female',NULL,'专业美容咨询师,5年从业经验','上海健康医学院','医疗美容技术','trainee',1,0,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(6,'nurse_001','nurse001@ruimei.com','13800138006','$2b$12$jFhkYU3.Cd1kAfr64/073eayPquAr0z9WWUQEdOyFRmAqcxz.i10C','美容护士','female',NULL,'持证美容护士,专业技术过硬','首都医科大学','护理学','trainee',1,0,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(7,'therapist_001','therapist001@ruimei.com','13800138007','$2b$12$jFhkYU3.Cd1kAfr64/073eayPquAr0z9WWUQEdOyFRmAqcxz.i10C','美容技师','female',NULL,'专业美容技师,擅长面部护理','北京卫生职业学院','医疗美容技术','trainee',1,0,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(8,'receptionist_001','front001@ruimei.com','13800138008','$2b$12$jFhkYU3.Cd1kAfr64/073eayPquAr0z9WWUQEdOyFRmAqcxz.i10C','前台接待','female',NULL,'负责客户接待和预约管理','北京商贸职业学院','商务管理','trainee',1,0,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL);
|
||||
/*!40000 ALTER TABLE `users` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Temporary view structure for view `v_user_course_progress`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `v_user_course_progress`;
|
||||
/*!50001 DROP VIEW IF EXISTS `v_user_course_progress`*/;
|
||||
SET @saved_cs_client = @@character_set_client;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
/*!50001 CREATE VIEW `v_user_course_progress` AS SELECT
|
||||
1 AS `user_id`,
|
||||
1 AS `username`,
|
||||
1 AS `course_id`,
|
||||
1 AS `course_name`,
|
||||
1 AS `exam_count`,
|
||||
1 AS `avg_score`,
|
||||
1 AS `best_score`*/;
|
||||
SET character_set_client = @saved_cs_client;
|
||||
|
||||
--
|
||||
-- Dumping events for database 'kaopeilian'
|
||||
--
|
||||
|
||||
--
|
||||
-- Dumping routines for database 'kaopeilian'
|
||||
--
|
||||
|
||||
--
|
||||
-- Final view structure for view `v_user_course_progress`
|
||||
--
|
||||
|
||||
/*!50001 DROP VIEW IF EXISTS `v_user_course_progress`*/;
|
||||
/*!50001 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50001 SET @saved_cs_results = @@character_set_results */;
|
||||
/*!50001 SET @saved_col_connection = @@collation_connection */;
|
||||
/*!50001 SET character_set_client = latin1 */;
|
||||
/*!50001 SET character_set_results = latin1 */;
|
||||
/*!50001 SET collation_connection = latin1_swedish_ci */;
|
||||
/*!50001 CREATE ALGORITHM=UNDEFINED */
|
||||
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
|
||||
/*!50001 VIEW `v_user_course_progress` AS select `u`.`id` AS `user_id`,`u`.`username` AS `username`,`c`.`id` AS `course_id`,`c`.`name` AS `course_name`,count(distinct `e`.`id`) AS `exam_count`,avg(`e`.`score`) AS `avg_score`,max(`e`.`score`) AS `best_score` from ((`users` `u` join `courses` `c`) left join `exams` `e` on(((`e`.`user_id` = `u`.`id`) and (`e`.`course_id` = `c`.`id`) and (`e`.`status` = 'submitted')))) group by `u`.`id`,`c`.`id` */;
|
||||
/*!50001 SET character_set_client = @saved_cs_client */;
|
||||
/*!50001 SET character_set_results = @saved_cs_results */;
|
||||
/*!50001 SET collation_connection = @saved_col_connection */;
|
||||
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
|
||||
|
||||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
||||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
||||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
-- Dump completed on 2025-09-22 18:55:48
|
||||
@@ -0,0 +1,821 @@
|
||||
-- MySQL dump 10.13 Distrib 8.0.43, for Linux (aarch64)
|
||||
--
|
||||
-- Host: localhost Database: kaopeilian
|
||||
-- ------------------------------------------------------
|
||||
-- Server version 8.0.43
|
||||
|
||||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
||||
/*!50503 SET NAMES utf8mb4 */;
|
||||
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
|
||||
/*!40103 SET TIME_ZONE='+00:00' */;
|
||||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
|
||||
--
|
||||
-- Table structure for table `course_exam_settings`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `course_exam_settings`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `course_exam_settings` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`course_id` int NOT NULL COMMENT '课程ID',
|
||||
`single_choice_count` int NOT NULL DEFAULT '10' COMMENT '单选题数量',
|
||||
`multiple_choice_count` int NOT NULL DEFAULT '5' COMMENT '多选题数量',
|
||||
`true_false_count` int NOT NULL DEFAULT '5' COMMENT '判断题数量',
|
||||
`fill_blank_count` int NOT NULL DEFAULT '0' COMMENT '填空题数量',
|
||||
`duration_minutes` int NOT NULL DEFAULT '60' COMMENT '考试时长(分钟)',
|
||||
`difficulty_level` int NOT NULL DEFAULT '3' COMMENT '难度系数(1-5)',
|
||||
`passing_score` int NOT NULL DEFAULT '60' COMMENT '及格分数',
|
||||
`is_enabled` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是否启用',
|
||||
`show_answer_immediately` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否立即显示答案',
|
||||
`allow_retake` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是否允许重考',
|
||||
`max_retake_times` int DEFAULT NULL COMMENT '最大重考次数',
|
||||
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`is_deleted` tinyint(1) NOT NULL DEFAULT '0',
|
||||
`deleted_at` datetime DEFAULT NULL,
|
||||
`deleted_by` int DEFAULT NULL COMMENT '删除人ID',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `course_id` (`course_id`),
|
||||
KEY `ix_course_exam_settings_id` (`id`),
|
||||
CONSTRAINT `course_exam_settings_ibfk_1` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='课程考试设置表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `course_exam_settings`
|
||||
--
|
||||
|
||||
LOCK TABLES `course_exam_settings` WRITE;
|
||||
/*!40000 ALTER TABLE `course_exam_settings` DISABLE KEYS */;
|
||||
INSERT INTO `course_exam_settings` VALUES (1,1,5,3,2,0,60,2,80,1,1,1,3,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(2,2,4,2,2,2,45,1,75,1,1,1,3,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(3,3,3,2,3,2,50,2,80,1,0,1,2,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(4,4,4,3,2,1,55,2,85,1,1,1,3,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(5,5,5,2,2,1,40,1,70,1,1,1,5,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(6,6,3,2,3,2,45,1,75,1,1,1,3,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(7,7,4,2,2,2,50,2,80,1,0,1,2,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(8,8,5,3,2,0,60,3,85,1,1,1,2,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(9,9,4,2,4,0,50,2,80,1,1,1,3,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(10,10,3,2,3,2,45,1,75,1,1,1,3,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(11,11,5,3,2,0,60,3,90,1,0,1,2,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(12,12,4,2,4,0,40,1,70,1,1,1,5,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL);
|
||||
/*!40000 ALTER TABLE `course_exam_settings` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `course_materials`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `course_materials`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `course_materials` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`course_id` int NOT NULL COMMENT '所属课程ID',
|
||||
`name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '资料名称',
|
||||
`description` text COLLATE utf8mb4_unicode_ci COMMENT '资料描述',
|
||||
`file_url` varchar(500) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '文件URL',
|
||||
`file_type` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '文件类型',
|
||||
`file_size` int NOT NULL COMMENT '文件大小(字节)',
|
||||
`sort_order` int DEFAULT '0' COMMENT '排序序号',
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_course_id` (`course_id`),
|
||||
KEY `idx_is_deleted` (`is_deleted`),
|
||||
CONSTRAINT `course_materials_ibfk_1` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='课程资料表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `course_materials`
|
||||
--
|
||||
|
||||
LOCK TABLES `course_materials` WRITE;
|
||||
/*!40000 ALTER TABLE `course_materials` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `course_materials` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `courses`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `courses`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `courses` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '课程名称',
|
||||
`description` text COLLATE utf8mb4_unicode_ci COMMENT '课程描述',
|
||||
`category` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '课程分类',
|
||||
`status` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT 'draft' COMMENT '课程状态',
|
||||
`cover_image` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '封面图片',
|
||||
`duration_hours` decimal(5,2) DEFAULT NULL COMMENT '课程时长(小时)',
|
||||
`difficulty_level` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '难度等级',
|
||||
`tags` json DEFAULT NULL COMMENT '标签列表',
|
||||
`published_at` datetime DEFAULT NULL COMMENT '发布时间',
|
||||
`publisher_id` int DEFAULT NULL COMMENT '发布人ID',
|
||||
`sort_order` int DEFAULT '0' COMMENT '排序',
|
||||
`is_featured` tinyint(1) DEFAULT '0' COMMENT '是否推荐',
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_status` (`status`),
|
||||
KEY `idx_category` (`category`),
|
||||
KEY `idx_is_featured` (`is_featured`),
|
||||
KEY `idx_is_deleted` (`is_deleted`),
|
||||
KEY `idx_sort_order` (`sort_order`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='课程信息表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `courses`
|
||||
--
|
||||
|
||||
LOCK TABLES `courses` WRITE;
|
||||
/*!40000 ALTER TABLE `courses` DISABLE KEYS */;
|
||||
INSERT INTO `courses` VALUES (1,'皮肤生理学基础','学习皮肤结构、功能和常见问题,为专业护理打下坚实基础','technology','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(2,'医美产品知识与应用','全面了解各类医美产品的成分、功效和适用人群,掌握产品推荐技巧','technology','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(3,'美容仪器操作与维护','掌握各类美容仪器的操作方法、注意事项和日常维护保养','technology','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(4,'医美项目介绍与咨询','详细了解各类医美项目的原理、效果和适应症,提升咨询专业度','business','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(5,'轻医美销售技巧','学习专业的销售话术、客户需求分析和成交技巧,提升业绩能力','business','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(6,'客户服务与投诉处理','提升服务意识,掌握客户投诉处理的方法和技巧,维护品牌形象','management','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(7,'社媒营销与私域运营','学习如何通过社交媒体进行品牌推广和客户维护,建立私域流量','business','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(8,'门店运营管理','学习门店日常管理、团队建设和业绩管理的方法和技巧','management','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(9,'卫生消毒与感染控制','学习医美机构的卫生标准和消毒流程,确保服务安全合规','general','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(10,'美容心理学','了解客户心理需求,掌握沟通技巧,提升服务满意度','general','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(11,'法律法规与行业规范','学习医美行业相关法律法规,确保合规经营','general','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(12,'新员工入职培训','新员工必修课程,包含企业文化、基础知识和操作规范','general','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24');
|
||||
/*!40000 ALTER TABLE `courses` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `exam_results`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `exam_results`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `exam_results` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`exam_id` int NOT NULL COMMENT '考试ID',
|
||||
`question_id` int NOT NULL COMMENT '题目ID',
|
||||
`user_answer` json DEFAULT NULL COMMENT '用户答案',
|
||||
`is_correct` tinyint(1) NOT NULL COMMENT '是否正确',
|
||||
`score` decimal(5,2) NOT NULL COMMENT '考试得分',
|
||||
`answer_time` int DEFAULT NULL COMMENT '答题时长(秒)',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_exam_id` (`exam_id`),
|
||||
KEY `idx_question_id` (`question_id`),
|
||||
CONSTRAINT `exam_results_ibfk_1` FOREIGN KEY (`exam_id`) REFERENCES `exams` (`id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `exam_results_ibfk_2` FOREIGN KEY (`question_id`) REFERENCES `questions` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='考试结果表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `exam_results`
|
||||
--
|
||||
|
||||
LOCK TABLES `exam_results` WRITE;
|
||||
/*!40000 ALTER TABLE `exam_results` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `exam_results` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `exams`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `exams`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `exams` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`user_id` int NOT NULL COMMENT '用户ID',
|
||||
`course_id` int NOT NULL COMMENT '课程ID',
|
||||
`exam_name` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '考试名称',
|
||||
`question_count` int DEFAULT NULL COMMENT '题目数量',
|
||||
`total_score` decimal(5,2) DEFAULT NULL COMMENT '总分',
|
||||
`pass_score` decimal(5,2) DEFAULT NULL COMMENT '及格分',
|
||||
`start_time` datetime DEFAULT NULL COMMENT '开始时间',
|
||||
`end_time` datetime DEFAULT NULL COMMENT '结束时间',
|
||||
`duration_minutes` int DEFAULT NULL COMMENT '考试时长(分钟)',
|
||||
`score` decimal(5,2) DEFAULT NULL COMMENT '得分',
|
||||
`is_passed` tinyint(1) DEFAULT '0' COMMENT '是否通过',
|
||||
`status` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT 'pending' COMMENT '考试状态',
|
||||
`questions` json DEFAULT NULL COMMENT '题目数据(JSON格式)',
|
||||
`answers` json DEFAULT NULL COMMENT '答案数据(JSON格式)',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_user_id` (`user_id`),
|
||||
KEY `idx_course_id` (`course_id`),
|
||||
KEY `idx_status` (`status`),
|
||||
CONSTRAINT `exams_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `exams_ibfk_2` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='考试记录表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `exams`
|
||||
--
|
||||
|
||||
LOCK TABLES `exams` WRITE;
|
||||
/*!40000 ALTER TABLE `exams` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `exams` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `growth_paths`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `growth_paths`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `growth_paths` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '成长路径名称',
|
||||
`description` text COLLATE utf8mb4_unicode_ci COMMENT '路径描述',
|
||||
`target_role` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '目标角色',
|
||||
`courses` json DEFAULT NULL COMMENT '课程列表',
|
||||
`estimated_duration_days` int DEFAULT NULL COMMENT '预计完成天数',
|
||||
`is_active` tinyint(1) DEFAULT '1' COMMENT '是否启用',
|
||||
`sort_order` int DEFAULT '0' COMMENT '排序顺序',
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_is_active` (`is_active`),
|
||||
KEY `idx_is_deleted` (`is_deleted`),
|
||||
KEY `idx_sort_order` (`sort_order`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='成长路径表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `growth_paths`
|
||||
--
|
||||
|
||||
LOCK TABLES `growth_paths` WRITE;
|
||||
/*!40000 ALTER TABLE `growth_paths` DISABLE KEYS */;
|
||||
INSERT INTO `growth_paths` VALUES (1,'美容顾问成长路径','从初级美容顾问到资深顾问的完整成长路径,包含专业技能和销售能力提升','资深美容顾问',NULL,NULL,1,0,0,NULL,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(2,'美容技师进阶路径','美容技师的技能进阶路径,从基础护理到高级项目操作','高级美容技师',NULL,NULL,1,0,0,NULL,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(3,'管理岗位培养路径','从一线员工到管理岗位的培养路径,包含领导力和管理技能','店长/区域经理',NULL,NULL,1,0,0,NULL,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(4,'医美咨询师专业路径','医美咨询师的专业发展路径,深度掌握医美项目知识','资深医美咨询师',NULL,NULL,1,0,0,NULL,'2025-09-23 02:39:48','2025-09-23 02:39:48');
|
||||
/*!40000 ALTER TABLE `growth_paths` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `knowledge_points`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `knowledge_points`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `knowledge_points` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`course_id` int DEFAULT NULL COMMENT '所属课程ID',
|
||||
`name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '知识点名称',
|
||||
`description` text COLLATE utf8mb4_unicode_ci COMMENT '知识点描述',
|
||||
`parent_id` int DEFAULT NULL COMMENT '父知识点ID',
|
||||
`level` int DEFAULT '1' COMMENT '层级深度',
|
||||
`path` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '知识点路径',
|
||||
`sort_order` int DEFAULT '0' COMMENT '排序顺序',
|
||||
`weight` decimal(3,2) DEFAULT '1.00' COMMENT '权重',
|
||||
`is_required` tinyint(1) DEFAULT '1' COMMENT '是否必修',
|
||||
`estimated_hours` decimal(4,2) DEFAULT NULL COMMENT '预计学习时间(小时)',
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_course_id` (`course_id`),
|
||||
KEY `idx_parent_id` (`parent_id`),
|
||||
KEY `idx_is_deleted` (`is_deleted`),
|
||||
KEY `idx_sort_order` (`sort_order`),
|
||||
CONSTRAINT `knowledge_points_ibfk_1` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `knowledge_points_ibfk_2` FOREIGN KEY (`parent_id`) REFERENCES `knowledge_points` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='知识点表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `knowledge_points`
|
||||
--
|
||||
|
||||
LOCK TABLES `knowledge_points` WRITE;
|
||||
/*!40000 ALTER TABLE `knowledge_points` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `knowledge_points` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `material_knowledge_points`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `material_knowledge_points`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `material_knowledge_points` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`material_id` int NOT NULL COMMENT '资料ID',
|
||||
`knowledge_point_id` int NOT NULL COMMENT '知识点ID',
|
||||
`sort_order` int DEFAULT '0' COMMENT '排序顺序',
|
||||
`is_ai_generated` tinyint(1) DEFAULT '0' COMMENT '是否AI生成',
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `idx_material_knowledge` (`material_id`,`knowledge_point_id`),
|
||||
KEY `idx_material_id` (`material_id`),
|
||||
KEY `idx_knowledge_point_id` (`knowledge_point_id`),
|
||||
CONSTRAINT `material_knowledge_points_ibfk_1` FOREIGN KEY (`material_id`) REFERENCES `course_materials` (`id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `material_knowledge_points_ibfk_2` FOREIGN KEY (`knowledge_point_id`) REFERENCES `knowledge_points` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='资料知识点关联表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `material_knowledge_points`
|
||||
--
|
||||
|
||||
LOCK TABLES `material_knowledge_points` WRITE;
|
||||
/*!40000 ALTER TABLE `material_knowledge_points` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `material_knowledge_points` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `position_courses`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `position_courses`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `position_courses` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`position_id` int NOT NULL COMMENT '岗位ID',
|
||||
`course_id` int NOT NULL COMMENT '课程ID',
|
||||
`course_type` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'required' COMMENT '课程类型(必修/选修)',
|
||||
`priority` int DEFAULT '0' COMMENT '优先级',
|
||||
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`is_deleted` tinyint(1) NOT NULL DEFAULT '0',
|
||||
`deleted_at` datetime DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uix_position_course` (`position_id`,`course_id`,`is_deleted`),
|
||||
KEY `course_id` (`course_id`),
|
||||
KEY `ix_position_courses_id` (`id`),
|
||||
CONSTRAINT `position_courses_ibfk_1` FOREIGN KEY (`position_id`) REFERENCES `positions` (`id`),
|
||||
CONSTRAINT `position_courses_ibfk_2` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='岗位课程关联表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `position_courses`
|
||||
--
|
||||
|
||||
LOCK TABLES `position_courses` WRITE;
|
||||
/*!40000 ALTER TABLE `position_courses` DISABLE KEYS */;
|
||||
INSERT INTO `position_courses` VALUES (1,1,6,'required',1,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(2,1,8,'required',2,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(3,1,11,'required',3,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(4,1,12,'required',4,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(5,3,1,'required',1,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(6,3,2,'required',2,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(7,3,5,'required',3,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(8,3,6,'required',4,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(9,3,10,'required',5,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(10,3,12,'required',6,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(11,4,1,'required',1,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(12,4,2,'required',2,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(13,4,4,'required',3,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(14,4,5,'required',4,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(15,4,9,'required',5,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(16,4,12,'required',6,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(17,5,1,'required',1,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(18,5,2,'required',2,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(19,5,3,'required',3,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(20,5,9,'required',4,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(21,5,12,'required',5,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(22,7,6,'required',1,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(23,7,10,'required',2,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(24,7,12,'required',3,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL);
|
||||
/*!40000 ALTER TABLE `position_courses` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `position_members`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `position_members`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `position_members` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`position_id` int NOT NULL COMMENT '岗位ID',
|
||||
`user_id` int NOT NULL COMMENT '用户ID',
|
||||
`role` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '在岗位中的角色',
|
||||
`joined_at` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '加入时间',
|
||||
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`is_deleted` tinyint(1) NOT NULL DEFAULT '0',
|
||||
`deleted_at` datetime DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uix_position_user` (`position_id`,`user_id`,`is_deleted`),
|
||||
KEY `user_id` (`user_id`),
|
||||
KEY `ix_position_members_id` (`id`),
|
||||
CONSTRAINT `position_members_ibfk_1` FOREIGN KEY (`position_id`) REFERENCES `positions` (`id`),
|
||||
CONSTRAINT `position_members_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='岗位成员关联表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `position_members`
|
||||
--
|
||||
|
||||
LOCK TABLES `position_members` WRITE;
|
||||
/*!40000 ALTER TABLE `position_members` DISABLE KEYS */;
|
||||
INSERT INTO `position_members` VALUES (1,1,3,NULL,'2025-09-22 18:42:32','2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(2,1,4,NULL,'2025-09-22 18:42:32','2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(3,3,5,NULL,'2025-09-22 18:42:32','2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(4,4,6,NULL,'2025-09-22 18:42:32','2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(5,5,7,NULL,'2025-09-22 18:42:32','2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(6,7,8,NULL,'2025-09-22 18:42:32','2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL);
|
||||
/*!40000 ALTER TABLE `position_members` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `positions`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `positions`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `positions` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '岗位名称',
|
||||
`code` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '岗位代码',
|
||||
`description` text COLLATE utf8mb4_unicode_ci COMMENT '岗位描述',
|
||||
`parent_id` int DEFAULT NULL COMMENT '上级岗位ID',
|
||||
`status` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT 'active' COMMENT '岗位状态',
|
||||
`skills` json DEFAULT NULL COMMENT '核心技能',
|
||||
`level` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '岗位级别',
|
||||
`sort_order` int DEFAULT '0' COMMENT '排序',
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `code` (`code`),
|
||||
KEY `parent_id` (`parent_id`),
|
||||
KEY `idx_positions_name` (`name`),
|
||||
CONSTRAINT `positions_ibfk_1` FOREIGN KEY (`parent_id`) REFERENCES `positions` (`id`) ON DELETE SET NULL
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='岗位信息表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `positions`
|
||||
--
|
||||
|
||||
LOCK TABLES `positions` WRITE;
|
||||
/*!40000 ALTER TABLE `positions` DISABLE KEYS */;
|
||||
INSERT INTO `positions` VALUES (1,'区域经理','region_manager','负责多家门店的运营管理和业绩达成,制定区域发展战略',NULL,'active',NULL,'expert',0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(2,'店长','store_manager','负责门店日常运营管理,团队建设和业绩达成',NULL,'active',NULL,'senior',0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(3,'美容顾问','beauty_consultant','为客户提供专业的美容咨询和个性化方案设计',NULL,'active',NULL,'intermediate',0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(4,'医美咨询师','medical_beauty_consultant','提供医疗美容项目咨询和专业方案制定',NULL,'active',NULL,'senior',0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(5,'美容技师','beauty_therapist','为客户提供专业的美容护理和技术服务',NULL,'active',NULL,'intermediate',0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(6,'美容护士','beauty_nurse','协助医生进行医美项目操作,负责术后护理指导',NULL,'active',NULL,'intermediate',0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(7,'前台接待','receptionist','负责客户接待、预约管理和前台事务处理',NULL,'active',NULL,'junior',0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(8,'市场专员','marketing_specialist','负责门店营销活动策划、执行和客户维护',NULL,'active',NULL,'intermediate',0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24');
|
||||
/*!40000 ALTER TABLE `positions` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `questions`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `questions`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `questions` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`course_id` int NOT NULL COMMENT '所属课程ID',
|
||||
`question_type` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '题目类型',
|
||||
`title` text COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '题目标题',
|
||||
`content` text COLLATE utf8mb4_unicode_ci COMMENT '题目内容',
|
||||
`options` json DEFAULT NULL COMMENT '选项内容',
|
||||
`correct_answer` text COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '正确答案',
|
||||
`explanation` text COLLATE utf8mb4_unicode_ci COMMENT '答案解析',
|
||||
`score` float DEFAULT '10' COMMENT '题目分值',
|
||||
`difficulty` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT 'medium' COMMENT '难度等级',
|
||||
`tags` json DEFAULT NULL COMMENT '题目标签',
|
||||
`usage_count` int DEFAULT '0' COMMENT '使用次数',
|
||||
`correct_count` int DEFAULT '0' COMMENT '答对次数',
|
||||
`is_active` tinyint(1) DEFAULT '1' COMMENT '是否启用',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_course_id` (`course_id`),
|
||||
KEY `idx_question_type` (`question_type`),
|
||||
KEY `idx_difficulty` (`difficulty`),
|
||||
KEY `idx_is_active` (`is_active`),
|
||||
CONSTRAINT `questions_ibfk_1` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='题目表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `questions`
|
||||
--
|
||||
|
||||
LOCK TABLES `questions` WRITE;
|
||||
/*!40000 ALTER TABLE `questions` DISABLE KEYS */;
|
||||
INSERT INTO `questions` VALUES (1,1,'single_choice','皮肤的最外层是什么?',NULL,'[{\"text\": \"表皮\", \"label\": \"A\"}, {\"text\": \"真皮\", \"label\": \"B\"}, {\"text\": \"皮下组织\", \"label\": \"C\"}, {\"text\": \"角质层\", \"label\": \"D\"}]','A','A选项是表皮,这是皮肤的最外层,起到保护作用',10,'easy',NULL,0,0,1,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(2,2,'single_choice','透明质酸的主要功效是什么?',NULL,'[{\"text\": \"美白淡斑\", \"label\": \"A\"}, {\"text\": \"保湿补水\", \"label\": \"B\"}, {\"text\": \"紧致提升\", \"label\": \"C\"}, {\"text\": \"去除皱纹\", \"label\": \"D\"}]','B','B选项是保湿补水,透明质酸具有强大的保湿能力',10,'easy',NULL,0,0,1,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(3,3,'multiple_choice','射频美容仪的禁忌症包括哪些?',NULL,'[{\"text\": \"孕期和哺乳期\", \"label\": \"A\"}, {\"text\": \"皮肤过敏\", \"label\": \"B\"}, {\"text\": \"心脏起搏器\", \"label\": \"C\"}, {\"text\": \"轻微痤疮\", \"label\": \"D\"}]','A,C','A和C选项都是射频美容仪的禁忌症,需要特别注意',15,'medium',NULL,0,0,1,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(4,4,'true_false','水光针适合所有肤质的客户',NULL,'[{\"text\": \"正确\", \"label\": \"A\"}, {\"text\": \"错误\", \"label\": \"B\"}]','B','水光针虽然适用范围广,但仍有一些禁忌症和不适合的肤质',10,'easy',NULL,0,0,1,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(5,4,'fill_blank','肉毒素注射后____小时内不能平躺','肉毒素注射后【】小时内不能平躺,以免影响药物分布效果。',NULL,'4','肉毒素注射后4小时内不能平躺,以免影响药物分布',10,'medium',NULL,0,0,1,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(6,5,'single_choice','客户咨询时最重要的是什么?',NULL,'[{\"text\": \"倾听客户需求\", \"label\": \"A\"}, {\"text\": \"推荐最贵的产品\", \"label\": \"B\"}, {\"text\": \"快速成交\", \"label\": \"C\"}, {\"text\": \"展示专业知识\", \"label\": \"D\"}]','A','A选项是倾听客户需求,这是专业咨询的基础',10,'easy',NULL,0,0,1,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(7,6,'single_choice','处理客户投诉的第一步是什么?',NULL,'[{\"text\": \"解释原因\", \"label\": \"A\"}, {\"text\": \"耐心倾听\", \"label\": \"B\"}, {\"text\": \"提供补偿\", \"label\": \"C\"}, {\"text\": \"转交上级\", \"label\": \"D\"}]','B','B选项是耐心倾听,让客户充分表达不满是处理投诉的第一步',10,'easy',NULL,0,0,1,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(8,7,'true_false','社交媒体营销只需要发布产品信息',NULL,'[{\"text\": \"正确\", \"label\": \"A\"}, {\"text\": \"错误\", \"label\": \"B\"}]','B','社交媒体营销需要内容多样化,包括教育内容、互动内容等',10,'easy',NULL,0,0,1,'2025-09-23 02:39:48','2025-09-23 02:39:48');
|
||||
/*!40000 ALTER TABLE `questions` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `teams`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `teams`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `teams` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '团队名称',
|
||||
`code` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '团队代码',
|
||||
`description` text COLLATE utf8mb4_unicode_ci COMMENT '团队描述',
|
||||
`team_type` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '团队类型',
|
||||
`is_active` tinyint(1) DEFAULT '1' COMMENT '是否激活',
|
||||
`leader_id` int DEFAULT NULL COMMENT '负责人ID',
|
||||
`parent_id` int DEFAULT NULL COMMENT '父团队ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `name` (`name`),
|
||||
UNIQUE KEY `code` (`code`),
|
||||
KEY `leader_id` (`leader_id`),
|
||||
KEY `parent_id` (`parent_id`),
|
||||
KEY `idx_team_type` (`team_type`),
|
||||
KEY `idx_is_active` (`is_active`),
|
||||
CONSTRAINT `teams_ibfk_1` FOREIGN KEY (`leader_id`) REFERENCES `users` (`id`) ON DELETE SET NULL,
|
||||
CONSTRAINT `teams_ibfk_2` FOREIGN KEY (`parent_id`) REFERENCES `teams` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='团队信息表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `teams`
|
||||
--
|
||||
|
||||
LOCK TABLES `teams` WRITE;
|
||||
/*!40000 ALTER TABLE `teams` DISABLE KEYS */;
|
||||
INSERT INTO `teams` VALUES (1,'管理层','MANAGEMENT','负责公司整体战略规划和运营管理','department',1,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(2,'北京运营团队','BJ_OPERATIONS','负责北京地区所有门店的运营管理','department',1,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(3,'上海运营团队','SH_OPERATIONS','负责上海地区所有门店的运营管理','department',1,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(4,'技术培训部','TECH_TRAINING','负责员工技术培训和考核','department',1,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(5,'客服质量部','QUALITY_SERVICE','负责客户服务质量监督和改进','department',1,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(6,'新员工培训小组','NEW_EMPLOYEE_TRAINING','专门负责新员工入职培训','study_group',1,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL);
|
||||
/*!40000 ALTER TABLE `teams` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `training_messages`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `training_messages`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `training_messages` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`session_id` int NOT NULL COMMENT '会话ID',
|
||||
`role` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '消息角色',
|
||||
`type` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '消息类型',
|
||||
`content` text COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '消息内容',
|
||||
`voice_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '语音文件URL',
|
||||
`voice_duration` int DEFAULT NULL COMMENT '语音时长(秒)',
|
||||
`message_metadata` json DEFAULT NULL COMMENT '消息元数据',
|
||||
`coze_message_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Coze消息ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_session_id` (`session_id`),
|
||||
KEY `idx_role` (`role`),
|
||||
CONSTRAINT `training_messages_ibfk_1` FOREIGN KEY (`session_id`) REFERENCES `training_sessions` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='培训消息表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `training_messages`
|
||||
--
|
||||
|
||||
LOCK TABLES `training_messages` WRITE;
|
||||
/*!40000 ALTER TABLE `training_messages` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `training_messages` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `training_reports`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `training_reports`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `training_reports` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`session_id` int NOT NULL COMMENT '会话ID',
|
||||
`user_id` int NOT NULL COMMENT '用户ID',
|
||||
`overall_score` decimal(5,2) DEFAULT NULL COMMENT '总体评分',
|
||||
`dimension_scores` json DEFAULT NULL COMMENT '各维度得分',
|
||||
`strengths` text COLLATE utf8mb4_unicode_ci COMMENT '优势点',
|
||||
`weaknesses` text COLLATE utf8mb4_unicode_ci COMMENT '待改进点',
|
||||
`suggestions` text COLLATE utf8mb4_unicode_ci COMMENT '改进建议',
|
||||
`detailed_analysis` text COLLATE utf8mb4_unicode_ci COMMENT '详细分析',
|
||||
`transcript` text COLLATE utf8mb4_unicode_ci COMMENT '对话记录',
|
||||
`statistics` json DEFAULT NULL COMMENT '统计数据',
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `session_id` (`session_id`),
|
||||
KEY `idx_user_id` (`user_id`),
|
||||
CONSTRAINT `training_reports_ibfk_1` FOREIGN KEY (`session_id`) REFERENCES `training_sessions` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='培训报告表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `training_reports`
|
||||
--
|
||||
|
||||
LOCK TABLES `training_reports` WRITE;
|
||||
/*!40000 ALTER TABLE `training_reports` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `training_reports` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `training_scenes`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `training_scenes`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `training_scenes` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '场景名称',
|
||||
`description` text COLLATE utf8mb4_unicode_ci COMMENT '场景描述',
|
||||
`category` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '场景分类',
|
||||
`ai_config` json DEFAULT NULL COMMENT 'AI配置',
|
||||
`prompt_template` text COLLATE utf8mb4_unicode_ci COMMENT '提示模板',
|
||||
`evaluation_criteria` json DEFAULT NULL COMMENT '评估标准',
|
||||
`status` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT 'active' COMMENT '场景状态',
|
||||
`is_public` tinyint(1) DEFAULT '1' COMMENT '是否公开',
|
||||
`required_level` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '所需用户等级',
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_status` (`status`),
|
||||
KEY `idx_category` (`category`),
|
||||
KEY `idx_is_public` (`is_public`),
|
||||
KEY `idx_is_deleted` (`is_deleted`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='培训场景表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `training_scenes`
|
||||
--
|
||||
|
||||
LOCK TABLES `training_scenes` WRITE;
|
||||
/*!40000 ALTER TABLE `training_scenes` DISABLE KEYS */;
|
||||
INSERT INTO `training_scenes` VALUES (1,'客户咨询模拟','模拟真实的客户咨询场景,练习专业咨询技巧','客户服务',NULL,NULL,NULL,'ACTIVE',1,NULL,0,NULL,NULL,NULL,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(2,'产品推荐演练','针对不同客户需求进行产品推荐的实战演练','销售技巧',NULL,NULL,NULL,'ACTIVE',1,NULL,0,NULL,NULL,NULL,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(3,'投诉处理训练','模拟各种客户投诉情况,训练处理技巧和话术','客户服务',NULL,NULL,NULL,'ACTIVE',1,NULL,0,NULL,NULL,NULL,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(4,'项目操作指导','美容项目操作的标准流程指导和安全注意事项','技术指导',NULL,NULL,NULL,'ACTIVE',1,NULL,0,NULL,NULL,NULL,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(5,'团队管理讨论','管理岗位的团队建设和绩效管理讨论','管理培训',NULL,NULL,NULL,'ACTIVE',1,NULL,0,NULL,NULL,NULL,'2025-09-23 02:39:48','2025-09-23 02:39:48');
|
||||
/*!40000 ALTER TABLE `training_scenes` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `training_sessions`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `training_sessions`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `training_sessions` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`user_id` int NOT NULL COMMENT '用户ID',
|
||||
`scene_id` int NOT NULL COMMENT '场景ID',
|
||||
`coze_conversation_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Coze对话ID',
|
||||
`start_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '开始时间',
|
||||
`end_time` datetime DEFAULT NULL COMMENT '结束时间',
|
||||
`duration_seconds` int DEFAULT NULL COMMENT '持续时长(秒)',
|
||||
`status` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT 'active' COMMENT '会话状态',
|
||||
`session_config` json DEFAULT NULL COMMENT '会话配置',
|
||||
`total_score` decimal(5,2) DEFAULT NULL COMMENT '总分',
|
||||
`evaluation_result` json DEFAULT NULL COMMENT '评估结果详情',
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_user_id` (`user_id`),
|
||||
KEY `idx_scene_id` (`scene_id`),
|
||||
KEY `idx_status` (`status`),
|
||||
CONSTRAINT `training_sessions_ibfk_1` FOREIGN KEY (`scene_id`) REFERENCES `training_scenes` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='培训会话表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `training_sessions`
|
||||
--
|
||||
|
||||
LOCK TABLES `training_sessions` WRITE;
|
||||
/*!40000 ALTER TABLE `training_sessions` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `training_sessions` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `user_teams`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `user_teams`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `user_teams` (
|
||||
`user_id` int NOT NULL COMMENT '用户ID',
|
||||
`team_id` int NOT NULL COMMENT '团队ID',
|
||||
`role` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '在团队中的角色',
|
||||
`joined_at` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '加入时间',
|
||||
PRIMARY KEY (`user_id`,`team_id`),
|
||||
KEY `team_id` (`team_id`),
|
||||
CONSTRAINT `user_teams_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `user_teams_ibfk_2` FOREIGN KEY (`team_id`) REFERENCES `teams` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='用户团队关联表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `user_teams`
|
||||
--
|
||||
|
||||
LOCK TABLES `user_teams` WRITE;
|
||||
/*!40000 ALTER TABLE `user_teams` DISABLE KEYS */;
|
||||
INSERT INTO `user_teams` VALUES (1,1,'leader','2025-09-22 18:42:32'),(2,1,'member','2025-09-22 18:42:32'),(3,2,'leader','2025-09-22 18:42:32'),(4,3,'leader','2025-09-22 18:42:32'),(5,2,'member','2025-09-22 18:42:32'),(5,4,'member','2025-09-22 18:42:32'),(6,2,'member','2025-09-22 18:42:32'),(6,4,'member','2025-09-22 18:42:32'),(7,3,'member','2025-09-22 18:42:32'),(7,4,'member','2025-09-22 18:42:32'),(8,3,'member','2025-09-22 18:42:32'),(8,6,'member','2025-09-22 18:42:32');
|
||||
/*!40000 ALTER TABLE `user_teams` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `users`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `users`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `users` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`username` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '用户名',
|
||||
`email` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '邮箱',
|
||||
`phone` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '手机号',
|
||||
`password_hash` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '密码哈希',
|
||||
`full_name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '真实姓名',
|
||||
`gender` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '性别',
|
||||
`avatar_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '头像URL',
|
||||
`bio` text COLLATE utf8mb4_unicode_ci COMMENT '个人简介',
|
||||
`school` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '学校',
|
||||
`major` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '专业',
|
||||
`role` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'trainee' COMMENT '用户角色',
|
||||
`is_active` tinyint(1) DEFAULT '1' COMMENT '是否激活',
|
||||
`is_verified` tinyint(1) DEFAULT '0' COMMENT '是否验证',
|
||||
`last_login_at` datetime DEFAULT NULL COMMENT '最后登录时间',
|
||||
`password_changed_at` datetime DEFAULT NULL COMMENT '密码修改时间',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `username` (`username`),
|
||||
UNIQUE KEY `email` (`email`),
|
||||
UNIQUE KEY `phone` (`phone`),
|
||||
KEY `idx_role` (`role`),
|
||||
KEY `idx_is_active` (`is_active`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='用户信息表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `users`
|
||||
--
|
||||
|
||||
LOCK TABLES `users` WRITE;
|
||||
/*!40000 ALTER TABLE `users` DISABLE KEYS */;
|
||||
INSERT INTO `users` VALUES (1,'superadmin','superadmin@ruimei.com','13800138001','$2b$12$jFhkYU3.Cd1kAfr64/073eayPquAr0z9WWUQEdOyFRmAqcxz.i10C','超级管理员','male',NULL,'负责系统整体管理和运营','睿美医疗美容学院','医疗美容管理','admin',1,0,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(2,'admin','admin@ruimei.com','13800138002','$2b$12$jFhkYU3.Cd1kAfr64/073eayPquAr0z9WWUQEdOyFRmAqcxz.i10C','系统管理员','female',NULL,'负责日常系统管理工作','睿美医疗美容学院','医疗美容技术','admin',1,0,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(3,'manager_beijing','manager.bj@ruimei.com','13800138003','$2b$12$jFhkYU3.Cd1kAfr64/073eayPquAr0z9WWUQEdOyFRmAqcxz.i10C','北京区域经理','male',NULL,'负责北京地区门店管理','北京医科大学','临床医学','manager',1,0,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(4,'manager_shanghai','manager.sh@ruimei.com','13800138004','$2b$12$jFhkYU3.Cd1kAfr64/073eayPquAr0z9WWUQEdOyFRmAqcxz.i10C','上海区域经理','female',NULL,'负责上海地区门店管理','复旦大学医学院','医疗美容','manager',1,0,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(5,'consultant_001','consultant001@ruimei.com','13800138005','$2b$12$jFhkYU3.Cd1kAfr64/073eayPquAr0z9WWUQEdOyFRmAqcxz.i10C','资深美容顾问','female',NULL,'专业美容咨询师,5年从业经验','上海健康医学院','医疗美容技术','trainee',1,0,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(6,'nurse_001','nurse001@ruimei.com','13800138006','$2b$12$jFhkYU3.Cd1kAfr64/073eayPquAr0z9WWUQEdOyFRmAqcxz.i10C','美容护士','female',NULL,'持证美容护士,专业技术过硬','首都医科大学','护理学','trainee',1,0,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(7,'therapist_001','therapist001@ruimei.com','13800138007','$2b$12$jFhkYU3.Cd1kAfr64/073eayPquAr0z9WWUQEdOyFRmAqcxz.i10C','美容技师','female',NULL,'专业美容技师,擅长面部护理','北京卫生职业学院','医疗美容技术','trainee',1,0,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(8,'receptionist_001','front001@ruimei.com','13800138008','$2b$12$jFhkYU3.Cd1kAfr64/073eayPquAr0z9WWUQEdOyFRmAqcxz.i10C','前台接待','female',NULL,'负责客户接待和预约管理','北京商贸职业学院','商务管理','trainee',1,0,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL);
|
||||
/*!40000 ALTER TABLE `users` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Temporary view structure for view `v_user_course_progress`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `v_user_course_progress`;
|
||||
/*!50001 DROP VIEW IF EXISTS `v_user_course_progress`*/;
|
||||
SET @saved_cs_client = @@character_set_client;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
/*!50001 CREATE VIEW `v_user_course_progress` AS SELECT
|
||||
1 AS `user_id`,
|
||||
1 AS `username`,
|
||||
1 AS `course_id`,
|
||||
1 AS `course_name`,
|
||||
1 AS `exam_count`,
|
||||
1 AS `avg_score`,
|
||||
1 AS `best_score`*/;
|
||||
SET character_set_client = @saved_cs_client;
|
||||
|
||||
--
|
||||
-- Dumping routines for database 'kaopeilian'
|
||||
--
|
||||
|
||||
--
|
||||
-- Final view structure for view `v_user_course_progress`
|
||||
--
|
||||
|
||||
/*!50001 DROP VIEW IF EXISTS `v_user_course_progress`*/;
|
||||
/*!50001 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50001 SET @saved_cs_results = @@character_set_results */;
|
||||
/*!50001 SET @saved_col_connection = @@collation_connection */;
|
||||
/*!50001 SET character_set_client = latin1 */;
|
||||
/*!50001 SET character_set_results = latin1 */;
|
||||
/*!50001 SET collation_connection = latin1_swedish_ci */;
|
||||
/*!50001 CREATE ALGORITHM=UNDEFINED */
|
||||
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
|
||||
/*!50001 VIEW `v_user_course_progress` AS select `u`.`id` AS `user_id`,`u`.`username` AS `username`,`c`.`id` AS `course_id`,`c`.`name` AS `course_name`,count(distinct `e`.`id`) AS `exam_count`,avg(`e`.`score`) AS `avg_score`,max(`e`.`score`) AS `best_score` from ((`users` `u` join `courses` `c`) left join `exams` `e` on(((`e`.`user_id` = `u`.`id`) and (`e`.`course_id` = `c`.`id`) and (`e`.`status` = 'submitted')))) group by `u`.`id`,`c`.`id` */;
|
||||
/*!50001 SET character_set_client = @saved_cs_client */;
|
||||
/*!50001 SET character_set_results = @saved_cs_results */;
|
||||
/*!50001 SET collation_connection = @saved_col_connection */;
|
||||
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
|
||||
|
||||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
||||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
||||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
-- Dump completed on 2025-09-22 18:51:09
|
||||
@@ -0,0 +1,841 @@
|
||||
-- MySQL dump 10.13 Distrib 8.0.43, for Linux (aarch64)
|
||||
--
|
||||
-- Host: localhost Database: kaopeilian
|
||||
-- ------------------------------------------------------
|
||||
-- Server version 8.0.43
|
||||
|
||||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
||||
/*!50503 SET NAMES utf8mb4 */;
|
||||
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
|
||||
/*!40103 SET TIME_ZONE='+00:00' */;
|
||||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
|
||||
--
|
||||
-- Current Database: `kaopeilian`
|
||||
--
|
||||
|
||||
/*!40000 DROP DATABASE IF EXISTS `kaopeilian`*/;
|
||||
|
||||
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `kaopeilian` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci */ /*!80016 DEFAULT ENCRYPTION='N' */;
|
||||
|
||||
USE `kaopeilian`;
|
||||
|
||||
--
|
||||
-- Table structure for table `course_exam_settings`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `course_exam_settings`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `course_exam_settings` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`course_id` int NOT NULL COMMENT '课程ID',
|
||||
`single_choice_count` int NOT NULL DEFAULT '10' COMMENT '单选题数量',
|
||||
`multiple_choice_count` int NOT NULL DEFAULT '5' COMMENT '多选题数量',
|
||||
`true_false_count` int NOT NULL DEFAULT '5' COMMENT '判断题数量',
|
||||
`fill_blank_count` int NOT NULL DEFAULT '0' COMMENT '填空题数量',
|
||||
`duration_minutes` int NOT NULL DEFAULT '60' COMMENT '考试时长(分钟)',
|
||||
`difficulty_level` int NOT NULL DEFAULT '3' COMMENT '难度系数(1-5)',
|
||||
`passing_score` int NOT NULL DEFAULT '60' COMMENT '及格分数',
|
||||
`is_enabled` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是否启用',
|
||||
`show_answer_immediately` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否立即显示答案',
|
||||
`allow_retake` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是否允许重考',
|
||||
`max_retake_times` int DEFAULT NULL COMMENT '最大重考次数',
|
||||
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`is_deleted` tinyint(1) NOT NULL DEFAULT '0',
|
||||
`deleted_at` datetime DEFAULT NULL,
|
||||
`deleted_by` int DEFAULT NULL COMMENT '删除人ID',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `course_id` (`course_id`),
|
||||
KEY `ix_course_exam_settings_id` (`id`),
|
||||
CONSTRAINT `course_exam_settings_ibfk_1` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='课程考试设置表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `course_exam_settings`
|
||||
--
|
||||
|
||||
LOCK TABLES `course_exam_settings` WRITE;
|
||||
/*!40000 ALTER TABLE `course_exam_settings` DISABLE KEYS */;
|
||||
INSERT INTO `course_exam_settings` (`id`, `course_id`, `single_choice_count`, `multiple_choice_count`, `true_false_count`, `fill_blank_count`, `duration_minutes`, `difficulty_level`, `passing_score`, `is_enabled`, `show_answer_immediately`, `allow_retake`, `max_retake_times`, `created_at`, `updated_at`, `created_by`, `updated_by`, `is_deleted`, `deleted_at`, `deleted_by`) VALUES (1,1,5,3,2,0,60,2,80,1,1,1,3,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(2,2,4,2,2,2,45,1,75,1,1,1,3,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(3,3,3,2,3,2,50,2,80,1,0,1,2,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(4,4,4,3,2,1,55,2,85,1,1,1,3,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(5,5,5,2,2,1,40,1,70,1,1,1,5,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(6,6,3,2,3,2,45,1,75,1,1,1,3,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(7,7,4,2,2,2,50,2,80,1,0,1,2,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(8,8,5,3,2,0,60,3,85,1,1,1,2,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(9,9,4,2,4,0,50,2,80,1,1,1,3,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(10,10,3,2,3,2,45,1,75,1,1,1,3,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(11,11,5,3,2,0,60,3,90,1,0,1,2,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(12,12,4,2,4,0,40,1,70,1,1,1,5,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL);
|
||||
/*!40000 ALTER TABLE `course_exam_settings` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `course_materials`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `course_materials`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `course_materials` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`course_id` int NOT NULL COMMENT '所属课程ID',
|
||||
`name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '资料名称',
|
||||
`description` text COLLATE utf8mb4_unicode_ci COMMENT '资料描述',
|
||||
`file_url` varchar(500) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '文件URL',
|
||||
`file_type` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '文件类型',
|
||||
`file_size` int NOT NULL COMMENT '文件大小(字节)',
|
||||
`sort_order` int DEFAULT '0' COMMENT '排序序号',
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_course_id` (`course_id`),
|
||||
KEY `idx_is_deleted` (`is_deleted`),
|
||||
CONSTRAINT `course_materials_ibfk_1` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='课程资料表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `course_materials`
|
||||
--
|
||||
|
||||
LOCK TABLES `course_materials` WRITE;
|
||||
/*!40000 ALTER TABLE `course_materials` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `course_materials` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `courses`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `courses`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `courses` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '课程名称',
|
||||
`description` text COLLATE utf8mb4_unicode_ci COMMENT '课程描述',
|
||||
`category` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '课程分类',
|
||||
`status` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT 'draft' COMMENT '课程状态',
|
||||
`cover_image` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '封面图片',
|
||||
`duration_hours` decimal(5,2) DEFAULT NULL COMMENT '课程时长(小时)',
|
||||
`difficulty_level` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '难度等级',
|
||||
`tags` json DEFAULT NULL COMMENT '标签列表',
|
||||
`published_at` datetime DEFAULT NULL COMMENT '发布时间',
|
||||
`publisher_id` int DEFAULT NULL COMMENT '发布人ID',
|
||||
`sort_order` int DEFAULT '0' COMMENT '排序',
|
||||
`is_featured` tinyint(1) DEFAULT '0' COMMENT '是否推荐',
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_status` (`status`),
|
||||
KEY `idx_category` (`category`),
|
||||
KEY `idx_is_featured` (`is_featured`),
|
||||
KEY `idx_is_deleted` (`is_deleted`),
|
||||
KEY `idx_sort_order` (`sort_order`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='课程信息表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `courses`
|
||||
--
|
||||
|
||||
LOCK TABLES `courses` WRITE;
|
||||
/*!40000 ALTER TABLE `courses` DISABLE KEYS */;
|
||||
INSERT INTO `courses` (`id`, `name`, `description`, `category`, `status`, `cover_image`, `duration_hours`, `difficulty_level`, `tags`, `published_at`, `publisher_id`, `sort_order`, `is_featured`, `is_deleted`, `deleted_at`, `created_by`, `updated_by`, `created_at`, `updated_at`) VALUES (1,'皮肤生理学基础','学习皮肤结构、功能和常见问题,为专业护理打下坚实基础','technology','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(2,'医美产品知识与应用','全面了解各类医美产品的成分、功效和适用人群,掌握产品推荐技巧','technology','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(3,'美容仪器操作与维护','掌握各类美容仪器的操作方法、注意事项和日常维护保养','technology','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(4,'医美项目介绍与咨询','详细了解各类医美项目的原理、效果和适应症,提升咨询专业度','business','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(5,'轻医美销售技巧','学习专业的销售话术、客户需求分析和成交技巧,提升业绩能力','business','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(6,'客户服务与投诉处理','提升服务意识,掌握客户投诉处理的方法和技巧,维护品牌形象','management','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(7,'社媒营销与私域运营','学习如何通过社交媒体进行品牌推广和客户维护,建立私域流量','business','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(8,'门店运营管理','学习门店日常管理、团队建设和业绩管理的方法和技巧','management','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(9,'卫生消毒与感染控制','学习医美机构的卫生标准和消毒流程,确保服务安全合规','general','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(10,'美容心理学','了解客户心理需求,掌握沟通技巧,提升服务满意度','general','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(11,'法律法规与行业规范','学习医美行业相关法律法规,确保合规经营','general','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(12,'新员工入职培训','新员工必修课程,包含企业文化、基础知识和操作规范','general','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24');
|
||||
/*!40000 ALTER TABLE `courses` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `exam_results`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `exam_results`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `exam_results` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`exam_id` int NOT NULL COMMENT '考试ID',
|
||||
`question_id` int NOT NULL COMMENT '题目ID',
|
||||
`user_answer` json DEFAULT NULL COMMENT '用户答案',
|
||||
`is_correct` tinyint(1) NOT NULL COMMENT '是否正确',
|
||||
`score` decimal(5,2) NOT NULL COMMENT '考试得分',
|
||||
`answer_time` int DEFAULT NULL COMMENT '答题时长(秒)',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_exam_id` (`exam_id`),
|
||||
KEY `idx_question_id` (`question_id`),
|
||||
CONSTRAINT `exam_results_ibfk_1` FOREIGN KEY (`exam_id`) REFERENCES `exams` (`id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `exam_results_ibfk_2` FOREIGN KEY (`question_id`) REFERENCES `questions` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='考试结果表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `exam_results`
|
||||
--
|
||||
|
||||
LOCK TABLES `exam_results` WRITE;
|
||||
/*!40000 ALTER TABLE `exam_results` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `exam_results` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `exams`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `exams`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `exams` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`user_id` int NOT NULL COMMENT '用户ID',
|
||||
`course_id` int NOT NULL COMMENT '课程ID',
|
||||
`exam_name` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '考试名称',
|
||||
`question_count` int DEFAULT NULL COMMENT '题目数量',
|
||||
`total_score` decimal(5,2) DEFAULT NULL COMMENT '总分',
|
||||
`pass_score` decimal(5,2) DEFAULT NULL COMMENT '及格分',
|
||||
`start_time` datetime DEFAULT NULL COMMENT '开始时间',
|
||||
`end_time` datetime DEFAULT NULL COMMENT '结束时间',
|
||||
`duration_minutes` int DEFAULT NULL COMMENT '考试时长(分钟)',
|
||||
`score` decimal(5,2) DEFAULT NULL COMMENT '得分',
|
||||
`is_passed` tinyint(1) DEFAULT '0' COMMENT '是否通过',
|
||||
`status` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT 'pending' COMMENT '考试状态',
|
||||
`questions` json DEFAULT NULL COMMENT '题目数据(JSON格式)',
|
||||
`answers` json DEFAULT NULL COMMENT '答案数据(JSON格式)',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_user_id` (`user_id`),
|
||||
KEY `idx_course_id` (`course_id`),
|
||||
KEY `idx_status` (`status`),
|
||||
CONSTRAINT `exams_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `exams_ibfk_2` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='考试记录表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `exams`
|
||||
--
|
||||
|
||||
LOCK TABLES `exams` WRITE;
|
||||
/*!40000 ALTER TABLE `exams` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `exams` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `growth_paths`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `growth_paths`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `growth_paths` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '成长路径名称',
|
||||
`description` text COLLATE utf8mb4_unicode_ci COMMENT '路径描述',
|
||||
`target_role` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '目标角色',
|
||||
`courses` json DEFAULT NULL COMMENT '课程列表',
|
||||
`estimated_duration_days` int DEFAULT NULL COMMENT '预计完成天数',
|
||||
`is_active` tinyint(1) DEFAULT '1' COMMENT '是否启用',
|
||||
`sort_order` int DEFAULT '0' COMMENT '排序顺序',
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_is_active` (`is_active`),
|
||||
KEY `idx_is_deleted` (`is_deleted`),
|
||||
KEY `idx_sort_order` (`sort_order`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='成长路径表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `growth_paths`
|
||||
--
|
||||
|
||||
LOCK TABLES `growth_paths` WRITE;
|
||||
/*!40000 ALTER TABLE `growth_paths` DISABLE KEYS */;
|
||||
INSERT INTO `growth_paths` (`id`, `name`, `description`, `target_role`, `courses`, `estimated_duration_days`, `is_active`, `sort_order`, `is_deleted`, `deleted_at`, `created_at`, `updated_at`) VALUES (1,'美容顾问成长路径','从初级美容顾问到资深顾问的完整成长路径,包含专业技能和销售能力提升','资深美容顾问',NULL,NULL,1,0,0,NULL,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(2,'美容技师进阶路径','美容技师的技能进阶路径,从基础护理到高级项目操作','高级美容技师',NULL,NULL,1,0,0,NULL,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(3,'管理岗位培养路径','从一线员工到管理岗位的培养路径,包含领导力和管理技能','店长/区域经理',NULL,NULL,1,0,0,NULL,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(4,'医美咨询师专业路径','医美咨询师的专业发展路径,深度掌握医美项目知识','资深医美咨询师',NULL,NULL,1,0,0,NULL,'2025-09-23 02:39:48','2025-09-23 02:39:48');
|
||||
/*!40000 ALTER TABLE `growth_paths` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `knowledge_points`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `knowledge_points`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `knowledge_points` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`course_id` int DEFAULT NULL COMMENT '所属课程ID',
|
||||
`name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '知识点名称',
|
||||
`description` text COLLATE utf8mb4_unicode_ci COMMENT '知识点描述',
|
||||
`parent_id` int DEFAULT NULL COMMENT '父知识点ID',
|
||||
`level` int DEFAULT '1' COMMENT '层级深度',
|
||||
`path` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '知识点路径',
|
||||
`sort_order` int DEFAULT '0' COMMENT '排序顺序',
|
||||
`weight` decimal(3,2) DEFAULT '1.00' COMMENT '权重',
|
||||
`is_required` tinyint(1) DEFAULT '1' COMMENT '是否必修',
|
||||
`estimated_hours` decimal(4,2) DEFAULT NULL COMMENT '预计学习时间(小时)',
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_course_id` (`course_id`),
|
||||
KEY `idx_parent_id` (`parent_id`),
|
||||
KEY `idx_is_deleted` (`is_deleted`),
|
||||
KEY `idx_sort_order` (`sort_order`),
|
||||
CONSTRAINT `knowledge_points_ibfk_1` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `knowledge_points_ibfk_2` FOREIGN KEY (`parent_id`) REFERENCES `knowledge_points` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='知识点表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `knowledge_points`
|
||||
--
|
||||
|
||||
LOCK TABLES `knowledge_points` WRITE;
|
||||
/*!40000 ALTER TABLE `knowledge_points` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `knowledge_points` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `material_knowledge_points`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `material_knowledge_points`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `material_knowledge_points` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`material_id` int NOT NULL COMMENT '资料ID',
|
||||
`knowledge_point_id` int NOT NULL COMMENT '知识点ID',
|
||||
`sort_order` int DEFAULT '0' COMMENT '排序顺序',
|
||||
`is_ai_generated` tinyint(1) DEFAULT '0' COMMENT '是否AI生成',
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `idx_material_knowledge` (`material_id`,`knowledge_point_id`),
|
||||
KEY `idx_material_id` (`material_id`),
|
||||
KEY `idx_knowledge_point_id` (`knowledge_point_id`),
|
||||
CONSTRAINT `material_knowledge_points_ibfk_1` FOREIGN KEY (`material_id`) REFERENCES `course_materials` (`id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `material_knowledge_points_ibfk_2` FOREIGN KEY (`knowledge_point_id`) REFERENCES `knowledge_points` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='资料知识点关联表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `material_knowledge_points`
|
||||
--
|
||||
|
||||
LOCK TABLES `material_knowledge_points` WRITE;
|
||||
/*!40000 ALTER TABLE `material_knowledge_points` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `material_knowledge_points` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `position_courses`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `position_courses`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `position_courses` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`position_id` int NOT NULL COMMENT '岗位ID',
|
||||
`course_id` int NOT NULL COMMENT '课程ID',
|
||||
`course_type` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'required' COMMENT '课程类型(必修/选修)',
|
||||
`priority` int DEFAULT '0' COMMENT '优先级',
|
||||
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`is_deleted` tinyint(1) NOT NULL DEFAULT '0',
|
||||
`deleted_at` datetime DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uix_position_course` (`position_id`,`course_id`,`is_deleted`),
|
||||
KEY `course_id` (`course_id`),
|
||||
KEY `ix_position_courses_id` (`id`),
|
||||
CONSTRAINT `position_courses_ibfk_1` FOREIGN KEY (`position_id`) REFERENCES `positions` (`id`),
|
||||
CONSTRAINT `position_courses_ibfk_2` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='岗位课程关联表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `position_courses`
|
||||
--
|
||||
|
||||
LOCK TABLES `position_courses` WRITE;
|
||||
/*!40000 ALTER TABLE `position_courses` DISABLE KEYS */;
|
||||
INSERT INTO `position_courses` (`id`, `position_id`, `course_id`, `course_type`, `priority`, `created_at`, `updated_at`, `created_by`, `updated_by`, `is_deleted`, `deleted_at`) VALUES (1,1,6,'required',1,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(2,1,8,'required',2,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(3,1,11,'required',3,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(4,1,12,'required',4,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(5,3,1,'required',1,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(6,3,2,'required',2,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(7,3,5,'required',3,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(8,3,6,'required',4,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(9,3,10,'required',5,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(10,3,12,'required',6,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(11,4,1,'required',1,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(12,4,2,'required',2,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(13,4,4,'required',3,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(14,4,5,'required',4,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(15,4,9,'required',5,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(16,4,12,'required',6,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(17,5,1,'required',1,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(18,5,2,'required',2,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(19,5,3,'required',3,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(20,5,9,'required',4,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(21,5,12,'required',5,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(22,7,6,'required',1,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(23,7,10,'required',2,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(24,7,12,'required',3,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL);
|
||||
/*!40000 ALTER TABLE `position_courses` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `position_members`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `position_members`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `position_members` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`position_id` int NOT NULL COMMENT '岗位ID',
|
||||
`user_id` int NOT NULL COMMENT '用户ID',
|
||||
`role` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '在岗位中的角色',
|
||||
`joined_at` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '加入时间',
|
||||
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`is_deleted` tinyint(1) NOT NULL DEFAULT '0',
|
||||
`deleted_at` datetime DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uix_position_user` (`position_id`,`user_id`,`is_deleted`),
|
||||
KEY `user_id` (`user_id`),
|
||||
KEY `ix_position_members_id` (`id`),
|
||||
CONSTRAINT `position_members_ibfk_1` FOREIGN KEY (`position_id`) REFERENCES `positions` (`id`),
|
||||
CONSTRAINT `position_members_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='岗位成员关联表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `position_members`
|
||||
--
|
||||
|
||||
LOCK TABLES `position_members` WRITE;
|
||||
/*!40000 ALTER TABLE `position_members` DISABLE KEYS */;
|
||||
INSERT INTO `position_members` (`id`, `position_id`, `user_id`, `role`, `joined_at`, `created_at`, `updated_at`, `created_by`, `updated_by`, `is_deleted`, `deleted_at`) VALUES (1,1,3,NULL,'2025-09-22 18:42:32','2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(2,1,4,NULL,'2025-09-22 18:42:32','2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(3,3,5,NULL,'2025-09-22 18:42:32','2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(4,4,6,NULL,'2025-09-22 18:42:32','2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(5,5,7,NULL,'2025-09-22 18:42:32','2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(6,7,8,NULL,'2025-09-22 18:42:32','2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL);
|
||||
/*!40000 ALTER TABLE `position_members` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `positions`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `positions`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `positions` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '岗位名称',
|
||||
`code` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '岗位代码',
|
||||
`description` text COLLATE utf8mb4_unicode_ci COMMENT '岗位描述',
|
||||
`parent_id` int DEFAULT NULL COMMENT '上级岗位ID',
|
||||
`status` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT 'active' COMMENT '岗位状态',
|
||||
`skills` json DEFAULT NULL COMMENT '核心技能',
|
||||
`level` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '岗位级别',
|
||||
`sort_order` int DEFAULT '0' COMMENT '排序',
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `code` (`code`),
|
||||
KEY `parent_id` (`parent_id`),
|
||||
KEY `idx_positions_name` (`name`),
|
||||
CONSTRAINT `positions_ibfk_1` FOREIGN KEY (`parent_id`) REFERENCES `positions` (`id`) ON DELETE SET NULL
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='岗位信息表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `positions`
|
||||
--
|
||||
|
||||
LOCK TABLES `positions` WRITE;
|
||||
/*!40000 ALTER TABLE `positions` DISABLE KEYS */;
|
||||
INSERT INTO `positions` (`id`, `name`, `code`, `description`, `parent_id`, `status`, `skills`, `level`, `sort_order`, `is_deleted`, `deleted_at`, `created_by`, `updated_by`, `created_at`, `updated_at`) VALUES (1,'区域经理','region_manager','负责多家门店的运营管理和业绩达成,制定区域发展战略',NULL,'active',NULL,'expert',0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(2,'店长','store_manager','负责门店日常运营管理,团队建设和业绩达成',NULL,'active',NULL,'senior',0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(3,'美容顾问','beauty_consultant','为客户提供专业的美容咨询和个性化方案设计',NULL,'active',NULL,'intermediate',0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(4,'医美咨询师','medical_beauty_consultant','提供医疗美容项目咨询和专业方案制定',NULL,'active',NULL,'senior',0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(5,'美容技师','beauty_therapist','为客户提供专业的美容护理和技术服务',NULL,'active',NULL,'intermediate',0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(6,'美容护士','beauty_nurse','协助医生进行医美项目操作,负责术后护理指导',NULL,'active',NULL,'intermediate',0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(7,'前台接待','receptionist','负责客户接待、预约管理和前台事务处理',NULL,'active',NULL,'junior',0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(8,'市场专员','marketing_specialist','负责门店营销活动策划、执行和客户维护',NULL,'active',NULL,'intermediate',0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24');
|
||||
/*!40000 ALTER TABLE `positions` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `questions`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `questions`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `questions` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`course_id` int NOT NULL COMMENT '所属课程ID',
|
||||
`question_type` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '题目类型',
|
||||
`title` text COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '题目标题',
|
||||
`content` text COLLATE utf8mb4_unicode_ci COMMENT '题目内容',
|
||||
`options` json DEFAULT NULL COMMENT '选项内容',
|
||||
`correct_answer` text COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '正确答案',
|
||||
`explanation` text COLLATE utf8mb4_unicode_ci COMMENT '答案解析',
|
||||
`score` float DEFAULT '10' COMMENT '题目分值',
|
||||
`difficulty` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT 'medium' COMMENT '难度等级',
|
||||
`tags` json DEFAULT NULL COMMENT '题目标签',
|
||||
`usage_count` int DEFAULT '0' COMMENT '使用次数',
|
||||
`correct_count` int DEFAULT '0' COMMENT '答对次数',
|
||||
`is_active` tinyint(1) DEFAULT '1' COMMENT '是否启用',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_course_id` (`course_id`),
|
||||
KEY `idx_question_type` (`question_type`),
|
||||
KEY `idx_difficulty` (`difficulty`),
|
||||
KEY `idx_is_active` (`is_active`),
|
||||
CONSTRAINT `questions_ibfk_1` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='题目表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `questions`
|
||||
--
|
||||
|
||||
LOCK TABLES `questions` WRITE;
|
||||
/*!40000 ALTER TABLE `questions` DISABLE KEYS */;
|
||||
INSERT INTO `questions` (`id`, `course_id`, `question_type`, `title`, `content`, `options`, `correct_answer`, `explanation`, `score`, `difficulty`, `tags`, `usage_count`, `correct_count`, `is_active`, `created_at`, `updated_at`) VALUES (1,1,'single_choice','皮肤的最外层是什么?',NULL,'[{\"text\": \"表皮\", \"label\": \"A\"}, {\"text\": \"真皮\", \"label\": \"B\"}, {\"text\": \"皮下组织\", \"label\": \"C\"}, {\"text\": \"角质层\", \"label\": \"D\"}]','A','A选项是表皮,这是皮肤的最外层,起到保护作用',10,'easy',NULL,0,0,1,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(2,2,'single_choice','透明质酸的主要功效是什么?',NULL,'[{\"text\": \"美白淡斑\", \"label\": \"A\"}, {\"text\": \"保湿补水\", \"label\": \"B\"}, {\"text\": \"紧致提升\", \"label\": \"C\"}, {\"text\": \"去除皱纹\", \"label\": \"D\"}]','B','B选项是保湿补水,透明质酸具有强大的保湿能力',10,'easy',NULL,0,0,1,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(3,3,'multiple_choice','射频美容仪的禁忌症包括哪些?',NULL,'[{\"text\": \"孕期和哺乳期\", \"label\": \"A\"}, {\"text\": \"皮肤过敏\", \"label\": \"B\"}, {\"text\": \"心脏起搏器\", \"label\": \"C\"}, {\"text\": \"轻微痤疮\", \"label\": \"D\"}]','A,C','A和C选项都是射频美容仪的禁忌症,需要特别注意',15,'medium',NULL,0,0,1,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(4,4,'true_false','水光针适合所有肤质的客户',NULL,'[{\"text\": \"正确\", \"label\": \"A\"}, {\"text\": \"错误\", \"label\": \"B\"}]','B','水光针虽然适用范围广,但仍有一些禁忌症和不适合的肤质',10,'easy',NULL,0,0,1,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(5,4,'fill_blank','肉毒素注射后____小时内不能平躺','肉毒素注射后【】小时内不能平躺,以免影响药物分布效果。',NULL,'4','肉毒素注射后4小时内不能平躺,以免影响药物分布',10,'medium',NULL,0,0,1,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(6,5,'single_choice','客户咨询时最重要的是什么?',NULL,'[{\"text\": \"倾听客户需求\", \"label\": \"A\"}, {\"text\": \"推荐最贵的产品\", \"label\": \"B\"}, {\"text\": \"快速成交\", \"label\": \"C\"}, {\"text\": \"展示专业知识\", \"label\": \"D\"}]','A','A选项是倾听客户需求,这是专业咨询的基础',10,'easy',NULL,0,0,1,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(7,6,'single_choice','处理客户投诉的第一步是什么?',NULL,'[{\"text\": \"解释原因\", \"label\": \"A\"}, {\"text\": \"耐心倾听\", \"label\": \"B\"}, {\"text\": \"提供补偿\", \"label\": \"C\"}, {\"text\": \"转交上级\", \"label\": \"D\"}]','B','B选项是耐心倾听,让客户充分表达不满是处理投诉的第一步',10,'easy',NULL,0,0,1,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(8,7,'true_false','社交媒体营销只需要发布产品信息',NULL,'[{\"text\": \"正确\", \"label\": \"A\"}, {\"text\": \"错误\", \"label\": \"B\"}]','B','社交媒体营销需要内容多样化,包括教育内容、互动内容等',10,'easy',NULL,0,0,1,'2025-09-23 02:39:48','2025-09-23 02:39:48');
|
||||
/*!40000 ALTER TABLE `questions` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `teams`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `teams`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `teams` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '团队名称',
|
||||
`code` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '团队代码',
|
||||
`description` text COLLATE utf8mb4_unicode_ci COMMENT '团队描述',
|
||||
`team_type` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '团队类型',
|
||||
`is_active` tinyint(1) DEFAULT '1' COMMENT '是否激活',
|
||||
`leader_id` int DEFAULT NULL COMMENT '负责人ID',
|
||||
`parent_id` int DEFAULT NULL COMMENT '父团队ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `name` (`name`),
|
||||
UNIQUE KEY `code` (`code`),
|
||||
KEY `leader_id` (`leader_id`),
|
||||
KEY `parent_id` (`parent_id`),
|
||||
KEY `idx_team_type` (`team_type`),
|
||||
KEY `idx_is_active` (`is_active`),
|
||||
CONSTRAINT `teams_ibfk_1` FOREIGN KEY (`leader_id`) REFERENCES `users` (`id`) ON DELETE SET NULL,
|
||||
CONSTRAINT `teams_ibfk_2` FOREIGN KEY (`parent_id`) REFERENCES `teams` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='团队信息表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `teams`
|
||||
--
|
||||
|
||||
LOCK TABLES `teams` WRITE;
|
||||
/*!40000 ALTER TABLE `teams` DISABLE KEYS */;
|
||||
INSERT INTO `teams` (`id`, `name`, `code`, `description`, `team_type`, `is_active`, `leader_id`, `parent_id`, `created_at`, `updated_at`, `is_deleted`, `deleted_at`) VALUES (1,'管理层','MANAGEMENT','负责公司整体战略规划和运营管理','department',1,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(2,'北京运营团队','BJ_OPERATIONS','负责北京地区所有门店的运营管理','department',1,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(3,'上海运营团队','SH_OPERATIONS','负责上海地区所有门店的运营管理','department',1,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(4,'技术培训部','TECH_TRAINING','负责员工技术培训和考核','department',1,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(5,'客服质量部','QUALITY_SERVICE','负责客户服务质量监督和改进','department',1,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(6,'新员工培训小组','NEW_EMPLOYEE_TRAINING','专门负责新员工入职培训','study_group',1,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL);
|
||||
/*!40000 ALTER TABLE `teams` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `training_messages`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `training_messages`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `training_messages` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`session_id` int NOT NULL COMMENT '会话ID',
|
||||
`role` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '消息角色',
|
||||
`type` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '消息类型',
|
||||
`content` text COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '消息内容',
|
||||
`voice_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '语音文件URL',
|
||||
`voice_duration` int DEFAULT NULL COMMENT '语音时长(秒)',
|
||||
`message_metadata` json DEFAULT NULL COMMENT '消息元数据',
|
||||
`coze_message_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Coze消息ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_session_id` (`session_id`),
|
||||
KEY `idx_role` (`role`),
|
||||
CONSTRAINT `training_messages_ibfk_1` FOREIGN KEY (`session_id`) REFERENCES `training_sessions` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='培训消息表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `training_messages`
|
||||
--
|
||||
|
||||
LOCK TABLES `training_messages` WRITE;
|
||||
/*!40000 ALTER TABLE `training_messages` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `training_messages` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `training_reports`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `training_reports`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `training_reports` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`session_id` int NOT NULL COMMENT '会话ID',
|
||||
`user_id` int NOT NULL COMMENT '用户ID',
|
||||
`overall_score` decimal(5,2) DEFAULT NULL COMMENT '总体评分',
|
||||
`dimension_scores` json DEFAULT NULL COMMENT '各维度得分',
|
||||
`strengths` text COLLATE utf8mb4_unicode_ci COMMENT '优势点',
|
||||
`weaknesses` text COLLATE utf8mb4_unicode_ci COMMENT '待改进点',
|
||||
`suggestions` text COLLATE utf8mb4_unicode_ci COMMENT '改进建议',
|
||||
`detailed_analysis` text COLLATE utf8mb4_unicode_ci COMMENT '详细分析',
|
||||
`transcript` text COLLATE utf8mb4_unicode_ci COMMENT '对话记录',
|
||||
`statistics` json DEFAULT NULL COMMENT '统计数据',
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `session_id` (`session_id`),
|
||||
KEY `idx_user_id` (`user_id`),
|
||||
CONSTRAINT `training_reports_ibfk_1` FOREIGN KEY (`session_id`) REFERENCES `training_sessions` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='培训报告表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `training_reports`
|
||||
--
|
||||
|
||||
LOCK TABLES `training_reports` WRITE;
|
||||
/*!40000 ALTER TABLE `training_reports` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `training_reports` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `training_scenes`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `training_scenes`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `training_scenes` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '场景名称',
|
||||
`description` text COLLATE utf8mb4_unicode_ci COMMENT '场景描述',
|
||||
`category` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '场景分类',
|
||||
`ai_config` json DEFAULT NULL COMMENT 'AI配置',
|
||||
`prompt_template` text COLLATE utf8mb4_unicode_ci COMMENT '提示模板',
|
||||
`evaluation_criteria` json DEFAULT NULL COMMENT '评估标准',
|
||||
`status` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT 'active' COMMENT '场景状态',
|
||||
`is_public` tinyint(1) DEFAULT '1' COMMENT '是否公开',
|
||||
`required_level` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '所需用户等级',
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_status` (`status`),
|
||||
KEY `idx_category` (`category`),
|
||||
KEY `idx_is_public` (`is_public`),
|
||||
KEY `idx_is_deleted` (`is_deleted`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='培训场景表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `training_scenes`
|
||||
--
|
||||
|
||||
LOCK TABLES `training_scenes` WRITE;
|
||||
/*!40000 ALTER TABLE `training_scenes` DISABLE KEYS */;
|
||||
INSERT INTO `training_scenes` (`id`, `name`, `description`, `category`, `ai_config`, `prompt_template`, `evaluation_criteria`, `status`, `is_public`, `required_level`, `is_deleted`, `deleted_at`, `created_by`, `updated_by`, `created_at`, `updated_at`) VALUES (1,'客户咨询模拟','模拟真实的客户咨询场景,练习专业咨询技巧','客户服务',NULL,NULL,NULL,'ACTIVE',1,NULL,0,NULL,NULL,NULL,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(2,'产品推荐演练','针对不同客户需求进行产品推荐的实战演练','销售技巧',NULL,NULL,NULL,'ACTIVE',1,NULL,0,NULL,NULL,NULL,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(3,'投诉处理训练','模拟各种客户投诉情况,训练处理技巧和话术','客户服务',NULL,NULL,NULL,'ACTIVE',1,NULL,0,NULL,NULL,NULL,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(4,'项目操作指导','美容项目操作的标准流程指导和安全注意事项','技术指导',NULL,NULL,NULL,'ACTIVE',1,NULL,0,NULL,NULL,NULL,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(5,'团队管理讨论','管理岗位的团队建设和绩效管理讨论','管理培训',NULL,NULL,NULL,'ACTIVE',1,NULL,0,NULL,NULL,NULL,'2025-09-23 02:39:48','2025-09-23 02:39:48');
|
||||
/*!40000 ALTER TABLE `training_scenes` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `training_sessions`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `training_sessions`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `training_sessions` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`user_id` int NOT NULL COMMENT '用户ID',
|
||||
`scene_id` int NOT NULL COMMENT '场景ID',
|
||||
`coze_conversation_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Coze对话ID',
|
||||
`start_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '开始时间',
|
||||
`end_time` datetime DEFAULT NULL COMMENT '结束时间',
|
||||
`duration_seconds` int DEFAULT NULL COMMENT '持续时长(秒)',
|
||||
`status` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT 'active' COMMENT '会话状态',
|
||||
`session_config` json DEFAULT NULL COMMENT '会话配置',
|
||||
`total_score` decimal(5,2) DEFAULT NULL COMMENT '总分',
|
||||
`evaluation_result` json DEFAULT NULL COMMENT '评估结果详情',
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_user_id` (`user_id`),
|
||||
KEY `idx_scene_id` (`scene_id`),
|
||||
KEY `idx_status` (`status`),
|
||||
CONSTRAINT `training_sessions_ibfk_1` FOREIGN KEY (`scene_id`) REFERENCES `training_scenes` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='培训会话表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `training_sessions`
|
||||
--
|
||||
|
||||
LOCK TABLES `training_sessions` WRITE;
|
||||
/*!40000 ALTER TABLE `training_sessions` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `training_sessions` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `user_teams`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `user_teams`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `user_teams` (
|
||||
`user_id` int NOT NULL COMMENT '用户ID',
|
||||
`team_id` int NOT NULL COMMENT '团队ID',
|
||||
`role` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '在团队中的角色',
|
||||
`joined_at` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '加入时间',
|
||||
PRIMARY KEY (`user_id`,`team_id`),
|
||||
KEY `team_id` (`team_id`),
|
||||
CONSTRAINT `user_teams_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `user_teams_ibfk_2` FOREIGN KEY (`team_id`) REFERENCES `teams` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='用户团队关联表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `user_teams`
|
||||
--
|
||||
|
||||
LOCK TABLES `user_teams` WRITE;
|
||||
/*!40000 ALTER TABLE `user_teams` DISABLE KEYS */;
|
||||
INSERT INTO `user_teams` (`user_id`, `team_id`, `role`, `joined_at`) VALUES (1,1,'leader','2025-09-22 18:42:32'),(2,1,'member','2025-09-22 18:42:32'),(3,2,'leader','2025-09-22 18:42:32'),(4,3,'leader','2025-09-22 18:42:32'),(5,2,'member','2025-09-22 18:42:32'),(5,4,'member','2025-09-22 18:42:32'),(6,2,'member','2025-09-22 18:42:32'),(6,4,'member','2025-09-22 18:42:32'),(7,3,'member','2025-09-22 18:42:32'),(7,4,'member','2025-09-22 18:42:32'),(8,3,'member','2025-09-22 18:42:32'),(8,6,'member','2025-09-22 18:42:32');
|
||||
/*!40000 ALTER TABLE `user_teams` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `users`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `users`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `users` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`username` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '用户名',
|
||||
`email` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '邮箱',
|
||||
`phone` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '手机号',
|
||||
`password_hash` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '密码哈希',
|
||||
`full_name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '真实姓名',
|
||||
`gender` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '性别',
|
||||
`avatar_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '头像URL',
|
||||
`bio` text COLLATE utf8mb4_unicode_ci COMMENT '个人简介',
|
||||
`school` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '学校',
|
||||
`major` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '专业',
|
||||
`role` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'trainee' COMMENT '用户角色',
|
||||
`is_active` tinyint(1) DEFAULT '1' COMMENT '是否激活',
|
||||
`is_verified` tinyint(1) DEFAULT '0' COMMENT '是否验证',
|
||||
`last_login_at` datetime DEFAULT NULL COMMENT '最后登录时间',
|
||||
`password_changed_at` datetime DEFAULT NULL COMMENT '密码修改时间',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `username` (`username`),
|
||||
UNIQUE KEY `email` (`email`),
|
||||
UNIQUE KEY `phone` (`phone`),
|
||||
KEY `idx_role` (`role`),
|
||||
KEY `idx_is_active` (`is_active`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='用户信息表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `users`
|
||||
--
|
||||
|
||||
LOCK TABLES `users` WRITE;
|
||||
/*!40000 ALTER TABLE `users` DISABLE KEYS */;
|
||||
INSERT INTO `users` (`id`, `username`, `email`, `phone`, `password_hash`, `full_name`, `gender`, `avatar_url`, `bio`, `school`, `major`, `role`, `is_active`, `is_verified`, `last_login_at`, `password_changed_at`, `created_at`, `updated_at`, `is_deleted`, `deleted_at`) VALUES (1,'superadmin','superadmin@ruimei.com','13800138001','$2b$12$jFhkYU3.Cd1kAfr64/073eayPquAr0z9WWUQEdOyFRmAqcxz.i10C','超级管理员','male',NULL,'负责系统整体管理和运营','睿美医疗美容学院','医疗美容管理','admin',1,0,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(2,'admin','admin@ruimei.com','13800138002','$2b$12$jFhkYU3.Cd1kAfr64/073eayPquAr0z9WWUQEdOyFRmAqcxz.i10C','系统管理员','female',NULL,'负责日常系统管理工作','睿美医疗美容学院','医疗美容技术','admin',1,0,'2025-09-22 18:54:56',NULL,'2025-09-23 02:38:24','2025-09-22 18:54:56',0,NULL),(3,'manager_beijing','manager.bj@ruimei.com','13800138003','$2b$12$jFhkYU3.Cd1kAfr64/073eayPquAr0z9WWUQEdOyFRmAqcxz.i10C','北京区域经理','male',NULL,'负责北京地区门店管理','北京医科大学','临床医学','manager',1,0,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(4,'manager_shanghai','manager.sh@ruimei.com','13800138004','$2b$12$jFhkYU3.Cd1kAfr64/073eayPquAr0z9WWUQEdOyFRmAqcxz.i10C','上海区域经理','female',NULL,'负责上海地区门店管理','复旦大学医学院','医疗美容','manager',1,0,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(5,'consultant_001','consultant001@ruimei.com','13800138005','$2b$12$jFhkYU3.Cd1kAfr64/073eayPquAr0z9WWUQEdOyFRmAqcxz.i10C','资深美容顾问','female',NULL,'专业美容咨询师,5年从业经验','上海健康医学院','医疗美容技术','trainee',1,0,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(6,'nurse_001','nurse001@ruimei.com','13800138006','$2b$12$jFhkYU3.Cd1kAfr64/073eayPquAr0z9WWUQEdOyFRmAqcxz.i10C','美容护士','female',NULL,'持证美容护士,专业技术过硬','首都医科大学','护理学','trainee',1,0,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(7,'therapist_001','therapist001@ruimei.com','13800138007','$2b$12$jFhkYU3.Cd1kAfr64/073eayPquAr0z9WWUQEdOyFRmAqcxz.i10C','美容技师','female',NULL,'专业美容技师,擅长面部护理','北京卫生职业学院','医疗美容技术','trainee',1,0,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(8,'receptionist_001','front001@ruimei.com','13800138008','$2b$12$jFhkYU3.Cd1kAfr64/073eayPquAr0z9WWUQEdOyFRmAqcxz.i10C','前台接待','female',NULL,'负责客户接待和预约管理','北京商贸职业学院','商务管理','trainee',1,0,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL);
|
||||
/*!40000 ALTER TABLE `users` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Temporary view structure for view `v_user_course_progress`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `v_user_course_progress`;
|
||||
/*!50001 DROP VIEW IF EXISTS `v_user_course_progress`*/;
|
||||
SET @saved_cs_client = @@character_set_client;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
/*!50001 CREATE VIEW `v_user_course_progress` AS SELECT
|
||||
1 AS `user_id`,
|
||||
1 AS `username`,
|
||||
1 AS `course_id`,
|
||||
1 AS `course_name`,
|
||||
1 AS `exam_count`,
|
||||
1 AS `avg_score`,
|
||||
1 AS `best_score`*/;
|
||||
SET character_set_client = @saved_cs_client;
|
||||
|
||||
--
|
||||
-- Dumping events for database 'kaopeilian'
|
||||
--
|
||||
|
||||
--
|
||||
-- Dumping routines for database 'kaopeilian'
|
||||
--
|
||||
|
||||
--
|
||||
-- Current Database: `kaopeilian`
|
||||
--
|
||||
|
||||
USE `kaopeilian`;
|
||||
|
||||
--
|
||||
-- Final view structure for view `v_user_course_progress`
|
||||
--
|
||||
|
||||
/*!50001 DROP VIEW IF EXISTS `v_user_course_progress`*/;
|
||||
/*!50001 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50001 SET @saved_cs_results = @@character_set_results */;
|
||||
/*!50001 SET @saved_col_connection = @@collation_connection */;
|
||||
/*!50001 SET character_set_client = latin1 */;
|
||||
/*!50001 SET character_set_results = latin1 */;
|
||||
/*!50001 SET collation_connection = latin1_swedish_ci */;
|
||||
/*!50001 CREATE ALGORITHM=UNDEFINED */
|
||||
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
|
||||
/*!50001 VIEW `v_user_course_progress` AS select `u`.`id` AS `user_id`,`u`.`username` AS `username`,`c`.`id` AS `course_id`,`c`.`name` AS `course_name`,count(distinct `e`.`id`) AS `exam_count`,avg(`e`.`score`) AS `avg_score`,max(`e`.`score`) AS `best_score` from ((`users` `u` join `courses` `c`) left join `exams` `e` on(((`e`.`user_id` = `u`.`id`) and (`e`.`course_id` = `c`.`id`) and (`e`.`status` = 'submitted')))) group by `u`.`id`,`c`.`id` */;
|
||||
/*!50001 SET character_set_client = @saved_cs_client */;
|
||||
/*!50001 SET character_set_results = @saved_cs_results */;
|
||||
/*!50001 SET collation_connection = @saved_col_connection */;
|
||||
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
|
||||
|
||||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
||||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
||||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
-- Dump completed on 2025-09-22 18:56:30
|
||||
@@ -0,0 +1,825 @@
|
||||
-- MySQL dump 10.13 Distrib 8.0.43, for Linux (aarch64)
|
||||
--
|
||||
-- Host: localhost Database: kaopeilian
|
||||
-- ------------------------------------------------------
|
||||
-- Server version 8.0.43
|
||||
|
||||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
||||
/*!50503 SET NAMES utf8mb4 */;
|
||||
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
|
||||
/*!40103 SET TIME_ZONE='+00:00' */;
|
||||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
|
||||
--
|
||||
-- Table structure for table `course_exam_settings`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `course_exam_settings`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `course_exam_settings` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`course_id` int NOT NULL COMMENT '课程ID',
|
||||
`single_choice_count` int NOT NULL DEFAULT '10' COMMENT '单选题数量',
|
||||
`multiple_choice_count` int NOT NULL DEFAULT '5' COMMENT '多选题数量',
|
||||
`true_false_count` int NOT NULL DEFAULT '5' COMMENT '判断题数量',
|
||||
`fill_blank_count` int NOT NULL DEFAULT '0' COMMENT '填空题数量',
|
||||
`duration_minutes` int NOT NULL DEFAULT '60' COMMENT '考试时长(分钟)',
|
||||
`difficulty_level` int NOT NULL DEFAULT '3' COMMENT '难度系数(1-5)',
|
||||
`passing_score` int NOT NULL DEFAULT '60' COMMENT '及格分数',
|
||||
`is_enabled` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是否启用',
|
||||
`show_answer_immediately` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否立即显示答案',
|
||||
`allow_retake` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是否允许重考',
|
||||
`max_retake_times` int DEFAULT NULL COMMENT '最大重考次数',
|
||||
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`is_deleted` tinyint(1) NOT NULL DEFAULT '0',
|
||||
`deleted_at` datetime DEFAULT NULL,
|
||||
`deleted_by` int DEFAULT NULL COMMENT '删除人ID',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `course_id` (`course_id`),
|
||||
KEY `ix_course_exam_settings_id` (`id`),
|
||||
CONSTRAINT `course_exam_settings_ibfk_1` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='课程考试设置表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `course_exam_settings`
|
||||
--
|
||||
|
||||
LOCK TABLES `course_exam_settings` WRITE;
|
||||
/*!40000 ALTER TABLE `course_exam_settings` DISABLE KEYS */;
|
||||
INSERT INTO `course_exam_settings` (`id`, `course_id`, `single_choice_count`, `multiple_choice_count`, `true_false_count`, `fill_blank_count`, `duration_minutes`, `difficulty_level`, `passing_score`, `is_enabled`, `show_answer_immediately`, `allow_retake`, `max_retake_times`, `created_at`, `updated_at`, `created_by`, `updated_by`, `is_deleted`, `deleted_at`, `deleted_by`) VALUES (1,1,5,3,2,0,60,2,80,1,1,1,3,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(2,2,4,2,2,2,45,1,75,1,1,1,3,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(3,3,3,2,3,2,50,2,80,1,0,1,2,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(4,4,4,3,2,1,55,2,85,1,1,1,3,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(5,5,5,2,2,1,40,1,70,1,1,1,5,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(6,6,3,2,3,2,45,1,75,1,1,1,3,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(7,7,4,2,2,2,50,2,80,1,0,1,2,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(8,8,5,3,2,0,60,3,85,1,1,1,2,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(9,9,4,2,4,0,50,2,80,1,1,1,3,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(10,10,3,2,3,2,45,1,75,1,1,1,3,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(11,11,5,3,2,0,60,3,90,1,0,1,2,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL),(12,12,4,2,4,0,40,1,70,1,1,1,5,'2025-09-23 02:41:33','2025-09-23 02:41:33',1,1,0,NULL,NULL);
|
||||
/*!40000 ALTER TABLE `course_exam_settings` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `course_materials`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `course_materials`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `course_materials` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`course_id` int NOT NULL COMMENT '所属课程ID',
|
||||
`name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '资料名称',
|
||||
`description` text COLLATE utf8mb4_unicode_ci COMMENT '资料描述',
|
||||
`file_url` varchar(500) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '文件URL',
|
||||
`file_type` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '文件类型',
|
||||
`file_size` int NOT NULL COMMENT '文件大小(字节)',
|
||||
`sort_order` int DEFAULT '0' COMMENT '排序序号',
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_course_id` (`course_id`),
|
||||
KEY `idx_is_deleted` (`is_deleted`),
|
||||
CONSTRAINT `course_materials_ibfk_1` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='课程资料表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `course_materials`
|
||||
--
|
||||
|
||||
LOCK TABLES `course_materials` WRITE;
|
||||
/*!40000 ALTER TABLE `course_materials` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `course_materials` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `courses`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `courses`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `courses` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '课程名称',
|
||||
`description` text COLLATE utf8mb4_unicode_ci COMMENT '课程描述',
|
||||
`category` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '课程分类',
|
||||
`status` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT 'draft' COMMENT '课程状态',
|
||||
`cover_image` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '封面图片',
|
||||
`duration_hours` decimal(5,2) DEFAULT NULL COMMENT '课程时长(小时)',
|
||||
`difficulty_level` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '难度等级',
|
||||
`tags` json DEFAULT NULL COMMENT '标签列表',
|
||||
`published_at` datetime DEFAULT NULL COMMENT '发布时间',
|
||||
`publisher_id` int DEFAULT NULL COMMENT '发布人ID',
|
||||
`sort_order` int DEFAULT '0' COMMENT '排序',
|
||||
`is_featured` tinyint(1) DEFAULT '0' COMMENT '是否推荐',
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_status` (`status`),
|
||||
KEY `idx_category` (`category`),
|
||||
KEY `idx_is_featured` (`is_featured`),
|
||||
KEY `idx_is_deleted` (`is_deleted`),
|
||||
KEY `idx_sort_order` (`sort_order`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='课程信息表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `courses`
|
||||
--
|
||||
|
||||
LOCK TABLES `courses` WRITE;
|
||||
/*!40000 ALTER TABLE `courses` DISABLE KEYS */;
|
||||
INSERT INTO `courses` (`id`, `name`, `description`, `category`, `status`, `cover_image`, `duration_hours`, `difficulty_level`, `tags`, `published_at`, `publisher_id`, `sort_order`, `is_featured`, `is_deleted`, `deleted_at`, `created_by`, `updated_by`, `created_at`, `updated_at`) VALUES (1,'皮肤生理学基础','学习皮肤结构、功能和常见问题,为专业护理打下坚实基础','technology','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(2,'医美产品知识与应用','全面了解各类医美产品的成分、功效和适用人群,掌握产品推荐技巧','technology','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(3,'美容仪器操作与维护','掌握各类美容仪器的操作方法、注意事项和日常维护保养','technology','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(4,'医美项目介绍与咨询','详细了解各类医美项目的原理、效果和适应症,提升咨询专业度','business','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(5,'轻医美销售技巧','学习专业的销售话术、客户需求分析和成交技巧,提升业绩能力','business','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(6,'客户服务与投诉处理','提升服务意识,掌握客户投诉处理的方法和技巧,维护品牌形象','management','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(7,'社媒营销与私域运营','学习如何通过社交媒体进行品牌推广和客户维护,建立私域流量','business','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(8,'门店运营管理','学习门店日常管理、团队建设和业绩管理的方法和技巧','management','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(9,'卫生消毒与感染控制','学习医美机构的卫生标准和消毒流程,确保服务安全合规','general','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(10,'美容心理学','了解客户心理需求,掌握沟通技巧,提升服务满意度','general','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(11,'法律法规与行业规范','学习医美行业相关法律法规,确保合规经营','general','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(12,'新员工入职培训','新员工必修课程,包含企业文化、基础知识和操作规范','general','published',NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24');
|
||||
/*!40000 ALTER TABLE `courses` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `exam_results`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `exam_results`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `exam_results` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`exam_id` int NOT NULL COMMENT '考试ID',
|
||||
`question_id` int NOT NULL COMMENT '题目ID',
|
||||
`user_answer` json DEFAULT NULL COMMENT '用户答案',
|
||||
`is_correct` tinyint(1) NOT NULL COMMENT '是否正确',
|
||||
`score` decimal(5,2) NOT NULL COMMENT '考试得分',
|
||||
`answer_time` int DEFAULT NULL COMMENT '答题时长(秒)',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_exam_id` (`exam_id`),
|
||||
KEY `idx_question_id` (`question_id`),
|
||||
CONSTRAINT `exam_results_ibfk_1` FOREIGN KEY (`exam_id`) REFERENCES `exams` (`id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `exam_results_ibfk_2` FOREIGN KEY (`question_id`) REFERENCES `questions` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='考试结果表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `exam_results`
|
||||
--
|
||||
|
||||
LOCK TABLES `exam_results` WRITE;
|
||||
/*!40000 ALTER TABLE `exam_results` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `exam_results` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `exams`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `exams`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `exams` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`user_id` int NOT NULL COMMENT '用户ID',
|
||||
`course_id` int NOT NULL COMMENT '课程ID',
|
||||
`exam_name` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '考试名称',
|
||||
`question_count` int DEFAULT NULL COMMENT '题目数量',
|
||||
`total_score` decimal(5,2) DEFAULT NULL COMMENT '总分',
|
||||
`pass_score` decimal(5,2) DEFAULT NULL COMMENT '及格分',
|
||||
`start_time` datetime DEFAULT NULL COMMENT '开始时间',
|
||||
`end_time` datetime DEFAULT NULL COMMENT '结束时间',
|
||||
`duration_minutes` int DEFAULT NULL COMMENT '考试时长(分钟)',
|
||||
`score` decimal(5,2) DEFAULT NULL COMMENT '得分',
|
||||
`is_passed` tinyint(1) DEFAULT '0' COMMENT '是否通过',
|
||||
`status` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT 'pending' COMMENT '考试状态',
|
||||
`questions` json DEFAULT NULL COMMENT '题目数据(JSON格式)',
|
||||
`answers` json DEFAULT NULL COMMENT '答案数据(JSON格式)',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_user_id` (`user_id`),
|
||||
KEY `idx_course_id` (`course_id`),
|
||||
KEY `idx_status` (`status`),
|
||||
CONSTRAINT `exams_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `exams_ibfk_2` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='考试记录表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `exams`
|
||||
--
|
||||
|
||||
LOCK TABLES `exams` WRITE;
|
||||
/*!40000 ALTER TABLE `exams` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `exams` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `growth_paths`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `growth_paths`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `growth_paths` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '成长路径名称',
|
||||
`description` text COLLATE utf8mb4_unicode_ci COMMENT '路径描述',
|
||||
`target_role` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '目标角色',
|
||||
`courses` json DEFAULT NULL COMMENT '课程列表',
|
||||
`estimated_duration_days` int DEFAULT NULL COMMENT '预计完成天数',
|
||||
`is_active` tinyint(1) DEFAULT '1' COMMENT '是否启用',
|
||||
`sort_order` int DEFAULT '0' COMMENT '排序顺序',
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_is_active` (`is_active`),
|
||||
KEY `idx_is_deleted` (`is_deleted`),
|
||||
KEY `idx_sort_order` (`sort_order`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='成长路径表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `growth_paths`
|
||||
--
|
||||
|
||||
LOCK TABLES `growth_paths` WRITE;
|
||||
/*!40000 ALTER TABLE `growth_paths` DISABLE KEYS */;
|
||||
INSERT INTO `growth_paths` (`id`, `name`, `description`, `target_role`, `courses`, `estimated_duration_days`, `is_active`, `sort_order`, `is_deleted`, `deleted_at`, `created_at`, `updated_at`) VALUES (1,'美容顾问成长路径','从初级美容顾问到资深顾问的完整成长路径,包含专业技能和销售能力提升','资深美容顾问',NULL,NULL,1,0,0,NULL,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(2,'美容技师进阶路径','美容技师的技能进阶路径,从基础护理到高级项目操作','高级美容技师',NULL,NULL,1,0,0,NULL,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(3,'管理岗位培养路径','从一线员工到管理岗位的培养路径,包含领导力和管理技能','店长/区域经理',NULL,NULL,1,0,0,NULL,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(4,'医美咨询师专业路径','医美咨询师的专业发展路径,深度掌握医美项目知识','资深医美咨询师',NULL,NULL,1,0,0,NULL,'2025-09-23 02:39:48','2025-09-23 02:39:48');
|
||||
/*!40000 ALTER TABLE `growth_paths` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `knowledge_points`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `knowledge_points`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `knowledge_points` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`course_id` int DEFAULT NULL COMMENT '所属课程ID',
|
||||
`name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '知识点名称',
|
||||
`description` text COLLATE utf8mb4_unicode_ci COMMENT '知识点描述',
|
||||
`parent_id` int DEFAULT NULL COMMENT '父知识点ID',
|
||||
`level` int DEFAULT '1' COMMENT '层级深度',
|
||||
`path` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '知识点路径',
|
||||
`sort_order` int DEFAULT '0' COMMENT '排序顺序',
|
||||
`weight` decimal(3,2) DEFAULT '1.00' COMMENT '权重',
|
||||
`is_required` tinyint(1) DEFAULT '1' COMMENT '是否必修',
|
||||
`estimated_hours` decimal(4,2) DEFAULT NULL COMMENT '预计学习时间(小时)',
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_course_id` (`course_id`),
|
||||
KEY `idx_parent_id` (`parent_id`),
|
||||
KEY `idx_is_deleted` (`is_deleted`),
|
||||
KEY `idx_sort_order` (`sort_order`),
|
||||
CONSTRAINT `knowledge_points_ibfk_1` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `knowledge_points_ibfk_2` FOREIGN KEY (`parent_id`) REFERENCES `knowledge_points` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='知识点表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `knowledge_points`
|
||||
--
|
||||
|
||||
LOCK TABLES `knowledge_points` WRITE;
|
||||
/*!40000 ALTER TABLE `knowledge_points` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `knowledge_points` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `material_knowledge_points`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `material_knowledge_points`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `material_knowledge_points` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`material_id` int NOT NULL COMMENT '资料ID',
|
||||
`knowledge_point_id` int NOT NULL COMMENT '知识点ID',
|
||||
`sort_order` int DEFAULT '0' COMMENT '排序顺序',
|
||||
`is_ai_generated` tinyint(1) DEFAULT '0' COMMENT '是否AI生成',
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `idx_material_knowledge` (`material_id`,`knowledge_point_id`),
|
||||
KEY `idx_material_id` (`material_id`),
|
||||
KEY `idx_knowledge_point_id` (`knowledge_point_id`),
|
||||
CONSTRAINT `material_knowledge_points_ibfk_1` FOREIGN KEY (`material_id`) REFERENCES `course_materials` (`id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `material_knowledge_points_ibfk_2` FOREIGN KEY (`knowledge_point_id`) REFERENCES `knowledge_points` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='资料知识点关联表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `material_knowledge_points`
|
||||
--
|
||||
|
||||
LOCK TABLES `material_knowledge_points` WRITE;
|
||||
/*!40000 ALTER TABLE `material_knowledge_points` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `material_knowledge_points` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `position_courses`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `position_courses`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `position_courses` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`position_id` int NOT NULL COMMENT '岗位ID',
|
||||
`course_id` int NOT NULL COMMENT '课程ID',
|
||||
`course_type` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'required' COMMENT '课程类型(必修/选修)',
|
||||
`priority` int DEFAULT '0' COMMENT '优先级',
|
||||
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`is_deleted` tinyint(1) NOT NULL DEFAULT '0',
|
||||
`deleted_at` datetime DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uix_position_course` (`position_id`,`course_id`,`is_deleted`),
|
||||
KEY `course_id` (`course_id`),
|
||||
KEY `ix_position_courses_id` (`id`),
|
||||
CONSTRAINT `position_courses_ibfk_1` FOREIGN KEY (`position_id`) REFERENCES `positions` (`id`),
|
||||
CONSTRAINT `position_courses_ibfk_2` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='岗位课程关联表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `position_courses`
|
||||
--
|
||||
|
||||
LOCK TABLES `position_courses` WRITE;
|
||||
/*!40000 ALTER TABLE `position_courses` DISABLE KEYS */;
|
||||
INSERT INTO `position_courses` (`id`, `position_id`, `course_id`, `course_type`, `priority`, `created_at`, `updated_at`, `created_by`, `updated_by`, `is_deleted`, `deleted_at`) VALUES (1,1,6,'required',1,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(2,1,8,'required',2,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(3,1,11,'required',3,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(4,1,12,'required',4,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(5,3,1,'required',1,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(6,3,2,'required',2,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(7,3,5,'required',3,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(8,3,6,'required',4,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(9,3,10,'required',5,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(10,3,12,'required',6,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(11,4,1,'required',1,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(12,4,2,'required',2,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(13,4,4,'required',3,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(14,4,5,'required',4,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(15,4,9,'required',5,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(16,4,12,'required',6,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(17,5,1,'required',1,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(18,5,2,'required',2,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(19,5,3,'required',3,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(20,5,9,'required',4,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(21,5,12,'required',5,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(22,7,6,'required',1,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(23,7,10,'required',2,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(24,7,12,'required',3,'2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL);
|
||||
/*!40000 ALTER TABLE `position_courses` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `position_members`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `position_members`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `position_members` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`position_id` int NOT NULL COMMENT '岗位ID',
|
||||
`user_id` int NOT NULL COMMENT '用户ID',
|
||||
`role` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '在岗位中的角色',
|
||||
`joined_at` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '加入时间',
|
||||
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`is_deleted` tinyint(1) NOT NULL DEFAULT '0',
|
||||
`deleted_at` datetime DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uix_position_user` (`position_id`,`user_id`,`is_deleted`),
|
||||
KEY `user_id` (`user_id`),
|
||||
KEY `ix_position_members_id` (`id`),
|
||||
CONSTRAINT `position_members_ibfk_1` FOREIGN KEY (`position_id`) REFERENCES `positions` (`id`),
|
||||
CONSTRAINT `position_members_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='岗位成员关联表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `position_members`
|
||||
--
|
||||
|
||||
LOCK TABLES `position_members` WRITE;
|
||||
/*!40000 ALTER TABLE `position_members` DISABLE KEYS */;
|
||||
INSERT INTO `position_members` (`id`, `position_id`, `user_id`, `role`, `joined_at`, `created_at`, `updated_at`, `created_by`, `updated_by`, `is_deleted`, `deleted_at`) VALUES (1,1,3,NULL,'2025-09-22 18:42:32','2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(2,1,4,NULL,'2025-09-22 18:42:32','2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(3,3,5,NULL,'2025-09-22 18:42:32','2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(4,4,6,NULL,'2025-09-22 18:42:32','2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(5,5,7,NULL,'2025-09-22 18:42:32','2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL),(6,7,8,NULL,'2025-09-22 18:42:32','2025-09-23 02:42:32','2025-09-23 02:42:32',NULL,NULL,0,NULL);
|
||||
/*!40000 ALTER TABLE `position_members` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `positions`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `positions`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `positions` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '岗位名称',
|
||||
`code` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '岗位代码',
|
||||
`description` text COLLATE utf8mb4_unicode_ci COMMENT '岗位描述',
|
||||
`parent_id` int DEFAULT NULL COMMENT '上级岗位ID',
|
||||
`status` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT 'active' COMMENT '岗位状态',
|
||||
`skills` json DEFAULT NULL COMMENT '核心技能',
|
||||
`level` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '岗位级别',
|
||||
`sort_order` int DEFAULT '0' COMMENT '排序',
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `code` (`code`),
|
||||
KEY `parent_id` (`parent_id`),
|
||||
KEY `idx_positions_name` (`name`),
|
||||
CONSTRAINT `positions_ibfk_1` FOREIGN KEY (`parent_id`) REFERENCES `positions` (`id`) ON DELETE SET NULL
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='岗位信息表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `positions`
|
||||
--
|
||||
|
||||
LOCK TABLES `positions` WRITE;
|
||||
/*!40000 ALTER TABLE `positions` DISABLE KEYS */;
|
||||
INSERT INTO `positions` (`id`, `name`, `code`, `description`, `parent_id`, `status`, `skills`, `level`, `sort_order`, `is_deleted`, `deleted_at`, `created_by`, `updated_by`, `created_at`, `updated_at`) VALUES (1,'区域经理','region_manager','负责多家门店的运营管理和业绩达成,制定区域发展战略',NULL,'active',NULL,'expert',0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(2,'店长','store_manager','负责门店日常运营管理,团队建设和业绩达成',NULL,'active',NULL,'senior',0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(3,'美容顾问','beauty_consultant','为客户提供专业的美容咨询和个性化方案设计',NULL,'active',NULL,'intermediate',0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(4,'医美咨询师','medical_beauty_consultant','提供医疗美容项目咨询和专业方案制定',NULL,'active',NULL,'senior',0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(5,'美容技师','beauty_therapist','为客户提供专业的美容护理和技术服务',NULL,'active',NULL,'intermediate',0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(6,'美容护士','beauty_nurse','协助医生进行医美项目操作,负责术后护理指导',NULL,'active',NULL,'intermediate',0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(7,'前台接待','receptionist','负责客户接待、预约管理和前台事务处理',NULL,'active',NULL,'junior',0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24'),(8,'市场专员','marketing_specialist','负责门店营销活动策划、执行和客户维护',NULL,'active',NULL,'intermediate',0,0,NULL,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24');
|
||||
/*!40000 ALTER TABLE `positions` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `questions`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `questions`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `questions` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`course_id` int NOT NULL COMMENT '所属课程ID',
|
||||
`question_type` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '题目类型',
|
||||
`title` text COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '题目标题',
|
||||
`content` text COLLATE utf8mb4_unicode_ci COMMENT '题目内容',
|
||||
`options` json DEFAULT NULL COMMENT '选项内容',
|
||||
`correct_answer` text COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '正确答案',
|
||||
`explanation` text COLLATE utf8mb4_unicode_ci COMMENT '答案解析',
|
||||
`score` float DEFAULT '10' COMMENT '题目分值',
|
||||
`difficulty` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT 'medium' COMMENT '难度等级',
|
||||
`tags` json DEFAULT NULL COMMENT '题目标签',
|
||||
`usage_count` int DEFAULT '0' COMMENT '使用次数',
|
||||
`correct_count` int DEFAULT '0' COMMENT '答对次数',
|
||||
`is_active` tinyint(1) DEFAULT '1' COMMENT '是否启用',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_course_id` (`course_id`),
|
||||
KEY `idx_question_type` (`question_type`),
|
||||
KEY `idx_difficulty` (`difficulty`),
|
||||
KEY `idx_is_active` (`is_active`),
|
||||
CONSTRAINT `questions_ibfk_1` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='题目表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `questions`
|
||||
--
|
||||
|
||||
LOCK TABLES `questions` WRITE;
|
||||
/*!40000 ALTER TABLE `questions` DISABLE KEYS */;
|
||||
INSERT INTO `questions` (`id`, `course_id`, `question_type`, `title`, `content`, `options`, `correct_answer`, `explanation`, `score`, `difficulty`, `tags`, `usage_count`, `correct_count`, `is_active`, `created_at`, `updated_at`) VALUES (1,1,'single_choice','皮肤的最外层是什么?',NULL,'[{\"text\": \"表皮\", \"label\": \"A\"}, {\"text\": \"真皮\", \"label\": \"B\"}, {\"text\": \"皮下组织\", \"label\": \"C\"}, {\"text\": \"角质层\", \"label\": \"D\"}]','A','A选项是表皮,这是皮肤的最外层,起到保护作用',10,'easy',NULL,0,0,1,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(2,2,'single_choice','透明质酸的主要功效是什么?',NULL,'[{\"text\": \"美白淡斑\", \"label\": \"A\"}, {\"text\": \"保湿补水\", \"label\": \"B\"}, {\"text\": \"紧致提升\", \"label\": \"C\"}, {\"text\": \"去除皱纹\", \"label\": \"D\"}]','B','B选项是保湿补水,透明质酸具有强大的保湿能力',10,'easy',NULL,0,0,1,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(3,3,'multiple_choice','射频美容仪的禁忌症包括哪些?',NULL,'[{\"text\": \"孕期和哺乳期\", \"label\": \"A\"}, {\"text\": \"皮肤过敏\", \"label\": \"B\"}, {\"text\": \"心脏起搏器\", \"label\": \"C\"}, {\"text\": \"轻微痤疮\", \"label\": \"D\"}]','A,C','A和C选项都是射频美容仪的禁忌症,需要特别注意',15,'medium',NULL,0,0,1,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(4,4,'true_false','水光针适合所有肤质的客户',NULL,'[{\"text\": \"正确\", \"label\": \"A\"}, {\"text\": \"错误\", \"label\": \"B\"}]','B','水光针虽然适用范围广,但仍有一些禁忌症和不适合的肤质',10,'easy',NULL,0,0,1,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(5,4,'fill_blank','肉毒素注射后____小时内不能平躺','肉毒素注射后【】小时内不能平躺,以免影响药物分布效果。',NULL,'4','肉毒素注射后4小时内不能平躺,以免影响药物分布',10,'medium',NULL,0,0,1,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(6,5,'single_choice','客户咨询时最重要的是什么?',NULL,'[{\"text\": \"倾听客户需求\", \"label\": \"A\"}, {\"text\": \"推荐最贵的产品\", \"label\": \"B\"}, {\"text\": \"快速成交\", \"label\": \"C\"}, {\"text\": \"展示专业知识\", \"label\": \"D\"}]','A','A选项是倾听客户需求,这是专业咨询的基础',10,'easy',NULL,0,0,1,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(7,6,'single_choice','处理客户投诉的第一步是什么?',NULL,'[{\"text\": \"解释原因\", \"label\": \"A\"}, {\"text\": \"耐心倾听\", \"label\": \"B\"}, {\"text\": \"提供补偿\", \"label\": \"C\"}, {\"text\": \"转交上级\", \"label\": \"D\"}]','B','B选项是耐心倾听,让客户充分表达不满是处理投诉的第一步',10,'easy',NULL,0,0,1,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(8,7,'true_false','社交媒体营销只需要发布产品信息',NULL,'[{\"text\": \"正确\", \"label\": \"A\"}, {\"text\": \"错误\", \"label\": \"B\"}]','B','社交媒体营销需要内容多样化,包括教育内容、互动内容等',10,'easy',NULL,0,0,1,'2025-09-23 02:39:48','2025-09-23 02:39:48');
|
||||
/*!40000 ALTER TABLE `questions` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `teams`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `teams`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `teams` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '团队名称',
|
||||
`code` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '团队代码',
|
||||
`description` text COLLATE utf8mb4_unicode_ci COMMENT '团队描述',
|
||||
`team_type` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '团队类型',
|
||||
`is_active` tinyint(1) DEFAULT '1' COMMENT '是否激活',
|
||||
`leader_id` int DEFAULT NULL COMMENT '负责人ID',
|
||||
`parent_id` int DEFAULT NULL COMMENT '父团队ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `name` (`name`),
|
||||
UNIQUE KEY `code` (`code`),
|
||||
KEY `leader_id` (`leader_id`),
|
||||
KEY `parent_id` (`parent_id`),
|
||||
KEY `idx_team_type` (`team_type`),
|
||||
KEY `idx_is_active` (`is_active`),
|
||||
CONSTRAINT `teams_ibfk_1` FOREIGN KEY (`leader_id`) REFERENCES `users` (`id`) ON DELETE SET NULL,
|
||||
CONSTRAINT `teams_ibfk_2` FOREIGN KEY (`parent_id`) REFERENCES `teams` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='团队信息表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `teams`
|
||||
--
|
||||
|
||||
LOCK TABLES `teams` WRITE;
|
||||
/*!40000 ALTER TABLE `teams` DISABLE KEYS */;
|
||||
INSERT INTO `teams` (`id`, `name`, `code`, `description`, `team_type`, `is_active`, `leader_id`, `parent_id`, `created_at`, `updated_at`, `is_deleted`, `deleted_at`) VALUES (1,'管理层','MANAGEMENT','负责公司整体战略规划和运营管理','department',1,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(2,'北京运营团队','BJ_OPERATIONS','负责北京地区所有门店的运营管理','department',1,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(3,'上海运营团队','SH_OPERATIONS','负责上海地区所有门店的运营管理','department',1,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(4,'技术培训部','TECH_TRAINING','负责员工技术培训和考核','department',1,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(5,'客服质量部','QUALITY_SERVICE','负责客户服务质量监督和改进','department',1,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(6,'新员工培训小组','NEW_EMPLOYEE_TRAINING','专门负责新员工入职培训','study_group',1,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL);
|
||||
/*!40000 ALTER TABLE `teams` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `training_messages`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `training_messages`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `training_messages` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`session_id` int NOT NULL COMMENT '会话ID',
|
||||
`role` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '消息角色',
|
||||
`type` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '消息类型',
|
||||
`content` text COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '消息内容',
|
||||
`voice_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '语音文件URL',
|
||||
`voice_duration` int DEFAULT NULL COMMENT '语音时长(秒)',
|
||||
`message_metadata` json DEFAULT NULL COMMENT '消息元数据',
|
||||
`coze_message_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Coze消息ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_session_id` (`session_id`),
|
||||
KEY `idx_role` (`role`),
|
||||
CONSTRAINT `training_messages_ibfk_1` FOREIGN KEY (`session_id`) REFERENCES `training_sessions` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='培训消息表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `training_messages`
|
||||
--
|
||||
|
||||
LOCK TABLES `training_messages` WRITE;
|
||||
/*!40000 ALTER TABLE `training_messages` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `training_messages` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `training_reports`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `training_reports`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `training_reports` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`session_id` int NOT NULL COMMENT '会话ID',
|
||||
`user_id` int NOT NULL COMMENT '用户ID',
|
||||
`overall_score` decimal(5,2) DEFAULT NULL COMMENT '总体评分',
|
||||
`dimension_scores` json DEFAULT NULL COMMENT '各维度得分',
|
||||
`strengths` text COLLATE utf8mb4_unicode_ci COMMENT '优势点',
|
||||
`weaknesses` text COLLATE utf8mb4_unicode_ci COMMENT '待改进点',
|
||||
`suggestions` text COLLATE utf8mb4_unicode_ci COMMENT '改进建议',
|
||||
`detailed_analysis` text COLLATE utf8mb4_unicode_ci COMMENT '详细分析',
|
||||
`transcript` text COLLATE utf8mb4_unicode_ci COMMENT '对话记录',
|
||||
`statistics` json DEFAULT NULL COMMENT '统计数据',
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `session_id` (`session_id`),
|
||||
KEY `idx_user_id` (`user_id`),
|
||||
CONSTRAINT `training_reports_ibfk_1` FOREIGN KEY (`session_id`) REFERENCES `training_sessions` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='培训报告表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `training_reports`
|
||||
--
|
||||
|
||||
LOCK TABLES `training_reports` WRITE;
|
||||
/*!40000 ALTER TABLE `training_reports` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `training_reports` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `training_scenes`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `training_scenes`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `training_scenes` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '场景名称',
|
||||
`description` text COLLATE utf8mb4_unicode_ci COMMENT '场景描述',
|
||||
`category` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '场景分类',
|
||||
`ai_config` json DEFAULT NULL COMMENT 'AI配置',
|
||||
`prompt_template` text COLLATE utf8mb4_unicode_ci COMMENT '提示模板',
|
||||
`evaluation_criteria` json DEFAULT NULL COMMENT '评估标准',
|
||||
`status` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT 'active' COMMENT '场景状态',
|
||||
`is_public` tinyint(1) DEFAULT '1' COMMENT '是否公开',
|
||||
`required_level` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '所需用户等级',
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_status` (`status`),
|
||||
KEY `idx_category` (`category`),
|
||||
KEY `idx_is_public` (`is_public`),
|
||||
KEY `idx_is_deleted` (`is_deleted`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='培训场景表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `training_scenes`
|
||||
--
|
||||
|
||||
LOCK TABLES `training_scenes` WRITE;
|
||||
/*!40000 ALTER TABLE `training_scenes` DISABLE KEYS */;
|
||||
INSERT INTO `training_scenes` (`id`, `name`, `description`, `category`, `ai_config`, `prompt_template`, `evaluation_criteria`, `status`, `is_public`, `required_level`, `is_deleted`, `deleted_at`, `created_by`, `updated_by`, `created_at`, `updated_at`) VALUES (1,'客户咨询模拟','模拟真实的客户咨询场景,练习专业咨询技巧','客户服务',NULL,NULL,NULL,'ACTIVE',1,NULL,0,NULL,NULL,NULL,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(2,'产品推荐演练','针对不同客户需求进行产品推荐的实战演练','销售技巧',NULL,NULL,NULL,'ACTIVE',1,NULL,0,NULL,NULL,NULL,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(3,'投诉处理训练','模拟各种客户投诉情况,训练处理技巧和话术','客户服务',NULL,NULL,NULL,'ACTIVE',1,NULL,0,NULL,NULL,NULL,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(4,'项目操作指导','美容项目操作的标准流程指导和安全注意事项','技术指导',NULL,NULL,NULL,'ACTIVE',1,NULL,0,NULL,NULL,NULL,'2025-09-23 02:39:48','2025-09-23 02:39:48'),(5,'团队管理讨论','管理岗位的团队建设和绩效管理讨论','管理培训',NULL,NULL,NULL,'ACTIVE',1,NULL,0,NULL,NULL,NULL,'2025-09-23 02:39:48','2025-09-23 02:39:48');
|
||||
/*!40000 ALTER TABLE `training_scenes` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `training_sessions`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `training_sessions`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `training_sessions` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`user_id` int NOT NULL COMMENT '用户ID',
|
||||
`scene_id` int NOT NULL COMMENT '场景ID',
|
||||
`coze_conversation_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Coze对话ID',
|
||||
`start_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '开始时间',
|
||||
`end_time` datetime DEFAULT NULL COMMENT '结束时间',
|
||||
`duration_seconds` int DEFAULT NULL COMMENT '持续时长(秒)',
|
||||
`status` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT 'active' COMMENT '会话状态',
|
||||
`session_config` json DEFAULT NULL COMMENT '会话配置',
|
||||
`total_score` decimal(5,2) DEFAULT NULL COMMENT '总分',
|
||||
`evaluation_result` json DEFAULT NULL COMMENT '评估结果详情',
|
||||
`created_by` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_by` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_user_id` (`user_id`),
|
||||
KEY `idx_scene_id` (`scene_id`),
|
||||
KEY `idx_status` (`status`),
|
||||
CONSTRAINT `training_sessions_ibfk_1` FOREIGN KEY (`scene_id`) REFERENCES `training_scenes` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='培训会话表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `training_sessions`
|
||||
--
|
||||
|
||||
LOCK TABLES `training_sessions` WRITE;
|
||||
/*!40000 ALTER TABLE `training_sessions` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `training_sessions` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `user_teams`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `user_teams`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `user_teams` (
|
||||
`user_id` int NOT NULL COMMENT '用户ID',
|
||||
`team_id` int NOT NULL COMMENT '团队ID',
|
||||
`role` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '在团队中的角色',
|
||||
`joined_at` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '加入时间',
|
||||
PRIMARY KEY (`user_id`,`team_id`),
|
||||
KEY `team_id` (`team_id`),
|
||||
CONSTRAINT `user_teams_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `user_teams_ibfk_2` FOREIGN KEY (`team_id`) REFERENCES `teams` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='用户团队关联表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `user_teams`
|
||||
--
|
||||
|
||||
LOCK TABLES `user_teams` WRITE;
|
||||
/*!40000 ALTER TABLE `user_teams` DISABLE KEYS */;
|
||||
INSERT INTO `user_teams` (`user_id`, `team_id`, `role`, `joined_at`) VALUES (1,1,'leader','2025-09-22 18:42:32'),(2,1,'member','2025-09-22 18:42:32'),(3,2,'leader','2025-09-22 18:42:32'),(4,3,'leader','2025-09-22 18:42:32'),(5,2,'member','2025-09-22 18:42:32'),(5,4,'member','2025-09-22 18:42:32'),(6,2,'member','2025-09-22 18:42:32'),(6,4,'member','2025-09-22 18:42:32'),(7,3,'member','2025-09-22 18:42:32'),(7,4,'member','2025-09-22 18:42:32'),(8,3,'member','2025-09-22 18:42:32'),(8,6,'member','2025-09-22 18:42:32');
|
||||
/*!40000 ALTER TABLE `user_teams` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `users`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `users`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `users` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`username` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '用户名',
|
||||
`email` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '邮箱',
|
||||
`phone` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '手机号',
|
||||
`password_hash` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '密码哈希',
|
||||
`full_name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '真实姓名',
|
||||
`gender` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '性别',
|
||||
`avatar_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '头像URL',
|
||||
`bio` text COLLATE utf8mb4_unicode_ci COMMENT '个人简介',
|
||||
`school` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '学校',
|
||||
`major` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '专业',
|
||||
`role` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'trainee' COMMENT '用户角色',
|
||||
`is_active` tinyint(1) DEFAULT '1' COMMENT '是否激活',
|
||||
`is_verified` tinyint(1) DEFAULT '0' COMMENT '是否验证',
|
||||
`last_login_at` datetime DEFAULT NULL COMMENT '最后登录时间',
|
||||
`password_changed_at` datetime DEFAULT NULL COMMENT '密码修改时间',
|
||||
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `username` (`username`),
|
||||
UNIQUE KEY `email` (`email`),
|
||||
UNIQUE KEY `phone` (`phone`),
|
||||
KEY `idx_role` (`role`),
|
||||
KEY `idx_is_active` (`is_active`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='用户信息表';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `users`
|
||||
--
|
||||
|
||||
LOCK TABLES `users` WRITE;
|
||||
/*!40000 ALTER TABLE `users` DISABLE KEYS */;
|
||||
INSERT INTO `users` (`id`, `username`, `email`, `phone`, `password_hash`, `full_name`, `gender`, `avatar_url`, `bio`, `school`, `major`, `role`, `is_active`, `is_verified`, `last_login_at`, `password_changed_at`, `created_at`, `updated_at`, `is_deleted`, `deleted_at`) VALUES (1,'superadmin','superadmin@ruimei.com','13800138001','$2b$12$jFhkYU3.Cd1kAfr64/073eayPquAr0z9WWUQEdOyFRmAqcxz.i10C','超级管理员','male',NULL,'负责系统整体管理和运营','睿美医疗美容学院','医疗美容管理','admin',1,0,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(2,'admin','admin@ruimei.com','13800138002','$2b$12$jFhkYU3.Cd1kAfr64/073eayPquAr0z9WWUQEdOyFRmAqcxz.i10C','系统管理员','female',NULL,'负责日常系统管理工作','睿美医疗美容学院','医疗美容技术','admin',1,0,'2025-09-22 18:54:56',NULL,'2025-09-23 02:38:24','2025-09-22 18:54:56',0,NULL),(3,'manager_beijing','manager.bj@ruimei.com','13800138003','$2b$12$jFhkYU3.Cd1kAfr64/073eayPquAr0z9WWUQEdOyFRmAqcxz.i10C','北京区域经理','male',NULL,'负责北京地区门店管理','北京医科大学','临床医学','manager',1,0,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(4,'manager_shanghai','manager.sh@ruimei.com','13800138004','$2b$12$jFhkYU3.Cd1kAfr64/073eayPquAr0z9WWUQEdOyFRmAqcxz.i10C','上海区域经理','female',NULL,'负责上海地区门店管理','复旦大学医学院','医疗美容','manager',1,0,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(5,'consultant_001','consultant001@ruimei.com','13800138005','$2b$12$jFhkYU3.Cd1kAfr64/073eayPquAr0z9WWUQEdOyFRmAqcxz.i10C','资深美容顾问','female',NULL,'专业美容咨询师,5年从业经验','上海健康医学院','医疗美容技术','trainee',1,0,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(6,'nurse_001','nurse001@ruimei.com','13800138006','$2b$12$jFhkYU3.Cd1kAfr64/073eayPquAr0z9WWUQEdOyFRmAqcxz.i10C','美容护士','female',NULL,'持证美容护士,专业技术过硬','首都医科大学','护理学','trainee',1,0,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(7,'therapist_001','therapist001@ruimei.com','13800138007','$2b$12$jFhkYU3.Cd1kAfr64/073eayPquAr0z9WWUQEdOyFRmAqcxz.i10C','美容技师','female',NULL,'专业美容技师,擅长面部护理','北京卫生职业学院','医疗美容技术','trainee',1,0,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL),(8,'receptionist_001','front001@ruimei.com','13800138008','$2b$12$jFhkYU3.Cd1kAfr64/073eayPquAr0z9WWUQEdOyFRmAqcxz.i10C','前台接待','female',NULL,'负责客户接待和预约管理','北京商贸职业学院','商务管理','trainee',1,0,NULL,NULL,'2025-09-23 02:38:24','2025-09-23 02:38:24',0,NULL);
|
||||
/*!40000 ALTER TABLE `users` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Temporary view structure for view `v_user_course_progress`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `v_user_course_progress`;
|
||||
/*!50001 DROP VIEW IF EXISTS `v_user_course_progress`*/;
|
||||
SET @saved_cs_client = @@character_set_client;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
/*!50001 CREATE VIEW `v_user_course_progress` AS SELECT
|
||||
1 AS `user_id`,
|
||||
1 AS `username`,
|
||||
1 AS `course_id`,
|
||||
1 AS `course_name`,
|
||||
1 AS `exam_count`,
|
||||
1 AS `avg_score`,
|
||||
1 AS `best_score`*/;
|
||||
SET character_set_client = @saved_cs_client;
|
||||
|
||||
--
|
||||
-- Dumping events for database 'kaopeilian'
|
||||
--
|
||||
|
||||
--
|
||||
-- Dumping routines for database 'kaopeilian'
|
||||
--
|
||||
|
||||
--
|
||||
-- Final view structure for view `v_user_course_progress`
|
||||
--
|
||||
|
||||
/*!50001 DROP VIEW IF EXISTS `v_user_course_progress`*/;
|
||||
/*!50001 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50001 SET @saved_cs_results = @@character_set_results */;
|
||||
/*!50001 SET @saved_col_connection = @@collation_connection */;
|
||||
/*!50001 SET character_set_client = latin1 */;
|
||||
/*!50001 SET character_set_results = latin1 */;
|
||||
/*!50001 SET collation_connection = latin1_swedish_ci */;
|
||||
/*!50001 CREATE ALGORITHM=UNDEFINED */
|
||||
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
|
||||
/*!50001 VIEW `v_user_course_progress` AS select `u`.`id` AS `user_id`,`u`.`username` AS `username`,`c`.`id` AS `course_id`,`c`.`name` AS `course_name`,count(distinct `e`.`id`) AS `exam_count`,avg(`e`.`score`) AS `avg_score`,max(`e`.`score`) AS `best_score` from ((`users` `u` join `courses` `c`) left join `exams` `e` on(((`e`.`user_id` = `u`.`id`) and (`e`.`course_id` = `c`.`id`) and (`e`.`status` = 'submitted')))) group by `u`.`id`,`c`.`id` */;
|
||||
/*!50001 SET character_set_client = @saved_cs_client */;
|
||||
/*!50001 SET character_set_results = @saved_cs_results */;
|
||||
/*!50001 SET collation_connection = @saved_col_connection */;
|
||||
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
|
||||
|
||||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
||||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
||||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
-- Dump completed on 2025-09-22 18:56:22
|
||||
Reference in New Issue
Block a user