fix: 行业导入、个股每日交易均完成可用

dev_refactor_0120_qoder
Lxy 4 months ago
parent 895796b48c
commit 7d0730246f

@ -28,13 +28,7 @@ public class TIndustryBasic extends BaseEntity
@Excel(name = "行业级别") @Excel(name = "行业级别")
private Integer industryLevel; private Integer industryLevel;
/** 父级行业代码 */
@Excel(name = "父级行业代码")
private String parentIndustryCode;
/** 行业描述 */
@Excel(name = "行业描述")
private String description;
/** 状态1=正常0=禁用) */ /** 状态1=正常0=禁用) */
@Excel(name = "状态", readConverterExp = "1=正常,0=禁用") @Excel(name = "状态", readConverterExp = "1=正常,0=禁用")
@ -74,25 +68,7 @@ public class TIndustryBasic extends BaseEntity
this.industryLevel = industryLevel; this.industryLevel = industryLevel;
} }
public String getParentIndustryCode()
{
return parentIndustryCode;
}
public void setParentIndustryCode(String parentIndustryCode)
{
this.parentIndustryCode = parentIndustryCode;
}
public String getDescription()
{
return description;
}
public void setDescription(String description)
{
this.description = description;
}
public Integer getStatus() public Integer getStatus()
{ {
@ -121,8 +97,6 @@ public class TIndustryBasic extends BaseEntity
"industryCode='" + industryCode + '\'' + "industryCode='" + industryCode + '\'' +
", industryName='" + industryName + '\'' + ", industryName='" + industryName + '\'' +
", industryLevel=" + industryLevel + ", industryLevel=" + industryLevel +
", parentIndustryCode='" + parentIndustryCode + '\'' +
", description='" + description + '\'' +
", status=" + status + ", status=" + status +
", sortOrder=" + sortOrder + ", sortOrder=" + sortOrder +
'}'; '}';

@ -79,18 +79,6 @@ public class TIndustryIndex extends BaseEntity
@Excel(name = "最低价") @Excel(name = "最低价")
private BigDecimal lowPrice; private BigDecimal lowPrice;
/** 振幅(百分比) */
@Excel(name = "振幅")
private BigDecimal amplitude;
/** 换手率(百分比) */
@Excel(name = "换手率")
private BigDecimal turnoverRate;
/** 等权重平均涨跌幅(百分比) */
@Excel(name = "等权平均涨跌幅")
private BigDecimal equalWeightAvgChangeRate;
/** 成份股上涨家数 */ /** 成份股上涨家数 */
@Excel(name = "上涨家数") @Excel(name = "上涨家数")
private Integer upCount; private Integer upCount;
@ -116,12 +104,13 @@ public class TIndustryIndex extends BaseEntity
private Integer suspendCount; private Integer suspendCount;
/** 近期创历史新高 */ /** 近期创历史新高 */
@Excel(name = "创历史新高", readConverterExp = "1=是,0=否") @Excel(name = "近期创历史新高", readConverterExp = "1=是,0=否")
private Integer newHighFlag; private Integer newHighFlag;
/** 近期创历史新低 */ /** 近期创历史新低 */
@Excel(name = "创历史新低", readConverterExp = "1=是,0=否") @Excel(name = "近期创历史新低", readConverterExp = "1=是,0=否")
private Integer newLowFlag; private Integer newLowFlag;
public String getIndustryIndexCode() public String getIndustryIndexCode()
{ {
@ -273,36 +262,6 @@ public class TIndustryIndex extends BaseEntity
this.lowPrice = lowPrice; this.lowPrice = lowPrice;
} }
public BigDecimal getAmplitude()
{
return amplitude;
}
public void setAmplitude(BigDecimal amplitude)
{
this.amplitude = amplitude;
}
public BigDecimal getTurnoverRate()
{
return turnoverRate;
}
public void setTurnoverRate(BigDecimal turnoverRate)
{
this.turnoverRate = turnoverRate;
}
public BigDecimal getEqualWeightAvgChangeRate()
{
return equalWeightAvgChangeRate;
}
public void setEqualWeightAvgChangeRate(BigDecimal equalWeightAvgChangeRate)
{
this.equalWeightAvgChangeRate = equalWeightAvgChangeRate;
}
public Integer getUpCount() public Integer getUpCount()
{ {
return upCount; return upCount;
@ -382,6 +341,7 @@ public class TIndustryIndex extends BaseEntity
{ {
this.newLowFlag = newLowFlag; this.newLowFlag = newLowFlag;
} }
@Override @Override
public String toString() public String toString()
@ -400,6 +360,8 @@ public class TIndustryIndex extends BaseEntity
", priceChangeRate=" + priceChangeRate + ", priceChangeRate=" + priceChangeRate +
", peTtm=" + peTtm + ", peTtm=" + peTtm +
", peTtmMedian=" + peTtmMedian + ", peTtmMedian=" + peTtmMedian +
", newHighFlag=" + newHighFlag +
", newLowFlag=" + newLowFlag +
'}'; '}';
} }
} }

@ -17,9 +17,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="totalMarketCap" column="total_market_cap" /> <result property="totalMarketCap" column="total_market_cap" />
<result property="freeCirculationCap" column="free_circulation_cap" /> <result property="freeCirculationCap" column="free_circulation_cap" />
<result property="priceChangeRate" column="price_change_rate" /> <result property="priceChangeRate" column="price_change_rate" />
<result property="amplitude" column="amplitude" />
<result property="turnoverRate" column="turnover_rate" />
<result property="equalWeightAvgChangeRate" column="equal_weight_avg_change_rate" />
<result property="peTtm" column="pe_ttm" /> <result property="peTtm" column="pe_ttm" />
<result property="peTtmMedian" column="pe_ttm_median" /> <result property="peTtmMedian" column="pe_ttm_median" />
<result property="upCount" column="up_count" /> <result property="upCount" column="up_count" />
@ -30,6 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="suspendCount" column="suspend_count" /> <result property="suspendCount" column="suspend_count" />
<result property="newHighFlag" column="new_high_flag" /> <result property="newHighFlag" column="new_high_flag" />
<result property="newLowFlag" column="new_low_flag" /> <result property="newLowFlag" column="new_low_flag" />
<result property="createTime" column="create_time" /> <result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" /> <result property="updateTime" column="update_time" />
</resultMap> </resultMap>
@ -37,8 +35,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="selectIndustryIndexVo"> <sql id="selectIndustryIndexVo">
select industry_index_code, industry_index_name, component_count, trade_date, select industry_index_code, industry_index_name, component_count, trade_date,
open_price, close_price, high_price, low_price, volume, turnover, open_price, close_price, high_price, low_price, volume, turnover,
total_market_cap, free_circulation_cap, price_change_rate, amplitude, total_market_cap, free_circulation_cap, price_change_rate, pe_ttm, pe_ttm_median,
turnover_rate, equal_weight_avg_change_rate, pe_ttm, pe_ttm_median,
up_count, down_count, limit_up_count, limit_down_count, no_change_count, up_count, down_count, limit_up_count, limit_down_count, no_change_count,
suspend_count, new_high_flag, new_low_flag, create_time, update_time suspend_count, new_high_flag, new_low_flag, create_time, update_time
from t_industry_index from t_industry_index
@ -99,9 +96,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="totalMarketCap != null">total_market_cap,</if> <if test="totalMarketCap != null">total_market_cap,</if>
<if test="freeCirculationCap != null">free_circulation_cap,</if> <if test="freeCirculationCap != null">free_circulation_cap,</if>
<if test="priceChangeRate != null">price_change_rate,</if> <if test="priceChangeRate != null">price_change_rate,</if>
<if test="amplitude != null">amplitude,</if>
<if test="turnoverRate != null">turnover_rate,</if>
<if test="equalWeightAvgChangeRate != null">equal_weight_avg_change_rate,</if>
<if test="peTtm != null">pe_ttm,</if> <if test="peTtm != null">pe_ttm,</if>
<if test="peTtmMedian != null">pe_ttm_median,</if> <if test="peTtmMedian != null">pe_ttm_median,</if>
<if test="upCount != null">up_count,</if> <if test="upCount != null">up_count,</if>
@ -112,6 +106,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="suspendCount != null">suspend_count,</if> <if test="suspendCount != null">suspend_count,</if>
<if test="newHighFlag != null">new_high_flag,</if> <if test="newHighFlag != null">new_high_flag,</if>
<if test="newLowFlag != null">new_low_flag,</if> <if test="newLowFlag != null">new_low_flag,</if>
create_time, create_time,
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
@ -128,9 +123,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="totalMarketCap != null">#{totalMarketCap},</if> <if test="totalMarketCap != null">#{totalMarketCap},</if>
<if test="freeCirculationCap != null">#{freeCirculationCap},</if> <if test="freeCirculationCap != null">#{freeCirculationCap},</if>
<if test="priceChangeRate != null">#{priceChangeRate},</if> <if test="priceChangeRate != null">#{priceChangeRate},</if>
<if test="amplitude != null">#{amplitude},</if>
<if test="turnoverRate != null">#{turnoverRate},</if>
<if test="equalWeightAvgChangeRate != null">#{equalWeightAvgChangeRate},</if>
<if test="peTtm != null">#{peTtm},</if> <if test="peTtm != null">#{peTtm},</if>
<if test="peTtmMedian != null">#{peTtmMedian},</if> <if test="peTtmMedian != null">#{peTtmMedian},</if>
<if test="upCount != null">#{upCount},</if> <if test="upCount != null">#{upCount},</if>
@ -141,6 +133,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="suspendCount != null">#{suspendCount},</if> <if test="suspendCount != null">#{suspendCount},</if>
<if test="newHighFlag != null">#{newHighFlag},</if> <if test="newHighFlag != null">#{newHighFlag},</if>
<if test="newLowFlag != null">#{newLowFlag},</if> <if test="newLowFlag != null">#{newLowFlag},</if>
NOW(), NOW(),
</trim> </trim>
</insert> </insert>
@ -159,9 +152,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="totalMarketCap != null">total_market_cap = #{totalMarketCap},</if> <if test="totalMarketCap != null">total_market_cap = #{totalMarketCap},</if>
<if test="freeCirculationCap != null">free_circulation_cap = #{freeCirculationCap},</if> <if test="freeCirculationCap != null">free_circulation_cap = #{freeCirculationCap},</if>
<if test="priceChangeRate != null">price_change_rate = #{priceChangeRate},</if> <if test="priceChangeRate != null">price_change_rate = #{priceChangeRate},</if>
<if test="amplitude != null">amplitude = #{amplitude},</if>
<if test="turnoverRate != null">turnover_rate = #{turnoverRate},</if>
<if test="equalWeightAvgChangeRate != null">equal_weight_avg_change_rate = #{equalWeightAvgChangeRate},</if>
<if test="peTtm != null">pe_ttm = #{peTtm},</if> <if test="peTtm != null">pe_ttm = #{peTtm},</if>
<if test="peTtmMedian != null">pe_ttm_median = #{peTtmMedian},</if> <if test="peTtmMedian != null">pe_ttm_median = #{peTtmMedian},</if>
<if test="upCount != null">up_count = #{upCount},</if> <if test="upCount != null">up_count = #{upCount},</if>
@ -172,6 +162,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="suspendCount != null">suspend_count = #{suspendCount},</if> <if test="suspendCount != null">suspend_count = #{suspendCount},</if>
<if test="newHighFlag != null">new_high_flag = #{newHighFlag},</if> <if test="newHighFlag != null">new_high_flag = #{newHighFlag},</if>
<if test="newLowFlag != null">new_low_flag = #{newLowFlag},</if> <if test="newLowFlag != null">new_low_flag = #{newLowFlag},</if>
update_time = NOW(), update_time = NOW(),
</trim> </trim>
where industry_index_code = #{industryIndexCode} and trade_date = #{tradeDate} where industry_index_code = #{industryIndexCode} and trade_date = #{tradeDate}
@ -184,16 +175,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<insert id="batchInsertIndustryIndex" parameterType="java.util.List"> <insert id="batchInsertIndustryIndex" parameterType="java.util.List">
insert into t_industry_index(industry_index_code, industry_index_name, component_count, trade_date, insert into t_industry_index(industry_index_code, industry_index_name, component_count, trade_date,
open_price, close_price, high_price, low_price, volume, turnover, open_price, close_price, high_price, low_price, volume, turnover,
total_market_cap, free_circulation_cap, price_change_rate, amplitude, total_market_cap, free_circulation_cap, price_change_rate, pe_ttm, pe_ttm_median,
turnover_rate, equal_weight_avg_change_rate, pe_ttm, pe_ttm_median,
up_count, down_count, limit_up_count, limit_down_count, no_change_count, up_count, down_count, limit_up_count, limit_down_count, no_change_count,
suspend_count, new_high_flag, new_low_flag, create_time) suspend_count, new_high_flag, new_low_flag, create_time)
values values
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
(#{item.industryIndexCode}, #{item.industryIndexName}, #{item.componentCount}, #{item.tradeDate}, (#{item.industryIndexCode}, #{item.industryIndexName}, #{item.componentCount}, #{item.tradeDate},
#{item.openPrice}, #{item.closePrice}, #{item.highPrice}, #{item.lowPrice}, #{item.volume}, #{item.turnover}, #{item.openPrice}, #{item.closePrice}, #{item.highPrice}, #{item.lowPrice}, #{item.volume}, #{item.turnover},
#{item.totalMarketCap}, #{item.freeCirculationCap}, #{item.priceChangeRate}, #{item.amplitude}, #{item.totalMarketCap}, #{item.freeCirculationCap}, #{item.priceChangeRate}, #{item.peTtm}, #{item.peTtmMedian},
#{item.turnoverRate}, #{item.equalWeightAvgChangeRate}, #{item.peTtm}, #{item.peTtmMedian},
#{item.upCount}, #{item.downCount}, #{item.limitUpCount}, #{item.limitDownCount}, #{item.noChangeCount}, #{item.upCount}, #{item.downCount}, #{item.limitUpCount}, #{item.limitDownCount}, #{item.noChangeCount},
#{item.suspendCount}, #{item.newHighFlag}, #{item.newLowFlag}, NOW()) #{item.suspendCount}, #{item.newHighFlag}, #{item.newLowFlag}, NOW())
</foreach> </foreach>
@ -202,16 +191,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<insert id="batchUpsertIndustryIndex" parameterType="java.util.List"> <insert id="batchUpsertIndustryIndex" parameterType="java.util.List">
insert into t_industry_index(industry_index_code, industry_index_name, component_count, trade_date, insert into t_industry_index(industry_index_code, industry_index_name, component_count, trade_date,
open_price, close_price, high_price, low_price, volume, turnover, open_price, close_price, high_price, low_price, volume, turnover,
total_market_cap, free_circulation_cap, price_change_rate, amplitude, total_market_cap, free_circulation_cap, price_change_rate, pe_ttm, pe_ttm_median,
turnover_rate, equal_weight_avg_change_rate, pe_ttm, pe_ttm_median,
up_count, down_count, limit_up_count, limit_down_count, no_change_count, up_count, down_count, limit_up_count, limit_down_count, no_change_count,
suspend_count, new_high_flag, new_low_flag, create_time) suspend_count, new_high_flag, new_low_flag, create_time)
values values
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
(#{item.industryIndexCode}, #{item.industryIndexName}, #{item.componentCount}, #{item.tradeDate}, (#{item.industryIndexCode}, #{item.industryIndexName}, #{item.componentCount}, #{item.tradeDate},
#{item.openPrice}, #{item.closePrice}, #{item.highPrice}, #{item.lowPrice}, #{item.volume}, #{item.turnover}, #{item.openPrice}, #{item.closePrice}, #{item.highPrice}, #{item.lowPrice}, #{item.volume}, #{item.turnover},
#{item.totalMarketCap}, #{item.freeCirculationCap}, #{item.priceChangeRate}, #{item.amplitude}, #{item.totalMarketCap}, #{item.freeCirculationCap}, #{item.priceChangeRate}, #{item.peTtm}, #{item.peTtmMedian},
#{item.turnoverRate}, #{item.equalWeightAvgChangeRate}, #{item.peTtm}, #{item.peTtmMedian},
#{item.upCount}, #{item.downCount}, #{item.limitUpCount}, #{item.limitDownCount}, #{item.noChangeCount}, #{item.upCount}, #{item.downCount}, #{item.limitUpCount}, #{item.limitDownCount}, #{item.noChangeCount},
#{item.suspendCount}, #{item.newHighFlag}, #{item.newLowFlag}, NOW()) #{item.suspendCount}, #{item.newHighFlag}, #{item.newLowFlag}, NOW())
</foreach> </foreach>
@ -227,9 +214,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
total_market_cap = VALUES(total_market_cap), total_market_cap = VALUES(total_market_cap),
free_circulation_cap = VALUES(free_circulation_cap), free_circulation_cap = VALUES(free_circulation_cap),
price_change_rate = VALUES(price_change_rate), price_change_rate = VALUES(price_change_rate),
amplitude = VALUES(amplitude),
turnover_rate = VALUES(turnover_rate),
equal_weight_avg_change_rate = VALUES(equal_weight_avg_change_rate),
pe_ttm = VALUES(pe_ttm), pe_ttm = VALUES(pe_ttm),
pe_ttm_median = VALUES(pe_ttm_median), pe_ttm_median = VALUES(pe_ttm_median),
up_count = VALUES(up_count), up_count = VALUES(up_count),

@ -8,8 +8,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="industryCode" column="industry_code" /> <result property="industryCode" column="industry_code" />
<result property="industryName" column="industry_name" /> <result property="industryName" column="industry_name" />
<result property="industryLevel" column="industry_level" /> <result property="industryLevel" column="industry_level" />
<result property="parentIndustryCode" column="parent_industry_code" />
<result property="description" column="description" />
<result property="status" column="status" /> <result property="status" column="status" />
<result property="sortOrder" column="sort_order" /> <result property="sortOrder" column="sort_order" />
<result property="createTime" column="create_time" /> <result property="createTime" column="create_time" />
@ -17,7 +15,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectTIndustryBasicVo"> <sql id="selectTIndustryBasicVo">
select industry_code, industry_name, industry_level, parent_industry_code, description, status, sort_order, create_time, update_time select industry_code, industry_name, industry_level, status, sort_order, create_time, update_time
from t_industry_basic from t_industry_basic
</sql> </sql>
@ -38,9 +36,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="industryLevel != null "> <if test="industryLevel != null ">
AND industry_level = #{industryLevel} AND industry_level = #{industryLevel}
</if> </if>
<if test="parentIndustryCode != null and parentIndustryCode != ''">
AND parent_industry_code = #{parentIndustryCode}
</if>
<if test="status != null "> <if test="status != null ">
AND status = #{status} AND status = #{status}
</if> </if>
@ -60,12 +55,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="industryLevel != null"> <if test="industryLevel != null">
industry_level, industry_level,
</if> </if>
<if test="parentIndustryCode != null">
parent_industry_code,
</if>
<if test="description != null">
description,
</if>
<if test="status != null"> <if test="status != null">
status, status,
</if> </if>
@ -83,12 +72,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="industryLevel != null"> <if test="industryLevel != null">
#{industryLevel}, #{industryLevel},
</if> </if>
<if test="parentIndustryCode != null">
#{parentIndustryCode},
</if>
<if test="description != null">
#{description},
</if>
<if test="status != null"> <if test="status != null">
#{status}, #{status},
</if> </if>
@ -107,12 +90,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="industryLevel != null"> <if test="industryLevel != null">
industry_level = #{industryLevel}, industry_level = #{industryLevel},
</if> </if>
<if test="parentIndustryCode != null">
parent_industry_code = #{parentIndustryCode},
</if>
<if test="description != null">
description = #{description},
</if>
<if test="status != null"> <if test="status != null">
status = #{status}, status = #{status},
</if> </if>
@ -139,21 +116,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<insert id="batchUpsertIndustryBasic" parameterType="com.ruoyi.newstocksystem.domain.TIndustryBasic"> <insert id="batchUpsertIndustryBasic" parameterType="com.ruoyi.newstocksystem.domain.TIndustryBasic">
INSERT INTO t_industry_basic( INSERT INTO t_industry_basic(
industry_code, industry_name, industry_level, parent_industry_code, industry_code, industry_name, industry_level,
description, status, sort_order, create_time, update_time status, sort_order, create_time, update_time
) VALUES ) VALUES
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
( (
#{item.industryCode}, #{item.industryName}, #{item.industryLevel}, #{item.industryCode}, #{item.industryName}, #{item.industryLevel},
#{item.parentIndustryCode}, #{item.description}, #{item.status}, #{item.status}, #{item.sortOrder}, now(), now()
#{item.sortOrder}, now(), now()
) )
</foreach> </foreach>
ON DUPLICATE KEY UPDATE ON DUPLICATE KEY UPDATE
industry_name = VALUES(industry_name), industry_name = VALUES(industry_name),
industry_level = VALUES(industry_level), industry_level = VALUES(industry_level),
parent_industry_code = VALUES(parent_industry_code),
description = VALUES(description),
status = VALUES(status), status = VALUES(status),
sort_order = VALUES(sort_order), sort_order = VALUES(sort_order),
update_time = now() update_time = now()

@ -0,0 +1,4 @@
-- 添加新高新低计数字段到行业指数表
ALTER TABLE `t_industry_index`
ADD COLUMN `new_high_count` INT NULL COMMENT '近期创历史新高家数' AFTER `suspend_count`,
ADD COLUMN `new_low_count` INT NULL COMMENT '近期创历史新低家数' AFTER `new_high_count`;

@ -0,0 +1,4 @@
-- 添加新高新低标志字段到行业指数表
ALTER TABLE `t_industry_index`
ADD COLUMN `new_high_flag` TINYINT NULL COMMENT '近期创历史新高1=是0=否)' AFTER `suspend_count`,
ADD COLUMN `new_low_flag` TINYINT NULL COMMENT '近期创历史新低1=是0=否)' AFTER `new_high_flag`;

@ -0,0 +1,12 @@
-- 删除行业基础数据表中的字段
ALTER TABLE `t_industry_basic`
DROP COLUMN `parent_industry_code`,
DROP COLUMN `description`;
-- 删除行业指数每日数据表中的字段
ALTER TABLE `t_industry_index`
DROP COLUMN `amplitude`,
DROP COLUMN `turnover_rate`,
DROP COLUMN `equal_weight_avg_change_rate`,
DROP COLUMN `new_high_flag`,
DROP COLUMN `new_low_flag`;

@ -0,0 +1,4 @@
-- 从行业指数表中删除新高新低计数字段
ALTER TABLE `t_industry_index`
DROP COLUMN `new_high_count`,
DROP COLUMN `new_low_count`;

@ -3,8 +3,7 @@ CREATE TABLE `t_industry_basic` (
`industry_code` VARCHAR(20) NOT NULL COMMENT '行业代码如802089.EI', `industry_code` VARCHAR(20) NOT NULL COMMENT '行业代码如802089.EI',
`industry_name` VARCHAR(50) NOT NULL COMMENT '行业名称(如"银行"', `industry_name` VARCHAR(50) NOT NULL COMMENT '行业名称(如"银行"',
`industry_level` TINYINT NOT NULL DEFAULT 2 COMMENT '行业级别1=一级行业2=二级行业3=三级行业等)', `industry_level` TINYINT NOT NULL DEFAULT 2 COMMENT '行业级别1=一级行业2=二级行业3=三级行业等)',
`parent_industry_code` VARCHAR(20) NULL COMMENT '父级行业代码',
`description` TEXT NULL COMMENT '行业描述',
`status` TINYINT NOT NULL DEFAULT 1 COMMENT '状态1=正常0=禁用)', `status` TINYINT NOT NULL DEFAULT 1 COMMENT '状态1=正常0=禁用)',
`sort_order` INT NOT NULL DEFAULT 0 COMMENT '排序', `sort_order` INT NOT NULL DEFAULT 0 COMMENT '排序',
`create_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `create_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',

@ -0,0 +1,16 @@
-- 行业基础数据表存储行业基础信息已删除parent_industry_code和description字段
CREATE TABLE `t_industry_basic` (
`industry_code` VARCHAR(20) NOT NULL COMMENT '行业代码如802089.EI',
`industry_name` VARCHAR(50) NOT NULL COMMENT '行业名称(如"银行"',
`industry_level` TINYINT NOT NULL DEFAULT 2 COMMENT '行业级别1=一级行业2=二级行业3=三级行业等)',
`status` TINYINT NOT NULL DEFAULT 1 COMMENT '状态1=正常0=禁用)',
`sort_order` INT NOT NULL DEFAULT 0 COMMENT '排序',
`create_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
-- 主键:行业代码
PRIMARY KEY (`industry_code`),
-- 索引:按行业级别查询优化
INDEX `idx_t_industry_basic_level` (`industry_level`),
-- 索引:按状态查询优化
INDEX `idx_t_industry_basic_status` (`status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='行业基础数据表';

@ -15,9 +15,6 @@ CREATE TABLE `t_industry_index` (
`pe_ttm_median` DECIMAL(10,2) NULL COMMENT '市盈率PE(TTM)中位值', `pe_ttm_median` DECIMAL(10,2) NULL COMMENT '市盈率PE(TTM)中位值',
`high_price` DECIMAL(10,2) NULL COMMENT '最高价(指数点位)', `high_price` DECIMAL(10,2) NULL COMMENT '最高价(指数点位)',
`low_price` DECIMAL(10,2) NULL COMMENT '最低价(指数点位)', `low_price` DECIMAL(10,2) NULL COMMENT '最低价(指数点位)',
`amplitude` DECIMAL(6,4) NULL COMMENT '振幅(百分比)',
`turnover_rate` DECIMAL(6,4) NULL COMMENT '换手率(百分比)',
`equal_weight_avg_change_rate` DECIMAL(6,4) NULL COMMENT '等权重平均涨跌幅(百分比)',
`up_count` INT NULL COMMENT '成份股上涨家数', `up_count` INT NULL COMMENT '成份股上涨家数',
`down_count` INT NULL COMMENT '成份股下跌家数', `down_count` INT NULL COMMENT '成份股下跌家数',
`limit_up_count` INT NULL COMMENT '成份股涨停家数', `limit_up_count` INT NULL COMMENT '成份股涨停家数',
@ -26,6 +23,7 @@ CREATE TABLE `t_industry_index` (
`suspend_count` INT NULL COMMENT '成份股停牌家数', `suspend_count` INT NULL COMMENT '成份股停牌家数',
`new_high_flag` TINYINT NULL COMMENT '近期创历史新高1=是0=否)', `new_high_flag` TINYINT NULL COMMENT '近期创历史新高1=是0=否)',
`new_low_flag` TINYINT NULL COMMENT '近期创历史新低1=是0=否)', `new_low_flag` TINYINT NULL COMMENT '近期创历史新低1=是0=否)',
`create_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '数据创建时间(自动填充)', `create_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '数据创建时间(自动填充)',
`update_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '数据更新时间(自动更新)', `update_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '数据更新时间(自动更新)',
-- 复合主键:确保"指数代码+日期"唯一 -- 复合主键:确保"指数代码+日期"唯一

@ -0,0 +1,30 @@
-- 行业指数表:存储东财二级行业指数基础信息及每日成交数据(已删除振幅、换手率、等权平均涨跌幅、新高新低标志位字段)
CREATE TABLE `t_industry_index` (
`industry_index_code` VARCHAR(20) NOT NULL COMMENT '行业指数代码如802089.EI',
`industry_index_name` VARCHAR(50) NOT NULL COMMENT '行业指数名称(如"银行"',
`component_count` INT NULL COMMENT '成份个数(行业包含个股数量)',
`trade_date` DATE NOT NULL COMMENT '交易日期',
`open_price` DECIMAL(10,2) NULL COMMENT '开盘价(指数点位)',
`close_price` DECIMAL(10,2) NOT NULL COMMENT '收盘价(指数点位)',
`volume` BIGINT NULL COMMENT '成交量(指数成交总量)',
`turnover` DECIMAL(20,2) NULL COMMENT '成交额(单位:万元)',
`total_market_cap` DECIMAL(20,2) NULL COMMENT '总市值(单位:万元)',
`free_circulation_cap` DECIMAL(20,2) NULL COMMENT '自由流通市值(单位:万元)',
`price_change_rate` DECIMAL(6,4) NULL COMMENT '涨跌幅百分比如1.2937=1.2937%',
`pe_ttm` DECIMAL(10,2) NULL COMMENT '市盈率PE(TTM)',
`pe_ttm_median` DECIMAL(10,2) NULL COMMENT '市盈率PE(TTM)中位值',
`high_price` DECIMAL(10,2) NULL COMMENT '最高价(指数点位)',
`low_price` DECIMAL(10,2) NULL COMMENT '最低价(指数点位)',
`up_count` INT NULL COMMENT '成份股上涨家数',
`down_count` INT NULL COMMENT '成份股下跌家数',
`limit_up_count` INT NULL COMMENT '成份股涨停家数',
`limit_down_count` INT NULL COMMENT '成份股跌停家数',
`no_change_count` INT NULL COMMENT '成份股平盘家数',
`suspend_count` INT NULL COMMENT '成份股停牌家数',
`create_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '数据创建时间(自动填充)',
`update_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '数据更新时间(自动更新)',
-- 复合主键:确保"指数代码+日期"唯一
PRIMARY KEY (`industry_index_code`, `trade_date`),
-- 索引:优化按日期查询所有行业指数的场景
INDEX `idx_t_industry_index_trade_date` (`trade_date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='东财二级行业指数每日数据';

@ -0,0 +1,32 @@
-- 行业指数表:存储东财二级行业指数基础信息及每日成交数据(包含新高新低计数字段)
CREATE TABLE `t_industry_index` (
`industry_index_code` VARCHAR(20) NOT NULL COMMENT '行业指数代码如802089.EI',
`industry_index_name` VARCHAR(50) NOT NULL COMMENT '行业指数名称(如"银行"',
`component_count` INT NULL COMMENT '成份个数(行业包含个股数量)',
`trade_date` DATE NOT NULL COMMENT '交易日期',
`open_price` DECIMAL(10,2) NULL COMMENT '开盘价(指数点位)',
`close_price` DECIMAL(10,2) NOT NULL COMMENT '收盘价(指数点位)',
`volume` BIGINT NULL COMMENT '成交量(指数成交总量)',
`turnover` DECIMAL(20,2) NULL COMMENT '成交额(单位:万元)',
`total_market_cap` DECIMAL(20,2) NULL COMMENT '总市值(单位:万元)',
`free_circulation_cap` DECIMAL(20,2) NULL COMMENT '自由流通市值(单位:万元)',
`price_change_rate` DECIMAL(6,4) NULL COMMENT '涨跌幅百分比如1.2937=1.2937%',
`pe_ttm` DECIMAL(10,2) NULL COMMENT '市盈率PE(TTM)',
`pe_ttm_median` DECIMAL(10,2) NULL COMMENT '市盈率PE(TTM)中位值',
`high_price` DECIMAL(10,2) NULL COMMENT '最高价(指数点位)',
`low_price` DECIMAL(10,2) NULL COMMENT '最低价(指数点位)',
`up_count` INT NULL COMMENT '成份股上涨家数',
`down_count` INT NULL COMMENT '成份股下跌家数',
`limit_up_count` INT NULL COMMENT '成份股涨停家数',
`limit_down_count` INT NULL COMMENT '成份股跌停家数',
`no_change_count` INT NULL COMMENT '成份股平盘家数',
`suspend_count` INT NULL COMMENT '成份股停牌家数',
`new_high_count` INT NULL COMMENT '近期创历史新高家数',
`new_low_count` INT NULL COMMENT '近期创历史新低家数',
`create_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '数据创建时间(自动填充)',
`update_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '数据更新时间(自动更新)',
-- 复合主键:确保"指数代码+日期"唯一
PRIMARY KEY (`industry_index_code`, `trade_date`),
-- 索引:优化按日期查询所有行业指数的场景
INDEX `idx_t_industry_index_trade_date` (`trade_date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='东财二级行业指数每日数据';

@ -0,0 +1,32 @@
-- 行业指数表:存储东财二级行业指数基础信息及每日成交数据(包含新高新低标志字段)
CREATE TABLE `t_industry_index` (
`industry_index_code` VARCHAR(20) NOT NULL COMMENT '行业指数代码如802089.EI',
`industry_index_name` VARCHAR(50) NOT NULL COMMENT '行业指数名称(如"银行"',
`component_count` INT NULL COMMENT '成份个数(行业包含个股数量)',
`trade_date` DATE NOT NULL COMMENT '交易日期',
`open_price` DECIMAL(10,2) NULL COMMENT '开盘价(指数点位)',
`close_price` DECIMAL(10,2) NOT NULL COMMENT '收盘价(指数点位)',
`volume` BIGINT NULL COMMENT '成交量(指数成交总量)',
`turnover` DECIMAL(20,2) NULL COMMENT '成交额(单位:万元)',
`total_market_cap` DECIMAL(20,2) NULL COMMENT '总市值(单位:万元)',
`free_circulation_cap` DECIMAL(20,2) NULL COMMENT '自由流通市值(单位:万元)',
`price_change_rate` DECIMAL(6,4) NULL COMMENT '涨跌幅百分比如1.2937=1.2937%',
`pe_ttm` DECIMAL(10,2) NULL COMMENT '市盈率PE(TTM)',
`pe_ttm_median` DECIMAL(10,2) NULL COMMENT '市盈率PE(TTM)中位值',
`high_price` DECIMAL(10,2) NULL COMMENT '最高价(指数点位)',
`low_price` DECIMAL(10,2) NULL COMMENT '最低价(指数点位)',
`up_count` INT NULL COMMENT '成份股上涨家数',
`down_count` INT NULL COMMENT '成份股下跌家数',
`limit_up_count` INT NULL COMMENT '成份股涨停家数',
`limit_down_count` INT NULL COMMENT '成份股跌停家数',
`no_change_count` INT NULL COMMENT '成份股平盘家数',
`suspend_count` INT NULL COMMENT '成份股停牌家数',
`new_high_flag` TINYINT NULL COMMENT '近期创历史新高1=是0=否)',
`new_low_flag` TINYINT NULL COMMENT '近期创历史新低1=是0=否)',
`create_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '数据创建时间(自动填充)',
`update_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '数据更新时间(自动更新)',
-- 复合主键:确保"指数代码+日期"唯一
PRIMARY KEY (`industry_index_code`, `trade_date`),
-- 索引:优化按日期查询所有行业指数的场景
INDEX `idx_t_industry_index_trade_date` (`trade_date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='东财二级行业指数每日数据';
Loading…
Cancel
Save