527 lines
38 KiB
SQL
527 lines
38 KiB
SQL
-- MySQL dump 10.13 Distrib 8.4.10, for Linux (x86_64)
|
||
--
|
||
-- Host: localhost Database: fitness
|
||
-- ------------------------------------------------------
|
||
-- Server version 8.4.10
|
||
|
||
/*!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 `body_records`
|
||
--
|
||
|
||
DROP TABLE IF EXISTS `body_records`;
|
||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||
/*!50503 SET character_set_client = utf8mb4 */;
|
||
CREATE TABLE `body_records` (
|
||
`id` bigint NOT NULL AUTO_INCREMENT,
|
||
`user_id` varchar(50) NOT NULL COMMENT '用户标识',
|
||
`record_date` date NOT NULL COMMENT '记录日期',
|
||
`weight` decimal(5,1) NOT NULL COMMENT '体重(kg)',
|
||
`waistline` decimal(5,1) DEFAULT NULL COMMENT '腰围(cm)',
|
||
`body_fat` decimal(4,1) DEFAULT NULL COMMENT '体脂率(%)',
|
||
`note` varchar(255) DEFAULT '' COMMENT '备注',
|
||
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
|
||
PRIMARY KEY (`id`),
|
||
UNIQUE KEY `uk_user_date` (`user_id`,`record_date`),
|
||
KEY `idx_user_date_order` (`user_id`,`record_date` DESC)
|
||
) ENGINE=InnoDB AUTO_INCREMENT=49 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='身体数据记录';
|
||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||
|
||
--
|
||
-- Dumping data for table `body_records`
|
||
--
|
||
|
||
LOCK TABLES `body_records` WRITE;
|
||
/*!40000 ALTER TABLE `body_records` DISABLE KEYS */;
|
||
INSERT INTO `body_records` VALUES (22,'yangxuan','2026-07-10',66.6,NULL,NULL,'','2026-07-10 03:55:18'),(31,'yangxuan','2019-07-01',63.3,NULL,NULL,'','2026-07-10 05:40:12'),(32,'yangxuan','2021-01-23',67.7,NULL,NULL,'','2026-07-10 05:40:12'),(33,'yangxuan','2022-01-08',70.6,NULL,NULL,'','2026-07-10 05:40:12'),(34,'yangxuan','2023-04-20',73.8,NULL,NULL,'','2026-07-10 05:40:12'),(35,'yangxuan','2024-09-21',71.6,NULL,NULL,'','2026-07-10 05:40:12'),(36,'yangxuan','2025-12-27',71.2,NULL,NULL,'','2026-07-10 05:40:12'),(37,'yangxuan','2026-03-20',69.7,NULL,NULL,'','2026-07-10 05:51:44'),(38,'yangxuan','2026-04-10',68.6,NULL,NULL,'','2026-07-10 05:51:44'),(39,'yangxuan','2026-04-17',68.8,NULL,NULL,'','2026-07-10 05:51:44'),(40,'yangxuan','2026-04-24',68.2,NULL,NULL,'','2026-07-10 05:51:44'),(41,'yangxuan','2026-04-30',67.3,NULL,NULL,'','2026-07-10 05:51:44'),(42,'yangxuan','2026-05-06',70.5,NULL,NULL,'','2026-07-10 05:51:44'),(43,'yangxuan','2026-05-25',68.1,NULL,NULL,'','2026-07-10 05:51:44'),(44,'yangxuan','2026-05-29',67.6,NULL,NULL,'','2026-07-10 05:51:44'),(45,'yangxuan','2026-06-17',67.1,NULL,NULL,'','2026-07-10 05:51:44'),(46,'yangxuan','2026-06-26',66.8,NULL,NULL,'','2026-07-10 05:51:44'),(47,'yangxuan','2026-07-03',66.7,NULL,NULL,'','2026-07-10 05:51:44'),(48,'yangxuan','2026-07-14',66.2,NULL,NULL,'','2026-07-14 10:17:38');
|
||
/*!40000 ALTER TABLE `body_records` ENABLE KEYS */;
|
||
UNLOCK TABLES;
|
||
|
||
--
|
||
-- Table structure for table `diet_records`
|
||
--
|
||
|
||
DROP TABLE IF EXISTS `diet_records`;
|
||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||
/*!50503 SET character_set_client = utf8mb4 */;
|
||
CREATE TABLE `diet_records` (
|
||
`id` bigint NOT NULL AUTO_INCREMENT,
|
||
`user_id` varchar(50) NOT NULL COMMENT '用户标识',
|
||
`record_date` date NOT NULL COMMENT '记录日期',
|
||
`meal_type` enum('早餐','午餐','晚餐','加餐') NOT NULL COMMENT '餐次',
|
||
`food_name` varchar(100) NOT NULL COMMENT '食物名称',
|
||
`quantity` decimal(8,1) NOT NULL COMMENT '食用量',
|
||
`unit` varchar(20) DEFAULT '克' COMMENT '单位',
|
||
`estimated_heat` decimal(7,1) DEFAULT '0.0' COMMENT '估算热量(kcal)',
|
||
`note` varchar(255) DEFAULT '' COMMENT '备注',
|
||
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
|
||
PRIMARY KEY (`id`),
|
||
KEY `idx_user_date` (`user_id`,`record_date`),
|
||
KEY `idx_record_date` (`record_date`)
|
||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='饮食记录';
|
||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||
|
||
--
|
||
-- Dumping data for table `diet_records`
|
||
--
|
||
|
||
LOCK TABLES `diet_records` WRITE;
|
||
/*!40000 ALTER TABLE `diet_records` DISABLE KEYS */;
|
||
/*!40000 ALTER TABLE `diet_records` ENABLE KEYS */;
|
||
UNLOCK TABLES;
|
||
|
||
--
|
||
-- Table structure for table `exercise_records`
|
||
--
|
||
|
||
DROP TABLE IF EXISTS `exercise_records`;
|
||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||
/*!50503 SET character_set_client = utf8mb4 */;
|
||
CREATE TABLE `exercise_records` (
|
||
`id` bigint NOT NULL AUTO_INCREMENT,
|
||
`user_id` varchar(50) NOT NULL COMMENT '用户标识',
|
||
`record_date` date NOT NULL COMMENT '记录日期',
|
||
`time_slot` enum('早晨','中午','下午','晚上') DEFAULT '早晨' COMMENT '时间段',
|
||
`exercise_type` varchar(50) NOT NULL COMMENT '运动类型(如:八段锦)',
|
||
`duration_minutes` int NOT NULL COMMENT '运动时长(分钟)',
|
||
`estimated_burn` decimal(7,1) DEFAULT '0.0' COMMENT '估算消耗(kcal)',
|
||
`note` varchar(255) DEFAULT '' COMMENT '备注/感受',
|
||
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
|
||
PRIMARY KEY (`id`),
|
||
KEY `idx_user_date` (`user_id`,`record_date`)
|
||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='运动记录';
|
||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||
|
||
--
|
||
-- Dumping data for table `exercise_records`
|
||
--
|
||
|
||
LOCK TABLES `exercise_records` WRITE;
|
||
/*!40000 ALTER TABLE `exercise_records` DISABLE KEYS */;
|
||
/*!40000 ALTER TABLE `exercise_records` ENABLE KEYS */;
|
||
UNLOCK TABLES;
|
||
|
||
--
|
||
-- Table structure for table `food_library`
|
||
--
|
||
|
||
DROP TABLE IF EXISTS `food_library`;
|
||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||
/*!50503 SET character_set_client = utf8mb4 */;
|
||
CREATE TABLE `food_library` (
|
||
`id` int NOT NULL AUTO_INCREMENT,
|
||
`name` varchar(100) NOT NULL COMMENT '食物名称',
|
||
`category` varchar(50) NOT NULL COMMENT '分类:主食/肉类/蔬菜/水果/乳制品/饮品/零食/调味品',
|
||
`heat` decimal(6,1) NOT NULL COMMENT '每100克热量(kcal)',
|
||
`unit` varchar(20) DEFAULT '克' COMMENT '常用单位',
|
||
`unit_weight` decimal(6,1) DEFAULT '100.0' COMMENT '单位对应的克数',
|
||
`nature` enum('温','热','平','凉','寒') DEFAULT '平' COMMENT '食物性质(中医)',
|
||
`note` text COMMENT '备注/建议',
|
||
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
|
||
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||
PRIMARY KEY (`id`),
|
||
UNIQUE KEY `uk_name` (`name`)
|
||
) ENGINE=InnoDB AUTO_INCREMENT=71 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='食物热量库';
|
||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||
|
||
--
|
||
-- Dumping data for table `food_library`
|
||
--
|
||
|
||
LOCK TABLES `food_library` WRITE;
|
||
/*!40000 ALTER TABLE `food_library` DISABLE KEYS */;
|
||
INSERT INTO `food_library` VALUES (1,'米饭','主食',116.0,'碗',200.0,'平','1碗约200克','2026-07-10 03:09:09','2026-07-10 03:09:09'),(2,'白粥','主食',46.0,'碗',300.0,'平','1碗约300克','2026-07-10 03:09:09','2026-07-10 03:09:09'),(3,'馒头','主食',223.0,'个',100.0,'平','1个约100克','2026-07-10 03:09:09','2026-07-10 03:09:09'),(4,'全麦面包','主食',246.0,'片',40.0,'平','1片约40克','2026-07-10 03:09:09','2026-07-10 03:09:09'),(5,'白面包','主食',265.0,'片',40.0,'平','1片约40克','2026-07-10 03:09:09','2026-07-10 03:09:09'),(6,'红薯','主食',86.0,'个',200.0,'平','1个中等约200克','2026-07-10 03:09:09','2026-07-10 03:09:09'),(7,'玉米(甜)','主食',112.0,'根',200.0,'平','1根约200克,推荐晚餐主食','2026-07-10 03:09:09','2026-07-10 03:09:09'),(8,'燕麦','主食',377.0,'克',30.0,'平','30g约113大卡','2026-07-10 03:09:09','2026-07-10 03:09:09'),(9,'面条(煮)','主食',110.0,'碗',250.0,'平','1碗约250克','2026-07-10 03:09:09','2026-07-10 03:09:09'),(10,'土豆','主食',77.0,'个',150.0,'平','1个中等约150克','2026-07-10 03:09:09','2026-07-10 03:09:09'),(11,'鸡胸肉','肉类',133.0,'克',100.0,'平','优质低脂蛋白','2026-07-10 03:09:09','2026-07-10 03:09:09'),(12,'鸡腿肉(去皮)','肉类',158.0,'克',100.0,'温','去皮后约158大卡','2026-07-10 03:09:09','2026-07-10 03:09:09'),(13,'鸡腿肉(带皮)','肉类',222.0,'克',100.0,'温','皮的热量较高','2026-07-10 03:09:09','2026-07-10 03:09:09'),(14,'瘦猪肉','肉类',143.0,'克',100.0,'平','','2026-07-10 03:09:09','2026-07-10 03:09:09'),(15,'猪排骨','肉类',264.0,'克',100.0,'平','脂肪含量较高','2026-07-10 03:09:09','2026-07-10 03:09:09'),(16,'瘦牛肉','肉类',125.0,'克',100.0,'平','','2026-07-10 03:09:09','2026-07-10 03:09:09'),(17,'羊肉(瘦)','肉类',145.0,'克',100.0,'温','','2026-07-10 03:09:09','2026-07-10 03:09:09'),(18,'鱼(白肉)','肉类',113.0,'克',100.0,'平','如鲈鱼、鳕鱼','2026-07-10 03:09:09','2026-07-10 03:09:09'),(19,'虾仁','肉类',93.0,'克',100.0,'平','低脂高蛋白','2026-07-10 03:09:09','2026-07-10 03:09:09'),(20,'鸡蛋(煮)','肉类',144.0,'克',60.0,'平','1个约60克/86大卡','2026-07-10 03:09:09','2026-07-10 03:09:09'),(21,'鸡蛋(炒)','肉类',196.0,'克',60.0,'平','炒蛋因用油热量更高','2026-07-10 03:09:09','2026-07-10 03:09:09'),(22,'黄瓜','蔬菜',15.0,'根',200.0,'凉','清爽低卡','2026-07-10 03:09:09','2026-07-10 03:09:09'),(23,'西红柿','蔬菜',19.0,'个',150.0,'平','','2026-07-10 03:09:09','2026-07-10 03:09:09'),(24,'白菜','蔬菜',13.0,'克',100.0,'平','','2026-07-10 03:09:09','2026-07-10 03:09:09'),(25,'菠菜','蔬菜',23.0,'克',100.0,'凉','','2026-07-10 03:09:09','2026-07-10 03:09:09'),(26,'西兰花','蔬菜',34.0,'克',100.0,'平','营养密度高','2026-07-10 03:09:09','2026-07-10 03:09:09'),(27,'生菜','蔬菜',15.0,'克',100.0,'凉','','2026-07-10 03:09:09','2026-07-10 03:09:09'),(28,'芹菜','蔬菜',16.0,'克',100.0,'凉','','2026-07-10 03:09:09','2026-07-10 03:09:09'),(29,'冬瓜','蔬菜',12.0,'克',100.0,'凉','利水消肿','2026-07-10 03:09:09','2026-07-10 03:09:09'),(30,'白萝卜','蔬菜',16.0,'克',100.0,'凉','','2026-07-10 03:09:09','2026-07-10 03:09:09'),(31,'木耳(泡发)','蔬菜',27.0,'克',100.0,'平','','2026-07-10 03:09:09','2026-07-10 03:09:09'),(32,'香菇','蔬菜',26.0,'克',100.0,'平','','2026-07-10 03:09:09','2026-07-10 03:09:09'),(33,'豆腐','蔬菜',81.0,'克',100.0,'平','','2026-07-10 03:09:09','2026-07-10 03:09:09'),(34,'豆芽','蔬菜',18.0,'克',100.0,'凉','','2026-07-10 03:09:09','2026-07-10 03:09:09'),(35,'秋葵','蔬菜',33.0,'克',100.0,'凉','','2026-07-10 03:09:09','2026-07-10 03:09:09'),(36,'桃子','水果',39.0,'个',200.0,'温','夏季水果,上火期建议暂停','2026-07-10 03:09:09','2026-07-10 03:09:09'),(37,'苹果','水果',52.0,'个',200.0,'平','','2026-07-10 03:09:09','2026-07-10 03:09:09'),(38,'雪梨','水果',51.0,'个',250.0,'凉','上火期推荐,润肺','2026-07-10 03:09:09','2026-07-10 03:09:09'),(39,'香蕉','水果',89.0,'根',150.0,'平','热量偏高','2026-07-10 03:09:09','2026-07-10 03:09:09'),(40,'西瓜','水果',30.0,'块',300.0,'凉','1块约300克','2026-07-10 03:09:09','2026-07-10 03:09:09'),(41,'火龙果(红心)','水果',55.0,'个',300.0,'凉','通便效果好','2026-07-10 03:09:09','2026-07-10 03:09:09'),(42,'火龙果(白心)','水果',50.0,'个',300.0,'凉','','2026-07-10 03:09:09','2026-07-10 03:09:09'),(43,'山竹','水果',72.0,'个',80.0,'凉','降火水果','2026-07-10 03:09:09','2026-07-10 03:09:09'),(44,'圣女果','水果',22.0,'个',15.0,'平','低糖水果,推荐加餐','2026-07-10 03:09:09','2026-07-10 03:09:09'),(45,'草莓','水果',32.0,'颗',20.0,'平','1颗约20克,低糖','2026-07-10 03:09:09','2026-07-10 03:09:09'),(46,'葡萄','水果',69.0,'颗',10.0,'平','糖分较高','2026-07-10 03:09:09','2026-07-10 03:09:09'),(47,'橙子','水果',47.0,'个',200.0,'平','维生素C丰富','2026-07-10 03:09:09','2026-07-10 03:09:09'),(48,'蓝莓','水果',57.0,'盒',125.0,'平','1盒约125克','2026-07-10 03:09:09','2026-07-10 03:09:09'),(49,'纯牛奶(全脂)','乳制品',67.0,'毫升',250.0,'平','1盒250ml约168大卡','2026-07-10 03:09:09','2026-07-10 03:09:09'),(50,'纯牛奶(脱脂)','乳制品',35.0,'毫升',250.0,'平','1盒250ml约88大卡','2026-07-10 03:09:09','2026-07-10 03:09:09'),(51,'无糖酸奶','乳制品',62.0,'杯',200.0,'平','1杯200克约124大卡','2026-07-10 03:09:09','2026-07-10 03:09:09'),(52,'低脂酸奶(含糖)','乳制品',95.0,'杯',200.0,'平','含糖,热量较高','2026-07-10 03:09:09','2026-07-10 03:09:09'),(53,'白开水','饮品',0.0,'毫升',500.0,'平','零热量,多喝','2026-07-10 03:09:09','2026-07-10 03:09:09'),(54,'无糖茶','饮品',0.0,'毫升',500.0,'平','','2026-07-10 03:09:09','2026-07-10 03:09:09'),(55,'美式咖啡(无糖)','饮品',2.0,'杯',300.0,'平','几乎零卡','2026-07-10 03:09:09','2026-07-10 03:09:09'),(56,'拿铁(无糖)','饮品',126.0,'杯',300.0,'平','含牛奶热量','2026-07-10 03:09:09','2026-07-10 03:09:09'),(57,'花生油','调味品',899.0,'勺',10.0,'平','1汤勺约10克/90大卡,需计入','2026-07-10 03:09:09','2026-07-10 03:09:09'),(58,'菜籽油','调味品',899.0,'勺',10.0,'平','1汤勺约10克/90大卡','2026-07-10 03:09:09','2026-07-10 03:09:09'),(59,'橄榄油','调味品',884.0,'勺',10.0,'平','1汤勺约10克/88大卡','2026-07-10 03:09:09','2026-07-10 03:09:09'),(60,'芝麻油','调味品',884.0,'勺',5.0,'平','1小勺约5克/44大卡','2026-07-10 03:09:09','2026-07-10 03:09:09'),(61,'白砂糖','调味品',387.0,'勺',5.0,'平','1小勺约5克/19大卡','2026-07-10 03:09:09','2026-07-10 03:09:09'),(62,'酱油','调味品',53.0,'勺',10.0,'平','1勺约10克','2026-07-10 03:09:09','2026-07-10 03:09:09'),(63,'沙拉酱','调味品',637.0,'勺',15.0,'温','热量较高,建议少用','2026-07-10 03:09:09','2026-07-10 03:09:09'),(64,'辣椒酱','调味品',85.0,'勺',10.0,'热','上火期慎用','2026-07-10 03:09:09','2026-07-10 03:09:09'),(65,'坚果(混合)','零食',553.0,'把',30.0,'平','1把约30克/166大卡,不宜多','2026-07-10 03:09:09','2026-07-10 03:09:09'),(66,'核桃','零食',646.0,'个',20.0,'平','1个约20克/129大卡','2026-07-10 03:09:09','2026-07-10 03:09:09'),(67,'瓜子','零食',615.0,'把',10.0,'热','容易上火','2026-07-10 03:09:09','2026-07-10 03:09:09'),(68,'薯片','零食',536.0,'包',50.0,'平','1小包约50克/268大卡','2026-07-10 03:09:09','2026-07-10 03:09:09'),(69,'巧克力','零食',546.0,'块',20.0,'平','1块约20克/109大卡','2026-07-10 03:09:09','2026-07-10 03:09:09'),(70,'苏打饼干','零食',408.0,'片',10.0,'平','1片约10克/41大卡','2026-07-10 03:09:09','2026-07-10 03:09:09');
|
||
/*!40000 ALTER TABLE `food_library` ENABLE KEYS */;
|
||
UNLOCK TABLES;
|
||
|
||
--
|
||
-- Table structure for table `health_abnormal_indicators`
|
||
--
|
||
|
||
DROP TABLE IF EXISTS `health_abnormal_indicators`;
|
||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||
/*!50503 SET character_set_client = utf8mb4 */;
|
||
CREATE TABLE `health_abnormal_indicators` (
|
||
`id` bigint NOT NULL AUTO_INCREMENT,
|
||
`user_id` varchar(50) NOT NULL COMMENT '用户标识',
|
||
`checkup_id` bigint DEFAULT NULL COMMENT '关联体检报告ID',
|
||
`indicator_name` varchar(100) NOT NULL COMMENT '指标名称(如:总胆固醇、尿酸、ALT)',
|
||
`indicator_category` varchar(50) NOT NULL COMMENT '指标分类(血常规/肝功能/肾功能/血脂/血糖/尿酸/血压/其他)',
|
||
`result_value` varchar(100) NOT NULL COMMENT '检测结果值',
|
||
`unit` varchar(30) DEFAULT '' COMMENT '单位(如:mmol/L、μmol/L)',
|
||
`normal_range` varchar(100) DEFAULT '' COMMENT '正常参考范围',
|
||
`deviation` enum('偏高','偏低','临界偏高','临界偏低') NOT NULL COMMENT '偏离方向',
|
||
`severity` enum('注意','警示','危险') DEFAULT '注意' COMMENT '严重程度',
|
||
`status` enum('待处理','观察中','已复查','已正常','需持续关注') DEFAULT '待处理' COMMENT '处理状态',
|
||
`doctor_advice` text COMMENT '医生建议',
|
||
`ai_analysis` text COMMENT 'AI分析解读',
|
||
`first_detected` date NOT NULL COMMENT '首次发现日期',
|
||
`resolved_date` date DEFAULT NULL COMMENT '恢复正常日期',
|
||
`note` text COMMENT '备注',
|
||
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
|
||
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||
PRIMARY KEY (`id`),
|
||
KEY `idx_user_indicator` (`user_id`,`indicator_name`),
|
||
KEY `idx_user_status` (`user_id`,`status`),
|
||
KEY `idx_severity` (`user_id`,`severity`),
|
||
KEY `idx_checkup` (`checkup_id`)
|
||
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='异常指标记录';
|
||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||
|
||
--
|
||
-- Dumping data for table `health_abnormal_indicators`
|
||
--
|
||
|
||
LOCK TABLES `health_abnormal_indicators` WRITE;
|
||
/*!40000 ALTER TABLE `health_abnormal_indicators` DISABLE KEYS */;
|
||
INSERT INTO `health_abnormal_indicators` VALUES (6,'yangxuan',2,'颈椎生理曲度变直','骨骼/脊柱','变直','','生理前屈','偏高','警示','待处理','避免长时间低头,加强颈后肌群','长期低头姿势导致颈部肌肉失衡。需纠正姿势、强化肩颈支撑肌肉。','2025-12-15',NULL,NULL,'2026-07-10 03:55:52','2026-07-10 03:55:52'),(7,'yangxuan',2,'颈3-5椎间不稳','骨骼/脊柱','过屈位呈阶梯样改变','','稳定','偏高','警示','待处理','避免颈部剧烈活动','稳定性下降,不当活动易加重劳损或压迫。需强化深层稳定肌群。','2025-12-15',NULL,NULL,'2026-07-10 03:55:52','2026-07-10 03:55:52'),(8,'yangxuan',2,'颈4-5、5-6椎间盘轻度突出(中央型)','骨骼/脊柱','轻度突出','','无突出','偏高','警示','待处理','避免颈部过度后伸、负重、旋转','中央型压迫硬膜囊,轻度但需避免冲击和负重姿势。','2025-12-15',NULL,NULL,'2026-07-10 03:55:52','2026-07-10 03:55:52'),(9,'yangxuan',2,'颈椎退行性变(骨质增生)','骨骼/脊柱','骨质增生','','无','偏高','注意','需持续关注','延缓退变,加强支撑肌肉','不可逆但可延缓。核心在减少颈椎压力、增强肌肉支撑。','2025-12-15',NULL,NULL,'2026-07-10 03:55:52','2026-07-10 03:55:52'),(10,'yangxuan',2,'舒张压','心血管/血压','86','mmHg','<80','偏高','注意','观察中','低钠饮食,定期监测','正常高值血压,舒张压较前两年回升。需控制盐摄入、规律运动。','2025-12-15',NULL,NULL,'2026-07-10 03:55:52','2026-07-10 03:55:52'),(11,'yangxuan',2,'BMI','体重','25.84','kg/m²','18.5-24','偏高','注意','待处理','减重至正常BMI','超重但已从峰值73.8→71.2下降2.6kg,方向正确。目标63-65kg。','2025-12-15',NULL,NULL,'2026-07-10 03:55:52','2026-07-10 03:55:52'),(12,'yangxuan',2,'慢性咽炎','耳鼻喉','黏膜充血、滤泡增生','','正常','偏高','注意','需持续关注','避免辛辣刺激、多饮水','持续多年(2019-2025),需长期饮食管理。','2019-12-15',NULL,NULL,'2026-07-10 03:55:52','2026-07-10 03:55:52'),(13,'yangxuan',2,'鼻黏膜糜烂','耳鼻喉','糜烂','','正常','偏高','注意','待处理','保持鼻腔湿润,避免抠鼻','2025年新出现,可能与干燥/上火有关。','2025-12-15',NULL,NULL,'2026-07-10 03:55:52','2026-07-10 03:55:52'),(14,'yangxuan',2,'湿疹','皮肤','存在','','不存在','偏高','注意','待处理','建议皮肤科就诊','2025年新出现。','2025-12-15',NULL,NULL,'2026-07-10 03:55:52','2026-07-10 03:55:52');
|
||
/*!40000 ALTER TABLE `health_abnormal_indicators` ENABLE KEYS */;
|
||
UNLOCK TABLES;
|
||
|
||
--
|
||
-- Table structure for table `health_alerts`
|
||
--
|
||
|
||
DROP TABLE IF EXISTS `health_alerts`;
|
||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||
/*!50503 SET character_set_client = utf8mb4 */;
|
||
CREATE TABLE `health_alerts` (
|
||
`id` bigint NOT NULL AUTO_INCREMENT,
|
||
`user_id` varchar(50) NOT NULL COMMENT '用户标识',
|
||
`indicator_id` bigint DEFAULT NULL COMMENT '关联异常指标ID',
|
||
`alert_type` enum('饮食违规','运动风险','指标恶化','复查逾期','禁忌冲突','综合预警') NOT NULL COMMENT '预警类型',
|
||
`severity` enum('提示','警告','危险') NOT NULL COMMENT '严重级别',
|
||
`title` varchar(200) NOT NULL COMMENT '预警标题',
|
||
`detail` text NOT NULL COMMENT '预警详情',
|
||
`related_context` text COMMENT '相关上下文(JSON)',
|
||
`action_required` varchar(500) DEFAULT '' COMMENT '建议操作',
|
||
`status` enum('未处理','已处理','已忽略') DEFAULT '未处理' COMMENT '处理状态',
|
||
`resolved_at` timestamp NULL DEFAULT NULL COMMENT '处理时间',
|
||
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
|
||
PRIMARY KEY (`id`),
|
||
KEY `idx_user_status` (`user_id`,`status`),
|
||
KEY `idx_severity` (`severity`),
|
||
KEY `idx_created` (`created_at` DESC)
|
||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='安全预警日志';
|
||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||
|
||
--
|
||
-- Dumping data for table `health_alerts`
|
||
--
|
||
|
||
LOCK TABLES `health_alerts` WRITE;
|
||
/*!40000 ALTER TABLE `health_alerts` DISABLE KEYS */;
|
||
/*!40000 ALTER TABLE `health_alerts` ENABLE KEYS */;
|
||
UNLOCK TABLES;
|
||
|
||
--
|
||
-- Table structure for table `health_checkups`
|
||
--
|
||
|
||
DROP TABLE IF EXISTS `health_checkups`;
|
||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||
/*!50503 SET character_set_client = utf8mb4 */;
|
||
CREATE TABLE `health_checkups` (
|
||
`id` bigint NOT NULL AUTO_INCREMENT,
|
||
`user_id` varchar(50) NOT NULL COMMENT '用户标识',
|
||
`checkup_date` date NOT NULL COMMENT '体检日期',
|
||
`hospital` varchar(100) DEFAULT '' COMMENT '体检机构/医院',
|
||
`summary` text COMMENT '体检总结/结论',
|
||
`overall_status` enum('正常','基本正常','异常','需复查') DEFAULT '基本正常' COMMENT '总体评价',
|
||
`report_file` varchar(255) DEFAULT '' COMMENT '报告文件路径/URL',
|
||
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
|
||
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||
PRIMARY KEY (`id`),
|
||
KEY `idx_user_date` (`user_id`,`checkup_date` DESC),
|
||
KEY `idx_status` (`user_id`,`overall_status`)
|
||
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='体检报告记录';
|
||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||
|
||
--
|
||
-- Dumping data for table `health_checkups`
|
||
--
|
||
|
||
LOCK TABLES `health_checkups` WRITE;
|
||
/*!40000 ALTER TABLE `health_checkups` DISABLE KEYS */;
|
||
INSERT INTO `health_checkups` VALUES (2,'yangxuan','2025-12-15','年度体检','颈椎:生理曲度变直,C3-5不稳,C4-5/C5-6椎间盘轻度突出,退行性变。脂肪肝已逆转。血压121/86。血脂血糖尿酸肝功能正常。慢性咽炎、鼻黏膜糜烂、湿疹。','需复查','','2026-07-10 03:55:52','2026-07-10 03:55:52');
|
||
/*!40000 ALTER TABLE `health_checkups` ENABLE KEYS */;
|
||
UNLOCK TABLES;
|
||
|
||
--
|
||
-- Table structure for table `health_indicator_trends`
|
||
--
|
||
|
||
DROP TABLE IF EXISTS `health_indicator_trends`;
|
||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||
/*!50503 SET character_set_client = utf8mb4 */;
|
||
CREATE TABLE `health_indicator_trends` (
|
||
`id` bigint NOT NULL AUTO_INCREMENT,
|
||
`user_id` varchar(50) NOT NULL COMMENT '用户标识',
|
||
`indicator_name` varchar(100) NOT NULL COMMENT '指标名称',
|
||
`indicator_category` varchar(50) NOT NULL COMMENT '指标分类',
|
||
`record_date` date NOT NULL COMMENT '检测日期',
|
||
`result_value` varchar(100) NOT NULL COMMENT '检测值',
|
||
`unit` varchar(30) DEFAULT '' COMMENT '单位',
|
||
`normal_range` varchar(100) DEFAULT '' COMMENT '参考范围',
|
||
`source` enum('体检报告','自主检测','医院就诊') DEFAULT '体检报告' COMMENT '数据来源',
|
||
`note` varchar(255) DEFAULT '' COMMENT '备注',
|
||
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
|
||
PRIMARY KEY (`id`),
|
||
UNIQUE KEY `uk_user_indicator_date` (`user_id`,`indicator_name`,`record_date`),
|
||
KEY `idx_user_indicator` (`user_id`,`indicator_name`,`record_date`)
|
||
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='指标变化追踪';
|
||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||
|
||
--
|
||
-- Dumping data for table `health_indicator_trends`
|
||
--
|
||
|
||
LOCK TABLES `health_indicator_trends` WRITE;
|
||
/*!40000 ALTER TABLE `health_indicator_trends` DISABLE KEYS */;
|
||
INSERT INTO `health_indicator_trends` VALUES (1,'yangxuan','收缩压','心血管/血压','2019-12-15','127','mmHg','<120','体检报告','','2026-07-10 03:56:05'),(2,'yangxuan','收缩压','心血管/血压','2021-12-15','137','mmHg','<120','体检报告','','2026-07-10 03:56:05'),(3,'yangxuan','收缩压','心血管/血压','2022-12-15','124','mmHg','<120','体检报告','','2026-07-10 03:56:05'),(4,'yangxuan','收缩压','心血管/血压','2023-12-15','119','mmHg','<120','体检报告','','2026-07-10 03:56:05'),(5,'yangxuan','收缩压','心血管/血压','2024-12-15','115','mmHg','<120','体检报告','','2026-07-10 03:56:05'),(6,'yangxuan','收缩压','心血管/血压','2025-12-15','121','mmHg','<120','体检报告','','2026-07-10 03:56:05'),(7,'yangxuan','舒张压','心血管/血压','2019-12-15','82','mmHg','<80','体检报告','','2026-07-10 03:56:05'),(8,'yangxuan','舒张压','心血管/血压','2021-12-15','87','mmHg','<80','体检报告','','2026-07-10 03:56:05'),(9,'yangxuan','舒张压','心血管/血压','2022-12-15','72','mmHg','<80','体检报告','','2026-07-10 03:56:05'),(10,'yangxuan','舒张压','心血管/血压','2023-12-15','74','mmHg','<80','体检报告','','2026-07-10 03:56:05'),(11,'yangxuan','舒张压','心血管/血压','2024-12-15','70','mmHg','<80','体检报告','','2026-07-10 03:56:05'),(12,'yangxuan','舒张压','心血管/血压','2025-12-15','86','mmHg','<80','体检报告','','2026-07-10 03:56:05'),(13,'yangxuan','体重','体重','2019-12-15','63.3','kg','BMI<24','体检报告','','2026-07-10 03:56:05'),(14,'yangxuan','体重','体重','2021-12-15','67.7','kg','BMI<24','体检报告','','2026-07-10 03:56:05'),(15,'yangxuan','体重','体重','2022-12-15','70.6','kg','BMI<24','体检报告','','2026-07-10 03:56:05'),(16,'yangxuan','体重','体重','2023-12-15','73.8','kg','BMI<24','体检报告','','2026-07-10 03:56:05'),(17,'yangxuan','体重','体重','2024-12-15','71.6','kg','BMI<24','体检报告','','2026-07-10 03:56:05'),(18,'yangxuan','体重','体重','2025-12-15','71.2','kg','BMI<24','体检报告','','2026-07-10 03:56:05');
|
||
/*!40000 ALTER TABLE `health_indicator_trends` ENABLE KEYS */;
|
||
UNLOCK TABLES;
|
||
|
||
--
|
||
-- Table structure for table `health_reminders`
|
||
--
|
||
|
||
DROP TABLE IF EXISTS `health_reminders`;
|
||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||
/*!50503 SET character_set_client = utf8mb4 */;
|
||
CREATE TABLE `health_reminders` (
|
||
`id` bigint NOT NULL AUTO_INCREMENT,
|
||
`user_id` varchar(50) NOT NULL COMMENT '用户标识',
|
||
`indicator_id` bigint DEFAULT NULL COMMENT '关联异常指标ID',
|
||
`reminder_type` enum('复查提醒','复诊提醒','用药提醒','生活调整','其他') NOT NULL COMMENT '提醒类型',
|
||
`title` varchar(200) NOT NULL COMMENT '提醒标题',
|
||
`description` text COMMENT '提醒内容',
|
||
`due_date` date NOT NULL COMMENT '预计执行日期',
|
||
`remind_before_days` int DEFAULT '3' COMMENT '提前提醒天数',
|
||
`repeat_interval` enum('不重复','每周','每月','每季度','每半年','每年') DEFAULT '不重复' COMMENT '重复周期',
|
||
`repeat_count` int DEFAULT '0' COMMENT '已重复次数',
|
||
`max_repeats` int DEFAULT '0' COMMENT '最大重复次数(0=不限)',
|
||
`status` enum('待执行','已执行','已过期','已取消') DEFAULT '待执行' COMMENT '执行状态',
|
||
`completed_at` timestamp NULL DEFAULT NULL COMMENT '实际完成时间',
|
||
`result` text COMMENT '执行结果/复查结论',
|
||
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
|
||
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||
PRIMARY KEY (`id`),
|
||
KEY `idx_user_due` (`user_id`,`due_date`),
|
||
KEY `idx_user_status` (`user_id`,`status`),
|
||
KEY `idx_due_date` (`due_date`,`status`)
|
||
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='复查提醒';
|
||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||
|
||
--
|
||
-- Dumping data for table `health_reminders`
|
||
--
|
||
|
||
LOCK TABLES `health_reminders` WRITE;
|
||
/*!40000 ALTER TABLE `health_reminders` DISABLE KEYS */;
|
||
INSERT INTO `health_reminders` VALUES (1,'yangxuan',NULL,'复查提醒','血压自测','舒张压86偏高,建议每月自测血压记录趋势','2026-08-01',7,'每月',0,0,'待执行',NULL,NULL,'2026-07-10 03:56:05','2026-07-10 03:56:05');
|
||
/*!40000 ALTER TABLE `health_reminders` ENABLE KEYS */;
|
||
UNLOCK TABLES;
|
||
|
||
--
|
||
-- Table structure for table `health_restrictions`
|
||
--
|
||
|
||
DROP TABLE IF EXISTS `health_restrictions`;
|
||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||
/*!50503 SET character_set_client = utf8mb4 */;
|
||
CREATE TABLE `health_restrictions` (
|
||
`id` bigint NOT NULL AUTO_INCREMENT,
|
||
`user_id` varchar(50) NOT NULL COMMENT '用户标识',
|
||
`indicator_id` bigint DEFAULT NULL COMMENT '关联异常指标ID(可为空,表示通用禁忌)',
|
||
`restriction_type` enum('饮食','运动','作息','用药','其他') NOT NULL COMMENT '禁忌类型',
|
||
`rule_name` varchar(100) NOT NULL COMMENT '规则名称(如:高嘌呤食物、剧烈运动)',
|
||
`forbidden_items` text NOT NULL COMMENT '禁忌清单(JSON数组或逗号分隔)',
|
||
`reason` text COMMENT '禁忌原因',
|
||
`start_date` date NOT NULL COMMENT '生效日期',
|
||
`end_date` date DEFAULT NULL COMMENT '失效日期(NULL=长期有效)',
|
||
`priority` enum('低','中','高','紧急') DEFAULT '中' COMMENT '优先级',
|
||
`is_active` tinyint(1) DEFAULT '1' COMMENT '是否生效',
|
||
`violation_consequence` text COMMENT '违反后果说明',
|
||
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
|
||
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||
PRIMARY KEY (`id`),
|
||
KEY `idx_user_active` (`user_id`,`is_active`),
|
||
KEY `idx_indicator` (`indicator_id`)
|
||
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='用户禁忌规则';
|
||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||
|
||
--
|
||
-- Dumping data for table `health_restrictions`
|
||
--
|
||
|
||
LOCK TABLES `health_restrictions` WRITE;
|
||
/*!40000 ALTER TABLE `health_restrictions` DISABLE KEYS */;
|
||
INSERT INTO `health_restrictions` VALUES (5,'yangxuan',6,'运动','颈椎·禁止剧烈头部活动','大幅度甩头、快速转头、仰头后伸过猛、翻滚、倒立','颈椎曲度变直+不稳+突出,剧烈活动可能加重压迫','2025-12-15',NULL,'高',1,NULL,'2026-07-10 03:55:52','2026-07-10 03:55:52'),(6,'yangxuan',8,'运动','颈椎·禁止头部承重/冲击','负重杠铃压颈、倒立、剧烈跳跃、跑步落地冲击过大','椎间盘突出+退行性变,冲击会直接压缩椎间隙','2025-12-15',NULL,'高',1,NULL,'2026-07-10 03:55:52','2026-07-10 03:55:52'),(7,'yangxuan',7,'运动','颈椎·运动幅度控制','肩倒立、头倒立、大幅度颈环绕、瑜伽犁式','椎间不稳,大幅度活动可能压迫神经','2025-12-15',NULL,'中',1,NULL,'2026-07-10 03:55:52','2026-07-10 03:55:52'),(8,'yangxuan',12,'饮食','慢性咽炎·忌刺激','辛辣(辣椒/花椒/芥末/姜/蒜)、过烫食物(>60℃)、过酸、油炸、高度酒、腌制食品、膨化零食','咽部黏膜慢性充血,刺激加重炎症','2025-12-15',NULL,'中',1,NULL,'2026-07-10 03:55:52','2026-07-10 03:55:52'),(9,'yangxuan',NULL,'饮食','血压·控钠','高钠食物(咸菜/腊肉/酱料/加工肉)、速食面、薯片','舒张压86mmHg偏高,需控制钠摄入','2025-12-15',NULL,'低',1,NULL,'2026-07-10 03:55:52','2026-07-10 03:55:52');
|
||
/*!40000 ALTER TABLE `health_restrictions` ENABLE KEYS */;
|
||
UNLOCK TABLES;
|
||
|
||
--
|
||
-- Table structure for table `health_status_logs`
|
||
--
|
||
|
||
DROP TABLE IF EXISTS `health_status_logs`;
|
||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||
/*!50503 SET character_set_client = utf8mb4 */;
|
||
CREATE TABLE `health_status_logs` (
|
||
`id` bigint NOT NULL AUTO_INCREMENT,
|
||
`user_id` varchar(50) NOT NULL COMMENT '用户标识',
|
||
`log_date` date NOT NULL COMMENT '记录日期',
|
||
`status_type` varchar(50) NOT NULL COMMENT '状态类型(上火/积食/疲劳/感冒/其他)',
|
||
`severity` enum('轻','中','重') DEFAULT '轻' COMMENT '严重程度',
|
||
`symptom` text COMMENT '具体症状描述',
|
||
`diagnosis` varchar(100) DEFAULT '' COMMENT '判断结论(如:肺热/胃火)',
|
||
`suggestion` text COMMENT '建议方案',
|
||
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
|
||
PRIMARY KEY (`id`),
|
||
KEY `idx_user_date` (`user_id`,`log_date`)
|
||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='健康状况日志';
|
||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||
|
||
--
|
||
-- Dumping data for table `health_status_logs`
|
||
--
|
||
|
||
LOCK TABLES `health_status_logs` WRITE;
|
||
/*!40000 ALTER TABLE `health_status_logs` DISABLE KEYS */;
|
||
/*!40000 ALTER TABLE `health_status_logs` ENABLE KEYS */;
|
||
UNLOCK TABLES;
|
||
|
||
--
|
||
-- Table structure for table `user_health_summary`
|
||
--
|
||
|
||
DROP TABLE IF EXISTS `user_health_summary`;
|
||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||
/*!50503 SET character_set_client = utf8mb4 */;
|
||
CREATE TABLE `user_health_summary` (
|
||
`id` int NOT NULL AUTO_INCREMENT,
|
||
`user_id` varchar(50) NOT NULL COMMENT '用户标识',
|
||
`abnormal_count` int DEFAULT '0' COMMENT '当前异常指标数',
|
||
`critical_count` int DEFAULT '0' COMMENT '高危指标数',
|
||
`pending_reminders` int DEFAULT '0' COMMENT '待处理提醒数',
|
||
`active_restrictions` int DEFAULT '0' COMMENT '生效禁忌数',
|
||
`last_checkup_date` date DEFAULT NULL COMMENT '最近体检日期',
|
||
`last_review_at` timestamp NULL DEFAULT NULL COMMENT '最近AI审核时间',
|
||
`overall_risk_level` enum('低','中','高') DEFAULT '低' COMMENT '综合风险等级',
|
||
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
|
||
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||
PRIMARY KEY (`id`),
|
||
UNIQUE KEY `user_id` (`user_id`)
|
||
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='用户健康概要';
|
||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||
|
||
--
|
||
-- Dumping data for table `user_health_summary`
|
||
--
|
||
|
||
LOCK TABLES `user_health_summary` WRITE;
|
||
/*!40000 ALTER TABLE `user_health_summary` DISABLE KEYS */;
|
||
INSERT INTO `user_health_summary` VALUES (1,'yangxuan',9,0,1,5,'2025-12-15','2026-07-10 03:56:05','中','2026-07-10 03:48:34','2026-07-10 03:56:05');
|
||
/*!40000 ALTER TABLE `user_health_summary` ENABLE KEYS */;
|
||
UNLOCK TABLES;
|
||
|
||
--
|
||
-- Table structure for table `user_profiles`
|
||
--
|
||
|
||
DROP TABLE IF EXISTS `user_profiles`;
|
||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||
/*!50503 SET character_set_client = utf8mb4 */;
|
||
CREATE TABLE `user_profiles` (
|
||
`id` int NOT NULL AUTO_INCREMENT,
|
||
`user_id` varchar(50) NOT NULL COMMENT '用户标识(如微信ID)',
|
||
`name` varchar(50) DEFAULT '' COMMENT '用户昵称',
|
||
`age` int DEFAULT '35' COMMENT '年龄',
|
||
`gender` enum('男','女') DEFAULT '男' COMMENT '性别',
|
||
`height` decimal(5,1) DEFAULT '175.0' COMMENT '身高(cm)',
|
||
`target_weight` decimal(5,1) DEFAULT '75.0' COMMENT '目标体重(kg)',
|
||
`daily_target_heat` int DEFAULT '1200' COMMENT '每日目标热量(大卡)',
|
||
`activity_level` enum('久坐','轻度','中度','高度') DEFAULT '久坐' COMMENT '活动量等级',
|
||
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
|
||
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||
PRIMARY KEY (`id`),
|
||
UNIQUE KEY `user_id` (`user_id`)
|
||
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='用户信息表';
|
||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||
|
||
--
|
||
-- Dumping data for table `user_profiles`
|
||
--
|
||
|
||
LOCK TABLES `user_profiles` WRITE;
|
||
/*!40000 ALTER TABLE `user_profiles` DISABLE KEYS */;
|
||
INSERT INTO `user_profiles` VALUES (1,'yangxuan','杨轩',34,'男',166.0,64.0,1500,'久坐','2026-07-10 03:55:18','2026-07-10 03:55:18');
|
||
/*!40000 ALTER TABLE `user_profiles` ENABLE KEYS */;
|
||
UNLOCK TABLES;
|
||
|
||
--
|
||
-- Table structure for table `weekly_reports`
|
||
--
|
||
|
||
DROP TABLE IF EXISTS `weekly_reports`;
|
||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||
/*!50503 SET character_set_client = utf8mb4 */;
|
||
CREATE TABLE `weekly_reports` (
|
||
`id` bigint NOT NULL AUTO_INCREMENT,
|
||
`user_id` varchar(50) NOT NULL COMMENT '用户标识',
|
||
`week_start` date NOT NULL COMMENT '周起始日期',
|
||
`week_end` date NOT NULL COMMENT '周结束日期',
|
||
`avg_weight` decimal(5,2) DEFAULT NULL COMMENT '平均体重(kg)',
|
||
`weight_change` decimal(5,2) DEFAULT NULL COMMENT '体重变化(kg)',
|
||
`avg_daily_heat` decimal(7,1) DEFAULT NULL COMMENT '日均热量摄入(kcal)',
|
||
`heat_deficit` decimal(7,1) DEFAULT NULL COMMENT '日均热量缺口(kcal)',
|
||
`exercise_days` int DEFAULT '0' COMMENT '运动天数',
|
||
`diet_compliance_days` int DEFAULT '0' COMMENT '饮食达标天数',
|
||
`plateau_flag` tinyint(1) DEFAULT '0' COMMENT '是否平台期(1=是)',
|
||
`assessment` text COMMENT '评估总结',
|
||
`suggestion` text COMMENT '下周建议',
|
||
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
|
||
PRIMARY KEY (`id`),
|
||
UNIQUE KEY `uk_user_week` (`user_id`,`week_start`)
|
||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='每周减脂报告';
|
||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||
|
||
--
|
||
-- Dumping data for table `weekly_reports`
|
||
--
|
||
|
||
LOCK TABLES `weekly_reports` WRITE;
|
||
/*!40000 ALTER TABLE `weekly_reports` DISABLE KEYS */;
|
||
/*!40000 ALTER TABLE `weekly_reports` ENABLE KEYS */;
|
||
UNLOCK TABLES;
|
||
|
||
--
|
||
-- Dumping events for database 'fitness'
|
||
--
|
||
|
||
--
|
||
-- Dumping routines for database 'fitness'
|
||
--
|
||
/*!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 2026-07-15 1:55:07
|