/*
 Navicat Premium Data Transfer

 Source Server         : 192.168.0.222
 Source Server Type    : MySQL
 Source Server Version : 80031
 Source Host           : 192.168.0.222:3306
 Source Schema         : ry

 Target Server Type    : MySQL
 Target Server Version : 80031
 File Encoding         : 65001

 Date: 14/03/2023 11:10:19
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for industries
-- ----------------------------
DROP TABLE IF EXISTS `industries`;
CREATE TABLE `industries`  (
  `id` double NOT NULL AUTO_INCREMENT,
  `name` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  `trade_day` date NULL DEFAULT NULL COMMENT '交易日期',
  `stocks_count` int(0) NULL DEFAULT -1 COMMENT '个股数量',
  `type` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '类型（2、3）',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '所属东财行业2级每日数据' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for industries_basis
-- ----------------------------
DROP TABLE IF EXISTS `industries_basis`;
CREATE TABLE `industries_basis`  (
  `id` double NOT NULL AUTO_INCREMENT,
  `name` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
  `type` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '类型（2、3）',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '所属东财行业2级' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for stock_basis
-- ----------------------------
DROP TABLE IF EXISTS `stock_basis`;
CREATE TABLE `stock_basis`  (
  `id` double NOT NULL AUTO_INCREMENT COMMENT 'id',
  `code` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '股票代码',
  `name` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '股票名称',
  `blemind2` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '所属东财行业指数2级',
  `blemind3` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '所属东财行业指数3级',
  `listdate` date NULL DEFAULT NULL COMMENT '首发上市日期*',
  PRIMARY KEY (`id`, `code`) USING BTREE,
  UNIQUE INDEX `code`(`code`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 137415 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = 'A股基础数据' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for stock_financial
-- ----------------------------
DROP TABLE IF EXISTS `stock_financial`;
CREATE TABLE `stock_financial`  (
  `id` double NOT NULL AUTO_INCREMENT COMMENT 'idstock_basis',
  `code` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '股票代码',
  `period` date NULL DEFAULT NULL COMMENT '报告期',
  `jlrtbzzl` decimal(50, 4) NULL DEFAULT NULL COMMENT '净利润同比增长率',
  `jlrhbzzl` decimal(50, 4) NULL DEFAULT NULL COMMENT '净利润环比增长率',
  `jzcsylroe` decimal(50, 4) NULL DEFAULT NULL COMMENT '净资产收益率ROE',
  `epsbasic` decimal(50, 4) NULL DEFAULT NULL COMMENT '每股收益EPS',
  `jlr` decimal(50, 4) NULL DEFAULT NULL COMMENT '净利润',
  `jbmgsy` decimal(50, 4) NULL DEFAULT NULL COMMENT '基本每股收益',
  `mgjzc` decimal(50, 4) NULL DEFAULT NULL COMMENT '每股净资产BPS',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 151531 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = 'A股财务数据' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for stock_index
-- ----------------------------
DROP TABLE IF EXISTS `stock_index`;
CREATE TABLE `stock_index`  (
  `id` double NOT NULL AUTO_INCREMENT,
  `code` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  `name` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  `trade_day` date NULL DEFAULT NULL COMMENT '交易日期',
  `open` decimal(50, 4) NULL DEFAULT NULL COMMENT '开盘价',
  `close` decimal(50, 4) NULL DEFAULT NULL COMMENT '收盘价',
  `high` decimal(50, 4) NULL DEFAULT NULL COMMENT '最高价',
  `low` decimal(50, 4) NULL DEFAULT NULL COMMENT '最低价',
  `differRange` decimal(50, 4) NULL DEFAULT NULL COMMENT '涨跌幅',
  `volume` decimal(50, 4) NULL DEFAULT NULL COMMENT '成交量',
  `amount` decimal(50, 4) NULL DEFAULT NULL COMMENT '成交额',
  `limitupnum` decimal(50, 4) NULL DEFAULT NULL COMMENT '涨停家数',
  `limitdownnum` decimal(50, 4) NULL DEFAULT NULL COMMENT '跌停家数',
  `suspendnum` decimal(50, 4) NULL DEFAULT NULL COMMENT '停牌家数',
  `risenum` decimal(50, 4) NULL DEFAULT NULL COMMENT '上涨家数',
  `fallnum` decimal(50, 4) NULL DEFAULT NULL COMMENT '下跌家数',
  `flatnum` decimal(50, 4) NULL DEFAULT NULL COMMENT '平盘家数',
  `componentnum` decimal(50, 4) NULL DEFAULT NULL COMMENT '成分个数',
  `mv` decimal(50, 4) NULL DEFAULT NULL COMMENT '总市值',
  `pettm` decimal(50, 4) NULL DEFAULT NULL COMMENT '市盈率PE',
  `pettm_mid` decimal(50, 4) NULL DEFAULT NULL COMMENT '市盈率PE中位值',
  `liqmv` decimal(50, 4) NULL DEFAULT NULL COMMENT '自由流通市值',
  `rcnthigh` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '近期创历史新高',
  `rcntlow` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '近期创历史新低',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 105433 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '指数交易行情' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for stocks
-- ----------------------------
DROP TABLE IF EXISTS `stocks`;
CREATE TABLE `stocks`  (
  `id` double NOT NULL AUTO_INCREMENT,
  `code` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  `trade_day` date NULL DEFAULT NULL COMMENT '交易日期',
  `open` decimal(50, 2) NULL DEFAULT NULL COMMENT '开盘价',
  `close` decimal(50, 2) NULL DEFAULT NULL COMMENT '收盘价',
  `high` decimal(50, 2) NULL DEFAULT NULL COMMENT '最高价',
  `low` decimal(50, 2) NULL DEFAULT NULL COMMENT '最低价',
  `islimit` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '是否涨停',
  `isdrop` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '是否跌停',
  `differrange` decimal(50, 2) NULL DEFAULT NULL COMMENT '当日涨跌幅',
  `trade_days` int(0) NULL DEFAULT NULL COMMENT '可交易日数',
  `volumn` decimal(50, 2) NULL DEFAULT NULL COMMENT '成交量',
  `amount` decimal(50, 2) NULL DEFAULT NULL COMMENT '成交额',
  `differrange10` decimal(50, 2) NULL DEFAULT NULL COMMENT '10日区间涨跌幅',
  `differrange20` decimal(50, 2) NULL DEFAULT NULL COMMENT '20日区间涨跌幅',
  `differrange60` decimal(50, 2) NULL DEFAULT NULL COMMENT '60日区间涨跌幅',
  `avg_volume20` decimal(50, 2) NULL DEFAULT NULL COMMENT '20日区间平均成交量',
  `freefloat_market_value` decimal(50, 2) NULL DEFAULT NULL COMMENT '自由流通市值',
  `total_market_value` decimal(50, 2) NULL DEFAULT NULL COMMENT '总市值',
  `agencies_hold` decimal(50, 2) NULL DEFAULT NULL COMMENT '机构持仓合计',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1246923 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '全部A股每日交易数据' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for stocks_in_trend
-- ----------------------------
DROP TABLE IF EXISTS `stocks_in_trend`;
CREATE TABLE `stocks_in_trend`  (
  `id` double NOT NULL AUTO_INCREMENT,
  `code` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  `trade_day` date NULL DEFAULT NULL COMMENT '交易日期',
  `sort` int(0) NULL DEFAULT -1 COMMENT '排名',
  `type` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '动量数据类型（10日、20日）',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 912155 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '动量个股' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for stocks_limit
-- ----------------------------
DROP TABLE IF EXISTS `stocks_limit`;
CREATE TABLE `stocks_limit`  (
  `id` double NOT NULL AUTO_INCREMENT,
  `code` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  `trade_day` date NULL DEFAULT NULL COMMENT '交易日期',
  `islimit` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '是否涨停',
  `isdrop` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '是否跌停',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 582 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '每日涨停板' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for stocks_limit_up
-- ----------------------------
DROP TABLE IF EXISTS `stocks_limit_up`;
CREATE TABLE `stocks_limit_up`  (
  `id` double NOT NULL AUTO_INCREMENT,
  `code` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  `trade_day` date NULL DEFAULT NULL COMMENT '交易日期',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 161 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '每日涨停板' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for stocks_new_record
-- ----------------------------
DROP TABLE IF EXISTS `stocks_new_record`;
CREATE TABLE `stocks_new_record`  (
  `id` double NOT NULL AUTO_INCREMENT,
  `code` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '股票代码',
  `trade_day` date NULL DEFAULT NULL COMMENT '交易日期',
  `isHigh` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '是否300天新低',
  `isLow` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '是否300天新高',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 30262 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '每日创新高新低' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for stocks_tmp
-- ----------------------------
DROP TABLE IF EXISTS `stocks_tmp`;
CREATE TABLE `stocks_tmp`  (
  `id` double NOT NULL AUTO_INCREMENT,
  `code` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  `trade_day` date NULL DEFAULT NULL COMMENT '交易日期',
  `differrange3` decimal(50, 4) NULL DEFAULT NULL COMMENT '3日区间涨跌幅',
  `differrange5` decimal(50, 4) NULL DEFAULT NULL COMMENT '5日区间涨跌幅',
  `differrange15` decimal(50, 4) NULL DEFAULT NULL COMMENT '15日区间涨跌幅',
  `differrange30` decimal(50, 4) NULL DEFAULT NULL COMMENT '30日区间涨跌幅',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1339349 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '全部A股每日交易数据辅助表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for trade_dates
-- ----------------------------
DROP TABLE IF EXISTS `trade_dates`;
CREATE TABLE `trade_dates`  (
  `date` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '日期',
  `week` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '周',
  `trade` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '是否可交易'
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '可交易日期' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for trends
-- ----------------------------
DROP TABLE IF EXISTS `trends`;
CREATE TABLE `trends`  (
  `id` double NOT NULL AUTO_INCREMENT,
  `trade_day` date NULL DEFAULT NULL COMMENT '交易日期',
  `blemind2` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '所属东财行业指数2级',
  `stocks_count` decimal(50, 2) NULL DEFAULT -1.00 COMMENT '动量个股数量',
  `trend_value` decimal(50, 2) NULL DEFAULT -1.00 COMMENT '动量值',
  `trend_value_change` decimal(50, 2) NULL DEFAULT -1.00 COMMENT '动量值变化',
  `sort` int(0) NULL DEFAULT -1 COMMENT '板块排名',
  `sort_change` int(0) NULL DEFAULT -1 COMMENT '板块排名变化',
  `type` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '动量数据类型',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 146992 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '动量结果' ROW_FORMAT = Dynamic;

SET FOREIGN_KEY_CHECKS = 1;
