fix:动量数据查询基本正常

dev_refactor_0120_qoder
Lxy 4 months ago
parent 1faa74db11
commit c662a567bd

@ -7,7 +7,6 @@ import java.util.Date;
/** /**
* t_trends * t_trends
* eastmoney_industry_codet_industry_index_basic
* *
* @author lxy * @author lxy
* @date 2026-01-21 * @date 2026-01-21
@ -27,14 +26,6 @@ public class TTrends extends BaseEntity
/** 行业名称关联t_industry_basic表 */ /** 行业名称关联t_industry_basic表 */
@Excel(name = "行业名称") @Excel(name = "行业名称")
private String industryName; private String industryName;
/** 所属东财行业代码 */
@Excel(name = "东财行业代码")
private String eastmoneyIndustryCode;
/** 所属东财行业名称 */
@Excel(name = "东财行业名称")
private String eastmoneyIndustryName;
/** 动量个股数量 */ /** 动量个股数量 */
@Excel(name = "动量个股数量") @Excel(name = "动量个股数量")
@ -97,26 +88,6 @@ public class TTrends extends BaseEntity
{ {
this.industryName = industryName; this.industryName = industryName;
} }
public String getEastmoneyIndustryCode()
{
return eastmoneyIndustryCode;
}
public void setEastmoneyIndustryCode(String eastmoneyIndustryCode)
{
this.eastmoneyIndustryCode = eastmoneyIndustryCode;
}
public String getEastmoneyIndustryName()
{
return eastmoneyIndustryName;
}
public void setEastmoneyIndustryName(String eastmoneyIndustryName)
{
this.eastmoneyIndustryName = eastmoneyIndustryName;
}
public Double getStocksCount() public Double getStocksCount()
{ {
@ -203,8 +174,7 @@ public class TTrends extends BaseEntity
return "TTrends{" + return "TTrends{" +
"id=" + id + "id=" + id +
", tradeDate=" + tradeDate + ", tradeDate=" + tradeDate +
", eastmoneyIndustryCode='" + eastmoneyIndustryCode + '\'' + ", industryName='" + industryName + '\'' +
", eastmoneyIndustryName='" + eastmoneyIndustryName + '\'' +
", stocksCount=" + stocksCount + ", stocksCount=" + stocksCount +
", trendValue=" + trendValue + ", trendValue=" + trendValue +
", trendValueChange=" + trendValueChange + ", trendValueChange=" + trendValueChange +

@ -8,8 +8,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<id property="id" column="id" /> <id property="id" column="id" />
<result property="tradeDate" column="trade_date" /> <result property="tradeDate" column="trade_date" />
<result property="industryName" column="industry_name" /> <result property="industryName" column="industry_name" />
<result property="eastmoneyIndustryCode" column="eastmoney_industry_code" />
<result property="eastmoneyIndustryName" column="eastmoney_industry_name" />
<result property="stocksCount" column="stocks_count" /> <result property="stocksCount" column="stocks_count" />
<result property="trendValue" column="trend_value" /> <result property="trendValue" column="trend_value" />
<result property="trendValueChange" column="trend_value_change" /> <result property="trendValueChange" column="trend_value_change" />
@ -21,7 +19,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectTTrendsVo"> <sql id="selectTTrendsVo">
select id, trade_date, industry_name, eastmoney_industry_code, eastmoney_industry_name, stocks_count, trend_value, trend_value_change, rank, rank_change, momentum_type, create_time, update_time from t_trends select id, trade_date, industry_name, stocks_count, trend_value, trend_value_change, `rank`, `rank_change`, momentum_type, create_time, update_time from t_trends
</sql> </sql>
<select id="selectTTrendsById" parameterType="Long" resultMap="TTrendsResult"> <select id="selectTTrendsById" parameterType="Long" resultMap="TTrendsResult">
@ -34,8 +32,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<where> <where>
<if test="tradeDate != null ">and trade_date = #{tradeDate}</if> <if test="tradeDate != null ">and trade_date = #{tradeDate}</if>
<if test="industryName != null and industryName != ''">and industry_name = #{industryName}</if> <if test="industryName != null and industryName != ''">and industry_name = #{industryName}</if>
<if test="eastmoneyIndustryCode != null and eastmoneyIndustryCode != ''">and eastmoney_industry_code = #{eastmoneyIndustryCode}</if>
<if test="eastmoneyIndustryName != null and eastmoneyIndustryName != ''">and eastmoney_industry_name = #{eastmoneyIndustryName}</if>
<if test="stocksCount != null ">and stocks_count = #{stocksCount}</if> <if test="stocksCount != null ">and stocks_count = #{stocksCount}</if>
<if test="trendValue != null ">and trend_value = #{trendValue}</if> <if test="trendValue != null ">and trend_value = #{trendValue}</if>
<if test="trendValueChange != null ">and trend_value_change = #{trendValueChange}</if> <if test="trendValueChange != null ">and trend_value_change = #{trendValueChange}</if>
@ -50,13 +46,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="tradeDate != null">trade_date,</if> <if test="tradeDate != null">trade_date,</if>
<if test="industryName != null and industryName != ''">industry_name,</if> <if test="industryName != null and industryName != ''">industry_name,</if>
<if test="eastmoneyIndustryCode != null and eastmoneyIndustryCode != ''">eastmoney_industry_code,</if>
<if test="eastmoneyIndustryName != null and eastmoneyIndustryName != ''">eastmoney_industry_name,</if>
<if test="stocksCount != null">stocks_count,</if> <if test="stocksCount != null">stocks_count,</if>
<if test="trendValue != null">trend_value,</if> <if test="trendValue != null">trend_value,</if>
<if test="trendValueChange != null">trend_value_change,</if> <if test="trendValueChange != null">trend_value_change,</if>
<if test="rank != null">rank,</if> <if test="rank != null">`rank`,</if>
<if test="rankChange != null">rank_change,</if> <if test="rankChange != null">`rank_change`,</if>
<if test="momentumType != null and momentumType != ''">momentum_type,</if> <if test="momentumType != null and momentumType != ''">momentum_type,</if>
<if test="createTime != null">create_time,</if> <if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if> <if test="updateTime != null">update_time,</if>
@ -64,8 +58,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="tradeDate != null">#{tradeDate},</if> <if test="tradeDate != null">#{tradeDate},</if>
<if test="industryName != null and industryName != ''">#{industryName},</if> <if test="industryName != null and industryName != ''">#{industryName},</if>
<if test="eastmoneyIndustryCode != null and eastmoneyIndustryCode != ''">#{eastmoneyIndustryCode},</if>
<if test="eastmoneyIndustryName != null and eastmoneyIndustryName != ''">#{eastmoneyIndustryName},</if>
<if test="stocksCount != null">#{stocksCount},</if> <if test="stocksCount != null">#{stocksCount},</if>
<if test="trendValue != null">#{trendValue},</if> <if test="trendValue != null">#{trendValue},</if>
<if test="trendValueChange != null">#{trendValueChange},</if> <if test="trendValueChange != null">#{trendValueChange},</if>
@ -82,13 +74,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="tradeDate != null">trade_date = #{tradeDate},</if> <if test="tradeDate != null">trade_date = #{tradeDate},</if>
<if test="industryName != null and industryName != ''">industry_name = #{industryName},</if> <if test="industryName != null and industryName != ''">industry_name = #{industryName},</if>
<if test="eastmoneyIndustryCode != null and eastmoneyIndustryCode != ''">eastmoney_industry_code = #{eastmoneyIndustryCode},</if>
<if test="eastmoneyIndustryName != null and eastmoneyIndustryName != ''">eastmoney_industry_name = #{eastmoneyIndustryName},</if>
<if test="stocksCount != null">stocks_count = #{stocksCount},</if> <if test="stocksCount != null">stocks_count = #{stocksCount},</if>
<if test="trendValue != null">trend_value = #{trendValue},</if> <if test="trendValue != null">trend_value = #{trendValue},</if>
<if test="trendValueChange != null">trend_value_change = #{trendValueChange},</if> <if test="trendValueChange != null">trend_value_change = #{trendValueChange},</if>
<if test="rank != null">rank = #{rank},</if> <if test="rank != null">`rank` = #{rank},</if>
<if test="rankChange != null">rank_change = #{rankChange},</if> <if test="rankChange != null">`rank_change` = #{rankChange},</if>
<if test="momentumType != null and momentumType != ''">momentum_type = #{momentumType},</if> <if test="momentumType != null and momentumType != ''">momentum_type = #{momentumType},</if>
<if test="updateTime != null">update_time = #{updateTime},</if> <if test="updateTime != null">update_time = #{updateTime},</if>
</trim> </trim>
@ -110,13 +100,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
INSERT INTO t_trends ( INSERT INTO t_trends (
trade_date, trade_date,
industry_name, industry_name,
eastmoney_industry_code,
eastmoney_industry_name,
stocks_count, stocks_count,
trend_value, trend_value,
trend_value_change, trend_value_change,
rank, `rank`,
rank_change, `rank_change`,
momentum_type, momentum_type,
create_time, create_time,
update_time update_time
@ -125,8 +113,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
( (
#{item.tradeDate}, #{item.tradeDate},
#{item.industryName}, #{item.industryName},
#{item.eastmoneyIndustryCode},
#{item.eastmoneyIndustryName},
#{item.stocksCount}, #{item.stocksCount},
#{item.trendValue}, #{item.trendValue},
#{item.trendValueChange}, #{item.trendValueChange},
@ -141,9 +127,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
stocks_count = VALUES(stocks_count), stocks_count = VALUES(stocks_count),
trend_value = VALUES(trend_value), trend_value = VALUES(trend_value),
trend_value_change = VALUES(trend_value_change), trend_value_change = VALUES(trend_value_change),
rank = VALUES(rank), `rank` = VALUES(`rank`),
rank_change = VALUES(rank_change), `rank_change` = VALUES(`rank_change`),
eastmoney_industry_name = VALUES(eastmoney_industry_name),
update_time = VALUES(update_time) update_time = VALUES(update_time)
</insert> </insert>

@ -186,6 +186,17 @@ export default {
params: query params: query
}) })
}, },
// ========================= 趋势数据相关 =========================
// 查询趋势列表
listTrends(query) {
return request({
url: '/newstocksystem/trends/list',
method: 'get',
params: query
})
},
// 查询个股新高新低状态列表(包含基础信息) // 查询个股新高新低状态列表(包含基础信息)
listStockHighLowStatusWithBasic(query) { listStockHighLowStatusWithBasic(query) {

@ -237,6 +237,58 @@
<pagination v-show="stockHighLowTotal > 0" :total="stockHighLowTotal" :page.sync="stockHighLowQuery.pageNum" :limit.sync="stockHighLowQuery.pageSize" @pagination="getStockHighLowList" /> <pagination v-show="stockHighLowTotal > 0" :total="stockHighLowTotal" :page.sync="stockHighLowQuery.pageNum" :limit.sync="stockHighLowQuery.pageSize" @pagination="getStockHighLowList" />
</el-tab-pane> </el-tab-pane>
<!-- 趋势数据 Tab -->
<el-tab-pane label="趋势数据" name="trends">
<el-form :model="trendsQuery" ref="trendsForm" size="small" :inline="true" label-width="100px">
<el-form-item label="交易日期" prop="tradeDate">
<el-date-picker v-model="trendsQuery.tradeDate" type="date" value-format="yyyy-MM-dd" placeholder="选择交易日期" clearable />
</el-form-item>
<el-form-item label="行业名称" prop="industryName">
<el-input v-model="trendsQuery.industryName" placeholder="请输入行业名称" clearable @keyup.enter.native="queryTrends" />
</el-form-item>
<el-form-item label="动量类型" prop="momentumType">
<el-select v-model="trendsQuery.momentumType" placeholder="请选择动量类型">
<el-option label="1日" :value="'1'" />
<el-option label="3日" :value="'3'" />
<el-option label="5日" :value="'5'" />
<el-option label="10日" :value="'10'" />
<el-option label="15日" :value="'15'" />
<el-option label="20日" :value="'20'" />
<el-option label="30日" :value="'30'" />
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="queryTrends"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetTrendsQuery"></el-button>
</el-form-item>
</el-form>
<el-table v-loading="trendsLoading" :data="trendsList" border fit highlight-current-row>
<el-table-column label="交易日期" align="center" prop="tradeDate" width="120" />
<el-table-column label="行业名称" align="center" prop="industryName" min-width="120" />
<el-table-column label="动量个股数量" align="center" prop="stocksCount" width="120" />
<el-table-column label="动量值" align="center" prop="trendValue" width="100">
<template slot-scope="scope">
<span :class="getChangeClass(scope.row.trendValue)">
{{ formatPercent(scope.row.trendValue) }}
</span>
</template>
</el-table-column>
<el-table-column label="动量值变化" align="center" prop="trendValueChange" width="110">
<template slot-scope="scope">
<span :class="getChangeClass(scope.row.trendValueChange)">
{{ formatPercent(scope.row.trendValueChange) }}
</span>
</template>
</el-table-column>
<el-table-column label="板块排名" align="center" prop="rank" width="90" />
<el-table-column label="排名变化" align="center" prop="rankChange" width="90" />
<el-table-column label="动量类型" align="center" prop="momentumType" width="90" />
</el-table>
<pagination v-show="trendsTotal > 0" :total="trendsTotal" :page.sync="trendsQuery.pageNum" :limit.sync="trendsQuery.pageSize" @pagination="getTrendsList" />
</el-tab-pane>
</el-tabs> </el-tabs>
<!-- 导入对话框 --> <!-- 导入对话框 -->
@ -346,6 +398,18 @@ export default {
tradeDate: null, tradeDate: null,
isNewHigh: null isNewHigh: null
}, },
// ========================= =========================
trendsLoading: false,
trendsList: [],
trendsTotal: 0,
trendsQuery: {
pageNum: 1,
pageSize: 10,
tradeDate: null,
industryName: null,
momentumType: '10'
},
// ========================= ========================= // ========================= =========================
upload: { upload: {
@ -399,6 +463,7 @@ export default {
this.dailyTradeQuery.tradeDate = lastTradeDate this.dailyTradeQuery.tradeDate = lastTradeDate
this.industryIndexQuery.tradeDate = lastTradeDate this.industryIndexQuery.tradeDate = lastTradeDate
this.stockHighLowQuery.tradeDate = lastTradeDate this.stockHighLowQuery.tradeDate = lastTradeDate
this.trendsQuery.tradeDate = lastTradeDate
// //
this.checkAnalysisStatus(lastTradeDate) this.checkAnalysisStatus(lastTradeDate)
} }
@ -434,6 +499,8 @@ export default {
this.getIndustryIndexList() this.getIndustryIndexList()
} else if (tab.name === 'stockHighLow') { } else if (tab.name === 'stockHighLow') {
this.getStockHighLowList() this.getStockHighLowList()
} else if (tab.name === 'trends') {
this.getTrendsList()
} }
}, },
@ -584,6 +651,39 @@ export default {
} }
this.getStockHighLowList() this.getStockHighLowList()
}, },
// ========================= =========================
/** 获取趋势数据列表 */
getTrendsList() {
this.trendsLoading = true
stockdataApi.listTrends(this.trendsQuery).then(response => {
this.trendsList = response.rows
this.trendsTotal = response.total
this.trendsLoading = false
}).catch(() => {
this.trendsLoading = false
})
},
/** 查询趋势数据 */
queryTrends() {
this.trendsQuery.pageNum = 1
this.getTrendsList()
},
/** 重置趋势数据查询 */
resetTrendsQuery() {
this.$refs.trendsForm.resetFields()
this.trendsQuery = {
pageNum: 1,
pageSize: 10,
tradeDate: null,
industryName: null,
momentumType: '10'
}
this.getTrendsList()
},
// ========================= ========================= // ========================= =========================

Loading…
Cancel
Save