diff --git a/newstock-system/src/main/java/com/ruoyi/newstocksystem/controller/TStockFinancialController.java b/newstock-system/src/main/java/com/ruoyi/newstocksystem/controller/TStockFinancialController.java new file mode 100644 index 0000000..3e0f6df --- /dev/null +++ b/newstock-system/src/main/java/com/ruoyi/newstocksystem/controller/TStockFinancialController.java @@ -0,0 +1,104 @@ +package com.ruoyi.newstocksystem.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.newstocksystem.domain.TStockFinancial; +import com.ruoyi.newstocksystem.service.TStockFinancialService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 股票财务数据Controller + * + * @author lxy + * @date 2026-01-21 + */ +@RestController +@RequestMapping("/newstocksystem/stockfinancial") +public class TStockFinancialController extends BaseController +{ + @Autowired + private TStockFinancialService tStockFinancialService; + + /** + * 查询股票财务数据列表 + */ + @PreAuthorize("@ss.hasPermi('newstocksystem:stockfinancial:list')") + @GetMapping("/list") + public TableDataInfo list(TStockFinancial tStockFinancial) + { + startPage(); + List list = tStockFinancialService.selectTStockFinancialList(tStockFinancial); + return getDataTable(list); + } + + /** + * 导出股票财务数据列表 + */ + @PreAuthorize("@ss.hasPermi('newstocksystem:stockfinancial:export')") + @Log(title = "股票财务数据", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, TStockFinancial tStockFinancial) + { + List list = tStockFinancialService.selectTStockFinancialList(tStockFinancial); + ExcelUtil util = new ExcelUtil(TStockFinancial.class); + util.exportExcel(response, list, "股票财务数据数据"); + } + + /** + * 获取股票财务数据详细信息 + */ + @PreAuthorize("@ss.hasPermi('newstocksystem:stockfinancial:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(tStockFinancialService.selectTStockFinancialById(id)); + } + + /** + * 新增股票财务数据 + */ + @PreAuthorize("@ss.hasPermi('newstocksystem:stockfinancial:add')") + @Log(title = "股票财务数据", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody TStockFinancial tStockFinancial) + { + return toAjax(tStockFinancialService.insertTStockFinancial(tStockFinancial)); + } + + /** + * 修改股票财务数据 + */ + @PreAuthorize("@ss.hasPermi('newstocksystem:stockfinancial:edit')") + @Log(title = "股票财务数据", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody TStockFinancial tStockFinancial) + { + return toAjax(tStockFinancialService.updateTStockFinancial(tStockFinancial)); + } + + /** + * 删除股票财务数据 + */ + @PreAuthorize("@ss.hasPermi('newstocksystem:stockfinancial:remove')") + @Log(title = "股票财务数据", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(tStockFinancialService.deleteTStockFinancialByIds(ids)); + } +} \ No newline at end of file diff --git a/newstock-system/src/main/java/com/ruoyi/newstocksystem/controller/TStocksInTrendController.java b/newstock-system/src/main/java/com/ruoyi/newstocksystem/controller/TStocksInTrendController.java new file mode 100644 index 0000000..9032174 --- /dev/null +++ b/newstock-system/src/main/java/com/ruoyi/newstocksystem/controller/TStocksInTrendController.java @@ -0,0 +1,104 @@ +package com.ruoyi.newstocksystem.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.newstocksystem.domain.TStocksInTrend; +import com.ruoyi.newstocksystem.service.TStocksInTrendService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 趋势中的股票Controller + * + * @author lxy + * @date 2026-01-21 + */ +@RestController +@RequestMapping("/newstocksystem/stocksintrnd") +public class TStocksInTrendController extends BaseController +{ + @Autowired + private TStocksInTrendService tStocksInTrendService; + + /** + * 查询趋势中的股票列表 + */ + @PreAuthorize("@ss.hasPermi('newstocksystem:stocksintrnd:list')") + @GetMapping("/list") + public TableDataInfo list(TStocksInTrend tStocksInTrend) + { + startPage(); + List list = tStocksInTrendService.selectTStocksInTrendList(tStocksInTrend); + return getDataTable(list); + } + + /** + * 导出趋势中的股票列表 + */ + @PreAuthorize("@ss.hasPermi('newstocksystem:stocksintrnd:export')") + @Log(title = "趋势中的股票", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, TStocksInTrend tStocksInTrend) + { + List list = tStocksInTrendService.selectTStocksInTrendList(tStocksInTrend); + ExcelUtil util = new ExcelUtil(TStocksInTrend.class); + util.exportExcel(response, list, "趋势中的股票数据"); + } + + /** + * 获取趋势中的股票详细信息 + */ + @PreAuthorize("@ss.hasPermi('newstocksystem:stocksintrnd:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(tStocksInTrendService.selectTStocksInTrendById(id)); + } + + /** + * 新增趋势中的股票 + */ + @PreAuthorize("@ss.hasPermi('newstocksystem:stocksintrnd:add')") + @Log(title = "趋势中的股票", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody TStocksInTrend tStocksInTrend) + { + return toAjax(tStocksInTrendService.insertTStocksInTrend(tStocksInTrend)); + } + + /** + * 修改趋势中的股票 + */ + @PreAuthorize("@ss.hasPermi('newstocksystem:stocksintrnd:edit')") + @Log(title = "趋势中的股票", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody TStocksInTrend tStocksInTrend) + { + return toAjax(tStocksInTrendService.updateTStocksInTrend(tStocksInTrend)); + } + + /** + * 删除趋势中的股票 + */ + @PreAuthorize("@ss.hasPermi('newstocksystem:stocksintrnd:remove')") + @Log(title = "趋势中的股票", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(tStocksInTrendService.deleteTStocksInTrendByIds(ids)); + } +} \ No newline at end of file diff --git a/newstock-system/src/main/java/com/ruoyi/newstocksystem/controller/TTrendsController.java b/newstock-system/src/main/java/com/ruoyi/newstocksystem/controller/TTrendsController.java new file mode 100644 index 0000000..cda4c72 --- /dev/null +++ b/newstock-system/src/main/java/com/ruoyi/newstocksystem/controller/TTrendsController.java @@ -0,0 +1,104 @@ +package com.ruoyi.newstocksystem.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.newstocksystem.domain.TTrends; +import com.ruoyi.newstocksystem.service.TTrendsService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 趋势Controller + * + * @author lxy + * @date 2026-01-21 + */ +@RestController +@RequestMapping("/newstocksystem/trends") +public class TTrendsController extends BaseController +{ + @Autowired + private TTrendsService tTrendsService; + + /** + * 查询趋势列表 + */ + @PreAuthorize("@ss.hasPermi('newstocksystem:trends:list')") + @GetMapping("/list") + public TableDataInfo list(TTrends tTrends) + { + startPage(); + List list = tTrendsService.selectTTrendsList(tTrends); + return getDataTable(list); + } + + /** + * 导出趋势列表 + */ + @PreAuthorize("@ss.hasPermi('newstocksystem:trends:export')") + @Log(title = "趋势", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, TTrends tTrends) + { + List list = tTrendsService.selectTTrendsList(tTrends); + ExcelUtil util = new ExcelUtil(TTrends.class); + util.exportExcel(response, list, "趋势数据"); + } + + /** + * 获取趋势详细信息 + */ + @PreAuthorize("@ss.hasPermi('newstocksystem:trends:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(tTrendsService.selectTTrendsById(id)); + } + + /** + * 新增趋势 + */ + @PreAuthorize("@ss.hasPermi('newstocksystem:trends:add')") + @Log(title = "趋势", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody TTrends tTrends) + { + return toAjax(tTrendsService.insertTTrends(tTrends)); + } + + /** + * 修改趋势 + */ + @PreAuthorize("@ss.hasPermi('newstocksystem:trends:edit')") + @Log(title = "趋势", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody TTrends tTrends) + { + return toAjax(tTrendsService.updateTTrends(tTrends)); + } + + /** + * 删除趋势 + */ + @PreAuthorize("@ss.hasPermi('newstocksystem:trends:remove')") + @Log(title = "趋势", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(tTrendsService.deleteTTrendsByIds(ids)); + } +} \ No newline at end of file diff --git a/newstock-system/src/main/java/com/ruoyi/newstocksystem/domain/TStockFinancial.java b/newstock-system/src/main/java/com/ruoyi/newstocksystem/domain/TStockFinancial.java new file mode 100644 index 0000000..1be9225 --- /dev/null +++ b/newstock-system/src/main/java/com/ruoyi/newstocksystem/domain/TStockFinancial.java @@ -0,0 +1,204 @@ +package com.ruoyi.newstocksystem.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import java.util.Date; + +/** + * 股票财务数据对象 t_stock_financial + * 注意:由于该表是分区表,不支持外键约束,但业务逻辑中仍需确保stock_code在t_stock_basic表中存在 + * + * @author lxy + * @date 2026-01-21 + */ +public class TStockFinancial extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键ID */ + private Long id; + + /** 股票代码 */ + @Excel(name = "股票代码") + private String stockCode; + + /** 报告期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "报告期", dateFormat = "yyyy-MM-dd") + private Date reportPeriod; + + /** 净利润同比增长率 */ + @Excel(name = "净利润同比增长率") + private Double netProfitGrowthRateYoy; + + /** 净利润环比增长率 */ + @Excel(name = "净利润环比增长率") + private Double netProfitGrowthRateQoq; + + /** 净资产收益率ROE */ + @Excel(name = "净资产收益率ROE") + private Double roe; + + /** 每股收益EPS */ + @Excel(name = "每股收益EPS") + private Double epsBasic; + + /** 净利润 */ + @Excel(name = "净利润") + private Double netProfit; + + /** 基本每股收益 */ + @Excel(name = "基本每股收益") + private Double basicEps; + + /** 每股净资产BPS */ + @Excel(name = "每股净资产BPS") + private Double bps; + + /** 创建时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + /** 更新时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; + + public Long getId() + { + return id; + } + + public void setId(Long id) + { + this.id = id; + } + + public String getStockCode() + { + return stockCode; + } + + public void setStockCode(String stockCode) + { + this.stockCode = stockCode; + } + + public Date getReportPeriod() + { + return reportPeriod; + } + + public void setReportPeriod(Date reportPeriod) + { + this.reportPeriod = reportPeriod; + } + + public Double getNetProfitGrowthRateYoy() + { + return netProfitGrowthRateYoy; + } + + public void setNetProfitGrowthRateYoy(Double netProfitGrowthRateYoy) + { + this.netProfitGrowthRateYoy = netProfitGrowthRateYoy; + } + + public Double getNetProfitGrowthRateQoq() + { + return netProfitGrowthRateQoq; + } + + public void setNetProfitGrowthRateQoq(Double netProfitGrowthRateQoq) + { + this.netProfitGrowthRateQoq = netProfitGrowthRateQoq; + } + + public Double getRoe() + { + return roe; + } + + public void setRoe(Double roe) + { + this.roe = roe; + } + + public Double getEpsBasic() + { + return epsBasic; + } + + public void setEpsBasic(Double epsBasic) + { + this.epsBasic = epsBasic; + } + + public Double getNetProfit() + { + return netProfit; + } + + public void setNetProfit(Double netProfit) + { + this.netProfit = netProfit; + } + + public Double getBasicEps() + { + return basicEps; + } + + public void setBasicEps(Double basicEps) + { + this.basicEps = basicEps; + } + + public Double getBps() + { + return bps; + } + + public void setBps(Double bps) + { + this.bps = bps; + } + + public Date getCreateTime() + { + return createTime; + } + + public void setCreateTime(Date createTime) + { + this.createTime = createTime; + } + + public Date getUpdateTime() + { + return updateTime; + } + + public void setUpdateTime(Date updateTime) + { + this.updateTime = updateTime; + } + + @Override + public String toString() { + return "TStockFinancial{" + + "id=" + id + + ", stockCode='" + stockCode + '\'' + + ", reportPeriod=" + reportPeriod + + ", netProfitGrowthRateYoy=" + netProfitGrowthRateYoy + + ", netProfitGrowthRateQoq=" + netProfitGrowthRateQoq + + ", roe=" + roe + + ", epsBasic=" + epsBasic + + ", netProfit=" + netProfit + + ", basicEps=" + basicEps + + ", bps=" + bps + + ", createTime=" + createTime + + ", updateTime=" + updateTime + + '}'; + } +} \ No newline at end of file diff --git a/newstock-system/src/main/java/com/ruoyi/newstocksystem/domain/TStocksInTrend.java b/newstock-system/src/main/java/com/ruoyi/newstocksystem/domain/TStocksInTrend.java new file mode 100644 index 0000000..b2b6f42 --- /dev/null +++ b/newstock-system/src/main/java/com/ruoyi/newstocksystem/domain/TStocksInTrend.java @@ -0,0 +1,129 @@ +package com.ruoyi.newstocksystem.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import java.util.Date; + +/** + * 趋势中的股票对象 t_stocks_in_trend + * 注意:由于该表是分区表,不支持外键约束,但业务逻辑中仍需确保stock_code在t_stock_basic表中存在 + * + * @author lxy + * @date 2026-01-21 + */ +public class TStocksInTrend extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键ID */ + private Long id; + + /** 股票代码 */ + @Excel(name = "股票代码") + private String stockCode; + + /** 交易日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "交易日期", dateFormat = "yyyy-MM-dd") + private Date tradeDate; + + /** 排名 */ + @Excel(name = "排名") + private Integer rank; + + /** 动量数据类型(10日、20日) */ + @Excel(name = "动量数据类型") + private String momentumType; + + /** 创建时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + /** 更新时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; + + public Long getId() + { + return id; + } + + public void setId(Long id) + { + this.id = id; + } + + public String getStockCode() + { + return stockCode; + } + + public void setStockCode(String stockCode) + { + this.stockCode = stockCode; + } + + public Date getTradeDate() + { + return tradeDate; + } + + public void setTradeDate(Date tradeDate) + { + this.tradeDate = tradeDate; + } + + public Integer getRank() + { + return rank; + } + + public void setRank(Integer rank) + { + this.rank = rank; + } + + public String getMomentumType() + { + return momentumType; + } + + public void setMomentumType(String momentumType) + { + this.momentumType = momentumType; + } + + public Date getCreateTime() + { + return createTime; + } + + public void setCreateTime(Date createTime) + { + this.createTime = createTime; + } + + public Date getUpdateTime() + { + return updateTime; + } + + public void setUpdateTime(Date updateTime) + { + this.updateTime = updateTime; + } + + @Override + public String toString() { + return "TStocksInTrend{" + + "id=" + id + + ", stockCode='" + stockCode + '\'' + + ", tradeDate=" + tradeDate + + ", rank=" + rank + + ", momentumType='" + momentumType + '\'' + + ", createTime=" + createTime + + ", updateTime=" + updateTime + + '}'; + } +} \ No newline at end of file diff --git a/newstock-system/src/main/java/com/ruoyi/newstocksystem/domain/TTrends.java b/newstock-system/src/main/java/com/ruoyi/newstocksystem/domain/TTrends.java new file mode 100644 index 0000000..de36eab --- /dev/null +++ b/newstock-system/src/main/java/com/ruoyi/newstocksystem/domain/TTrends.java @@ -0,0 +1,204 @@ +package com.ruoyi.newstocksystem.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import java.util.Date; + +/** + * 趋势对象 t_trends + * 注意:由于该表是分区表,不支持外键约束,但业务逻辑中仍需确保eastmoney_industry_code在t_industry_index_basic表中存在 + * + * @author lxy + * @date 2026-01-21 + */ +public class TTrends extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键ID */ + private Long id; + + /** 交易日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "交易日期", dateFormat = "yyyy-MM-dd") + private Date tradeDate; + + /** 所属东财行业代码 */ + @Excel(name = "东财行业代码") + private String eastmoneyIndustryCode; + + /** 所属东财行业名称 */ + @Excel(name = "东财行业名称") + private String eastmoneyIndustryName; + + /** 动量个股数量 */ + @Excel(name = "动量个股数量") + private Double stocksCount; + + /** 动量值 */ + @Excel(name = "动量值") + private Double trendValue; + + /** 动量值变化 */ + @Excel(name = "动量值变化") + private Double trendValueChange; + + /** 板块排名 */ + @Excel(name = "板块排名") + private Integer rank; + + /** 板块排名变化 */ + @Excel(name = "板块排名变化") + private Integer rankChange; + + /** 动量数据类型(10日、20日) */ + @Excel(name = "动量数据类型") + private String momentumType; + + /** 创建时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + /** 更新时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; + + public Long getId() + { + return id; + } + + public void setId(Long id) + { + this.id = id; + } + + public Date getTradeDate() + { + return tradeDate; + } + + public void setTradeDate(Date tradeDate) + { + this.tradeDate = tradeDate; + } + + 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() + { + return stocksCount; + } + + public void setStocksCount(Double stocksCount) + { + this.stocksCount = stocksCount; + } + + public Double getTrendValue() + { + return trendValue; + } + + public void setTrendValue(Double trendValue) + { + this.trendValue = trendValue; + } + + public Double getTrendValueChange() + { + return trendValueChange; + } + + public void setTrendValueChange(Double trendValueChange) + { + this.trendValueChange = trendValueChange; + } + + public Integer getRank() + { + return rank; + } + + public void setRank(Integer rank) + { + this.rank = rank; + } + + public Integer getRankChange() + { + return rankChange; + } + + public void setRankChange(Integer rankChange) + { + this.rankChange = rankChange; + } + + public String getMomentumType() + { + return momentumType; + } + + public void setMomentumType(String momentumType) + { + this.momentumType = momentumType; + } + + public Date getCreateTime() + { + return createTime; + } + + public void setCreateTime(Date createTime) + { + this.createTime = createTime; + } + + public Date getUpdateTime() + { + return updateTime; + } + + public void setUpdateTime(Date updateTime) + { + this.updateTime = updateTime; + } + + @Override + public String toString() { + return "TTrends{" + + "id=" + id + + ", tradeDate=" + tradeDate + + ", eastmoneyIndustryCode='" + eastmoneyIndustryCode + '\'' + + ", eastmoneyIndustryName='" + eastmoneyIndustryName + '\'' + + ", stocksCount=" + stocksCount + + ", trendValue=" + trendValue + + ", trendValueChange=" + trendValueChange + + ", rank=" + rank + + ", rankChange=" + rankChange + + ", momentumType='" + momentumType + '\'' + + ", createTime=" + createTime + + ", updateTime=" + updateTime + + '}'; + } +} \ No newline at end of file diff --git a/newstock-system/src/main/java/com/ruoyi/newstocksystem/mapper/TStockFinancialMapper.java b/newstock-system/src/main/java/com/ruoyi/newstocksystem/mapper/TStockFinancialMapper.java new file mode 100644 index 0000000..9b4d7ea --- /dev/null +++ b/newstock-system/src/main/java/com/ruoyi/newstocksystem/mapper/TStockFinancialMapper.java @@ -0,0 +1,77 @@ +package com.ruoyi.newstocksystem.mapper; + +import java.util.List; +import com.ruoyi.newstocksystem.domain.TStockFinancial; + +/** + * 股票财务数据Mapper接口 + * + * @author lxy + * @date 2026-01-21 + */ +public interface TStockFinancialMapper +{ + /** + * 查询股票财务数据 + * + * @param id 股票财务数据主键 + * @return 股票财务数据 + */ + public TStockFinancial selectTStockFinancialById(Long id); + + /** + * 查询股票财务数据列表 + * + * @param tStockFinancial 股票财务数据 + * @return 股票财务数据集合 + */ + public List selectTStockFinancialList(TStockFinancial tStockFinancial); + + /** + * 新增股票财务数据 + * + * @param tStockFinancial 股票财务数据 + * @return 结果 + */ + public int insertTStockFinancial(TStockFinancial tStockFinancial); + + /** + * 修改股票财务数据 + * + * @param tStockFinancial 股票财务数据 + * @return 结果 + */ + public int updateTStockFinancial(TStockFinancial tStockFinancial); + + /** + * 删除股票财务数据 + * + * @param id 股票财务数据主键 + * @return 结果 + */ + public int deleteTStockFinancialById(Long id); + + /** + * 批量删除股票财务数据 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteTStockFinancialByIds(Long[] ids); + + /** + * 批量新增股票财务数据 + * + * @param tStockFinancials 股票财务数据集合 + * @return 结果 + */ + public int batchInsertTStockFinancial(List tStockFinancials); + + /** + * 批量插入或更新股票财务数据 + * + * @param tStockFinancialList 股票财务数据列表 + * @return 结果 + */ + public int batchUpsert(List tStockFinancialList); +} \ No newline at end of file diff --git a/newstock-system/src/main/java/com/ruoyi/newstocksystem/mapper/TStocksInTrendMapper.java b/newstock-system/src/main/java/com/ruoyi/newstocksystem/mapper/TStocksInTrendMapper.java new file mode 100644 index 0000000..854d67e --- /dev/null +++ b/newstock-system/src/main/java/com/ruoyi/newstocksystem/mapper/TStocksInTrendMapper.java @@ -0,0 +1,77 @@ +package com.ruoyi.newstocksystem.mapper; + +import java.util.List; +import com.ruoyi.newstocksystem.domain.TStocksInTrend; + +/** + * 趋势中的股票Mapper接口 + * + * @author lxy + * @date 2026-01-21 + */ +public interface TStocksInTrendMapper +{ + /** + * 查询趋势中的股票 + * + * @param id 趋势中的股票主键 + * @return 趋势中的股票 + */ + public TStocksInTrend selectTStocksInTrendById(Long id); + + /** + * 查询趋势中的股票列表 + * + * @param tStocksInTrend 趋势中的股票 + * @return 趋势中的股票集合 + */ + public List selectTStocksInTrendList(TStocksInTrend tStocksInTrend); + + /** + * 新增趋势中的股票 + * + * @param tStocksInTrend 趋势中的股票 + * @return 结果 + */ + public int insertTStocksInTrend(TStocksInTrend tStocksInTrend); + + /** + * 修改趋势中的股票 + * + * @param tStocksInTrend 趋势中的股票 + * @return 结果 + */ + public int updateTStocksInTrend(TStocksInTrend tStocksInTrend); + + /** + * 删除趋势中的股票 + * + * @param id 趋势中的股票主键 + * @return 结果 + */ + public int deleteTStocksInTrendById(Long id); + + /** + * 批量删除趋势中的股票 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteTStocksInTrendByIds(Long[] ids); + + /** + * 批量新增趋势中的股票 + * + * @param tStocksInTrends 趋势中的股票集合 + * @return 结果 + */ + public int batchInsertTStocksInTrend(List tStocksInTrends); + + /** + * 批量插入或更新趋势中的股票数据 + * + * @param tStocksInTrendList 趋势中的股票数据列表 + * @return 结果 + */ + public int batchUpsert(List tStocksInTrendList); +} \ No newline at end of file diff --git a/newstock-system/src/main/java/com/ruoyi/newstocksystem/mapper/TTrendsMapper.java b/newstock-system/src/main/java/com/ruoyi/newstocksystem/mapper/TTrendsMapper.java new file mode 100644 index 0000000..0198840 --- /dev/null +++ b/newstock-system/src/main/java/com/ruoyi/newstocksystem/mapper/TTrendsMapper.java @@ -0,0 +1,73 @@ +package com.ruoyi.newstocksystem.mapper; + +import java.util.List; +import org.apache.ibatis.annotations.Mapper; +import org.springframework.stereotype.Repository; +import com.ruoyi.newstocksystem.domain.TTrends; + +/** + * 趋势Mapper接口 + * + * @author lxy + * @date 2026-01-21 + */ +@Repository +@Mapper +public interface TTrendsMapper +{ + /** + * 查询趋势 + * + * @param id 趋势主键 + * @return 趋势 + */ + public TTrends selectTTrendsById(Long id); + + /** + * 查询趋势列表 + * + * @param tTrends 趋势 + * @return 趋势集合 + */ + public List selectTTrendsList(TTrends tTrends); + + /** + * 新增趋势 + * + * @param tTrends 趋势 + * @return 结果 + */ + public int insertTTrends(TTrends tTrends); + + /** + * 修改趋势 + * + * @param tTrends 趋势 + * @return 结果 + */ + public int updateTTrends(TTrends tTrends); + + /** + * 删除趋势 + * + * @param id 趋势主键 + * @return 结果 + */ + public int deleteTTrendsById(Long id); + + /** + * 批量删除趋势 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteTTrendsByIds(Long[] ids); + + /** + * 批量插入或更新趋势数据 + * + * @param tTrendsList 趋势数据列表 + * @return 结果 + */ + public int batchUpsert(List tTrendsList); +} \ No newline at end of file diff --git a/newstock-system/src/main/java/com/ruoyi/newstocksystem/service/TStockFinancialService.java b/newstock-system/src/main/java/com/ruoyi/newstocksystem/service/TStockFinancialService.java new file mode 100644 index 0000000..bb56ed9 --- /dev/null +++ b/newstock-system/src/main/java/com/ruoyi/newstocksystem/service/TStockFinancialService.java @@ -0,0 +1,77 @@ +package com.ruoyi.newstocksystem.service; + +import java.util.List; +import com.ruoyi.newstocksystem.domain.TStockFinancial; + +/** + * 股票财务数据Service接口 + * + * @author lxy + * @date 2026-01-21 + */ +public interface TStockFinancialService +{ + /** + * 查询股票财务数据 + * + * @param id 股票财务数据主键 + * @return 股票财务数据 + */ + public TStockFinancial selectTStockFinancialById(Long id); + + /** + * 查询股票财务数据列表 + * + * @param tStockFinancial 股票财务数据 + * @return 股票财务数据集合 + */ + public List selectTStockFinancialList(TStockFinancial tStockFinancial); + + /** + * 新增股票财务数据 + * + * @param tStockFinancial 股票财务数据 + * @return 结果 + */ + public int insertTStockFinancial(TStockFinancial tStockFinancial); + + /** + * 修改股票财务数据 + * + * @param tStockFinancial 股票财务数据 + * @return 结果 + */ + public int updateTStockFinancial(TStockFinancial tStockFinancial); + + /** + * 批量删除股票财务数据 + * + * @param ids 需要删除的股票财务数据主键 + * @return 结果 + */ + public int deleteTStockFinancialByIds(Long[] ids); + + /** + * 删除股票财务数据信息 + * + * @param id 股票财务数据主键 + * @return 结果 + */ + public int deleteTStockFinancialById(Long id); + + /** + * 批量插入或更新股票财务数据 + * + * @param tStockFinancialList 股票财务数据列表 + * @return 结果 + */ + public int batchUpsert(List tStockFinancialList); + + /** + * 验证股票代码是否在基础表中存在 + * + * @param stockCode 股票代码 + * @return 是否存在 + */ + public boolean validateStockCodeExists(String stockCode); +} \ No newline at end of file diff --git a/newstock-system/src/main/java/com/ruoyi/newstocksystem/service/TStocksInTrendService.java b/newstock-system/src/main/java/com/ruoyi/newstocksystem/service/TStocksInTrendService.java new file mode 100644 index 0000000..5d8f095 --- /dev/null +++ b/newstock-system/src/main/java/com/ruoyi/newstocksystem/service/TStocksInTrendService.java @@ -0,0 +1,77 @@ +package com.ruoyi.newstocksystem.service; + +import java.util.List; +import com.ruoyi.newstocksystem.domain.TStocksInTrend; + +/** + * 趋势中的股票Service接口 + * + * @author lxy + * @date 2026-01-21 + */ +public interface TStocksInTrendService +{ + /** + * 查询趋势中的股票 + * + * @param id 趋势中的股票主键 + * @return 趋势中的股票 + */ + public TStocksInTrend selectTStocksInTrendById(Long id); + + /** + * 查询趋势中的股票列表 + * + * @param tStocksInTrend 趋势中的股票 + * @return 趋势中的股票集合 + */ + public List selectTStocksInTrendList(TStocksInTrend tStocksInTrend); + + /** + * 新增趋势中的股票 + * + * @param tStocksInTrend 趋势中的股票 + * @return 结果 + */ + public int insertTStocksInTrend(TStocksInTrend tStocksInTrend); + + /** + * 修改趋势中的股票 + * + * @param tStocksInTrend 趋势中的股票 + * @return 结果 + */ + public int updateTStocksInTrend(TStocksInTrend tStocksInTrend); + + /** + * 批量删除趋势中的股票 + * + * @param ids 需要删除的趋势中的股票主键 + * @return 结果 + */ + public int deleteTStocksInTrendByIds(Long[] ids); + + /** + * 删除趋势中的股票信息 + * + * @param id 趋势中的股票主键 + * @return 结果 + */ + public int deleteTStocksInTrendById(Long id); + + /** + * 批量插入或更新趋势中的股票 + * + * @param tStocksInTrendList 趋势中的股票列表 + * @return 结果 + */ + public int batchUpsert(List tStocksInTrendList); + + /** + * 验证股票代码是否在基础表中存在 + * + * @param stockCode 股票代码 + * @return 是否存在 + */ + public boolean validateStockCodeExists(String stockCode); +} \ No newline at end of file diff --git a/newstock-system/src/main/java/com/ruoyi/newstocksystem/service/TTrendsService.java b/newstock-system/src/main/java/com/ruoyi/newstocksystem/service/TTrendsService.java new file mode 100644 index 0000000..551bf89 --- /dev/null +++ b/newstock-system/src/main/java/com/ruoyi/newstocksystem/service/TTrendsService.java @@ -0,0 +1,77 @@ +package com.ruoyi.newstocksystem.service; + +import java.util.List; +import com.ruoyi.newstocksystem.domain.TTrends; + +/** + * 趋势Service接口 + * + * @author lxy + * @date 2026-01-21 + */ +public interface TTrendsService +{ + /** + * 查询趋势 + * + * @param id 趋势主键 + * @return 趋势 + */ + public TTrends selectTTrendsById(Long id); + + /** + * 查询趋势列表 + * + * @param tTrends 趋势 + * @return 趋势集合 + */ + public List selectTTrendsList(TTrends tTrends); + + /** + * 新增趋势 + * + * @param tTrends 趋势 + * @return 结果 + */ + public int insertTTrends(TTrends tTrends); + + /** + * 修改趋势 + * + * @param tTrends 趋势 + * @return 结果 + */ + public int updateTTrends(TTrends tTrends); + + /** + * 批量删除趋势 + * + * @param ids 需要删除的趋势主键 + * @return 结果 + */ + public int deleteTTrendsByIds(Long[] ids); + + /** + * 删除趋势信息 + * + * @param id 趋势主键 + * @return 结果 + */ + public int deleteTTrendsById(Long id); + + /** + * 批量插入或更新趋势 + * + * @param tTrendsList 趋势列表 + * @return 结果 + */ + public int batchUpsert(List tTrendsList); + + /** + * 验证行业代码是否在基础表中存在 + * + * @param industryCode 行业代码 + * @return 是否存在 + */ + public boolean validateIndustryCodeExists(String industryCode); +} \ No newline at end of file diff --git a/newstock-system/src/main/java/com/ruoyi/newstocksystem/service/impl/TStockFinancialServiceImpl.java b/newstock-system/src/main/java/com/ruoyi/newstocksystem/service/impl/TStockFinancialServiceImpl.java new file mode 100644 index 0000000..87bf204 --- /dev/null +++ b/newstock-system/src/main/java/com/ruoyi/newstocksystem/service/impl/TStockFinancialServiceImpl.java @@ -0,0 +1,115 @@ +package com.ruoyi.newstocksystem.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.newstocksystem.mapper.TStockFinancialMapper; +import com.ruoyi.newstocksystem.domain.TStockFinancial; +import com.ruoyi.newstocksystem.service.TStockFinancialService; +import com.ruoyi.newstocksystem.mapper.TStockBasicMapper; + +/** + * 股票财务数据Service业务层处理 + * + * @author lxy + * @date 2026-01-21 + */ +@Service +public class TStockFinancialServiceImpl implements TStockFinancialService +{ + @Autowired + private TStockFinancialMapper tStockFinancialMapper; + + @Autowired + private TStockBasicMapper tStockBasicMapper; + + /** + * 查询股票财务数据 + * + * @param id 股票财务数据主键 + * @return 股票财务数据 + */ + @Override + public TStockFinancial selectTStockFinancialById(Long id) + { + return tStockFinancialMapper.selectTStockFinancialById(id); + } + + /** + * 查询股票财务数据列表 + * + * @param tStockFinancial 股票财务数据 + * @return 股票财务数据 + */ + @Override + public List selectTStockFinancialList(TStockFinancial tStockFinancial) + { + return tStockFinancialMapper.selectTStockFinancialList(tStockFinancial); + } + + /** + * 新增股票财务数据 + * + * @param tStockFinancial 股票财务数据 + * @return 结果 + */ + @Override + public int insertTStockFinancial(TStockFinancial tStockFinancial) + { + return tStockFinancialMapper.insertTStockFinancial(tStockFinancial); + } + + /** + * 修改股票财务数据 + * + * @param tStockFinancial 股票财务数据 + * @return 结果 + */ + @Override + public int updateTStockFinancial(TStockFinancial tStockFinancial) + { + return tStockFinancialMapper.updateTStockFinancial(tStockFinancial); + } + + /** + * 批量删除股票财务数据 + * + * @param ids 需要删除的股票财务数据主键 + * @return 结果 + */ + @Override + public int deleteTStockFinancialByIds(Long[] ids) + { + return tStockFinancialMapper.deleteTStockFinancialByIds(ids); + } + + /** + * 删除股票财务数据信息 + * + * @param id 股票财务数据主键 + * @return 结果 + */ + @Override + public int deleteTStockFinancialById(Long id) + { + return tStockFinancialMapper.deleteTStockFinancialById(id); + } + + /** + * 批量插入或更新股票财务数据 + * + * @param tStockFinancialList 股票财务数据列表 + * @return 结果 + */ + @Override + public int batchUpsert(List tStockFinancialList) + { + return tStockFinancialMapper.batchUpsert(tStockFinancialList); + } + + @Override + public boolean validateStockCodeExists(String stockCode) + { + return tStockBasicMapper.selectStockBasicByCode(stockCode) != null; + } +} \ No newline at end of file diff --git a/newstock-system/src/main/java/com/ruoyi/newstocksystem/service/impl/TStocksInTrendServiceImpl.java b/newstock-system/src/main/java/com/ruoyi/newstocksystem/service/impl/TStocksInTrendServiceImpl.java new file mode 100644 index 0000000..8fc0f08 --- /dev/null +++ b/newstock-system/src/main/java/com/ruoyi/newstocksystem/service/impl/TStocksInTrendServiceImpl.java @@ -0,0 +1,115 @@ +package com.ruoyi.newstocksystem.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.newstocksystem.mapper.TStocksInTrendMapper; +import com.ruoyi.newstocksystem.domain.TStocksInTrend; +import com.ruoyi.newstocksystem.service.TStocksInTrendService; +import com.ruoyi.newstocksystem.mapper.TStockBasicMapper; + +/** + * 趋势中的股票Service业务层处理 + * + * @author lxy + * @date 2026-01-21 + */ +@Service +public class TStocksInTrendServiceImpl implements TStocksInTrendService +{ + @Autowired + private TStocksInTrendMapper tStocksInTrendMapper; + + @Autowired + private TStockBasicMapper tStockBasicMapper; + + /** + * 查询趋势中的股票 + * + * @param id 趋势中的股票主键 + * @return 趋势中的股票 + */ + @Override + public TStocksInTrend selectTStocksInTrendById(Long id) + { + return tStocksInTrendMapper.selectTStocksInTrendById(id); + } + + /** + * 查询趋势中的股票列表 + * + * @param tStocksInTrend 趋势中的股票 + * @return 趋势中的股票 + */ + @Override + public List selectTStocksInTrendList(TStocksInTrend tStocksInTrend) + { + return tStocksInTrendMapper.selectTStocksInTrendList(tStocksInTrend); + } + + /** + * 新增趋势中的股票 + * + * @param tStocksInTrend 趋势中的股票 + * @return 结果 + */ + @Override + public int insertTStocksInTrend(TStocksInTrend tStocksInTrend) + { + return tStocksInTrendMapper.insertTStocksInTrend(tStocksInTrend); + } + + /** + * 修改趋势中的股票 + * + * @param tStocksInTrend 趋势中的股票 + * @return 结果 + */ + @Override + public int updateTStocksInTrend(TStocksInTrend tStocksInTrend) + { + return tStocksInTrendMapper.updateTStocksInTrend(tStocksInTrend); + } + + /** + * 批量删除趋势中的股票 + * + * @param ids 需要删除的趋势中的股票主键 + * @return 结果 + */ + @Override + public int deleteTStocksInTrendByIds(Long[] ids) + { + return tStocksInTrendMapper.deleteTStocksInTrendByIds(ids); + } + + /** + * 删除趋势中的股票信息 + * + * @param id 趋势中的股票主键 + * @return 结果 + */ + @Override + public int deleteTStocksInTrendById(Long id) + { + return tStocksInTrendMapper.deleteTStocksInTrendById(id); + } + + /** + * 批量插入或更新趋势中的股票 + * + * @param tStocksInTrendList 趋势中的股票列表 + * @return 结果 + */ + @Override + public int batchUpsert(List tStocksInTrendList) + { + return tStocksInTrendMapper.batchUpsert(tStocksInTrendList); + } + + @Override + public boolean validateStockCodeExists(String stockCode) + { + return tStockBasicMapper.selectStockBasicByCode(stockCode) != null; + } +} \ No newline at end of file diff --git a/newstock-system/src/main/java/com/ruoyi/newstocksystem/service/impl/TTrendsServiceImpl.java b/newstock-system/src/main/java/com/ruoyi/newstocksystem/service/impl/TTrendsServiceImpl.java new file mode 100644 index 0000000..824e6c8 --- /dev/null +++ b/newstock-system/src/main/java/com/ruoyi/newstocksystem/service/impl/TTrendsServiceImpl.java @@ -0,0 +1,115 @@ +package com.ruoyi.newstocksystem.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.newstocksystem.mapper.TTrendsMapper; +import com.ruoyi.newstocksystem.domain.TTrends; +import com.ruoyi.newstocksystem.service.TTrendsService; +import com.ruoyi.newstocksystem.mapper.TIndustryBasicMapper; + +/** + * 趋势Service业务层处理 + * + * @author lxy + * @date 2026-01-21 + */ +@Service +public class TTrendsServiceImpl implements TTrendsService +{ + @Autowired + private TTrendsMapper tTrendsMapper; + + @Autowired + private TIndustryBasicMapper tIndustryBasicMapper; + + /** + * 查询趋势 + * + * @param id 趋势主键 + * @return 趋势 + */ + @Override + public TTrends selectTTrendsById(Long id) + { + return tTrendsMapper.selectTTrendsById(id); + } + + /** + * 查询趋势列表 + * + * @param tTrends 趋势 + * @return 趋势 + */ + @Override + public List selectTTrendsList(TTrends tTrends) + { + return tTrendsMapper.selectTTrendsList(tTrends); + } + + /** + * 新增趋势 + * + * @param tTrends 趋势 + * @return 结果 + */ + @Override + public int insertTTrends(TTrends tTrends) + { + return tTrendsMapper.insertTTrends(tTrends); + } + + /** + * 修改趋势 + * + * @param tTrends 趋势 + * @return 结果 + */ + @Override + public int updateTTrends(TTrends tTrends) + { + return tTrendsMapper.updateTTrends(tTrends); + } + + /** + * 批量删除趋势 + * + * @param ids 需要删除的趋势主键 + * @return 结果 + */ + @Override + public int deleteTTrendsByIds(Long[] ids) + { + return tTrendsMapper.deleteTTrendsByIds(ids); + } + + /** + * 删除趋势信息 + * + * @param id 趋势主键 + * @return 结果 + */ + @Override + public int deleteTTrendsById(Long id) + { + return tTrendsMapper.deleteTTrendsById(id); + } + + /** + * 批量插入或更新趋势 + * + * @param tTrendsList 趋势列表 + * @return 结果 + */ + @Override + public int batchUpsert(List tTrendsList) + { + return tTrendsMapper.batchUpsert(tTrendsList); + } + + @Override + public boolean validateIndustryCodeExists(String industryCode) + { + return tIndustryBasicMapper.selectTIndustryBasicByCode(industryCode) != null; + } +} \ No newline at end of file diff --git a/newstock-system/src/main/resources/mapper/newstocksystem/TStockFinancialMapper.xml b/newstock-system/src/main/resources/mapper/newstocksystem/TStockFinancialMapper.xml new file mode 100644 index 0000000..ebeec6c --- /dev/null +++ b/newstock-system/src/main/resources/mapper/newstocksystem/TStockFinancialMapper.xml @@ -0,0 +1,143 @@ + + + + + + + + + + + + + + + + + + + + + select id, stock_code, report_period, net_profit_growth_rate_yoy, net_profit_growth_rate_qoq, roe, eps_basic, net_profit, basic_eps, bps, create_time, update_time from t_stock_financial + + + + + + + + insert into t_stock_financial + + stock_code, + report_period, + net_profit_growth_rate_yoy, + net_profit_growth_rate_qoq, + roe, + eps_basic, + net_profit, + basic_eps, + bps, + create_time, + update_time, + + + #{stockCode}, + #{reportPeriod}, + #{netProfitGrowthRateYoy}, + #{netProfitGrowthRateQoq}, + #{roe}, + #{epsBasic}, + #{netProfit}, + #{basicEps}, + #{bps}, + #{createTime}, + #{updateTime}, + + + + + update t_stock_financial + + stock_code = #{stockCode}, + report_period = #{reportPeriod}, + net_profit_growth_rate_yoy = #{netProfitGrowthRateYoy}, + net_profit_growth_rate_qoq = #{netProfitGrowthRateQoq}, + roe = #{roe}, + eps_basic = #{epsBasic}, + net_profit = #{netProfit}, + basic_eps = #{basicEps}, + bps = #{bps}, + update_time = #{updateTime}, + + where id = #{id} + + + + delete from t_stock_financial where id = #{id} + + + + delete from t_stock_financial where id in + + #{id} + + + + + INSERT INTO t_stock_financial ( + stock_code, + report_period, + net_profit_growth_rate_yoy, + net_profit_growth_rate_qoq, + roe, + eps_basic, + net_profit, + basic_eps, + bps, + create_time, + update_time + ) VALUES + + ( + #{item.stockCode}, + #{item.reportPeriod}, + #{item.netProfitGrowthRateYoy}, + #{item.netProfitGrowthRateQoq}, + #{item.roe}, + #{item.epsBasic}, + #{item.netProfit}, + #{item.basicEps}, + #{item.bps}, + #{item.createTime}, + #{item.updateTime} + ) + + ON DUPLICATE KEY UPDATE + net_profit_growth_rate_yoy = VALUES(net_profit_growth_rate_yoy), + net_profit_growth_rate_qoq = VALUES(net_profit_growth_rate_qoq), + roe = VALUES(roe), + eps_basic = VALUES(eps_basic), + net_profit = VALUES(net_profit), + basic_eps = VALUES(basic_eps), + bps = VALUES(bps), + update_time = VALUES(update_time) + + \ No newline at end of file diff --git a/newstock-system/src/main/resources/mapper/newstocksystem/TStocksInTrendMapper.xml b/newstock-system/src/main/resources/mapper/newstocksystem/TStocksInTrendMapper.xml new file mode 100644 index 0000000..7751303 --- /dev/null +++ b/newstock-system/src/main/resources/mapper/newstocksystem/TStocksInTrendMapper.xml @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + select id, stock_code, trade_date, rank, momentum_type, create_time, update_time from t_stocks_in_trend + + + + + + + + insert into t_stocks_in_trend + + stock_code, + trade_date, + rank, + momentum_type, + create_time, + update_time, + + + #{stockCode}, + #{tradeDate}, + #{rank}, + #{momentumType}, + #{createTime}, + #{updateTime}, + + + + + update t_stocks_in_trend + + stock_code = #{stockCode}, + trade_date = #{tradeDate}, + rank = #{rank}, + momentum_type = #{momentumType}, + update_time = #{updateTime}, + + where id = #{id} + + + + delete from t_stocks_in_trend where id = #{id} + + + + delete from t_stocks_in_trend where id in + + #{id} + + + + + INSERT INTO t_stocks_in_trend ( + stock_code, + trade_date, + rank, + momentum_type, + create_time, + update_time + ) VALUES + + ( + #{item.stockCode}, + #{item.tradeDate}, + #{item.rank}, + #{item.momentumType}, + #{item.createTime}, + #{item.updateTime} + ) + + ON DUPLICATE KEY UPDATE + rank = VALUES(rank), + momentum_type = VALUES(momentum_type), + update_time = VALUES(update_time) + + \ No newline at end of file diff --git a/newstock-system/src/main/resources/mapper/newstocksystem/TTrendsMapper.xml b/newstock-system/src/main/resources/mapper/newstocksystem/TTrendsMapper.xml new file mode 100644 index 0000000..72da911 --- /dev/null +++ b/newstock-system/src/main/resources/mapper/newstocksystem/TTrendsMapper.xml @@ -0,0 +1,141 @@ + + + + + + + + + + + + + + + + + + + + + select id, trade_date, 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 + + + + + + + + insert into t_trends + + trade_date, + eastmoney_industry_code, + eastmoney_industry_name, + stocks_count, + trend_value, + trend_value_change, + rank, + rank_change, + momentum_type, + create_time, + update_time, + + + #{tradeDate}, + #{eastmoneyIndustryCode}, + #{eastmoneyIndustryName}, + #{stocksCount}, + #{trendValue}, + #{trendValueChange}, + #{rank}, + #{rankChange}, + #{momentumType}, + #{createTime}, + #{updateTime}, + + + + + update t_trends + + trade_date = #{tradeDate}, + eastmoney_industry_code = #{eastmoneyIndustryCode}, + eastmoney_industry_name = #{eastmoneyIndustryName}, + stocks_count = #{stocksCount}, + trend_value = #{trendValue}, + trend_value_change = #{trendValueChange}, + rank = #{rank}, + rank_change = #{rankChange}, + momentum_type = #{momentumType}, + update_time = #{updateTime}, + + where id = #{id} + + + + delete from t_trends where id = #{id} + + + + delete from t_trends where id in + + #{id} + + + + + INSERT INTO t_trends ( + trade_date, + eastmoney_industry_code, + eastmoney_industry_name, + stocks_count, + trend_value, + trend_value_change, + rank, + rank_change, + momentum_type, + create_time, + update_time + ) VALUES + + ( + #{item.tradeDate}, + #{item.eastmoneyIndustryCode}, + #{item.eastmoneyIndustryName}, + #{item.stocksCount}, + #{item.trendValue}, + #{item.trendValueChange}, + #{item.rank}, + #{item.rankChange}, + #{item.momentumType}, + #{item.createTime}, + #{item.updateTime} + ) + + ON DUPLICATE KEY UPDATE + stocks_count = VALUES(stocks_count), + trend_value = VALUES(trend_value), + trend_value_change = VALUES(trend_value_change), + rank = VALUES(rank), + rank_change = VALUES(rank_change), + update_time = VALUES(update_time) + + \ No newline at end of file diff --git a/sql_refacor0120/t_stock_financial.sql b/sql_refacor0120/t_stock_financial.sql new file mode 100644 index 0000000..fafea42 --- /dev/null +++ b/sql_refacor0120/t_stock_financial.sql @@ -0,0 +1,108 @@ +/* +Navicat MySQL Data Transfer + +Source Server : localhost +Source Server Version : 80022 +Source Host : localhost:3306 +Source Database : ry_refactor0120 + +Target Server Type : MYSQL +Target Server Version : 80022 +File Encoding : 65001 + +Date: 2026-01-21 10:00:00 +*/ + +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for t_stock_financial (股票财务数据表 - 按月分区) +-- ---------------------------- +DROP TABLE IF EXISTS `t_stock_financial`; +CREATE TABLE `t_stock_financial` ( + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID', + `stock_code` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '股票代码', + `report_period` date NOT NULL COMMENT '报告期', + `net_profit_growth_rate_yoy` decimal(50, 4) NULL DEFAULT NULL COMMENT '净利润同比增长率', + `net_profit_growth_rate_qoq` decimal(50, 4) NULL DEFAULT NULL COMMENT '净利润环比增长率', + `roe` decimal(50, 4) NULL DEFAULT NULL COMMENT '净资产收益率ROE', + `eps_basic` decimal(50, 4) NULL DEFAULT NULL COMMENT '每股收益EPS', + `net_profit` decimal(50, 4) NULL DEFAULT NULL COMMENT '净利润', + `basic_eps` decimal(50, 4) NULL DEFAULT NULL COMMENT '基本每股收益', + `bps` decimal(50, 4) NULL DEFAULT NULL COMMENT '每股净资产BPS', + `create_time` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `update_time` datetime NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', + UNIQUE KEY `uk_stock_period` (`stock_code`, `report_period`), + PRIMARY KEY (`id`, `report_period`), + INDEX `idx_stock_code` (`stock_code`), + INDEX `idx_report_period` (`report_period`), + INDEX `idx_create_time` (`create_time`) +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '股票财务数据表' ROW_FORMAT = Dynamic +PARTITION BY RANGE (YEAR(report_period)*100 + MONTH(report_period)) ( + PARTITION p202210 VALUES LESS THAN (202211), + PARTITION p202211 VALUES LESS THAN (202212), + PARTITION p202212 VALUES LESS THAN (202301), + PARTITION p202301 VALUES LESS THAN (202302), + PARTITION p202302 VALUES LESS THAN (202303), + PARTITION p202303 VALUES LESS THAN (202304), + PARTITION p202304 VALUES LESS THAN (202305), + PARTITION p202305 VALUES LESS THAN (202306), + PARTITION p202306 VALUES LESS THAN (202307), + PARTITION p202307 VALUES LESS THAN (202308), + PARTITION p202308 VALUES LESS THAN (202309), + PARTITION p202309 VALUES LESS THAN (202310), + PARTITION p202310 VALUES LESS THAN (202311), + PARTITION p202311 VALUES LESS THAN (202312), + PARTITION p202312 VALUES LESS THAN (202401), + PARTITION p202401 VALUES LESS THAN (202402), + PARTITION p202402 VALUES LESS THAN (202403), + PARTITION p202403 VALUES LESS THAN (202404), + PARTITION p202404 VALUES LESS THAN (202405), + PARTITION p202405 VALUES LESS THAN (202406), + PARTITION p202406 VALUES LESS THAN (202407), + PARTITION p202407 VALUES LESS THAN (202408), + PARTITION p202408 VALUES LESS THAN (202409), + PARTITION p202409 VALUES LESS THAN (202410), + PARTITION p202410 VALUES LESS THAN (202411), + PARTITION p202411 VALUES LESS THAN (202412), + PARTITION p202412 VALUES LESS THAN (202501), + PARTITION p202501 VALUES LESS THAN (202502), + PARTITION p202502 VALUES LESS THAN (202503), + PARTITION p202503 VALUES LESS THAN (202504), + PARTITION p202504 VALUES LESS THAN (202505), + PARTITION p202505 VALUES LESS THAN (202506), + PARTITION p202506 VALUES LESS THAN (202507), + PARTITION p202507 VALUES LESS THAN (202508), + PARTITION p202508 VALUES LESS THAN (202509), + PARTITION p202509 VALUES LESS THAN (202510), + PARTITION p202510 VALUES LESS THAN (202511), + PARTITION p202511 VALUES LESS THAN (202512), + PARTITION p202512 VALUES LESS THAN (202601), + PARTITION p202601 VALUES LESS THAN (202602), + PARTITION p202602 VALUES LESS THAN (202603), + PARTITION p202603 VALUES LESS THAN (202604), + PARTITION p202604 VALUES LESS THAN (202605), + PARTITION p202605 VALUES LESS THAN (202606), + PARTITION p202606 VALUES LESS THAN (202607), + PARTITION p202607 VALUES LESS THAN (202608), + PARTITION p202608 VALUES LESS THAN (202609), + PARTITION p202609 VALUES LESS THAN (202610), + PARTITION p202610 VALUES LESS THAN (202611), + PARTITION p202611 VALUES LESS THAN (202612), + PARTITION p202612 VALUES LESS THAN (202701), + PARTITION p202701 VALUES LESS THAN (202702), + PARTITION p202702 VALUES LESS THAN (202703), + PARTITION p202703 VALUES LESS THAN (202704), + PARTITION p202704 VALUES LESS THAN (202705), + PARTITION p202705 VALUES LESS THAN (202706), + PARTITION p202706 VALUES LESS THAN (202707), + PARTITION p202707 VALUES LESS THAN (202708), + PARTITION p202708 VALUES LESS THAN (202709), + PARTITION p202709 VALUES LESS THAN (202710), + PARTITION p202710 VALUES LESS THAN (202711), + PARTITION p202711 VALUES LESS THAN (202712), + PARTITION p202712 VALUES LESS THAN MAXVALUE +); + +SET FOREIGN_KEY_CHECKS = 1; \ No newline at end of file diff --git a/sql_refacor0120/t_stocks_in_trend.sql b/sql_refacor0120/t_stocks_in_trend.sql new file mode 100644 index 0000000..4c6c4cc --- /dev/null +++ b/sql_refacor0120/t_stocks_in_trend.sql @@ -0,0 +1,116 @@ +/* +Navicat MySQL Data Transfer + +Source Server : localhost +Source Server Version : 80022 +Source Host : localhost:3306 +Source Database : ry_refactor0120 + +Target Server Type : MYSQL +Target Server Version : 80022 +File Encoding : 65001 + +Date: 2026-01-21 10:00:00 +*/ + +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for t_stocks_in_trend (趋势中的股票表 - 按月分区) +-- ---------------------------- +DROP TABLE IF EXISTS `t_stocks_in_trend`; +CREATE TABLE `t_stocks_in_trend` ( + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID', + `stock_code` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '股票代码', + `trade_date` date NOT NULL COMMENT '交易日期', + `rank` int NULL DEFAULT -1 COMMENT '排名', + `momentum_type` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '动量数据类型(10日、20日)', + `create_time` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `update_time` datetime NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', + UNIQUE KEY `uk_stock_date_type` (`stock_code`, `trade_date`, `momentum_type`), + PRIMARY KEY (`id`, `trade_date`), + INDEX `idx_stock_code` (`stock_code`), + INDEX `idx_trade_date` (`trade_date`), + INDEX `idx_momentum_type` (`momentum_type`), + INDEX `idx_rank` (`rank`), + INDEX `idx_create_time` (`create_time`) +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '趋势中的股票表' ROW_FORMAT = Dynamic +PARTITION BY RANGE (YEAR(trade_date)*100 + MONTH(trade_date)) ( + PARTITION p202111 VALUES LESS THAN (202112), + PARTITION p202112 VALUES LESS THAN (202201), + PARTITION p202201 VALUES LESS THAN (202202), + PARTITION p202202 VALUES LESS THAN (202203), + PARTITION p202203 VALUES LESS THAN (202204), + PARTITION p202204 VALUES LESS THAN (202205), + PARTITION p202205 VALUES LESS THAN (202206), + PARTITION p202206 VALUES LESS THAN (202207), + PARTITION p202207 VALUES LESS THAN (202208), + PARTITION p202208 VALUES LESS THAN (202209), + PARTITION p202209 VALUES LESS THAN (202210), + PARTITION p202210 VALUES LESS THAN (202211), + PARTITION p202211 VALUES LESS THAN (202212), + PARTITION p202212 VALUES LESS THAN (202301), + PARTITION p202301 VALUES LESS THAN (202302), + PARTITION p202302 VALUES LESS THAN (202303), + PARTITION p202303 VALUES LESS THAN (202304), + PARTITION p202304 VALUES LESS THAN (202305), + PARTITION p202305 VALUES LESS THAN (202306), + PARTITION p202306 VALUES LESS THAN (202307), + PARTITION p202307 VALUES LESS THAN (202308), + PARTITION p202308 VALUES LESS THAN (202309), + PARTITION p202309 VALUES LESS THAN (202310), + PARTITION p202310 VALUES LESS THAN (202311), + PARTITION p202311 VALUES LESS THAN (202312), + PARTITION p202312 VALUES LESS THAN (202401), + PARTITION p202401 VALUES LESS THAN (202402), + PARTITION p202402 VALUES LESS THAN (202403), + PARTITION p202403 VALUES LESS THAN (202404), + PARTITION p202404 VALUES LESS THAN (202405), + PARTITION p202405 VALUES LESS THAN (202406), + PARTITION p202406 VALUES LESS THAN (202407), + PARTITION p202407 VALUES LESS THAN (202408), + PARTITION p202408 VALUES LESS THAN (202409), + PARTITION p202409 VALUES LESS THAN (202410), + PARTITION p202410 VALUES LESS THAN (202411), + PARTITION p202411 VALUES LESS THAN (202412), + PARTITION p202412 VALUES LESS THAN (202501), + PARTITION p202501 VALUES LESS THAN (202502), + PARTITION p202502 VALUES LESS THAN (202503), + PARTITION p202503 VALUES LESS THAN (202504), + PARTITION p202504 VALUES LESS THAN (202505), + PARTITION p202505 VALUES LESS THAN (202506), + PARTITION p202506 VALUES LESS THAN (202507), + PARTITION p202507 VALUES LESS THAN (202508), + PARTITION p202508 VALUES LESS THAN (202509), + PARTITION p202509 VALUES LESS THAN (202510), + PARTITION p202510 VALUES LESS THAN (202511), + PARTITION p202511 VALUES LESS THAN (202512), + PARTITION p202512 VALUES LESS THAN (202601), + PARTITION p202601 VALUES LESS THAN (202602), + PARTITION p202602 VALUES LESS THAN (202603), + PARTITION p202603 VALUES LESS THAN (202604), + PARTITION p202604 VALUES LESS THAN (202605), + PARTITION p202605 VALUES LESS THAN (202606), + PARTITION p202606 VALUES LESS THAN (202607), + PARTITION p202607 VALUES LESS THAN (202608), + PARTITION p202608 VALUES LESS THAN (202609), + PARTITION p202609 VALUES LESS THAN (202610), + PARTITION p202610 VALUES LESS THAN (202611), + PARTITION p202611 VALUES LESS THAN (202612), + PARTITION p202612 VALUES LESS THAN (202701), + PARTITION p202701 VALUES LESS THAN (202702), + PARTITION p202702 VALUES LESS THAN (202703), + PARTITION p202703 VALUES LESS THAN (202704), + PARTITION p202704 VALUES LESS THAN (202705), + PARTITION p202705 VALUES LESS THAN (202706), + PARTITION p202706 VALUES LESS THAN (202707), + PARTITION p202707 VALUES LESS THAN (202708), + PARTITION p202708 VALUES LESS THAN (202709), + PARTITION p202709 VALUES LESS THAN (202710), + PARTITION p202710 VALUES LESS THAN (202711), + PARTITION p202711 VALUES LESS THAN (202712), + PARTITION p202712 VALUES LESS THAN MAXVALUE +); + +SET FOREIGN_KEY_CHECKS = 1; \ No newline at end of file diff --git a/sql_refacor0120/t_trends.sql b/sql_refacor0120/t_trends.sql new file mode 100644 index 0000000..3d36678 --- /dev/null +++ b/sql_refacor0120/t_trends.sql @@ -0,0 +1,121 @@ +/* +Navicat MySQL Data Transfer + +Source Server : localhost +Source Server Version : 80022 +Source Host : localhost:3306 +Source Database : ry_refactor0120 + +Target Server Type : MYSQL +Target Server Version : 80022 +File Encoding : 65001 + +Date: 2026-01-21 10:00:00 +*/ + +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for t_trends (趋势表 - 按月分区) +-- ---------------------------- +DROP TABLE IF EXISTS `t_trends`; +CREATE TABLE `t_trends` ( + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID', + `trade_date` date NOT NULL COMMENT '交易日期', + `eastmoney_industry_code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '所属东财行业代码', + `eastmoney_industry_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '所属东财行业名称', + `stocks_count` decimal(50, 4) NULL DEFAULT -1.0000 COMMENT '动量个股数量', + `trend_value` decimal(50, 4) NULL DEFAULT -1.0000 COMMENT '动量值', + `trend_value_change` decimal(50, 4) NULL DEFAULT -1.0000 COMMENT '动量值变化', + `rank` int NULL DEFAULT -1 COMMENT '板块排名', + `rank_change` int NULL DEFAULT -1 COMMENT '板块排名变化', + `momentum_type` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '动量数据类型(10日、20日)', + `create_time` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `update_time` datetime NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', + UNIQUE KEY `uk_date_industry_type` (`trade_date`, `eastmoney_industry_code`, `momentum_type`), + PRIMARY KEY (`id`, `trade_date`), + INDEX `idx_trade_date` (`trade_date`), + INDEX `idx_eastmoney_industry_code` (`eastmoney_industry_code`), + INDEX `idx_momentum_type` (`momentum_type`), + INDEX `idx_rank` (`rank`), + INDEX `idx_create_time` (`create_time`) +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '趋势表' ROW_FORMAT = Dynamic +PARTITION BY RANGE (YEAR(trade_date)*100 + MONTH(trade_date)) ( + PARTITION p202111 VALUES LESS THAN (202112), + PARTITION p202112 VALUES LESS THAN (202201), + PARTITION p202201 VALUES LESS THAN (202202), + PARTITION p202202 VALUES LESS THAN (202203), + PARTITION p202203 VALUES LESS THAN (202204), + PARTITION p202204 VALUES LESS THAN (202205), + PARTITION p202205 VALUES LESS THAN (202206), + PARTITION p202206 VALUES LESS THAN (202207), + PARTITION p202207 VALUES LESS THAN (202208), + PARTITION p202208 VALUES LESS THAN (202209), + PARTITION p202209 VALUES LESS THAN (202210), + PARTITION p202210 VALUES LESS THAN (202211), + PARTITION p202211 VALUES LESS THAN (202212), + PARTITION p202212 VALUES LESS THAN (202301), + PARTITION p202301 VALUES LESS THAN (202302), + PARTITION p202302 VALUES LESS THAN (202303), + PARTITION p202303 VALUES LESS THAN (202304), + PARTITION p202304 VALUES LESS THAN (202305), + PARTITION p202305 VALUES LESS THAN (202306), + PARTITION p202306 VALUES LESS THAN (202307), + PARTITION p202307 VALUES LESS THAN (202308), + PARTITION p202308 VALUES LESS THAN (202309), + PARTITION p202309 VALUES LESS THAN (202310), + PARTITION p202310 VALUES LESS THAN (202311), + PARTITION p202311 VALUES LESS THAN (202312), + PARTITION p202312 VALUES LESS THAN (202401), + PARTITION p202401 VALUES LESS THAN (202402), + PARTITION p202402 VALUES LESS THAN (202403), + PARTITION p202403 VALUES LESS THAN (202404), + PARTITION p202404 VALUES LESS THAN (202405), + PARTITION p202405 VALUES LESS THAN (202406), + PARTITION p202406 VALUES LESS THAN (202407), + PARTITION p202407 VALUES LESS THAN (202408), + PARTITION p202408 VALUES LESS THAN (202409), + PARTITION p202409 VALUES LESS THAN (202410), + PARTITION p202410 VALUES LESS THAN (202411), + PARTITION p202411 VALUES LESS THAN (202412), + PARTITION p202412 VALUES LESS THAN (202501), + PARTITION p202501 VALUES LESS THAN (202502), + PARTITION p202502 VALUES LESS THAN (202503), + PARTITION p202503 VALUES LESS THAN (202504), + PARTITION p202504 VALUES LESS THAN (202505), + PARTITION p202505 VALUES LESS THAN (202506), + PARTITION p202506 VALUES LESS THAN (202507), + PARTITION p202507 VALUES LESS THAN (202508), + PARTITION p202508 VALUES LESS THAN (202509), + PARTITION p202509 VALUES LESS THAN (202510), + PARTITION p202510 VALUES LESS THAN (202511), + PARTITION p202511 VALUES LESS THAN (202512), + PARTITION p202512 VALUES LESS THAN (202601), + PARTITION p202601 VALUES LESS THAN (202602), + PARTITION p202602 VALUES LESS THAN (202603), + PARTITION p202603 VALUES LESS THAN (202604), + PARTITION p202604 VALUES LESS THAN (202605), + PARTITION p202605 VALUES LESS THAN (202606), + PARTITION p202606 VALUES LESS THAN (202607), + PARTITION p202607 VALUES LESS THAN (202608), + PARTITION p202608 VALUES LESS THAN (202609), + PARTITION p202609 VALUES LESS THAN (202610), + PARTITION p202610 VALUES LESS THAN (202611), + PARTITION p202611 VALUES LESS THAN (202612), + PARTITION p202612 VALUES LESS THAN (202701), + PARTITION p202701 VALUES LESS THAN (202702), + PARTITION p202702 VALUES LESS THAN (202703), + PARTITION p202703 VALUES LESS THAN (202704), + PARTITION p202704 VALUES LESS THAN (202705), + PARTITION p202705 VALUES LESS THAN (202706), + PARTITION p202706 VALUES LESS THAN (202707), + PARTITION p202707 VALUES LESS THAN (202708), + PARTITION p202708 VALUES LESS THAN (202709), + PARTITION p202709 VALUES LESS THAN (202710), + PARTITION p202710 VALUES LESS THAN (202711), + PARTITION p202711 VALUES LESS THAN (202712), + PARTITION p202712 VALUES LESS THAN MAXVALUE +); + +SET FOREIGN_KEY_CHECKS = 1; \ No newline at end of file diff --git a/sql_refacor0120/trend/stock_financial.sql b/sql_refacor0120/trend/stock_financial.sql new file mode 100644 index 0000000..3220bb0 --- /dev/null +++ b/sql_refacor0120/trend/stock_financial.sql @@ -0,0 +1,38 @@ +/* + Navicat Premium Dump SQL + + Source Server : 192.168.0.222 + Source Server Type : MySQL + Source Server Version : 80031 (8.0.31) + Source Host : 192.168.0.222:3306 + Source Schema : ry_refactor0120 + + Target Server Type : MySQL + Target Server Version : 80031 (8.0.31) + File Encoding : 65001 + + Date: 24/01/2026 14:48:04 +*/ + +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- 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 = 172707 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = 'A股财务数据' ROW_FORMAT = DYNAMIC; + +SET FOREIGN_KEY_CHECKS = 1; diff --git a/sql_refacor0120/trend/stocks_in_trend.sql b/sql_refacor0120/trend/stocks_in_trend.sql new file mode 100644 index 0000000..9641339 --- /dev/null +++ b/sql_refacor0120/trend/stocks_in_trend.sql @@ -0,0 +1,33 @@ +/* + Navicat Premium Dump SQL + + Source Server : 192.168.0.222 + Source Server Type : MySQL + Source Server Version : 80031 (8.0.31) + Source Host : 192.168.0.222:3306 + Source Schema : ry_refactor0120 + + Target Server Type : MySQL + Target Server Version : 80031 (8.0.31) + File Encoding : 65001 + + Date: 24/01/2026 14:48:23 +*/ + +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- 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 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 = 2692129 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '动量个股' ROW_FORMAT = DYNAMIC; + +SET FOREIGN_KEY_CHECKS = 1; diff --git a/sql_refacor0120/trend/trends.sql b/sql_refacor0120/trend/trends.sql new file mode 100644 index 0000000..a8ce44d --- /dev/null +++ b/sql_refacor0120/trend/trends.sql @@ -0,0 +1,37 @@ +/* + Navicat Premium Dump SQL + + Source Server : 192.168.0.222 + Source Server Type : MySQL + Source Server Version : 80031 (8.0.31) + Source Host : 192.168.0.222:3306 + Source Schema : ry_refactor0120 + + Target Server Type : MySQL + Target Server Version : 80031 (8.0.31) + File Encoding : 65001 + + Date: 24/01/2026 14:49:00 +*/ + +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- 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 NULL DEFAULT -1 COMMENT '板块排名', + `sort_change` int 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 = 449078 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '动量结果' ROW_FORMAT = DYNAMIC; + +SET FOREIGN_KEY_CHECKS = 1;