/*
 Navicat Premium Dump SQL

 Source Server         : 192.168.18.199(gpfx)
 Source Server Type    : MySQL
 Source Server Version : 90200 (9.2.0)
 Source Host           : 192.168.18.199:3306
 Source Schema         : db_gp_cj

 Target Server Type    : MySQL
 Target Server Version : 90200 (9.2.0)
 File Encoding         : 65001

 Date: 26/06/2025 11:41:15
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for eastmoney_rzrq_data
-- ----------------------------
DROP TABLE IF EXISTS `eastmoney_rzrq_data`;
CREATE TABLE `eastmoney_rzrq_data`  (
  `trade_date` date NOT NULL,
  `index_value` decimal(10, 4) NULL DEFAULT NULL COMMENT '指数',
  `change_percent` decimal(10, 4) NULL DEFAULT NULL COMMENT '涨跌幅',
  `float_market_value` decimal(20, 2) NULL DEFAULT NULL COMMENT '流通市值',
  `change_percent_3d` decimal(10, 4) NULL DEFAULT NULL COMMENT '3日涨跌幅',
  `change_percent_5d` decimal(10, 4) NULL DEFAULT NULL COMMENT '5日涨跌幅',
  `change_percent_10d` decimal(10, 4) NULL DEFAULT NULL COMMENT '10日涨跌幅',
  `financing_balance` decimal(20, 2) NULL DEFAULT NULL COMMENT '融资余额',
  `financing_balance_ratio` decimal(10, 4) NULL DEFAULT NULL COMMENT '融资余额占比',
  `financing_buy_amount` decimal(20, 2) NULL DEFAULT NULL COMMENT '融资买入额',
  `financing_buy_amount_3d` decimal(20, 2) NULL DEFAULT NULL COMMENT '3日融资买入额',
  `financing_buy_amount_5d` decimal(20, 2) NULL DEFAULT NULL COMMENT '5日融资买入额',
  `financing_buy_amount_10d` decimal(20, 2) NULL DEFAULT NULL COMMENT '10日融资买入额',
  `financing_repay_amount` decimal(20, 2) NULL DEFAULT NULL COMMENT '融资偿还额',
  `financing_repay_amount_3d` decimal(20, 2) NULL DEFAULT NULL COMMENT '3日融资偿还额',
  `financing_repay_amount_5d` decimal(20, 2) NULL DEFAULT NULL COMMENT '5日融资偿还额',
  `financing_repay_amount_10d` decimal(20, 2) NULL DEFAULT NULL COMMENT '10日融资偿还额',
  `financing_net_amount` decimal(20, 2) NULL DEFAULT NULL COMMENT '融资净额',
  `financing_net_amount_3d` decimal(20, 2) NULL DEFAULT NULL COMMENT '3日融资净额',
  `financing_net_amount_5d` decimal(20, 2) NULL DEFAULT NULL COMMENT '5日融资净额',
  `financing_net_amount_10d` decimal(20, 2) NULL DEFAULT NULL COMMENT '10日融资净额',
  `securities_balance` decimal(20, 2) NULL DEFAULT NULL COMMENT '融券余额',
  `securities_volume` decimal(20, 2) NULL DEFAULT NULL COMMENT '融券余量',
  `securities_repay_volume` decimal(20, 2) NULL DEFAULT NULL COMMENT '融券偿还量',
  `securities_repay_volume_3d` decimal(20, 2) NULL DEFAULT NULL COMMENT '3日融券偿还量',
  `securities_repay_volume_5d` decimal(20, 2) NULL DEFAULT NULL COMMENT '5日融券偿还量',
  `securities_repay_volume_10d` decimal(20, 2) NULL DEFAULT NULL COMMENT '10日融券偿还量',
  `securities_sell_volume` decimal(20, 2) NULL DEFAULT NULL COMMENT '融券卖出量',
  `securities_sell_volume_3d` decimal(20, 2) NULL DEFAULT NULL COMMENT '3日融券卖出量',
  `securities_sell_volume_5d` decimal(20, 2) NULL DEFAULT NULL COMMENT '5日融券卖出量',
  `securities_sell_volume_10d` decimal(20, 2) NULL DEFAULT NULL COMMENT '10日融券卖出量',
  `securities_net_volume` decimal(20, 2) NULL DEFAULT NULL COMMENT '融券净量',
  `securities_net_volume_3d` decimal(20, 2) NULL DEFAULT NULL COMMENT '3日融券净量',
  `securities_net_volume_5d` decimal(20, 2) NULL DEFAULT NULL COMMENT '5日融券净量',
  `securities_net_volume_10d` decimal(20, 2) NULL DEFAULT NULL COMMENT '10日融券净量',
  `total_rzrq_balance` decimal(20, 2) NULL DEFAULT NULL COMMENT '融资融券余额',
  `total_rzrq_balance_cz` decimal(20, 2) NULL DEFAULT NULL COMMENT '融资融券余额差值',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`trade_date`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '东方财富融资融券数据表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for fear_greed_index
-- ----------------------------
DROP TABLE IF EXISTS `fear_greed_index`;
CREATE TABLE `fear_greed_index`  (
  `id` int NOT NULL AUTO_INCREMENT,
  `index_value` decimal(5, 2) NOT NULL COMMENT '恐贪指数值(0-100)',
  `trading_date` date NOT NULL COMMENT '交易日期',
  `update_time` datetime NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `uk_trading_date`(`trading_date` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1003 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '市场恐贪指数数据' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for follow_stock
-- ----------------------------
DROP TABLE IF EXISTS `follow_stock`;
CREATE TABLE `follow_stock`  (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `stock_code` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '股票代码',
  `stock_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '股票名称',
  `add_time` datetime NULL DEFAULT NULL COMMENT '添加时间',
  `status` tinyint NULL DEFAULT 1 COMMENT '状态',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `uk_stock_code`(`stock_code` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 22 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '关注的股票' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for fund_cang
-- ----------------------------
DROP TABLE IF EXISTS `fund_cang`;
CREATE TABLE `fund_cang`  (
  `id` int NOT NULL AUTO_INCREMENT,
  `fund_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  `fund_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  `company_money` decimal(20, 2) NULL DEFAULT NULL,
  `company_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  `company_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  `fund_data` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1874595 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for fundamental_analysis
-- ----------------------------
DROP TABLE IF EXISTS `fundamental_analysis`;
CREATE TABLE `fundamental_analysis`  (
  `id` int NOT NULL AUTO_INCREMENT,
  `stock_code` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '股票代码',
  `stock_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '股票名称',
  `dimension` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '分析维度',
  `ai_response` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT 'AI分析结果',
  `reasoning_process` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '推理过程',
  `references` json NULL COMMENT '参考资料',
  `update_time` datetime NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `extra_info` json NULL COMMENT '扩展信息',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `idx_stock_dimension`(`stock_code` ASC, `dimension` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 12104 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '基本面分析结果表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for gp_category_industry
-- ----------------------------
DROP TABLE IF EXISTS `gp_category_industry`;
CREATE TABLE `gp_category_industry`  (
  `id` int NOT NULL AUTO_INCREMENT COMMENT 'id',
  `category_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '分类名称',
  `belong_industry` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '所属行业',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 52 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for gp_code_all
-- ----------------------------
DROP TABLE IF EXISTS `gp_code_all`;
CREATE TABLE `gp_code_all`  (
  `id` int NOT NULL AUTO_INCREMENT,
  `gp_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  `gp_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  `gp_code_two` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  `gp_code_three` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  `market_cap` decimal(20, 2) NULL DEFAULT NULL,
  `mark1` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  `mark2` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 6686 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '所有个股代码-爬取指数用' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for gp_code_hk
-- ----------------------------
DROP TABLE IF EXISTS `gp_code_hk`;
CREATE TABLE `gp_code_hk`  (
  `id` int NOT NULL AUTO_INCREMENT,
  `gp_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  `gp_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  `gp_code_two` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  `gp_code_three` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  `market_cap` decimal(20, 2) NULL DEFAULT NULL,
  `mark1` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  `mark2` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2956 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '所有指数代码-爬取数据使用' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for gp_code_zs
-- ----------------------------
DROP TABLE IF EXISTS `gp_code_zs`;
CREATE TABLE `gp_code_zs`  (
  `id` int NOT NULL AUTO_INCREMENT,
  `gp_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  `gp_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  `gp_code_two` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  `gp_code_three` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  `market_cap` decimal(20, 2) NULL DEFAULT NULL,
  `mark1` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  `mark2` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 6686 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '所有指数代码-爬取数据使用' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for gp_data
-- ----------------------------
DROP TABLE IF EXISTS `gp_data`;
CREATE TABLE `gp_data`  (
  `id` int NOT NULL AUTO_INCREMENT,
  `pg_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  `xiangsidu` decimal(10, 2) NULL DEFAULT NULL COMMENT '控制相似度为多少的时候进行回测 和下面的数字是关联的',
  `ii` int NULL DEFAULT NULL COMMENT '相似度的条数',
  `raye_ga_hc` decimal(10, 2) NULL DEFAULT NULL COMMENT '回测涨跌幅大于多少的数据',
  `huice_function_num` int NULL DEFAULT NULL COMMENT '回测判断胜率方法 0是代表相差1%或者同涨同跌都算胜 1是代表相差1%算胜  2是代表同涨同跌算胜',
  `yes_yuce` int NULL DEFAULT NULL,
  `no_yuce` int NULL DEFAULT NULL,
  `yes_yuce_twoday` int NULL DEFAULT NULL,
  `no_yuce_twoday` int NULL DEFAULT NULL,
  `yes_yuce_fiveday` int NULL DEFAULT NULL,
  `no_yuce_fiveday` int NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 42690 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for gp_day_data
-- ----------------------------
DROP TABLE IF EXISTS `gp_day_data`;
CREATE TABLE `gp_day_data`  (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
  `symbol` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '个股代码',
  `timestamp` timestamp NULL DEFAULT NULL COMMENT '时间戳',
  `volume` bigint NULL DEFAULT NULL COMMENT '数量',
  `open` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '开始价',
  `high` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '最高价',
  `low` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '最低价',
  `close` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '结束价',
  `chg` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '变化数值',
  `percent` decimal(10, 2) NULL DEFAULT NULL COMMENT '变化百分比',
  `turnoverrate` decimal(10, 2) NULL DEFAULT NULL COMMENT '换手率',
  `amount` bigint NULL DEFAULT NULL COMMENT '成交金额',
  `pb` decimal(10, 2) NULL DEFAULT NULL COMMENT '当前PB',
  `pe` decimal(10, 2) NULL DEFAULT NULL COMMENT '当前PE',
  `ps` decimal(10, 2) NULL DEFAULT NULL COMMENT '当前PS',
  `create_time` datetime NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `idx_symbol`(`symbol` ASC) USING BTREE,
  INDEX `idx_timestamp`(`timestamp` ASC) USING BTREE,
  INDEX `idx_symbol_time`(`symbol` ASC, `timestamp` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 28356293 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for gp_ex_rights_log
-- ----------------------------
DROP TABLE IF EXISTS `gp_ex_rights_log`;
CREATE TABLE `gp_ex_rights_log`  (
  `id` int NOT NULL AUTO_INCREMENT,
  `stock_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '股票代码',
  `change_date` date NULL DEFAULT NULL COMMENT '除权变动日期',
  `before_price` decimal(10, 3) NULL DEFAULT NULL COMMENT '变动前收盘价（数据库中的价格）',
  `after_price` decimal(10, 3) NULL DEFAULT NULL COMMENT '变动后收盘价（API获取的价格）',
  `update_time` datetime NULL DEFAULT NULL COMMENT '脚本执行的更新时间',
  `optimization_flag` int NULL DEFAULT NULL COMMENT '波段优化标志，1为已经完成优化',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 285 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '股票除权日志表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for gp_gnbk
-- ----------------------------
DROP TABLE IF EXISTS `gp_gnbk`;
CREATE TABLE `gp_gnbk`  (
  `id` bigint NULL DEFAULT NULL,
  `bk_code` bigint NULL DEFAULT NULL,
  `bk_name` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL,
  `gp_code` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL,
  `gp_name` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for gp_gnbk_all
-- ----------------------------
DROP TABLE IF EXISTS `gp_gnbk_all`;
CREATE TABLE `gp_gnbk_all`  (
  `id` bigint NULL DEFAULT NULL,
  `bk_code` bigint NULL DEFAULT NULL,
  `bk_name` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL,
  `gp_code` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL,
  `gp_name` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for gp_gnbk_gn
-- ----------------------------
DROP TABLE IF EXISTS `gp_gnbk_gn`;
CREATE TABLE `gp_gnbk_gn`  (
  `id` bigint NULL DEFAULT NULL,
  `bk_code` bigint NULL DEFAULT NULL,
  `bk_name` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL,
  `gp_code` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL,
  `gp_name` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for gp_hybk
-- ----------------------------
DROP TABLE IF EXISTS `gp_hybk`;
CREATE TABLE `gp_hybk`  (
  `id` bigint NULL DEFAULT NULL,
  `bk_code` bigint NULL DEFAULT NULL,
  `bk_name` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL,
  `gp_code` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL,
  `gp_name` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL,
  `Unnamed: 5` double NULL DEFAULT NULL,
  `Unnamed: 6` double NULL DEFAULT NULL
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for gp_main_business
-- ----------------------------
DROP TABLE IF EXISTS `gp_main_business`;
CREATE TABLE `gp_main_business`  (
  `stock_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '股票代码',
  `stock_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '股票简称',
  `report_date` varchar(8) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '报告期(YYYYMMDD)',
  `product_rank` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '项目排名(1-5)',
  `product_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '项目名称',
  `revenue` decimal(20, 2) NULL DEFAULT NULL COMMENT '项目收入',
  `cost` decimal(20, 2) NULL DEFAULT NULL COMMENT '项目成本',
  `profit` decimal(20, 2) NULL DEFAULT NULL COMMENT '项目毛利',
  `profit_margin` decimal(10, 4) NULL DEFAULT NULL COMMENT '项目毛利率',
  PRIMARY KEY (`stock_code`, `report_date`, `product_rank`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for gp_min_data
-- ----------------------------
DROP TABLE IF EXISTS `gp_min_data`;
CREATE TABLE `gp_min_data`  (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
  `symbol` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '个股代码',
  `timestamp` timestamp NULL DEFAULT NULL COMMENT '时间戳',
  `volume` bigint NULL DEFAULT NULL COMMENT '数量',
  `open` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '开始价',
  `high` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '最高价',
  `low` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '最低价',
  `close` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '结束价',
  `chg` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '变化数值',
  `percent` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '变化百分比',
  `turnoverrate` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  `amount` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '成交金额',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 61116588 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for gp_product_category
-- ----------------------------
DROP TABLE IF EXISTS `gp_product_category`;
CREATE TABLE `gp_product_category`  (
  `id` int NOT NULL AUTO_INCREMENT,
  `category_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  `product_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  `stock_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  `stock_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `idx_stock_code`(`stock_code` ASC) USING BTREE,
  INDEX `idx_product_name`(`product_name` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 35869 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for gp_zygc
-- ----------------------------
DROP TABLE IF EXISTS `gp_zygc`;
CREATE TABLE `gp_zygc`  (
  `id` int NOT NULL AUTO_INCREMENT,
  `gp_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '股票名称',
  `gp_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '股票代码',
  `zygc_xmmc` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '主营构成(按行业)-项目名称',
  `zygc_xmsr` decimal(20, 0) NULL DEFAULT NULL COMMENT '主营构成(按行业)-项目收入',
  `zygc_xmmlr` decimal(10, 2) NULL DEFAULT NULL COMMENT '主营构成(按行业)-项目毛利率',
  `belong_time` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '所属财报期',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 12774 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '个股的主营构成' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for gp_zyyw
-- ----------------------------
DROP TABLE IF EXISTS `gp_zyyw`;
CREATE TABLE `gp_zyyw`  (
  `id` int NOT NULL AUTO_INCREMENT,
  `gp_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '股票名称',
  `gp_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '股票代码',
  `zyyw_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '主营业务名称',
  `zyyw_zb` decimal(10, 2) NULL DEFAULT NULL COMMENT '主营业务占比',
  `belong_time` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '所属财报期',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 25280 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '上市公司主营业务占比' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for hk_hot_stocks
-- ----------------------------
DROP TABLE IF EXISTS `hk_hot_stocks`;
CREATE TABLE `hk_hot_stocks`  (
  `id` int NOT NULL AUTO_INCREMENT,
  `symbol` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
  `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
  `value` int NULL DEFAULT NULL,
  `increment` int NULL DEFAULT NULL,
  `rank_change` int NULL DEFAULT NULL,
  `percent` float NULL DEFAULT NULL,
  `current` float NULL DEFAULT NULL,
  `chg` float NULL DEFAULT NULL,
  `exchange` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
  `stock_type` int NULL DEFAULT NULL,
  `add_time` datetime NULL DEFAULT NULL,
  `status` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 53981 CHARACTER SET = sjis COLLATE = sjis_japanese_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for limitup_analysis_stock_changes
-- ----------------------------
DROP TABLE IF EXISTS `limitup_analysis_stock_changes`;
CREATE TABLE `limitup_analysis_stock_changes`  (
  `symbol` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL,
  `net_profit_cagr` double NULL DEFAULT NULL,
  `north_net_inflow` double NULL DEFAULT NULL,
  `ps` double NULL DEFAULT NULL,
  `type` bigint NULL DEFAULT NULL,
  `percent` double NULL DEFAULT NULL,
  `has_follow` tinyint(1) NULL DEFAULT NULL,
  `tick_size` double NULL DEFAULT NULL,
  `pb_ttm` double NULL DEFAULT NULL,
  `float_shares` bigint NULL DEFAULT NULL,
  `current` double NULL DEFAULT NULL,
  `amplitude` double NULL DEFAULT NULL,
  `pcf` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL,
  `current_year_percent` double NULL DEFAULT NULL,
  `float_market_capital` double NULL DEFAULT NULL,
  `north_net_inflow_time` double NULL DEFAULT NULL,
  `market_capital` double NULL DEFAULT NULL,
  `dividend_yield` double NULL DEFAULT NULL,
  `lot_size` bigint NULL DEFAULT NULL,
  `roe_ttm` double NULL DEFAULT NULL,
  `total_percent` double NULL DEFAULT NULL,
  `percent5m` double NULL DEFAULT NULL,
  `income_cagr` double NULL DEFAULT NULL,
  `amount` double NULL DEFAULT NULL,
  `chg` double NULL DEFAULT NULL,
  `issue_date_ts` bigint NULL DEFAULT NULL,
  `eps` double NULL DEFAULT NULL,
  `main_net_inflows` double NULL DEFAULT NULL,
  `volume` bigint NULL DEFAULT NULL,
  `volume_ratio` double NULL DEFAULT NULL,
  `pb` double NULL DEFAULT NULL,
  `followers` bigint NULL DEFAULT NULL,
  `turnover_rate` double NULL DEFAULT NULL,
  `mapping_quote_current` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL,
  `first_percent` double NULL DEFAULT NULL,
  `name` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL,
  `pe_ttm` double NULL DEFAULT NULL,
  `dual_counter_mapping_symbol` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL,
  `total_shares` bigint NULL DEFAULT NULL,
  `limitup_days` bigint NULL DEFAULT NULL,
  `id` bigint NULL DEFAULT NULL
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for rzrq_data
-- ----------------------------
DROP TABLE IF EXISTS `rzrq_data`;
CREATE TABLE `rzrq_data`  (
  `trade_date` date NOT NULL COMMENT '交易日期',
  `sh_financing_balance` decimal(12, 2) NULL DEFAULT NULL COMMENT '上海融资余额（亿元）',
  `sz_financing_balance` decimal(12, 2) NULL DEFAULT NULL COMMENT '深圳融资余额（亿元）',
  `bj_financing_balance` decimal(12, 2) NULL DEFAULT NULL COMMENT '北京融资余额（亿元）',
  `total_financing_balance` decimal(12, 2) NULL DEFAULT NULL COMMENT '融资余额合计（亿元）',
  `sh_financing_buy` decimal(12, 2) NULL DEFAULT NULL COMMENT '上海融资买入额（亿元）',
  `sz_financing_buy` decimal(12, 2) NULL DEFAULT NULL COMMENT '深圳融资买入额（亿元）',
  `bj_financing_buy` decimal(12, 2) NULL DEFAULT NULL COMMENT '北京融资买入额（亿元）',
  `total_financing_buy` decimal(12, 2) NULL DEFAULT NULL COMMENT '融资买入额合计（亿元）',
  `sh_securities_balance` decimal(12, 2) NULL DEFAULT NULL COMMENT '上海融券余量余额（亿元）',
  `sz_securities_balance` decimal(12, 2) NULL DEFAULT NULL COMMENT '深圳融券余量余额（亿元）',
  `bj_securities_balance` decimal(12, 2) NULL DEFAULT NULL COMMENT '北京融券余量余额（亿元）',
  `total_securities_balance` decimal(12, 2) NULL DEFAULT NULL COMMENT '融券余量余额合计（亿元）',
  `sh_rzrq_balance` decimal(12, 2) NULL DEFAULT NULL COMMENT '上海融资融券余额（亿元）',
  `sz_rzrq_balance` decimal(12, 2) NULL DEFAULT NULL COMMENT '深圳融资融券余额（亿元）',
  `bj_rzrq_balance` decimal(12, 2) NULL DEFAULT NULL COMMENT '北京融资融券余额（亿元）',
  `total_rzrq_balance` decimal(12, 2) NULL DEFAULT NULL COMMENT '融资融券余额合计（亿元）',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`trade_date`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '融资融券数据表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for stock_price_changes
-- ----------------------------
DROP TABLE IF EXISTS `stock_price_changes`;
CREATE TABLE `stock_price_changes`  (
  `symbol` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL,
  `name` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL,
  `current` double NULL DEFAULT NULL,
  `percent` double NULL DEFAULT NULL,
  `time_mark` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL,
  `add_time` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for stock_price_data
-- ----------------------------
DROP TABLE IF EXISTS `stock_price_data`;
CREATE TABLE `stock_price_data`  (
  `stock_code` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '股票代码',
  `stock_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '股票名称',
  `latest_price` decimal(10, 2) NULL DEFAULT NULL COMMENT '最新价',
  `change_percent` decimal(10, 2) NULL DEFAULT NULL COMMENT '涨跌幅',
  `change_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '涨跌额',
  `volume` bigint NULL DEFAULT NULL COMMENT '成交量(手)',
  `amount` decimal(20, 2) NULL DEFAULT NULL COMMENT '成交额',
  `amplitude` decimal(10, 2) NULL DEFAULT NULL COMMENT '振幅',
  `turnover_rate` decimal(10, 2) NULL DEFAULT NULL COMMENT '换手率',
  `pe_ratio` decimal(10, 2) NULL DEFAULT NULL COMMENT '市盈率',
  `high_price` decimal(10, 2) NULL DEFAULT NULL COMMENT '最高价',
  `low_price` decimal(10, 2) NULL DEFAULT NULL COMMENT '最低价',
  `open_price` decimal(10, 2) NULL DEFAULT NULL COMMENT '开盘价',
  `pre_close` decimal(10, 2) NULL DEFAULT NULL COMMENT '昨收价',
  `total_market_value` decimal(20, 2) NULL DEFAULT NULL COMMENT '总市值',
  `float_market_value` decimal(20, 2) NULL DEFAULT NULL COMMENT '流通市值',
  `pb_ratio` decimal(10, 2) NULL DEFAULT NULL COMMENT '市净率',
  `list_date` date NULL DEFAULT NULL COMMENT '上市日期',
  `update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  PRIMARY KEY (`stock_code`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '实时股价数据表' ROW_FORMAT = Dynamic;

SET FOREIGN_KEY_CHECKS = 1;
