Compare commits

..

No commits in common. 'dev_refactor_0118' and 'main' have entirely different histories.

3
.gitignore vendored

@ -34,9 +34,6 @@ nbdist/
.nb-gradle/ .nb-gradle/
node_modules/* node_modules/*
# 忽略.vscode文件夹核心规则
.vscode/
###################################################################### ######################################################################
# Others # Others
*.log *.log

@ -1,11 +1,3 @@
## 项目介绍
本分支为基于原项目进行优化分支尝试新建表、算法等重构开始时间2026年1月18日 2030
计划:
1、优化数据表新建表结构导入部分数据
2、优化导入
3、优化动量计算方法
4、优化查询提升效率
其他待定
## 平台简介 ## 平台简介
若依是一套全部开源的快速开发平台,毫无保留给个人及企业免费使用。 若依是一套全部开源的快速开发平台,毫无保留给个人及企业免费使用。

@ -1,109 +0,0 @@
-- 为新的行情数据页面添加菜单配置
-- 1. 首先查询股票系统的父菜单ID
SELECT menu_id, menu_name, parent_id FROM sys_menu WHERE menu_name = '股票系统';
-- 2. 假设股票系统的父菜单ID为某个值添加新的行情数据菜单项
-- 请根据实际查询结果修改parent_id的值
-- 插入新的行情数据菜单项
INSERT INTO sys_menu (
menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by
) VALUES (
'新行情数据',
(SELECT menu_id FROM sys_menu WHERE menu_name = '股票系统'),
'10',
'newstocks',
'stocksystem/newstocks',
'1',
'0',
'C',
'0',
'0',
'stocksystem:newstocks:list',
'chart',
'admin'
);
-- 3. 为新的行情数据页面添加按钮权限
-- 获取新插入的菜单ID
SET @menu_id = LAST_INSERT_ID();
-- 插入新增按钮权限
INSERT INTO sys_menu (
menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by
) VALUES (
'新增',
@menu_id,
'1',
'#',
NULL,
'1',
'0',
'F',
'0',
'0',
'stocksystem:newstocks:add',
'#',
'admin'
);
-- 插入修改按钮权限
INSERT INTO sys_menu (
menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by
) VALUES (
'修改',
@menu_id,
'2',
'#',
NULL,
'1',
'0',
'F',
'0',
'0',
'stocksystem:newstocks:edit',
'#',
'admin'
);
-- 插入删除按钮权限
INSERT INTO sys_menu (
menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by
) VALUES (
'删除',
@menu_id,
'3',
'#',
NULL,
'1',
'0',
'F',
'0',
'0',
'stocksystem:newstocks:remove',
'#',
'admin'
);
-- 插入导出按钮权限
INSERT INTO sys_menu (
menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by
) VALUES (
'导出',
@menu_id,
'4',
'#',
NULL,
'1',
'0',
'F',
'0',
'0',
'stocksystem:newstocks:export',
'#',
'admin'
);
-- 4. 查询结果
SELECT * FROM sys_menu WHERE menu_name LIKE '%新行情数据%' OR parent_id = @menu_id;

@ -1,104 +0,0 @@
package com.ruoyi.booksystem.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.booksystem.domain.Account;
import com.ruoyi.booksystem.service.IAccountService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* Controller
*
* @author ruoyi
* @date 2023-12-18
*/
@RestController
@RequestMapping("/booksystem/account")
public class AccountController extends BaseController
{
@Autowired
private IAccountService accountService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('booksystem:account:list')")
@GetMapping("/list")
public TableDataInfo list(Account account)
{
startPage();
List<Account> list = accountService.selectAccountList(account);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('booksystem:account:export')")
@Log(title = "交易账户", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, Account account)
{
List<Account> list = accountService.selectAccountList(account);
ExcelUtil<Account> util = new ExcelUtil<Account>(Account.class);
util.exportExcel(response, list, "交易账户数据");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('booksystem:account:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(accountService.selectAccountById(id));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('booksystem:account:add')")
@Log(title = "交易账户", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody Account account)
{
return toAjax(accountService.insertAccount(account));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('booksystem:account:edit')")
@Log(title = "交易账户", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody Account account)
{
return toAjax(accountService.updateAccount(account));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('booksystem:account:remove')")
@Log(title = "交易账户", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(accountService.deleteAccountByIds(ids));
}
}

@ -1,111 +0,0 @@
package com.ruoyi.booksystem.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.utils.SecurityUtils;
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.booksystem.domain.Operations;
import com.ruoyi.booksystem.service.IOperationsService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* Controller
*
* @author ruoyi
* @date 2023-12-18
*/
@RestController
@RequestMapping("/booksystem/operations")
public class OperationsController extends BaseController
{
@Autowired
private IOperationsService operationsService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('booksystem:operations:list')")
@GetMapping("/list")
public TableDataInfo list(Operations operations)
{
startPage();
List<Operations> list = operationsService.selectOperationsList(operations);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('booksystem:operations:export')")
@Log(title = "当日操作", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, Operations operations)
{
List<Operations> list = operationsService.selectOperationsList(operations);
ExcelUtil<Operations> util = new ExcelUtil<Operations>(Operations.class);
util.exportExcel(response, list, "当日操作数据");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('booksystem:operations:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(operationsService.selectOperationsById(id));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('booksystem:operations:add')")
@Log(title = "当日操作", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody Operations operations)
{
LoginUser loginUser = SecurityUtils.getLoginUser();
System.out.println("[AccountBookController] userName: " + loginUser.getUsername() + " userId: " + loginUser.getUserId());
operations.setUserId(loginUser.getUserId());
//插入一条后,要更新持仓表
return toAjax(operationsService.insertOperations(operations));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('booksystem:operations:edit')")
@Log(title = "当日操作", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody Operations operations)
{
return toAjax(operationsService.updateOperations(operations));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('booksystem:operations:remove')")
@Log(title = "当日操作", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(operationsService.deleteOperationsByIds(ids));
}
}

@ -1,104 +0,0 @@
package com.ruoyi.booksystem.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.booksystem.domain.Statistics;
import com.ruoyi.booksystem.service.IStatisticsService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* Controller
*
* @author ruoyi
* @date 2023-12-18
*/
@RestController
@RequestMapping("/booksystem/statistics")
public class StatisticsController extends BaseController
{
@Autowired
private IStatisticsService statisticsService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('booksystem:statistics:list')")
@GetMapping("/list")
public TableDataInfo list(Statistics statistics)
{
startPage();
List<Statistics> list = statisticsService.selectStatisticsList(statistics);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('booksystem:statistics:export')")
@Log(title = "单笔操作统计", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, Statistics statistics)
{
List<Statistics> list = statisticsService.selectStatisticsList(statistics);
ExcelUtil<Statistics> util = new ExcelUtil<Statistics>(Statistics.class);
util.exportExcel(response, list, "单笔操作统计数据");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('booksystem:statistics:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(statisticsService.selectStatisticsById(id));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('booksystem:statistics:add')")
@Log(title = "单笔操作统计", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody Statistics statistics)
{
return toAjax(statisticsService.insertStatistics(statistics));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('booksystem:statistics:edit')")
@Log(title = "单笔操作统计", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody Statistics statistics)
{
return toAjax(statisticsService.updateStatistics(statistics));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('booksystem:statistics:remove')")
@Log(title = "单笔操作统计", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(statisticsService.deleteStatisticsByIds(ids));
}
}

@ -1,104 +0,0 @@
package com.ruoyi.booksystem.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.booksystem.domain.StatisticsRemain;
import com.ruoyi.booksystem.service.IStatisticsRemainService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* Controller
*
* @author ruoyi
* @date 2023-12-18
*/
@RestController
@RequestMapping("/booksystem/statisticremain")
public class StatisticsRemainController extends BaseController
{
@Autowired
private IStatisticsRemainService statisticsRemainService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('booksystem:statisticremain:list')")
@GetMapping("/list")
public TableDataInfo list(StatisticsRemain statisticsRemain)
{
startPage();
List<StatisticsRemain> list = statisticsRemainService.selectStatisticsRemainList(statisticsRemain);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('booksystem:statisticremain:export')")
@Log(title = "当日持仓统计", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, StatisticsRemain statisticsRemain)
{
List<StatisticsRemain> list = statisticsRemainService.selectStatisticsRemainList(statisticsRemain);
ExcelUtil<StatisticsRemain> util = new ExcelUtil<StatisticsRemain>(StatisticsRemain.class);
util.exportExcel(response, list, "当日持仓统计数据");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('booksystem:statisticremain:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(statisticsRemainService.selectStatisticsRemainById(id));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('booksystem:statisticremain:add')")
@Log(title = "当日持仓统计", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody StatisticsRemain statisticsRemain)
{
return toAjax(statisticsRemainService.insertStatisticsRemain(statisticsRemain));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('booksystem:statisticremain:edit')")
@Log(title = "当日持仓统计", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody StatisticsRemain statisticsRemain)
{
return toAjax(statisticsRemainService.updateStatisticsRemain(statisticsRemain));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('booksystem:statisticremain:remove')")
@Log(title = "当日持仓统计", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(statisticsRemainService.deleteStatisticsRemainByIds(ids));
}
}

@ -1,104 +0,0 @@
package com.ruoyi.booksystem.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.booksystem.domain.StatisticsTotal;
import com.ruoyi.booksystem.service.IStatisticsTotalService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* Controller
*
* @author ruoyi
* @date 2023-12-18
*/
@RestController
@RequestMapping("/booksystem/statistictotal")
public class StatisticsTotalController extends BaseController
{
@Autowired
private IStatisticsTotalService statisticsTotalService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('booksystem:statistictotal:list')")
@GetMapping("/list")
public TableDataInfo list(StatisticsTotal statisticsTotal)
{
startPage();
List<StatisticsTotal> list = statisticsTotalService.selectStatisticsTotalList(statisticsTotal);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('booksystem:statistictotal:export')")
@Log(title = "统计当日持仓", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, StatisticsTotal statisticsTotal)
{
List<StatisticsTotal> list = statisticsTotalService.selectStatisticsTotalList(statisticsTotal);
ExcelUtil<StatisticsTotal> util = new ExcelUtil<StatisticsTotal>(StatisticsTotal.class);
util.exportExcel(response, list, "统计当日持仓数据");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('booksystem:statistictotal:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(statisticsTotalService.selectStatisticsTotalById(id));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('booksystem:statistictotal:add')")
@Log(title = "统计当日持仓", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody StatisticsTotal statisticsTotal)
{
return toAjax(statisticsTotalService.insertStatisticsTotal(statisticsTotal));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('booksystem:statistictotal:edit')")
@Log(title = "统计当日持仓", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody StatisticsTotal statisticsTotal)
{
return toAjax(statisticsTotalService.updateStatisticsTotal(statisticsTotal));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('booksystem:statistictotal:remove')")
@Log(title = "统计当日持仓", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(statisticsTotalService.deleteStatisticsTotalByIds(ids));
}
}

@ -1,153 +0,0 @@
package com.ruoyi.booksystem.domain;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* account
*
* @author ruoyi
* @date 2023-12-18
*/
public class Account extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
private Long id;
/** 交易日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "交易日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date tradeDay;
/** 交易日星期 */
@Excel(name = "交易日星期")
private String weekDay;
/** 净资产 */
@Excel(name = "净资产")
private BigDecimal assets;
/** 总资产 */
@Excel(name = "总资产")
private BigDecimal totalAssets;
/** 当日盈亏 */
@Excel(name = "当日盈亏")
private BigDecimal profit;
/** 当日净资产盈亏比例 */
@Excel(name = "当日净资产盈亏比例")
private BigDecimal assetsDiff;
/** 当日总资产盈亏比例 */
@Excel(name = "当日总资产盈亏比例")
private BigDecimal totalDiff;
/** 用户id */
@Excel(name = "用户id")
private Long userId;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setTradeDay(Date tradeDay)
{
this.tradeDay = tradeDay;
}
public Date getTradeDay()
{
return tradeDay;
}
public void setWeekDay(String weekDay)
{
this.weekDay = weekDay;
}
public String getWeekDay()
{
return weekDay;
}
public void setAssets(BigDecimal assets)
{
this.assets = assets;
}
public BigDecimal getAssets()
{
return assets;
}
public void setTotalAssets(BigDecimal totalAssets)
{
this.totalAssets = totalAssets;
}
public BigDecimal getTotalAssets()
{
return totalAssets;
}
public void setProfit(BigDecimal profit)
{
this.profit = profit;
}
public BigDecimal getProfit()
{
return profit;
}
public void setAssetsDiff(BigDecimal assetsDiff)
{
this.assetsDiff = assetsDiff;
}
public BigDecimal getAssetsDiff()
{
return assetsDiff;
}
public void setTotalDiff(BigDecimal totalDiff)
{
this.totalDiff = totalDiff;
}
public BigDecimal getTotalDiff()
{
return totalDiff;
}
public void setUserId(Long userId)
{
this.userId = userId;
}
public Long getUserId()
{
return userId;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("tradeDay", getTradeDay())
.append("weekDay", getWeekDay())
.append("assets", getAssets())
.append("totalAssets", getTotalAssets())
.append("profit", getProfit())
.append("assetsDiff", getAssetsDiff())
.append("totalDiff", getTotalDiff())
.append("userId", getUserId())
.toString();
}
}

@ -1,265 +0,0 @@
package com.ruoyi.booksystem.domain;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* operations
*
* @author ruoyi
* @date 2023-12-18
*/
public class Operations extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
private Long id;
/** 股票代码 */
@Excel(name = "股票代码")
private String code;
/** 股票名称 */
@Excel(name = "股票名称")
private String name;
/** 交易日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "交易日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date tradeDay;
/** 交易日星期 */
@Excel(name = "交易日星期")
private String weekDay;
/** 操作(含账户转入转出) */
@Excel(name = "操作", readConverterExp = "含=账户转入转出")
private String operate;
/** 交易价格 */
@Excel(name = "交易价格")
private BigDecimal dealPrice;
/** 成交量 */
@Excel(name = "成交量")
private Long volumn;
/** 成交额 */
@Excel(name = "成交额")
private BigDecimal amount;
/** 印花税 */
@Excel(name = "印花税")
private BigDecimal tax;
/** 手续费 */
@Excel(name = "手续费")
private BigDecimal fee;
/** 其他费用 */
@Excel(name = "其他费用")
private BigDecimal other;
/** 操作时涨跌 */
@Excel(name = "操作时涨跌")
private BigDecimal operateDiff;
/** 关联操作id */
@Excel(name = "关联操作id")
private Long preId;
/** 用户id */
@Excel(name = "用户id")
private Long userId;
/** 操作逻辑 */
@Excel(name = "操作逻辑")
private String dealLogic;
/** 备注 */
@Excel(name = "备注")
private String bz;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setCode(String code)
{
this.code = code;
}
public String getCode()
{
return code;
}
public void setName(String name)
{
this.name = name;
}
public String getName()
{
return name;
}
public void setTradeDay(Date tradeDay)
{
this.tradeDay = tradeDay;
}
public Date getTradeDay()
{
return tradeDay;
}
public void setWeekDay(String weekDay)
{
this.weekDay = weekDay;
}
public String getWeekDay()
{
return weekDay;
}
public void setOperate(String operate)
{
this.operate = operate;
}
public String getOperate()
{
return operate;
}
public void setDealPrice(BigDecimal dealPrice)
{
this.dealPrice = dealPrice;
}
public BigDecimal getDealPrice()
{
return dealPrice;
}
public void setVolumn(Long volumn)
{
this.volumn = volumn;
}
public Long getVolumn()
{
return volumn;
}
public void setAmount(BigDecimal amount)
{
this.amount = amount;
}
public BigDecimal getAmount()
{
return amount;
}
public void setTax(BigDecimal tax)
{
this.tax = tax;
}
public BigDecimal getTax()
{
return tax;
}
public void setFee(BigDecimal fee)
{
this.fee = fee;
}
public BigDecimal getFee()
{
return fee;
}
public void setOther(BigDecimal other)
{
this.other = other;
}
public BigDecimal getOther()
{
return other;
}
public void setOperateDiff(BigDecimal operateDiff)
{
this.operateDiff = operateDiff;
}
public BigDecimal getOperateDiff()
{
return operateDiff;
}
public void setPreId(Long preId)
{
this.preId = preId;
}
public Long getPreId()
{
return preId;
}
public void setUserId(Long userId)
{
this.userId = userId;
}
public Long getUserId()
{
return userId;
}
public void setDealLogic(String dealLogic)
{
this.dealLogic = dealLogic;
}
public String getDealLogic()
{
return dealLogic;
}
public void setBz(String bz)
{
this.bz = bz;
}
public String getBz()
{
return bz;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("code", getCode())
.append("name", getName())
.append("tradeDay", getTradeDay())
.append("weekDay", getWeekDay())
.append("operate", getOperate())
.append("dealPrice", getDealPrice())
.append("volumn", getVolumn())
.append("amount", getAmount())
.append("tax", getTax())
.append("fee", getFee())
.append("other", getOther())
.append("operateDiff", getOperateDiff())
.append("preId", getPreId())
.append("userId", getUserId())
.append("dealLogic", getDealLogic())
.append("bz", getBz())
.toString();
}
}

@ -1,181 +0,0 @@
package com.ruoyi.booksystem.domain;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* statistics
*
* @author ruoyi
* @date 2023-12-18
*/
public class Statistics extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
private Long id;
/** 股票代码 */
@Excel(name = "股票代码")
private String code;
/** 股票名称 */
@Excel(name = "股票名称")
private String name;
/** 交易日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "交易日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date tradeDay;
/** 交易日星期 */
@Excel(name = "交易日星期")
private String weekDay;
/** 操作id */
@Excel(name = "操作id")
private String operationsId;
/** 当笔当日盈亏 */
@Excel(name = "当笔当日盈亏")
private BigDecimal profit;
/** 当笔当日盈亏盈亏比例 */
@Excel(name = "当笔当日盈亏盈亏比例")
private Long diff;
/** 操作id */
@Excel(name = "操作id")
private Long operateionId;
/** 用户id */
@Excel(name = "用户id")
private Long userId;
/** 备注 */
@Excel(name = "备注")
private String bz;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setCode(String code)
{
this.code = code;
}
public String getCode()
{
return code;
}
public void setName(String name)
{
this.name = name;
}
public String getName()
{
return name;
}
public void setTradeDay(Date tradeDay)
{
this.tradeDay = tradeDay;
}
public Date getTradeDay()
{
return tradeDay;
}
public void setWeekDay(String weekDay)
{
this.weekDay = weekDay;
}
public String getWeekDay()
{
return weekDay;
}
public void setOperationsId(String operationsId)
{
this.operationsId = operationsId;
}
public String getOperationsId()
{
return operationsId;
}
public void setProfit(BigDecimal profit)
{
this.profit = profit;
}
public BigDecimal getProfit()
{
return profit;
}
public void setDiff(Long diff)
{
this.diff = diff;
}
public Long getDiff()
{
return diff;
}
public void setOperateionId(Long operateionId)
{
this.operateionId = operateionId;
}
public Long getOperateionId()
{
return operateionId;
}
public void setUserId(Long userId)
{
this.userId = userId;
}
public Long getUserId()
{
return userId;
}
public void setBz(String bz)
{
this.bz = bz;
}
public String getBz()
{
return bz;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("code", getCode())
.append("name", getName())
.append("tradeDay", getTradeDay())
.append("weekDay", getWeekDay())
.append("operationsId", getOperationsId())
.append("profit", getProfit())
.append("diff", getDiff())
.append("operateionId", getOperateionId())
.append("userId", getUserId())
.append("bz", getBz())
.toString();
}
}

@ -1,181 +0,0 @@
package com.ruoyi.booksystem.domain;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* statistics_remain
*
* @author ruoyi
* @date 2023-12-18
*/
public class StatisticsRemain extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
private Long id;
/** 股票代码 */
@Excel(name = "股票代码")
private String code;
/** 股票名称 */
@Excel(name = "股票名称")
private String name;
/** 交易日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "交易日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date tradeDay;
/** 交易日星期 */
@Excel(name = "交易日星期")
private String weekDay;
/** 总盈亏 */
@Excel(name = "总盈亏")
private BigDecimal totalProfit;
/** 总盈亏比例 */
@Excel(name = "总盈亏比例")
private BigDecimal totalDiff;
/** 总盈亏占整体盈亏比例 */
@Excel(name = "总盈亏占整体盈亏比例")
private BigDecimal totalDiffOverall;
/** 剩余数量 */
@Excel(name = "剩余数量")
private BigDecimal remaining;
/** 用户id */
@Excel(name = "用户id")
private Long userId;
/** 备注 */
@Excel(name = "备注")
private String bz;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setCode(String code)
{
this.code = code;
}
public String getCode()
{
return code;
}
public void setName(String name)
{
this.name = name;
}
public String getName()
{
return name;
}
public void setTradeDay(Date tradeDay)
{
this.tradeDay = tradeDay;
}
public Date getTradeDay()
{
return tradeDay;
}
public void setWeekDay(String weekDay)
{
this.weekDay = weekDay;
}
public String getWeekDay()
{
return weekDay;
}
public void setTotalProfit(BigDecimal totalProfit)
{
this.totalProfit = totalProfit;
}
public BigDecimal getTotalProfit()
{
return totalProfit;
}
public void setTotalDiff(BigDecimal totalDiff)
{
this.totalDiff = totalDiff;
}
public BigDecimal getTotalDiff()
{
return totalDiff;
}
public void setTotalDiffOverall(BigDecimal totalDiffOverall)
{
this.totalDiffOverall = totalDiffOverall;
}
public BigDecimal getTotalDiffOverall()
{
return totalDiffOverall;
}
public void setRemaining(BigDecimal remaining)
{
this.remaining = remaining;
}
public BigDecimal getRemaining()
{
return remaining;
}
public void setUserId(Long userId)
{
this.userId = userId;
}
public Long getUserId()
{
return userId;
}
public void setBz(String bz)
{
this.bz = bz;
}
public String getBz()
{
return bz;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("code", getCode())
.append("name", getName())
.append("tradeDay", getTradeDay())
.append("weekDay", getWeekDay())
.append("totalProfit", getTotalProfit())
.append("totalDiff", getTotalDiff())
.append("totalDiffOverall", getTotalDiffOverall())
.append("remaining", getRemaining())
.append("userId", getUserId())
.append("bz", getBz())
.toString();
}
}

@ -1,266 +0,0 @@
package com.ruoyi.booksystem.domain;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* statistics_total
*
* @author ruoyi
* @date 2023-12-18
*/
public class StatisticsTotal extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
private Long id;
/** 股票代码 */
@Excel(name = "股票代码")
private String code;
/** 股票名称 */
@Excel(name = "股票名称")
private String name;
/** 建仓交易日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "建仓交易日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date startTradeDay;
/** 清仓交易日星期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "清仓交易日星期", width = 30, dateFormat = "yyyy-MM-dd")
private Date endTradeDay;
/** 总盈亏 */
@Excel(name = "总盈亏")
private BigDecimal totalProfit;
/** 总盈亏比例 */
@Excel(name = "总盈亏比例")
private BigDecimal totalDiff;
/** 建仓交易价格 */
@Excel(name = "建仓交易价格")
private BigDecimal startPrice;
/** 建仓交易价格 */
@Excel(name = "建仓交易价格")
private BigDecimal endPrice;
/** 总成交量 */
@Excel(name = "总成交量")
private Long volumnTotal;
/** 总成交额 */
@Excel(name = "总成交额")
private BigDecimal amountTotal;
/** 交易次数 */
@Excel(name = "交易次数")
private BigDecimal operateTimes;
/** 总手续费 */
@Excel(name = "总手续费")
private BigDecimal fee;
/** 总印花税 */
@Excel(name = "总印花税")
private BigDecimal tax;
/** 总其他费用 */
@Excel(name = "总其他费用")
private BigDecimal other;
/** 用户id */
@Excel(name = "用户id")
private Long userId;
/** 备注 */
@Excel(name = "备注")
private String bz;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setCode(String code)
{
this.code = code;
}
public String getCode()
{
return code;
}
public void setName(String name)
{
this.name = name;
}
public String getName()
{
return name;
}
public void setStartTradeDay(Date startTradeDay)
{
this.startTradeDay = startTradeDay;
}
public Date getStartTradeDay()
{
return startTradeDay;
}
public void setEndTradeDay(Date endTradeDay)
{
this.endTradeDay = endTradeDay;
}
public Date getEndTradeDay()
{
return endTradeDay;
}
public void setTotalProfit(BigDecimal totalProfit)
{
this.totalProfit = totalProfit;
}
public BigDecimal getTotalProfit()
{
return totalProfit;
}
public void setTotalDiff(BigDecimal totalDiff)
{
this.totalDiff = totalDiff;
}
public BigDecimal getTotalDiff()
{
return totalDiff;
}
public void setStartPrice(BigDecimal startPrice)
{
this.startPrice = startPrice;
}
public BigDecimal getStartPrice()
{
return startPrice;
}
public void setEndPrice(BigDecimal endPrice)
{
this.endPrice = endPrice;
}
public BigDecimal getEndPrice()
{
return endPrice;
}
public void setVolumnTotal(Long volumnTotal)
{
this.volumnTotal = volumnTotal;
}
public Long getVolumnTotal()
{
return volumnTotal;
}
public void setAmountTotal(BigDecimal amountTotal)
{
this.amountTotal = amountTotal;
}
public BigDecimal getAmountTotal()
{
return amountTotal;
}
public void setOperateTimes(BigDecimal operateTimes)
{
this.operateTimes = operateTimes;
}
public BigDecimal getOperateTimes()
{
return operateTimes;
}
public void setFee(BigDecimal fee)
{
this.fee = fee;
}
public BigDecimal getFee()
{
return fee;
}
public void setTax(BigDecimal tax)
{
this.tax = tax;
}
public BigDecimal getTax()
{
return tax;
}
public void setOther(BigDecimal other)
{
this.other = other;
}
public BigDecimal getOther()
{
return other;
}
public void setUserId(Long userId)
{
this.userId = userId;
}
public Long getUserId()
{
return userId;
}
public void setBz(String bz)
{
this.bz = bz;
}
public String getBz()
{
return bz;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("code", getCode())
.append("name", getName())
.append("startTradeDay", getStartTradeDay())
.append("endTradeDay", getEndTradeDay())
.append("totalProfit", getTotalProfit())
.append("totalDiff", getTotalDiff())
.append("startPrice", getStartPrice())
.append("endPrice", getEndPrice())
.append("volumnTotal", getVolumnTotal())
.append("amountTotal", getAmountTotal())
.append("operateTimes", getOperateTimes())
.append("fee", getFee())
.append("tax", getTax())
.append("other", getOther())
.append("userId", getUserId())
.append("bz", getBz())
.toString();
}
}

@ -1,61 +0,0 @@
package com.ruoyi.booksystem.mapper;
import java.util.List;
import com.ruoyi.booksystem.domain.Account;
/**
* Mapper
*
* @author ruoyi
* @date 2023-12-18
*/
public interface AccountMapper
{
/**
*
*
* @param id
* @return
*/
public Account selectAccountById(Long id);
/**
*
*
* @param account
* @return
*/
public List<Account> selectAccountList(Account account);
/**
*
*
* @param account
* @return
*/
public int insertAccount(Account account);
/**
*
*
* @param account
* @return
*/
public int updateAccount(Account account);
/**
*
*
* @param id
* @return
*/
public int deleteAccountById(Long id);
/**
*
*
* @param ids
* @return
*/
public int deleteAccountByIds(Long[] ids);
}

@ -1,61 +0,0 @@
package com.ruoyi.booksystem.mapper;
import java.util.List;
import com.ruoyi.booksystem.domain.Operations;
/**
* Mapper
*
* @author ruoyi
* @date 2023-12-18
*/
public interface OperationsMapper
{
/**
*
*
* @param id
* @return
*/
public Operations selectOperationsById(Long id);
/**
*
*
* @param operations
* @return
*/
public List<Operations> selectOperationsList(Operations operations);
/**
*
*
* @param operations
* @return
*/
public int insertOperations(Operations operations);
/**
*
*
* @param operations
* @return
*/
public int updateOperations(Operations operations);
/**
*
*
* @param id
* @return
*/
public int deleteOperationsById(Long id);
/**
*
*
* @param ids
* @return
*/
public int deleteOperationsByIds(Long[] ids);
}

@ -1,61 +0,0 @@
package com.ruoyi.booksystem.mapper;
import java.util.List;
import com.ruoyi.booksystem.domain.Statistics;
/**
* Mapper
*
* @author ruoyi
* @date 2023-12-18
*/
public interface StatisticsMapper
{
/**
*
*
* @param id
* @return
*/
public Statistics selectStatisticsById(Long id);
/**
*
*
* @param statistics
* @return
*/
public List<Statistics> selectStatisticsList(Statistics statistics);
/**
*
*
* @param statistics
* @return
*/
public int insertStatistics(Statistics statistics);
/**
*
*
* @param statistics
* @return
*/
public int updateStatistics(Statistics statistics);
/**
*
*
* @param id
* @return
*/
public int deleteStatisticsById(Long id);
/**
*
*
* @param ids
* @return
*/
public int deleteStatisticsByIds(Long[] ids);
}

@ -1,61 +0,0 @@
package com.ruoyi.booksystem.mapper;
import java.util.List;
import com.ruoyi.booksystem.domain.StatisticsRemain;
/**
* Mapper
*
* @author ruoyi
* @date 2023-12-18
*/
public interface StatisticsRemainMapper
{
/**
*
*
* @param id
* @return
*/
public StatisticsRemain selectStatisticsRemainById(Long id);
/**
*
*
* @param statisticsRemain
* @return
*/
public List<StatisticsRemain> selectStatisticsRemainList(StatisticsRemain statisticsRemain);
/**
*
*
* @param statisticsRemain
* @return
*/
public int insertStatisticsRemain(StatisticsRemain statisticsRemain);
/**
*
*
* @param statisticsRemain
* @return
*/
public int updateStatisticsRemain(StatisticsRemain statisticsRemain);
/**
*
*
* @param id
* @return
*/
public int deleteStatisticsRemainById(Long id);
/**
*
*
* @param ids
* @return
*/
public int deleteStatisticsRemainByIds(Long[] ids);
}

@ -1,61 +0,0 @@
package com.ruoyi.booksystem.mapper;
import java.util.List;
import com.ruoyi.booksystem.domain.StatisticsTotal;
/**
* Mapper
*
* @author ruoyi
* @date 2023-12-18
*/
public interface StatisticsTotalMapper
{
/**
*
*
* @param id
* @return
*/
public StatisticsTotal selectStatisticsTotalById(Long id);
/**
*
*
* @param statisticsTotal
* @return
*/
public List<StatisticsTotal> selectStatisticsTotalList(StatisticsTotal statisticsTotal);
/**
*
*
* @param statisticsTotal
* @return
*/
public int insertStatisticsTotal(StatisticsTotal statisticsTotal);
/**
*
*
* @param statisticsTotal
* @return
*/
public int updateStatisticsTotal(StatisticsTotal statisticsTotal);
/**
*
*
* @param id
* @return
*/
public int deleteStatisticsTotalById(Long id);
/**
*
*
* @param ids
* @return
*/
public int deleteStatisticsTotalByIds(Long[] ids);
}

@ -1,61 +0,0 @@
package com.ruoyi.booksystem.service;
import java.util.List;
import com.ruoyi.booksystem.domain.Account;
/**
* Service
*
* @author ruoyi
* @date 2023-12-18
*/
public interface IAccountService
{
/**
*
*
* @param id
* @return
*/
public Account selectAccountById(Long id);
/**
*
*
* @param account
* @return
*/
public List<Account> selectAccountList(Account account);
/**
*
*
* @param account
* @return
*/
public int insertAccount(Account account);
/**
*
*
* @param account
* @return
*/
public int updateAccount(Account account);
/**
*
*
* @param ids
* @return
*/
public int deleteAccountByIds(Long[] ids);
/**
*
*
* @param id
* @return
*/
public int deleteAccountById(Long id);
}

@ -1,61 +0,0 @@
package com.ruoyi.booksystem.service;
import java.util.List;
import com.ruoyi.booksystem.domain.Operations;
/**
* Service
*
* @author ruoyi
* @date 2023-12-18
*/
public interface IOperationsService
{
/**
*
*
* @param id
* @return
*/
public Operations selectOperationsById(Long id);
/**
*
*
* @param operations
* @return
*/
public List<Operations> selectOperationsList(Operations operations);
/**
*
*
* @param operations
* @return
*/
public int insertOperations(Operations operations);
/**
*
*
* @param operations
* @return
*/
public int updateOperations(Operations operations);
/**
*
*
* @param ids
* @return
*/
public int deleteOperationsByIds(Long[] ids);
/**
*
*
* @param id
* @return
*/
public int deleteOperationsById(Long id);
}

@ -1,61 +0,0 @@
package com.ruoyi.booksystem.service;
import java.util.List;
import com.ruoyi.booksystem.domain.StatisticsRemain;
/**
* Service
*
* @author ruoyi
* @date 2023-12-18
*/
public interface IStatisticsRemainService
{
/**
*
*
* @param id
* @return
*/
public StatisticsRemain selectStatisticsRemainById(Long id);
/**
*
*
* @param statisticsRemain
* @return
*/
public List<StatisticsRemain> selectStatisticsRemainList(StatisticsRemain statisticsRemain);
/**
*
*
* @param statisticsRemain
* @return
*/
public int insertStatisticsRemain(StatisticsRemain statisticsRemain);
/**
*
*
* @param statisticsRemain
* @return
*/
public int updateStatisticsRemain(StatisticsRemain statisticsRemain);
/**
*
*
* @param ids
* @return
*/
public int deleteStatisticsRemainByIds(Long[] ids);
/**
*
*
* @param id
* @return
*/
public int deleteStatisticsRemainById(Long id);
}

@ -1,61 +0,0 @@
package com.ruoyi.booksystem.service;
import java.util.List;
import com.ruoyi.booksystem.domain.Statistics;
/**
* Service
*
* @author ruoyi
* @date 2023-12-18
*/
public interface IStatisticsService
{
/**
*
*
* @param id
* @return
*/
public Statistics selectStatisticsById(Long id);
/**
*
*
* @param statistics
* @return
*/
public List<Statistics> selectStatisticsList(Statistics statistics);
/**
*
*
* @param statistics
* @return
*/
public int insertStatistics(Statistics statistics);
/**
*
*
* @param statistics
* @return
*/
public int updateStatistics(Statistics statistics);
/**
*
*
* @param ids
* @return
*/
public int deleteStatisticsByIds(Long[] ids);
/**
*
*
* @param id
* @return
*/
public int deleteStatisticsById(Long id);
}

@ -1,61 +0,0 @@
package com.ruoyi.booksystem.service;
import java.util.List;
import com.ruoyi.booksystem.domain.StatisticsTotal;
/**
* Service
*
* @author ruoyi
* @date 2023-12-18
*/
public interface IStatisticsTotalService
{
/**
*
*
* @param id
* @return
*/
public StatisticsTotal selectStatisticsTotalById(Long id);
/**
*
*
* @param statisticsTotal
* @return
*/
public List<StatisticsTotal> selectStatisticsTotalList(StatisticsTotal statisticsTotal);
/**
*
*
* @param statisticsTotal
* @return
*/
public int insertStatisticsTotal(StatisticsTotal statisticsTotal);
/**
*
*
* @param statisticsTotal
* @return
*/
public int updateStatisticsTotal(StatisticsTotal statisticsTotal);
/**
*
*
* @param ids
* @return
*/
public int deleteStatisticsTotalByIds(Long[] ids);
/**
*
*
* @param id
* @return
*/
public int deleteStatisticsTotalById(Long id);
}

@ -1,93 +0,0 @@
package com.ruoyi.booksystem.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.booksystem.mapper.AccountMapper;
import com.ruoyi.booksystem.domain.Account;
import com.ruoyi.booksystem.service.IAccountService;
/**
* Service
*
* @author ruoyi
* @date 2023-12-18
*/
@Service
public class AccountServiceImpl implements IAccountService
{
@Autowired
private AccountMapper accountMapper;
/**
*
*
* @param id
* @return
*/
@Override
public Account selectAccountById(Long id)
{
return accountMapper.selectAccountById(id);
}
/**
*
*
* @param account
* @return
*/
@Override
public List<Account> selectAccountList(Account account)
{
return accountMapper.selectAccountList(account);
}
/**
*
*
* @param account
* @return
*/
@Override
public int insertAccount(Account account)
{
return accountMapper.insertAccount(account);
}
/**
*
*
* @param account
* @return
*/
@Override
public int updateAccount(Account account)
{
return accountMapper.updateAccount(account);
}
/**
*
*
* @param ids
* @return
*/
@Override
public int deleteAccountByIds(Long[] ids)
{
return accountMapper.deleteAccountByIds(ids);
}
/**
*
*
* @param id
* @return
*/
@Override
public int deleteAccountById(Long id)
{
return accountMapper.deleteAccountById(id);
}
}

@ -1,93 +0,0 @@
package com.ruoyi.booksystem.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.booksystem.mapper.OperationsMapper;
import com.ruoyi.booksystem.domain.Operations;
import com.ruoyi.booksystem.service.IOperationsService;
/**
* Service
*
* @author ruoyi
* @date 2023-12-18
*/
@Service
public class OperationsServiceImpl implements IOperationsService
{
@Autowired
private OperationsMapper operationsMapper;
/**
*
*
* @param id
* @return
*/
@Override
public Operations selectOperationsById(Long id)
{
return operationsMapper.selectOperationsById(id);
}
/**
*
*
* @param operations
* @return
*/
@Override
public List<Operations> selectOperationsList(Operations operations)
{
return operationsMapper.selectOperationsList(operations);
}
/**
*
*
* @param operations
* @return
*/
@Override
public int insertOperations(Operations operations)
{
return operationsMapper.insertOperations(operations);
}
/**
*
*
* @param operations
* @return
*/
@Override
public int updateOperations(Operations operations)
{
return operationsMapper.updateOperations(operations);
}
/**
*
*
* @param ids
* @return
*/
@Override
public int deleteOperationsByIds(Long[] ids)
{
return operationsMapper.deleteOperationsByIds(ids);
}
/**
*
*
* @param id
* @return
*/
@Override
public int deleteOperationsById(Long id)
{
return operationsMapper.deleteOperationsById(id);
}
}

@ -1,93 +0,0 @@
package com.ruoyi.booksystem.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.booksystem.mapper.StatisticsRemainMapper;
import com.ruoyi.booksystem.domain.StatisticsRemain;
import com.ruoyi.booksystem.service.IStatisticsRemainService;
/**
* Service
*
* @author ruoyi
* @date 2023-12-18
*/
@Service
public class StatisticsRemainServiceImpl implements IStatisticsRemainService
{
@Autowired
private StatisticsRemainMapper statisticsRemainMapper;
/**
*
*
* @param id
* @return
*/
@Override
public StatisticsRemain selectStatisticsRemainById(Long id)
{
return statisticsRemainMapper.selectStatisticsRemainById(id);
}
/**
*
*
* @param statisticsRemain
* @return
*/
@Override
public List<StatisticsRemain> selectStatisticsRemainList(StatisticsRemain statisticsRemain)
{
return statisticsRemainMapper.selectStatisticsRemainList(statisticsRemain);
}
/**
*
*
* @param statisticsRemain
* @return
*/
@Override
public int insertStatisticsRemain(StatisticsRemain statisticsRemain)
{
return statisticsRemainMapper.insertStatisticsRemain(statisticsRemain);
}
/**
*
*
* @param statisticsRemain
* @return
*/
@Override
public int updateStatisticsRemain(StatisticsRemain statisticsRemain)
{
return statisticsRemainMapper.updateStatisticsRemain(statisticsRemain);
}
/**
*
*
* @param ids
* @return
*/
@Override
public int deleteStatisticsRemainByIds(Long[] ids)
{
return statisticsRemainMapper.deleteStatisticsRemainByIds(ids);
}
/**
*
*
* @param id
* @return
*/
@Override
public int deleteStatisticsRemainById(Long id)
{
return statisticsRemainMapper.deleteStatisticsRemainById(id);
}
}

@ -1,93 +0,0 @@
package com.ruoyi.booksystem.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.booksystem.mapper.StatisticsMapper;
import com.ruoyi.booksystem.domain.Statistics;
import com.ruoyi.booksystem.service.IStatisticsService;
/**
* Service
*
* @author ruoyi
* @date 2023-12-18
*/
@Service
public class StatisticsServiceImpl implements IStatisticsService
{
@Autowired
private StatisticsMapper statisticsMapper;
/**
*
*
* @param id
* @return
*/
@Override
public Statistics selectStatisticsById(Long id)
{
return statisticsMapper.selectStatisticsById(id);
}
/**
*
*
* @param statistics
* @return
*/
@Override
public List<Statistics> selectStatisticsList(Statistics statistics)
{
return statisticsMapper.selectStatisticsList(statistics);
}
/**
*
*
* @param statistics
* @return
*/
@Override
public int insertStatistics(Statistics statistics)
{
return statisticsMapper.insertStatistics(statistics);
}
/**
*
*
* @param statistics
* @return
*/
@Override
public int updateStatistics(Statistics statistics)
{
return statisticsMapper.updateStatistics(statistics);
}
/**
*
*
* @param ids
* @return
*/
@Override
public int deleteStatisticsByIds(Long[] ids)
{
return statisticsMapper.deleteStatisticsByIds(ids);
}
/**
*
*
* @param id
* @return
*/
@Override
public int deleteStatisticsById(Long id)
{
return statisticsMapper.deleteStatisticsById(id);
}
}

@ -1,93 +0,0 @@
package com.ruoyi.booksystem.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.booksystem.mapper.StatisticsTotalMapper;
import com.ruoyi.booksystem.domain.StatisticsTotal;
import com.ruoyi.booksystem.service.IStatisticsTotalService;
/**
* Service
*
* @author ruoyi
* @date 2023-12-18
*/
@Service
public class StatisticsTotalServiceImpl implements IStatisticsTotalService
{
@Autowired
private StatisticsTotalMapper statisticsTotalMapper;
/**
*
*
* @param id
* @return
*/
@Override
public StatisticsTotal selectStatisticsTotalById(Long id)
{
return statisticsTotalMapper.selectStatisticsTotalById(id);
}
/**
*
*
* @param statisticsTotal
* @return
*/
@Override
public List<StatisticsTotal> selectStatisticsTotalList(StatisticsTotal statisticsTotal)
{
return statisticsTotalMapper.selectStatisticsTotalList(statisticsTotal);
}
/**
*
*
* @param statisticsTotal
* @return
*/
@Override
public int insertStatisticsTotal(StatisticsTotal statisticsTotal)
{
return statisticsTotalMapper.insertStatisticsTotal(statisticsTotal);
}
/**
*
*
* @param statisticsTotal
* @return
*/
@Override
public int updateStatisticsTotal(StatisticsTotal statisticsTotal)
{
return statisticsTotalMapper.updateStatisticsTotal(statisticsTotal);
}
/**
*
*
* @param ids
* @return
*/
@Override
public int deleteStatisticsTotalByIds(Long[] ids)
{
return statisticsTotalMapper.deleteStatisticsTotalByIds(ids);
}
/**
*
*
* @param id
* @return
*/
@Override
public int deleteStatisticsTotalById(Long id)
{
return statisticsTotalMapper.deleteStatisticsTotalById(id);
}
}

@ -1,91 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.booksystem.mapper.AccountMapper">
<resultMap type="Account" id="AccountResult">
<result property="id" column="id" />
<result property="tradeDay" column="trade_day" />
<result property="weekDay" column="week_day" />
<result property="assets" column="assets" />
<result property="totalAssets" column="total_assets" />
<result property="profit" column="profit" />
<result property="assetsDiff" column="assets_diff" />
<result property="totalDiff" column="total_diff" />
<result property="userId" column="user_id" />
</resultMap>
<sql id="selectAccountVo">
select id, trade_day, week_day, assets, total_assets, profit, assets_diff, total_diff, user_id from account
</sql>
<select id="selectAccountList" parameterType="Account" resultMap="AccountResult">
<include refid="selectAccountVo"/>
<where>
<if test="tradeDay != null "> and trade_day = #{tradeDay}</if>
<if test="weekDay != null "> and week_day = #{weekDay}</if>
<if test="assets != null "> and assets = #{assets}</if>
<if test="totalAssets != null "> and total_assets = #{totalAssets}</if>
<if test="profit != null "> and profit = #{profit}</if>
<if test="assetsDiff != null "> and assets_diff = #{assetsDiff}</if>
<if test="totalDiff != null "> and total_diff = #{totalDiff}</if>
<if test="userId != null "> and user_id = #{userId}</if>
</where>
</select>
<select id="selectAccountById" parameterType="Long" resultMap="AccountResult">
<include refid="selectAccountVo"/>
where id = #{id}
</select>
<insert id="insertAccount" parameterType="Account" useGeneratedKeys="true" keyProperty="id">
insert into account
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="tradeDay != null">trade_day,</if>
<if test="weekDay != null">week_day,</if>
<if test="assets != null">assets,</if>
<if test="totalAssets != null">total_assets,</if>
<if test="profit != null">profit,</if>
<if test="assetsDiff != null">assets_diff,</if>
<if test="totalDiff != null">total_diff,</if>
<if test="userId != null">user_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="tradeDay != null">#{tradeDay},</if>
<if test="weekDay != null">#{weekDay},</if>
<if test="assets != null">#{assets},</if>
<if test="totalAssets != null">#{totalAssets},</if>
<if test="profit != null">#{profit},</if>
<if test="assetsDiff != null">#{assetsDiff},</if>
<if test="totalDiff != null">#{totalDiff},</if>
<if test="userId != null">#{userId},</if>
</trim>
</insert>
<update id="updateAccount" parameterType="Account">
update account
<trim prefix="SET" suffixOverrides=",">
<if test="tradeDay != null">trade_day = #{tradeDay},</if>
<if test="weekDay != null">week_day = #{weekDay},</if>
<if test="assets != null">assets = #{assets},</if>
<if test="totalAssets != null">total_assets = #{totalAssets},</if>
<if test="profit != null">profit = #{profit},</if>
<if test="assetsDiff != null">assets_diff = #{assetsDiff},</if>
<if test="totalDiff != null">total_diff = #{totalDiff},</if>
<if test="userId != null">user_id = #{userId},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteAccountById" parameterType="Long">
delete from account where id = #{id}
</delete>
<delete id="deleteAccountByIds" parameterType="String">
delete from account where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

@ -1,131 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.booksystem.mapper.OperationsMapper">
<resultMap type="Operations" id="OperationsResult">
<result property="id" column="id" />
<result property="code" column="code" />
<result property="name" column="name" />
<result property="tradeDay" column="trade_day" />
<result property="weekDay" column="week_day" />
<result property="operate" column="operate" />
<result property="dealPrice" column="deal_price" />
<result property="volumn" column="volumn" />
<result property="amount" column="amount" />
<result property="tax" column="tax" />
<result property="fee" column="fee" />
<result property="other" column="other" />
<result property="operateDiff" column="operate_diff" />
<result property="preId" column="pre_id" />
<result property="userId" column="user_id" />
<result property="dealLogic" column="deal_logic" />
<result property="bz" column="bz" />
</resultMap>
<sql id="selectOperationsVo">
select id, code, name, trade_day, week_day, operate, deal_price, volumn, amount, tax, fee, other, operate_diff, pre_id, user_id, deal_logic, bz from operations
</sql>
<select id="selectOperationsList" parameterType="Operations" resultMap="OperationsResult">
<include refid="selectOperationsVo"/>
<where>
<if test="code != null and code != ''"> and code = #{code}</if>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="tradeDay != null "> and trade_day = #{tradeDay}</if>
<if test="weekDay != null "> and week_day = #{weekDay}</if>
<if test="operate != null and operate != ''"> and operate = #{operate}</if>
<if test="dealPrice != null "> and deal_price = #{dealPrice}</if>
<if test="volumn != null "> and volumn = #{volumn}</if>
<if test="amount != null "> and amount = #{amount}</if>
<if test="tax != null "> and tax = #{tax}</if>
<if test="fee != null "> and fee = #{fee}</if>
<if test="other != null "> and other = #{other}</if>
<if test="operateDiff != null "> and operate_diff = #{operateDiff}</if>
<if test="preId != null "> and pre_id = #{preId}</if>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="dealLogic != null and dealLogic != ''"> and deal_logic = #{dealLogic}</if>
<if test="bz != null and bz != ''"> and bz = #{bz}</if>
</where>
</select>
<select id="selectOperationsById" parameterType="Long" resultMap="OperationsResult">
<include refid="selectOperationsVo"/>
where id = #{id}
</select>
<insert id="insertOperations" parameterType="Operations" useGeneratedKeys="true" keyProperty="id">
insert into operations
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="code != null and code != ''">code,</if>
<if test="name != null">name,</if>
<if test="tradeDay != null">trade_day,</if>
<if test="weekDay != null">week_day,</if>
<if test="operate != null and operate != ''">operate,</if>
<if test="dealPrice != null">deal_price,</if>
<if test="volumn != null">volumn,</if>
<if test="amount != null">amount,</if>
<if test="tax != null">tax,</if>
<if test="fee != null">fee,</if>
<if test="other != null">other,</if>
<if test="operateDiff != null">operate_diff,</if>
<if test="preId != null">pre_id,</if>
<if test="userId != null">user_id,</if>
<if test="dealLogic != null">deal_logic,</if>
<if test="bz != null">bz,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="code != null and code != ''">#{code},</if>
<if test="name != null">#{name},</if>
<if test="tradeDay != null">#{tradeDay},</if>
<if test="weekDay != null">#{weekDay},</if>
<if test="operate != null and operate != ''">#{operate},</if>
<if test="dealPrice != null">#{dealPrice},</if>
<if test="volumn != null">#{volumn},</if>
<if test="amount != null">#{amount},</if>
<if test="tax != null">#{tax},</if>
<if test="fee != null">#{fee},</if>
<if test="other != null">#{other},</if>
<if test="operateDiff != null">#{operateDiff},</if>
<if test="preId != null">#{preId},</if>
<if test="userId != null">#{userId},</if>
<if test="dealLogic != null">#{dealLogic},</if>
<if test="bz != null">#{bz},</if>
</trim>
</insert>
<update id="updateOperations" parameterType="Operations">
update operations
<trim prefix="SET" suffixOverrides=",">
<if test="code != null and code != ''">code = #{code},</if>
<if test="name != null">name = #{name},</if>
<if test="tradeDay != null">trade_day = #{tradeDay},</if>
<if test="weekDay != null">week_day = #{weekDay},</if>
<if test="operate != null and operate != ''">operate = #{operate},</if>
<if test="dealPrice != null">deal_price = #{dealPrice},</if>
<if test="volumn != null">volumn = #{volumn},</if>
<if test="amount != null">amount = #{amount},</if>
<if test="tax != null">tax = #{tax},</if>
<if test="fee != null">fee = #{fee},</if>
<if test="other != null">other = #{other},</if>
<if test="operateDiff != null">operate_diff = #{operateDiff},</if>
<if test="preId != null">pre_id = #{preId},</if>
<if test="userId != null">user_id = #{userId},</if>
<if test="dealLogic != null">deal_logic = #{dealLogic},</if>
<if test="bz != null">bz = #{bz},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteOperationsById" parameterType="Long">
delete from operations where id = #{id}
</delete>
<delete id="deleteOperationsByIds" parameterType="String">
delete from operations where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

@ -1,101 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.booksystem.mapper.StatisticsMapper">
<resultMap type="Statistics" id="StatisticsResult">
<result property="id" column="id" />
<result property="code" column="code" />
<result property="name" column="name" />
<result property="tradeDay" column="trade_day" />
<result property="weekDay" column="week_day" />
<result property="operationsId" column="operations_id" />
<result property="profit" column="profit" />
<result property="diff" column="diff" />
<result property="operateionId" column="operateion_id" />
<result property="userId" column="user_id" />
<result property="bz" column="bz" />
</resultMap>
<sql id="selectStatisticsVo">
select id, code, name, trade_day, week_day, operations_id, profit, diff, operateion_id, user_id, bz from statistics
</sql>
<select id="selectStatisticsList" parameterType="Statistics" resultMap="StatisticsResult">
<include refid="selectStatisticsVo"/>
<where>
<if test="code != null and code != ''"> and code = #{code}</if>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="tradeDay != null "> and trade_day = #{tradeDay}</if>
<if test="weekDay != null "> and week_day = #{weekDay}</if>
<if test="operationsId != null and operationsId != ''"> and operations_id = #{operationsId}</if>
<if test="profit != null "> and profit = #{profit}</if>
<if test="diff != null "> and diff = #{diff}</if>
<if test="operateionId != null "> and operateion_id = #{operateionId}</if>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="bz != null and bz != ''"> and bz = #{bz}</if>
</where>
</select>
<select id="selectStatisticsById" parameterType="Long" resultMap="StatisticsResult">
<include refid="selectStatisticsVo"/>
where id = #{id}
</select>
<insert id="insertStatistics" parameterType="Statistics" useGeneratedKeys="true" keyProperty="id">
insert into statistics
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="code != null and code != ''">code,</if>
<if test="name != null">name,</if>
<if test="tradeDay != null">trade_day,</if>
<if test="weekDay != null">week_day,</if>
<if test="operationsId != null and operationsId != ''">operations_id,</if>
<if test="profit != null">profit,</if>
<if test="diff != null">diff,</if>
<if test="operateionId != null">operateion_id,</if>
<if test="userId != null">user_id,</if>
<if test="bz != null">bz,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="code != null and code != ''">#{code},</if>
<if test="name != null">#{name},</if>
<if test="tradeDay != null">#{tradeDay},</if>
<if test="weekDay != null">#{weekDay},</if>
<if test="operationsId != null and operationsId != ''">#{operationsId},</if>
<if test="profit != null">#{profit},</if>
<if test="diff != null">#{diff},</if>
<if test="operateionId != null">#{operateionId},</if>
<if test="userId != null">#{userId},</if>
<if test="bz != null">#{bz},</if>
</trim>
</insert>
<update id="updateStatistics" parameterType="Statistics">
update statistics
<trim prefix="SET" suffixOverrides=",">
<if test="code != null and code != ''">code = #{code},</if>
<if test="name != null">name = #{name},</if>
<if test="tradeDay != null">trade_day = #{tradeDay},</if>
<if test="weekDay != null">week_day = #{weekDay},</if>
<if test="operationsId != null and operationsId != ''">operations_id = #{operationsId},</if>
<if test="profit != null">profit = #{profit},</if>
<if test="diff != null">diff = #{diff},</if>
<if test="operateionId != null">operateion_id = #{operateionId},</if>
<if test="userId != null">user_id = #{userId},</if>
<if test="bz != null">bz = #{bz},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteStatisticsById" parameterType="Long">
delete from statistics where id = #{id}
</delete>
<delete id="deleteStatisticsByIds" parameterType="String">
delete from statistics where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

@ -1,101 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.booksystem.mapper.StatisticsRemainMapper">
<resultMap type="StatisticsRemain" id="StatisticsRemainResult">
<result property="id" column="id" />
<result property="code" column="code" />
<result property="name" column="name" />
<result property="tradeDay" column="trade_day" />
<result property="weekDay" column="week_day" />
<result property="totalProfit" column="total_profit" />
<result property="totalDiff" column="total_diff" />
<result property="totalDiffOverall" column="total_diff_overall" />
<result property="remaining" column="remaining" />
<result property="userId" column="user_id" />
<result property="bz" column="bz" />
</resultMap>
<sql id="selectStatisticsRemainVo">
select id, code, name, trade_day, week_day, total_profit, total_diff, total_diff_overall, remaining, user_id, bz from statistics_remain
</sql>
<select id="selectStatisticsRemainList" parameterType="StatisticsRemain" resultMap="StatisticsRemainResult">
<include refid="selectStatisticsRemainVo"/>
<where>
<if test="code != null and code != ''"> and code = #{code}</if>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="tradeDay != null "> and trade_day = #{tradeDay}</if>
<if test="weekDay != null "> and week_day = #{weekDay}</if>
<if test="totalProfit != null "> and total_profit = #{totalProfit}</if>
<if test="totalDiff != null "> and total_diff = #{totalDiff}</if>
<if test="totalDiffOverall != null "> and total_diff_overall = #{totalDiffOverall}</if>
<if test="remaining != null "> and remaining = #{remaining}</if>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="bz != null and bz != ''"> and bz = #{bz}</if>
</where>
</select>
<select id="selectStatisticsRemainById" parameterType="Long" resultMap="StatisticsRemainResult">
<include refid="selectStatisticsRemainVo"/>
where id = #{id}
</select>
<insert id="insertStatisticsRemain" parameterType="StatisticsRemain" useGeneratedKeys="true" keyProperty="id">
insert into statistics_remain
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="code != null and code != ''">code,</if>
<if test="name != null">name,</if>
<if test="tradeDay != null">trade_day,</if>
<if test="weekDay != null">week_day,</if>
<if test="totalProfit != null">total_profit,</if>
<if test="totalDiff != null">total_diff,</if>
<if test="totalDiffOverall != null">total_diff_overall,</if>
<if test="remaining != null">remaining,</if>
<if test="userId != null">user_id,</if>
<if test="bz != null">bz,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="code != null and code != ''">#{code},</if>
<if test="name != null">#{name},</if>
<if test="tradeDay != null">#{tradeDay},</if>
<if test="weekDay != null">#{weekDay},</if>
<if test="totalProfit != null">#{totalProfit},</if>
<if test="totalDiff != null">#{totalDiff},</if>
<if test="totalDiffOverall != null">#{totalDiffOverall},</if>
<if test="remaining != null">#{remaining},</if>
<if test="userId != null">#{userId},</if>
<if test="bz != null">#{bz},</if>
</trim>
</insert>
<update id="updateStatisticsRemain" parameterType="StatisticsRemain">
update statistics_remain
<trim prefix="SET" suffixOverrides=",">
<if test="code != null and code != ''">code = #{code},</if>
<if test="name != null">name = #{name},</if>
<if test="tradeDay != null">trade_day = #{tradeDay},</if>
<if test="weekDay != null">week_day = #{weekDay},</if>
<if test="totalProfit != null">total_profit = #{totalProfit},</if>
<if test="totalDiff != null">total_diff = #{totalDiff},</if>
<if test="totalDiffOverall != null">total_diff_overall = #{totalDiffOverall},</if>
<if test="remaining != null">remaining = #{remaining},</if>
<if test="userId != null">user_id = #{userId},</if>
<if test="bz != null">bz = #{bz},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteStatisticsRemainById" parameterType="Long">
delete from statistics_remain where id = #{id}
</delete>
<delete id="deleteStatisticsRemainByIds" parameterType="String">
delete from statistics_remain where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

@ -1,131 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.booksystem.mapper.StatisticsTotalMapper">
<resultMap type="StatisticsTotal" id="StatisticsTotalResult">
<result property="id" column="id" />
<result property="code" column="code" />
<result property="name" column="name" />
<result property="startTradeDay" column="start_trade_day" />
<result property="endTradeDay" column="end_trade_day" />
<result property="totalProfit" column="total_profit" />
<result property="totalDiff" column="total_diff" />
<result property="startPrice" column="start_price" />
<result property="endPrice" column="end_price" />
<result property="volumnTotal" column="volumn_total" />
<result property="amountTotal" column="amount_total" />
<result property="operateTimes" column="operate_times" />
<result property="fee" column="fee" />
<result property="tax" column="tax" />
<result property="other" column="other" />
<result property="userId" column="user_id" />
<result property="bz" column="bz" />
</resultMap>
<sql id="selectStatisticsTotalVo">
select id, code, name, start_trade_day, end_trade_day, total_profit, total_diff, start_price, end_price, volumn_total, amount_total, operate_times, fee, tax, other, user_id, bz from statistics_total
</sql>
<select id="selectStatisticsTotalList" parameterType="StatisticsTotal" resultMap="StatisticsTotalResult">
<include refid="selectStatisticsTotalVo"/>
<where>
<if test="code != null and code != ''"> and code = #{code}</if>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="startTradeDay != null "> and start_trade_day = #{startTradeDay}</if>
<if test="endTradeDay != null "> and end_trade_day = #{endTradeDay}</if>
<if test="totalProfit != null "> and total_profit = #{totalProfit}</if>
<if test="totalDiff != null "> and total_diff = #{totalDiff}</if>
<if test="startPrice != null "> and start_price = #{startPrice}</if>
<if test="endPrice != null "> and end_price = #{endPrice}</if>
<if test="volumnTotal != null "> and volumn_total = #{volumnTotal}</if>
<if test="amountTotal != null "> and amount_total = #{amountTotal}</if>
<if test="operateTimes != null "> and operate_times = #{operateTimes}</if>
<if test="fee != null "> and fee = #{fee}</if>
<if test="tax != null "> and tax = #{tax}</if>
<if test="other != null "> and other = #{other}</if>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="bz != null and bz != ''"> and bz = #{bz}</if>
</where>
</select>
<select id="selectStatisticsTotalById" parameterType="Long" resultMap="StatisticsTotalResult">
<include refid="selectStatisticsTotalVo"/>
where id = #{id}
</select>
<insert id="insertStatisticsTotal" parameterType="StatisticsTotal" useGeneratedKeys="true" keyProperty="id">
insert into statistics_total
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="code != null and code != ''">code,</if>
<if test="name != null">name,</if>
<if test="startTradeDay != null">start_trade_day,</if>
<if test="endTradeDay != null">end_trade_day,</if>
<if test="totalProfit != null">total_profit,</if>
<if test="totalDiff != null">total_diff,</if>
<if test="startPrice != null">start_price,</if>
<if test="endPrice != null">end_price,</if>
<if test="volumnTotal != null">volumn_total,</if>
<if test="amountTotal != null">amount_total,</if>
<if test="operateTimes != null">operate_times,</if>
<if test="fee != null">fee,</if>
<if test="tax != null">tax,</if>
<if test="other != null">other,</if>
<if test="userId != null">user_id,</if>
<if test="bz != null">bz,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="code != null and code != ''">#{code},</if>
<if test="name != null">#{name},</if>
<if test="startTradeDay != null">#{startTradeDay},</if>
<if test="endTradeDay != null">#{endTradeDay},</if>
<if test="totalProfit != null">#{totalProfit},</if>
<if test="totalDiff != null">#{totalDiff},</if>
<if test="startPrice != null">#{startPrice},</if>
<if test="endPrice != null">#{endPrice},</if>
<if test="volumnTotal != null">#{volumnTotal},</if>
<if test="amountTotal != null">#{amountTotal},</if>
<if test="operateTimes != null">#{operateTimes},</if>
<if test="fee != null">#{fee},</if>
<if test="tax != null">#{tax},</if>
<if test="other != null">#{other},</if>
<if test="userId != null">#{userId},</if>
<if test="bz != null">#{bz},</if>
</trim>
</insert>
<update id="updateStatisticsTotal" parameterType="StatisticsTotal">
update statistics_total
<trim prefix="SET" suffixOverrides=",">
<if test="code != null and code != ''">code = #{code},</if>
<if test="name != null">name = #{name},</if>
<if test="startTradeDay != null">start_trade_day = #{startTradeDay},</if>
<if test="endTradeDay != null">end_trade_day = #{endTradeDay},</if>
<if test="totalProfit != null">total_profit = #{totalProfit},</if>
<if test="totalDiff != null">total_diff = #{totalDiff},</if>
<if test="startPrice != null">start_price = #{startPrice},</if>
<if test="endPrice != null">end_price = #{endPrice},</if>
<if test="volumnTotal != null">volumn_total = #{volumnTotal},</if>
<if test="amountTotal != null">amount_total = #{amountTotal},</if>
<if test="operateTimes != null">operate_times = #{operateTimes},</if>
<if test="fee != null">fee = #{fee},</if>
<if test="tax != null">tax = #{tax},</if>
<if test="other != null">other = #{other},</if>
<if test="userId != null">user_id = #{userId},</if>
<if test="bz != null">bz = #{bz},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteStatisticsTotalById" parameterType="Long">
delete from statistics_total where id = #{id}
</delete>
<delete id="deleteStatisticsTotalByIds" parameterType="String">
delete from statistics_total where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

@ -1,147 +0,0 @@
erDiagram
stock_industry {
INT industry_id PK
TINYINT industry_level
VARCHAR(20) industry_code UK
VARCHAR(50) industry_name
VARCHAR(20) parent_code
}
stock_basic {
INT id PK
VARCHAR(10) code UK
VARCHAR(20) name
INT industry_id FK
DATE list_date
VARCHAR(10) market_type
TINYINT status
}
stock_financial {
INT id PK
VARCHAR(10) code FK
DATE period
DECIMAL net_profit_yoy
DECIMAL net_profit_qoq
DECIMAL roe
DECIMAL eps
DECIMAL net_profit
DECIMAL basic_eps
DECIMAL bps
DECIMAL total_assets
DECIMAL total_liabilities
DECIMAL operating_income
DATETIME create_time
}
stock_index {
INT id PK
VARCHAR(10) code
VARCHAR(20) name
DATE trade_date
DECIMAL open
DECIMAL close
DECIMAL high
DECIMAL low
DECIMAL change_rate
BIGINT volume
DECIMAL amount
DATETIME create_time
}
stocks {
INT id PK
VARCHAR(10) code FK
DATE trade_date
DECIMAL open
DECIMAL close
DECIMAL change_rate
INT trade_days
BIGINT volume
DECIMAL amount
DECIMAL change_rate_10
DECIMAL change_rate_20
DECIMAL change_rate_60
DECIMAL avg_volume_20
DECIMAL free_float_market_value
DECIMAL total_market_value
DECIMAL agencies_hold
DATETIME create_time
}
stock_trend {
INT id PK
VARCHAR(10) code FK
DATE trade_date
DECIMAL ma5
DECIMAL ma10
DECIMAL ma20
DECIMAL ma60
DECIMAL macd
DECIMAL kdj_k
DECIMAL kdj_d
DECIMAL kdj_j
DECIMAL rsi
DECIMAL volume_ratio
DECIMAL turnover_rate
DATETIME create_time
}
stock_limit {
INT id PK
VARCHAR(10) code FK
DATE trade_date
TINYINT limit_type
DECIMAL limit_price
DECIMAL open_price
DECIMAL close_price
BIGINT volume
DECIMAL amount
DATETIME create_time
}
stock_new_record {
INT id PK
VARCHAR(10) code FK
DATE trade_date
TINYINT record_type
DECIMAL price
INT days
DATETIME create_time
}
trade_dates {
INT id PK
DATE trade_date UK
TINYINT is_trading
SMALLINT year
TINYINT month
TINYINT day
TINYINT weekday
TINYINT is_weekend
TINYINT is_holiday
DATETIME create_time
}
industry_trend {
INT id PK
INT industry_id FK
DATE trade_date
DECIMAL avg_change_rate
INT up_stocks_count
INT down_stocks_count
INT flat_stocks_count
INT limit_up_count
INT limit_down_count
DECIMAL total_market_value
DECIMAL avg_turnover_rate
DATETIME create_time
}
stock_basic ||--o{ stock_industry : belongs_to
stock_financial ||--o{ stock_basic : belongs_to
stocks ||--o{ stock_basic : belongs_to
stock_trend ||--o{ stock_basic : belongs_to
stock_limit ||--o{ stock_basic : belongs_to
stock_new_record ||--o{ stock_basic : belongs_to
industry_trend ||--o{ stock_industry : belongs_to

@ -1,38 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>ruoyi</artifactId>
<groupId>com.ruoyi</groupId>
<version>3.8.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>newstock-system</artifactId>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<!-- 通用工具-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-system</artifactId>
</dependency>
<!-- 通用工具-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common</artifactId>
</dependency>
</dependencies>
</project>

@ -1,221 +0,0 @@
package com.ruoyi.newstocksystem.controller;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.newstocksystem.domain.NewStockBasic;
import com.ruoyi.newstocksystem.domain.NewStocks;
import com.ruoyi.newstocksystem.service.INewStockBasicService;
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.service.INewStocksService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
import org.springframework.web.multipart.MultipartFile;
/**
* Controller
*
* @author lxy
* @date 2026-01-18
*/
@RestController
@RequestMapping("/newstocksystem/newstocks")
public class NewStocksController extends BaseController
{
@Autowired
private INewStocksService newStocksService;
@Autowired
private INewStockBasicService newStockBasicService;
/**
*
*/
@GetMapping("/list")
public TableDataInfo list(NewStocks newStocks)
{
startPage();
List<NewStocks> list = newStocksService.selectNewStocksList(newStocks);
return getDataTable(list);
}
/**
*
*/
@GetMapping("/listB")
public TableDataInfo listB(NewStocks newStocks)
{
startPage();
List<NewStocks> list = newStocksService.selectNewStocksListB(newStocks);
return getDataTable(list);
}
/**
*
*/
@GetMapping("/listStrongStocks")
public TableDataInfo listStrongStocks(NewStocks newStocks)
{
startPage();
List<NewStocks> list = newStocksService.selectNewStrongStocksList(newStocks);
return getDataTable(list);
}
/**
*
*/
@GetMapping("/listLimitStocks")
public TableDataInfo listLimitStocks(NewStocks newStocks)
{
startPage();
List<NewStocks> list = newStocksService.selectNewLimitStocksList(newStocks);
return getDataTable(list);
}
/**
*
*/
@PostMapping("/export")
public void export(HttpServletResponse response, NewStocks newStocks)
{
List<NewStocks> list = newStocksService.selectNewStocksList(newStocks);
ExcelUtil<NewStocks> util = new ExcelUtil<NewStocks>(NewStocks.class);
util.exportExcel(response, list, "行情数据数据");
}
/**
*
*/
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Integer id)
{
return AjaxResult.success(newStocksService.selectNewStocksById(id));
}
/**
*
*/
@PostMapping
public AjaxResult add(@RequestBody NewStocks newStocks)
{
return toAjax(newStocksService.insertNewStocks(newStocks));
}
/**
*
*/
@PutMapping
public AjaxResult edit(@RequestBody NewStocks newStocks)
{
return toAjax(newStocksService.updateNewStocks(newStocks));
}
/**
*
*/
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Integer[] ids)
{
return toAjax(newStocksService.deleteNewStocksByIds(ids));
}
/**
*
*/
@PostMapping("/importData")
public AjaxResult importData(MultipartFile file, boolean updateSupport, String tradeDate)
{
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");//注意月份是MM
System.out.println(" tradeDay :" + tradeDate);
Date tradeDay1 = null;
try
{
tradeDay1 = simpleDateFormat.parse(tradeDate);
}catch (ParseException e) {
e.printStackTrace();
}
if(tradeDay1 == null)
{
return AjaxResult.success("tradeday error, import data failed");
}
ExcelUtil<NewStocks> util = new ExcelUtil<NewStocks>(NewStocks.class);
try
{
List<NewStocks> newStocksList = util.importExcel(file.getInputStream());
int successNum = newStocksService.importNewStocks(newStocksList, tradeDate);
return AjaxResult.success("导入成功 " + successNum + " 条数据");
}
catch (Exception e)
{
return AjaxResult.error("导入失败:" + e.getMessage());
}
}
/**
*
*/
@PostMapping("/analyze")
public AjaxResult analyze(@RequestBody NewStocks newStocks)
{
Object result = newStocksService.analyzeNewStocks(newStocks);
return AjaxResult.success(result);
}
/**
* ()
*/
@GetMapping("/stockQueryData")
public AjaxResult stockQueryData(String query)
{
NewStockBasic newStockBasic = new NewStockBasic();
if (StringUtils.isNotEmpty(query))
{
newStockBasic.setCode(query);
}
List<NewStockBasic> list = newStockBasicService.selectNewStockBasicList(newStockBasic);
return AjaxResult.success(list);
}
/**
* ()
*/
@GetMapping("/stockNameQueryData")
public AjaxResult stockNameQueryData(String query)
{
NewStockBasic newStockBasic = new NewStockBasic();
if (StringUtils.isNotEmpty(query))
{
newStockBasic.setName(query);
}
List<NewStockBasic> list = newStockBasicService.selectNewStockBasicList(newStockBasic);
return AjaxResult.success(list);
}
/**
*
*/
@GetMapping("/tradeDates")
public AjaxResult getTradeDates()
{
List<String> tradeDates = newStocksService.selectTradeDates();
return AjaxResult.success(tradeDates);
}
}

@ -1,109 +0,0 @@
package com.ruoyi.newstocksystem.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.domain.BaseEntity;
import java.util.Date;
/**
*
*
* @author lxy
* @date 2026-01-18
*/
public class NewStockBasic extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键ID */
private Integer id;
/** 股票代码 */
private String code;
/** 股票名称 */
private String name;
/** 所属行业ID */
private Integer industryId;
/** 首发上市日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
private Date listDate;
/** 市场类型SZ/SH */
private String marketType;
/** 状态1-正常0-暂停上市) */
private Integer status;
public void setId(Integer id)
{
this.id = id;
}
public Integer getId()
{
return id;
}
public void setCode(String code)
{
this.code = code;
}
public String getCode()
{
return code;
}
public void setName(String name)
{
this.name = name;
}
public String getName()
{
return name;
}
public void setIndustryId(Integer industryId)
{
this.industryId = industryId;
}
public Integer getIndustryId()
{
return industryId;
}
public void setListDate(Date listDate)
{
this.listDate = listDate;
}
public Date getListDate()
{
return listDate;
}
public void setMarketType(String marketType)
{
this.marketType = marketType;
}
public String getMarketType()
{
return marketType;
}
public void setStatus(Integer status)
{
this.status = status;
}
public Integer getStatus()
{
return status;
}
}

@ -1,79 +0,0 @@
package com.ruoyi.newstocksystem.domain;
import com.ruoyi.common.core.domain.BaseEntity;
/**
*
*
* @author lxy
* @date 2026-01-18
*/
public class NewStockIndustry extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 行业ID */
private Integer industryId;
/** 行业级别1-3 */
private Integer industryLevel;
/** 行业代码 */
private String industryCode;
/** 行业名称 */
private String industryName;
/** 父行业代码 */
private String parentCode;
public void setIndustryId(Integer industryId)
{
this.industryId = industryId;
}
public Integer getIndustryId()
{
return industryId;
}
public void setIndustryLevel(Integer industryLevel)
{
this.industryLevel = industryLevel;
}
public Integer getIndustryLevel()
{
return industryLevel;
}
public void setIndustryCode(String industryCode)
{
this.industryCode = industryCode;
}
public String getIndustryCode()
{
return industryCode;
}
public void setIndustryName(String industryName)
{
this.industryName = industryName;
}
public String getIndustryName()
{
return industryName;
}
public void setParentCode(String parentCode)
{
this.parentCode = parentCode;
}
public String getParentCode()
{
return parentCode;
}
}

@ -1,378 +0,0 @@
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;
import java.math.BigDecimal;
/**
*
*
* @author lxy
* @date 2026-01-18
*/
public class NewStocks extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键ID */
private Integer id;
/** 股票代码 */
@Excel(name = "证券代码", sort = 1, type = Excel.Type.ALL)
private String code;
/** 交易日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "交易日期", sort = 2, type = Excel.Type.ALL, dateFormat = "yyyy-MM-dd")
private Date tradeDate;
/** 开盘价 */
@Excel(name = "开盘价", sort = 3, type = Excel.Type.ALL)
private BigDecimal open;
/** 收盘价 */
@Excel(name = "收盘价", sort = 4, type = Excel.Type.ALL)
private BigDecimal close;
/** 当日涨跌幅 */
@Excel(name = "当日涨跌幅", sort = 5, type = Excel.Type.ALL)
private BigDecimal changeRate;
/** 可交易日数 */
@Excel(name = "可交易日数", sort = 6, type = Excel.Type.ALL)
private Integer tradeDays;
/** 成交量 */
@Excel(name = "成交量", sort = 7, type = Excel.Type.ALL)
private Long volume;
/** 成交额 */
@Excel(name = "成交额", sort = 8, type = Excel.Type.ALL)
private BigDecimal amount;
/** 10日区间涨跌幅 */
@Excel(name = "10日区间涨跌幅", sort = 9, type = Excel.Type.ALL)
private BigDecimal changeRate10;
/** 20日区间涨跌幅 */
@Excel(name = "20日区间涨跌幅", sort = 10, type = Excel.Type.ALL)
private BigDecimal changeRate20;
/** 60日区间涨跌幅 */
@Excel(name = "60日区间涨跌幅", sort = 11, type = Excel.Type.ALL)
private BigDecimal changeRate60;
/** 20日区间平均成交量 */
@Excel(name = "20日区间平均成交量", sort = 12, type = Excel.Type.ALL)
private BigDecimal avgVolume20;
/** 自由流通市值 */
@Excel(name = "自由流通市值", sort = 13, type = Excel.Type.ALL)
private BigDecimal freeFloatMarketValue;
/** 总市值 */
@Excel(name = "总市值", sort = 14, type = Excel.Type.ALL)
private BigDecimal totalMarketValue;
/** 机构持仓合计 */
@Excel(name = "机构持仓合计", sort = 15, type = Excel.Type.ALL)
private BigDecimal agenciesHold;
// 关联字段,非数据库字段
@Excel(name = "证券名称", sort = 16, type = Excel.Type.ALL)
private String name;
@Excel(name = "行业ID", sort = 17, type = Excel.Type.ALL)
private Integer industryId;
@Excel(name = "所属东财行业指数2级", sort = 18, type = Excel.Type.ALL)
private String industryName;
@Excel(name = "行业级别", sort = 19, type = Excel.Type.ALL)
private Integer industryLevel;
@Excel(name = "所属东财行业指数代码2级", sort = 20, type = Excel.Type.ALL)
private String industryCode;
@Excel(name = "父行业代码", sort = 21, type = Excel.Type.ALL)
private String parentCode;
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "上市日期", sort = 22, type = Excel.Type.ALL, dateFormat = "yyyy-MM-dd")
private Date listDate;
@Excel(name = "市场类型", sort = 23, type = Excel.Type.ALL)
private String marketType;
@Excel(name = "状态", sort = 24, type = Excel.Type.ALL)
private Integer status;
@Excel(name = "涨跌停类型", sort = 25, type = Excel.Type.ALL)
private Integer limitType;
@Excel(name = "涨跌停价格", sort = 26, type = Excel.Type.ALL)
private BigDecimal limitPrice;
public void setId(Integer id)
{
this.id = id;
}
public Integer getId()
{
return id;
}
public void setCode(String code)
{
this.code = code;
}
public String getCode()
{
return code;
}
public void setTradeDate(Date tradeDate)
{
this.tradeDate = tradeDate;
}
public Date getTradeDate()
{
return tradeDate;
}
public void setOpen(BigDecimal open)
{
this.open = open;
}
public BigDecimal getOpen()
{
return open;
}
public void setClose(BigDecimal close)
{
this.close = close;
}
public BigDecimal getClose()
{
return close;
}
public void setChangeRate(BigDecimal changeRate)
{
this.changeRate = changeRate;
}
public BigDecimal getChangeRate()
{
return changeRate;
}
public void setTradeDays(Integer tradeDays)
{
this.tradeDays = tradeDays;
}
public Integer getTradeDays()
{
return tradeDays;
}
public void setVolume(Long volume)
{
this.volume = volume;
}
public Long getVolume()
{
return volume;
}
public void setAmount(BigDecimal amount)
{
this.amount = amount;
}
public BigDecimal getAmount()
{
return amount;
}
public void setChangeRate10(BigDecimal changeRate10)
{
this.changeRate10 = changeRate10;
}
public BigDecimal getChangeRate10()
{
return changeRate10;
}
public void setChangeRate20(BigDecimal changeRate20)
{
this.changeRate20 = changeRate20;
}
public BigDecimal getChangeRate20()
{
return changeRate20;
}
public void setChangeRate60(BigDecimal changeRate60)
{
this.changeRate60 = changeRate60;
}
public BigDecimal getChangeRate60()
{
return changeRate60;
}
public void setAvgVolume20(BigDecimal avgVolume20)
{
this.avgVolume20 = avgVolume20;
}
public BigDecimal getAvgVolume20()
{
return avgVolume20;
}
public void setFreeFloatMarketValue(BigDecimal freeFloatMarketValue)
{
this.freeFloatMarketValue = freeFloatMarketValue;
}
public BigDecimal getFreeFloatMarketValue()
{
return freeFloatMarketValue;
}
public void setTotalMarketValue(BigDecimal totalMarketValue)
{
this.totalMarketValue = totalMarketValue;
}
public BigDecimal getTotalMarketValue()
{
return totalMarketValue;
}
public void setAgenciesHold(BigDecimal agenciesHold)
{
this.agenciesHold = agenciesHold;
}
public BigDecimal getAgenciesHold()
{
return agenciesHold;
}
public String getName()
{
return name;
}
public void setName(String name)
{
this.name = name;
}
public Integer getIndustryId()
{
return industryId;
}
public void setIndustryId(Integer industryId)
{
this.industryId = industryId;
}
public String getIndustryName()
{
return industryName;
}
public void setIndustryName(String industryName)
{
this.industryName = industryName;
}
public Integer getIndustryLevel()
{
return industryLevel;
}
public void setIndustryLevel(Integer industryLevel)
{
this.industryLevel = industryLevel;
}
public String getIndustryCode()
{
return industryCode;
}
public void setIndustryCode(String industryCode)
{
this.industryCode = industryCode;
}
public String getParentCode()
{
return parentCode;
}
public void setParentCode(String parentCode)
{
this.parentCode = parentCode;
}
public Date getListDate()
{
return listDate;
}
public void setListDate(Date listDate)
{
this.listDate = listDate;
}
public String getMarketType()
{
return marketType;
}
public void setMarketType(String marketType)
{
this.marketType = marketType;
}
public Integer getStatus()
{
return status;
}
public void setStatus(Integer status)
{
this.status = status;
}
public Integer getLimitType()
{
return limitType;
}
public void setLimitType(Integer limitType)
{
this.limitType = limitType;
}
public BigDecimal getLimitPrice()
{
return limitPrice;
}
public void setLimitPrice(BigDecimal limitPrice)
{
this.limitPrice = limitPrice;
}
}

@ -1,78 +0,0 @@
package com.ruoyi.newstocksystem.mapper;
import com.ruoyi.newstocksystem.domain.NewStockBasic;
import java.util.List;
/**
* Mapper
*
* @author lxy
* @date 2026-01-18
*/
public interface NewStockBasicMapper
{
/**
*
*
* @param id
* @return
*/
public NewStockBasic selectNewStockBasicById(Integer id);
/**
*
*
* @param code
* @return
*/
public NewStockBasic selectNewStockBasicByCode(String code);
/**
*
*
* @param newStockBasic
* @return
*/
public List<NewStockBasic> selectNewStockBasicList(NewStockBasic newStockBasic);
/**
*
*
* @param newStockBasic
* @return
*/
public int insertNewStockBasic(NewStockBasic newStockBasic);
/**
*
*
* @param newStockBasic
* @return
*/
public int updateNewStockBasic(NewStockBasic newStockBasic);
/**
*
*
* @param id
* @return
*/
public int deleteNewStockBasicById(Integer id);
/**
*
*
* @param ids
* @return
*/
public int deleteNewStockBasicByIds(Integer[] ids);
/**
*
*
* @param newStockBasicList
* @return
*/
public int batchInsertNewStockBasic(List<NewStockBasic> newStockBasicList);
}

@ -1,78 +0,0 @@
package com.ruoyi.newstocksystem.mapper;
import com.ruoyi.newstocksystem.domain.NewStockIndustry;
import java.util.List;
/**
* Mapper
*
* @author lxy
* @date 2026-01-18
*/
public interface NewStockIndustryMapper
{
/**
*
*
* @param industryId
* @return
*/
public NewStockIndustry selectNewStockIndustryById(Integer industryId);
/**
*
*
* @param industryCode
* @return
*/
public NewStockIndustry selectNewStockIndustryByCode(String industryCode);
/**
*
*
* @param newStockIndustry
* @return
*/
public List<NewStockIndustry> selectNewStockIndustryList(NewStockIndustry newStockIndustry);
/**
*
*
* @param newStockIndustry
* @return
*/
public int insertNewStockIndustry(NewStockIndustry newStockIndustry);
/**
*
*
* @param newStockIndustry
* @return
*/
public int updateNewStockIndustry(NewStockIndustry newStockIndustry);
/**
*
*
* @param industryId
* @return
*/
public int deleteNewStockIndustryById(Integer industryId);
/**
*
*
* @param industryIds
* @return
*/
public int deleteNewStockIndustryByIds(Integer[] industryIds);
/**
*
*
* @param newStockIndustryList
* @return
*/
public int batchInsertNewStockIndustry(List<NewStockIndustry> newStockIndustryList);
}

@ -1,110 +0,0 @@
package com.ruoyi.newstocksystem.mapper;
import com.ruoyi.newstocksystem.domain.NewStocks;
import java.util.List;
/**
* Mapper
*
* @author lxy
* @date 2026-01-18
*/
public interface NewStocksMapper
{
/**
*
*
* @param id
* @return
*/
public NewStocks selectNewStocksById(Integer id);
/**
*
*
* @param newStocks
* @return
*/
public List<NewStocks> selectNewStocksList(NewStocks newStocks);
/**
*
*
* @param newStocks
* @return
*/
public List<NewStocks> selectNewStocksListB(NewStocks newStocks);
/**
*
*
* @param newStocks
* @return
*/
public List<NewStocks> selectNewStrongStocksList(NewStocks newStocks);
/**
*
*
* @param newStocks
* @return
*/
public List<NewStocks> selectNewLimitStocksList(NewStocks newStocks);
/**
*
*
* @param newStocks
* @return
*/
public int insertNewStocks(NewStocks newStocks);
/**
*
*
* @param newStocksList
* @return
*/
public int batchInsertNewStocks(List<NewStocks> newStocksList);
/**
*
*
* @param newStocks
* @return
*/
public int updateNewStocks(NewStocks newStocks);
/**
*
*
* @param id
* @return
*/
public int deleteNewStocksById(Integer id);
/**
*
*
* @param ids
* @return
*/
public int deleteNewStocksByIds(Integer[] ids);
/**
*
*
* @param code
* @param tradeDate
* @return
*/
public NewStocks selectNewStocksByCodeAndDate(String code, String tradeDate);
/**
*
*
* @return
*/
public List<String> selectTradeDates();
}

@ -1,78 +0,0 @@
package com.ruoyi.newstocksystem.service;
import java.util.List;
import com.ruoyi.newstocksystem.domain.NewStockBasic;
/**
* Service
*
* @author lxy
* @date 2026-01-18
*/
public interface INewStockBasicService
{
/**
*
*
* @param id
* @return
*/
public NewStockBasic selectNewStockBasicById(Integer id);
/**
*
*
* @param code
* @return
*/
public NewStockBasic selectNewStockBasicByCode(String code);
/**
*
*
* @param newStockBasic
* @return
*/
public List<NewStockBasic> selectNewStockBasicList(NewStockBasic newStockBasic);
/**
*
*
* @param newStockBasic
* @return
*/
public int insertNewStockBasic(NewStockBasic newStockBasic);
/**
*
*
* @param newStockBasic
* @return
*/
public int updateNewStockBasic(NewStockBasic newStockBasic);
/**
*
*
* @param id
* @return
*/
public int deleteNewStockBasicById(Integer id);
/**
*
*
* @param ids
* @return
*/
public int deleteNewStockBasicByIds(Integer[] ids);
/**
*
*
* @param newStockBasicList
* @return
*/
public int batchInsertNewStockBasic(List<NewStockBasic> newStockBasicList);
}

@ -1,78 +0,0 @@
package com.ruoyi.newstocksystem.service;
import java.util.List;
import com.ruoyi.newstocksystem.domain.NewStockIndustry;
/**
* Service
*
* @author lxy
* @date 2026-01-18
*/
public interface INewStockIndustryService
{
/**
*
*
* @param industryId
* @return
*/
public NewStockIndustry selectNewStockIndustryById(Integer industryId);
/**
*
*
* @param industryCode
* @return
*/
public NewStockIndustry selectNewStockIndustryByCode(String industryCode);
/**
*
*
* @param newStockIndustry
* @return
*/
public List<NewStockIndustry> selectNewStockIndustryList(NewStockIndustry newStockIndustry);
/**
*
*
* @param newStockIndustry
* @return
*/
public int insertNewStockIndustry(NewStockIndustry newStockIndustry);
/**
*
*
* @param newStockIndustry
* @return
*/
public int updateNewStockIndustry(NewStockIndustry newStockIndustry);
/**
*
*
* @param industryId
* @return
*/
public int deleteNewStockIndustryById(Integer industryId);
/**
*
*
* @param industryIds
* @return
*/
public int deleteNewStockIndustryByIds(Integer[] industryIds);
/**
*
*
* @param newStockIndustryList
* @return
*/
public int batchInsertNewStockIndustry(List<NewStockIndustry> newStockIndustryList);
}

@ -1,118 +0,0 @@
package com.ruoyi.newstocksystem.service;
import java.util.List;
import com.ruoyi.newstocksystem.domain.NewStocks;
/**
* Service
*
* @author lxy
* @date 2026-01-18
*/
public interface INewStocksService
{
/**
*
*
* @param id
* @return
*/
public NewStocks selectNewStocksById(Integer id);
/**
*
*
* @param newStocks
* @return
*/
public List<NewStocks> selectNewStocksList(NewStocks newStocks);
/**
*
*
* @param newStocks
* @return
*/
public List<NewStocks> selectNewStocksListB(NewStocks newStocks);
/**
*
*
* @param newStocks
* @return
*/
public List<NewStocks> selectNewStrongStocksList(NewStocks newStocks);
/**
*
*
* @param newStocks
* @return
*/
public List<NewStocks> selectNewLimitStocksList(NewStocks newStocks);
/**
*
*
* @param newStocks
* @return
*/
public int insertNewStocks(NewStocks newStocks);
/**
*
*
* @param newStocksList
* @return
*/
public int batchInsertNewStocks(List<NewStocks> newStocksList);
/**
*
*
* @param newStocks
* @return
*/
public int updateNewStocks(NewStocks newStocks);
/**
*
*
* @param id
* @return
*/
public int deleteNewStocksById(Integer id);
/**
*
*
* @param ids
* @return
*/
public int deleteNewStocksByIds(Integer[] ids);
/**
*
*
* @param newStocksList
* @param tradeDate
* @return
*/
public int importNewStocks(List<NewStocks> newStocksList, String tradeDate);
/**
*
*
* @param newStocks
* @return
*/
public Object analyzeNewStocks(NewStocks newStocks);
/**
*
*
* @return
*/
public List<String> selectTradeDates();
}

@ -1,124 +0,0 @@
package com.ruoyi.newstocksystem.service.impl;
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.ruoyi.newstocksystem.domain.NewStockBasic;
import com.ruoyi.newstocksystem.service.INewStockBasicService;
import com.ruoyi.newstocksystem.mapper.NewStockBasicMapper;
/**
* Service
*
* @author lxy
* @date 2026-01-18
*/
@Service
public class NewStockBasicServiceImpl implements INewStockBasicService
{
@Autowired
private NewStockBasicMapper newStockBasicMapper;
@Override
public NewStockBasic selectNewStockBasicById(Integer id)
{
return newStockBasicMapper.selectNewStockBasicById(id);
}
@Override
public NewStockBasic selectNewStockBasicByCode(String code)
{
return newStockBasicMapper.selectNewStockBasicByCode(code);
}
@Override
public List<NewStockBasic> selectNewStockBasicList(NewStockBasic newStockBasic)
{
return newStockBasicMapper.selectNewStockBasicList(newStockBasic);
}
@Override
public int insertNewStockBasic(NewStockBasic newStockBasic)
{
return newStockBasicMapper.insertNewStockBasic(newStockBasic);
}
@Override
public int updateNewStockBasic(NewStockBasic newStockBasic)
{
return newStockBasicMapper.updateNewStockBasic(newStockBasic);
}
@Override
public int deleteNewStockBasicById(Integer id)
{
return newStockBasicMapper.deleteNewStockBasicById(id);
}
@Override
public int deleteNewStockBasicByIds(Integer[] ids)
{
return newStockBasicMapper.deleteNewStockBasicByIds(ids);
}
@Override
@Transactional
public int batchInsertNewStockBasic(List<NewStockBasic> newStockBasicList)
{
// 分离新增和更新的数据
List<NewStockBasic> insertList = new ArrayList<>();
List<NewStockBasic> updateList = new ArrayList<>();
for (NewStockBasic newStockBasic : newStockBasicList)
{
// 先查询是否已存在
NewStockBasic existing = newStockBasicMapper.selectNewStockBasicByCode(newStockBasic.getCode());
if (existing == null)
{
// 新增数据
insertList.add(newStockBasic);
}
else
{
// 更新数据
newStockBasic.setId(existing.getId());
updateList.add(newStockBasic);
}
}
int count = 0;
// 批量新增每1000条一批
if (!insertList.isEmpty())
{
int batchSize = 1000;
for (int i = 0; i < insertList.size(); i += batchSize)
{
int end = Math.min(i + batchSize, insertList.size());
List<NewStockBasic> batchList = insertList.subList(i, end);
count += newStockBasicMapper.batchInsertNewStockBasic(batchList);
}
}
// 批量更新每1000条一批
if (!updateList.isEmpty())
{
int batchSize = 1000;
for (int i = 0; i < updateList.size(); i += batchSize)
{
int end = Math.min(i + batchSize, updateList.size());
List<NewStockBasic> batchList = updateList.subList(i, end);
for (NewStockBasic newStockBasic : batchList)
{
count += newStockBasicMapper.updateNewStockBasic(newStockBasic);
}
}
}
return count;
}
}

@ -1,124 +0,0 @@
package com.ruoyi.newstocksystem.service.impl;
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.ruoyi.newstocksystem.domain.NewStockIndustry;
import com.ruoyi.newstocksystem.service.INewStockIndustryService;
import com.ruoyi.newstocksystem.mapper.NewStockIndustryMapper;
/**
* Service
*
* @author lxy
* @date 2026-01-18
*/
@Service
public class NewStockIndustryServiceImpl implements INewStockIndustryService
{
@Autowired
private NewStockIndustryMapper newStockIndustryMapper;
@Override
public NewStockIndustry selectNewStockIndustryById(Integer industryId)
{
return newStockIndustryMapper.selectNewStockIndustryById(industryId);
}
@Override
public NewStockIndustry selectNewStockIndustryByCode(String industryCode)
{
return newStockIndustryMapper.selectNewStockIndustryByCode(industryCode);
}
@Override
public List<NewStockIndustry> selectNewStockIndustryList(NewStockIndustry newStockIndustry)
{
return newStockIndustryMapper.selectNewStockIndustryList(newStockIndustry);
}
@Override
public int insertNewStockIndustry(NewStockIndustry newStockIndustry)
{
return newStockIndustryMapper.insertNewStockIndustry(newStockIndustry);
}
@Override
public int updateNewStockIndustry(NewStockIndustry newStockIndustry)
{
return newStockIndustryMapper.updateNewStockIndustry(newStockIndustry);
}
@Override
public int deleteNewStockIndustryById(Integer industryId)
{
return newStockIndustryMapper.deleteNewStockIndustryById(industryId);
}
@Override
public int deleteNewStockIndustryByIds(Integer[] industryIds)
{
return newStockIndustryMapper.deleteNewStockIndustryByIds(industryIds);
}
@Override
@Transactional
public int batchInsertNewStockIndustry(List<NewStockIndustry> newStockIndustryList)
{
// 分离新增和更新的数据
List<NewStockIndustry> insertList = new ArrayList<>();
List<NewStockIndustry> updateList = new ArrayList<>();
for (NewStockIndustry newStockIndustry : newStockIndustryList)
{
// 先查询是否已存在
NewStockIndustry existing = newStockIndustryMapper.selectNewStockIndustryByCode(newStockIndustry.getIndustryCode());
if (existing == null)
{
// 新增数据
insertList.add(newStockIndustry);
}
else
{
// 更新数据
newStockIndustry.setIndustryId(existing.getIndustryId());
updateList.add(newStockIndustry);
}
}
int count = 0;
// 批量新增每1000条一批
if (!insertList.isEmpty())
{
int batchSize = 1000;
for (int i = 0; i < insertList.size(); i += batchSize)
{
int end = Math.min(i + batchSize, insertList.size());
List<NewStockIndustry> batchList = insertList.subList(i, end);
count += newStockIndustryMapper.batchInsertNewStockIndustry(batchList);
}
}
// 批量更新每1000条一批
if (!updateList.isEmpty())
{
int batchSize = 1000;
for (int i = 0; i < updateList.size(); i += batchSize)
{
int end = Math.min(i + batchSize, updateList.size());
List<NewStockIndustry> batchList = updateList.subList(i, end);
for (NewStockIndustry industry : batchList)
{
count += newStockIndustryMapper.updateNewStockIndustry(industry);
}
}
}
return count;
}
}

@ -1,332 +0,0 @@
package com.ruoyi.newstocksystem.service.impl;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.newstocksystem.domain.NewStockBasic;
import com.ruoyi.newstocksystem.domain.NewStockIndustry;
import com.ruoyi.newstocksystem.domain.NewStocks;
import com.ruoyi.newstocksystem.service.INewStockBasicService;
import com.ruoyi.newstocksystem.service.INewStockIndustryService;
import com.ruoyi.newstocksystem.service.INewStocksService;
import com.ruoyi.newstocksystem.mapper.NewStocksMapper;
/**
* Service
*
* @author lxy
* @date 2026-01-18
*/
@Service
public class NewStocksServiceImpl implements INewStocksService
{
@Autowired
private NewStocksMapper newStocksMapper;
@Autowired
private INewStockBasicService newStockBasicService;
@Autowired
private INewStockIndustryService newStockIndustryService;
@Override
public NewStocks selectNewStocksById(Integer id)
{
return newStocksMapper.selectNewStocksById(id);
}
@Override
public List<NewStocks> selectNewStocksList(NewStocks newStocks)
{
return newStocksMapper.selectNewStocksList(newStocks);
}
@Override
public List<NewStocks> selectNewStocksListB(NewStocks newStocks)
{
return newStocksMapper.selectNewStocksListB(newStocks);
}
@Override
public List<NewStocks> selectNewStrongStocksList(NewStocks newStocks)
{
return newStocksMapper.selectNewStrongStocksList(newStocks);
}
@Override
public List<NewStocks> selectNewLimitStocksList(NewStocks newStocks)
{
return newStocksMapper.selectNewLimitStocksList(newStocks);
}
@Override
public int insertNewStocks(NewStocks newStocks)
{
return newStocksMapper.insertNewStocks(newStocks);
}
@Override
public int batchInsertNewStocks(List<NewStocks> newStocksList)
{
// 数据验证确保没有tradeDate为null的记录
List<NewStocks> validList = new ArrayList<>();
for (NewStocks stock : newStocksList)
{
if (stock.getTradeDate() != null && !StringUtils.isEmpty(stock.getCode()))
{
validList.add(stock);
}
}
if (validList.isEmpty())
{
return 0;
}
return newStocksMapper.batchInsertNewStocks(validList);
}
@Override
public int updateNewStocks(NewStocks newStocks)
{
return newStocksMapper.updateNewStocks(newStocks);
}
@Override
public int deleteNewStocksById(Integer id)
{
return newStocksMapper.deleteNewStocksById(id);
}
@Override
public int deleteNewStocksByIds(Integer[] ids)
{
return newStocksMapper.deleteNewStocksByIds(ids);
}
@Override
@Transactional
public int importNewStocks(List<NewStocks> newStocksList, String tradeDate)
{
int count = 0;
List<NewStockBasic> newStockBasicList = new ArrayList<>();
List<NewStockIndustry> newStockIndustryList = new ArrayList<>();
List<NewStockBasic> updateBasicList = new ArrayList<>();
List<NewStocks> validStocksList = new ArrayList<>();
// 一次性读取所有行业数据到内存中
List<NewStockIndustry> allIndustries = newStockIndustryService.selectNewStockIndustryList(new NewStockIndustry());
Map<Integer, NewStockIndustry> industryMap = new HashMap<>();
for (NewStockIndustry industry : allIndustries)
{
industryMap.put(industry.getIndustryId(), industry);
}
// 一次性读取所有基础数据到内存中
List<NewStockBasic> allBasics = newStockBasicService.selectNewStockBasicList(new NewStockBasic());
Map<String, NewStockBasic> basicMap = new HashMap<>();
for (NewStockBasic basic : allBasics)
{
basicMap.put(basic.getCode(), basic);
}
// 数据验证和处理
for (NewStocks newStocks : newStocksList)
{
// 如果传入了tradeDate参数则使用传入的日期
if (StringUtils.isNotEmpty(tradeDate))
{
newStocks.setTradeDate(DateUtils.parseDate(tradeDate));
}
// 验证tradeDate不为null
if (newStocks.getTradeDate() == null)
{
continue; // 跳过tradeDate为null的记录
}
// 验证code不为null或空
if (StringUtils.isEmpty(newStocks.getCode()))
{
continue; // 跳过code为空的记录
}
validStocksList.add(newStocks);
}
// 先处理行业数据
for (NewStocks newStocks : validStocksList)
{
// 检查行业数据是否存在(在内存中检查)
if (newStocks.getIndustryId() != null)
{
if (!industryMap.containsKey(newStocks.getIndustryId()))
{
// 不存在,创建新的行业数据
NewStockIndustry newStockIndustry = new NewStockIndustry();
newStockIndustry.setIndustryId(newStocks.getIndustryId());
newStockIndustry.setIndustryName(newStocks.getIndustryName());
newStockIndustry.setIndustryCode(newStocks.getIndustryCode());
newStockIndustry.setIndustryLevel(newStocks.getIndustryLevel());
newStockIndustry.setParentCode(newStocks.getParentCode());
newStockIndustryList.add(newStockIndustry);
// 更新内存中的行业数据映射
industryMap.put(newStocks.getIndustryId(), newStockIndustry);
}
}
}
// 批量新增行业数据每1000条一批
if (!newStockIndustryList.isEmpty())
{
int batchSize = 1000;
for (int i = 0; i < newStockIndustryList.size(); i += batchSize)
{
int end = Math.min(i + batchSize, newStockIndustryList.size());
List<NewStockIndustry> batchList = newStockIndustryList.subList(i, end);
newStockIndustryService.batchInsertNewStockIndustry(batchList);
}
}
// 处理基础数据
for (NewStocks newStocks : validStocksList)
{
// 检查基础数据是否存在(在内存中检查)
NewStockBasic existing = basicMap.get(newStocks.getCode());
if (existing == null)
{
// 不存在,创建新的基础数据
NewStockBasic newStockBasic = new NewStockBasic();
newStockBasic.setCode(newStocks.getCode());
newStockBasic.setName(newStocks.getName());
newStockBasic.setIndustryId(newStocks.getIndustryId());
newStockBasic.setMarketType(newStocks.getMarketType());
newStockBasic.setListDate(newStocks.getListDate());
newStockBasic.setStatus(newStocks.getStatus() != null ? newStocks.getStatus() : 1); // 默认为正常状态
newStockBasicList.add(newStockBasic);
// 更新内存中的基础数据映射
basicMap.put(newStocks.getCode(), newStockBasic);
}
else
{
// 存在并且只有name更改时才需要进行更新更新基础数据
if(!newStocks.getName().equals(existing.getName())) {
existing.setName(newStocks.getName());
existing.setIndustryId(newStocks.getIndustryId());
existing.setMarketType(newStocks.getMarketType());
existing.setListDate(newStocks.getListDate());
existing.setStatus(newStocks.getStatus() != null ? newStocks.getStatus() : 1);
updateBasicList.add(existing);
}
}
}
// 批量新增基础数据每1000条一批
if (!newStockBasicList.isEmpty())
{
int batchSize = 1000;
for (int i = 0; i < newStockBasicList.size(); i += batchSize)
{
int end = Math.min(i + batchSize, newStockBasicList.size());
List<NewStockBasic> batchList = newStockBasicList.subList(i, end);
newStockBasicService.batchInsertNewStockBasic(batchList);
}
}
// 批量更新基础数据每1000条一批
if (!updateBasicList.isEmpty())
{
int batchSize = 1000;
for (int i = 0; i < updateBasicList.size(); i += batchSize)
{
int end = Math.min(i + batchSize, updateBasicList.size());
List<NewStockBasic> batchList = updateBasicList.subList(i, end);
for (NewStockBasic basic : batchList)
{
newStockBasicService.updateNewStockBasic(basic);
}
}
}
// 批量新增行情数据每1000条一批
int batchSize = 1000;
for (int i = 0; i < validStocksList.size(); i += batchSize)
{
int end = Math.min(i + batchSize, validStocksList.size());
List<NewStocks> batchList = validStocksList.subList(i, end);
// 再次验证batchList中的记录
List<NewStocks> filteredBatchList = new ArrayList<>();
for (NewStocks stock : batchList)
{
if (stock.getTradeDate() != null && !StringUtils.isEmpty(stock.getCode()))
{
filteredBatchList.add(stock);
}
}
if (!filteredBatchList.isEmpty())
{
count += newStocksMapper.batchInsertNewStocks(filteredBatchList);
}
}
return count;
}
@Override
public Object analyzeNewStocks(NewStocks newStocks)
{
Map<String, Object> result = new HashMap<>();
// 查询行情数据列表
List<NewStocks> stocksList = newStocksMapper.selectNewStocksList(newStocks);
// 计算基本统计数据
if (!stocksList.isEmpty())
{
double avgChangeRate = 0;
double totalChangeRate = 0;
int upCount = 0;
int downCount = 0;
for (NewStocks stock : stocksList)
{
double changeRate = stock.getChangeRate() != null ? stock.getChangeRate().doubleValue() : 0;
totalChangeRate += changeRate;
if (changeRate > 0)
{
upCount++;
}
else if (changeRate < 0)
{
downCount++;
}
}
avgChangeRate = totalChangeRate / stocksList.size();
result.put("totalStocks", stocksList.size());
result.put("avgChangeRate", avgChangeRate);
result.put("upCount", upCount);
result.put("downCount", downCount);
result.put("flatCount", stocksList.size() - upCount - downCount);
result.put("upRatio", upCount * 100.0 / stocksList.size());
result.put("downRatio", downCount * 100.0 / stocksList.size());
}
result.put("stocksList", stocksList);
return result;
}
@Override
public List<String> selectTradeDates()
{
return newStocksMapper.selectTradeDates();
}
}

@ -1,132 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.newstocksystem.mapper.NewStockBasicMapper">
<resultMap type="com.ruoyi.newstocksystem.domain.NewStockBasic" id="NewStockBasicResult">
<id property="id" column="id" />
<result property="code" column="code" />
<result property="name" column="name" />
<result property="industryId" column="industry_id" />
<result property="industryName" column="industry_name" />
<result property="market" column="market" />
<result property="listDate" column="list_date" />
<result property="status" column="status" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectNewStockBasicVo">
select id, code, name, industry_id, industry_name, market, list_date, status, create_by, create_time, update_by, update_time, remark from new_stock_basic
</sql>
<select id="selectNewStockBasicById" parameterType="Integer" resultMap="NewStockBasicResult">
<include refid="selectNewStockBasicVo" />
where id = #{id}
</select>
<select id="selectNewStockBasicByCode" parameterType="String" resultMap="NewStockBasicResult">
<include refid="selectNewStockBasicVo" />
where code = #{code}
</select>
<select id="selectNewStockBasicList" parameterType="com.ruoyi.newstocksystem.domain.NewStockBasic" resultMap="NewStockBasicResult">
<include refid="selectNewStockBasicVo" />
<where>
<if test="code != null and code != ''">
and code = #{code}
</if>
<if test="name != null and name != ''">
and name like concat('%', #{name}, '%')
</if>
<if test="industryId != null">
and industry_id = #{industryId}
</if>
<if test="industryName != null and industryName != ''">
and industry_name like concat('%', #{industryName}, '%')
</if>
<if test="market != null and market != ''">
and market = #{market}
</if>
<if test="listDate != null and listDate != ''">
and list_date = #{listDate}
</if>
<if test="status != null">
and status = #{status}
</if>
</where>
</select>
<insert id="insertNewStockBasic" parameterType="com.ruoyi.newstocksystem.domain.NewStockBasic" useGeneratedKeys="true" keyProperty="id">
insert into new_stock_basic
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="code != null and code != ''">code,</if>
<if test="name != null and name != ''">name,</if>
<if test="industryId != null">industry_id,</if>
<if test="industryName != null and industryName != ''">industry_name,</if>
<if test="market != null and market != ''">market,</if>
<if test="listDate != null and listDate != ''">list_date,</if>
<if test="status != null">status,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null and updateBy != ''">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null and remark != ''">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="code != null and code != ''">#{code},</if>
<if test="name != null and name != ''">#{name},</if>
<if test="industryId != null">#{industryId},</if>
<if test="industryName != null and industryName != ''">#{industryName},</if>
<if test="market != null and market != ''">#{market},</if>
<if test="listDate != null and listDate != ''">#{listDate},</if>
<if test="status != null">#{status},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null and remark != ''">#{remark},</if>
</trim>
</insert>
<update id="updateNewStockBasic" parameterType="com.ruoyi.newstocksystem.domain.NewStockBasic">
update new_stock_basic
<trim prefix="set" suffixOverrides=",">
<if test="code != null and code != ''">code = #{code},</if>
<if test="name != null and name != ''">name = #{name},</if>
<if test="industryId != null">industry_id = #{industryId},</if>
<if test="industryName != null and industryName != ''">industry_name = #{industryName},</if>
<if test="market != null and market != ''">market = #{market},</if>
<if test="listDate != null and listDate != ''">list_date = #{listDate},</if>
<if test="status != null">status = #{status},</if>
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null and remark != ''">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteNewStockBasicById" parameterType="Integer">
delete from new_stock_basic where id = #{id}
</delete>
<delete id="deleteNewStockBasicByIds" parameterType="String">
delete from new_stock_basic where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<insert id="batchInsertNewStockBasic" parameterType="java.util.List">
insert into new_stock_basic(code, name, industry_id, industry_name, market, list_date, status, create_by, create_time, update_by, update_time, remark)
values
<foreach collection="list" item="item" separator=",">
(#{item.code}, #{item.name}, #{item.industryId}, #{item.industryName}, #{item.market}, #{item.listDate}, #{item.status}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime}, #{item.remark})
</foreach>
</insert>
</mapper>

@ -1,111 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.newstocksystem.mapper.NewStockIndustryMapper">
<resultMap type="com.ruoyi.newstocksystem.domain.NewStockIndustry" id="NewStockIndustryResult">
<id property="industryId" column="industry_id" />
<result property="industryCode" column="industry_code" />
<result property="industryName" column="industry_name" />
<result property="level" column="level" />
<result property="parentId" column="parent_id" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectNewStockIndustryVo">
select industry_id, industry_code, industry_name, level, parent_id, create_by, create_time, update_by, update_time, remark from new_stock_industry
</sql>
<select id="selectNewStockIndustryById" parameterType="Integer" resultMap="NewStockIndustryResult">
<include refid="selectNewStockIndustryVo" />
where industry_id = #{industryId}
</select>
<select id="selectNewStockIndustryByCode" parameterType="String" resultMap="NewStockIndustryResult">
<include refid="selectNewStockIndustryVo" />
where industry_code = #{industryCode}
</select>
<select id="selectNewStockIndustryList" parameterType="com.ruoyi.newstocksystem.domain.NewStockIndustry" resultMap="NewStockIndustryResult">
<include refid="selectNewStockIndustryVo" />
<where>
<if test="industryCode != null and industryCode != ''">
and industry_code = #{industryCode}
</if>
<if test="industryName != null and industryName != ''">
and industry_name like concat('%', #{industryName}, '%')
</if>
<if test="level != null">
and level = #{level}
</if>
<if test="parentId != null">
and parent_id = #{parentId}
</if>
</where>
</select>
<insert id="insertNewStockIndustry" parameterType="com.ruoyi.newstocksystem.domain.NewStockIndustry" useGeneratedKeys="true" keyProperty="industryId">
insert into new_stock_industry
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="industryCode != null and industryCode != ''">industry_code,</if>
<if test="industryName != null and industryName != ''">industry_name,</if>
<if test="level != null">level,</if>
<if test="parentId != null">parent_id,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null and updateBy != ''">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null and remark != ''">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="industryCode != null and industryCode != ''">#{industryCode},</if>
<if test="industryName != null and industryName != ''">#{industryName},</if>
<if test="level != null">#{level},</if>
<if test="parentId != null">#{parentId},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null and remark != ''">#{remark},</if>
</trim>
</insert>
<update id="updateNewStockIndustry" parameterType="com.ruoyi.newstocksystem.domain.NewStockIndustry">
update new_stock_industry
<trim prefix="set" suffixOverrides=",">
<if test="industryCode != null and industryCode != ''">industry_code = #{industryCode},</if>
<if test="industryName != null and industryName != ''">industry_name = #{industryName},</if>
<if test="level != null">level = #{level},</if>
<if test="parentId != null">parent_id = #{parentId},</if>
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null and remark != ''">remark = #{remark},</if>
</trim>
where industry_id = #{industryId}
</update>
<delete id="deleteNewStockIndustryById" parameterType="Integer">
delete from new_stock_industry where industry_id = #{industryId}
</delete>
<delete id="deleteNewStockIndustryByIds" parameterType="String">
delete from new_stock_industry where industry_id in
<foreach item="industryId" collection="array" open="(" separator="," close=")">
#{industryId}
</foreach>
</delete>
<insert id="batchInsertNewStockIndustry" parameterType="java.util.List">
insert into new_stock_industry(industry_code, industry_name, level, parent_id, create_by, create_time, update_by, update_time, remark)
values
<foreach collection="list" item="item" separator=",">
(#{item.industryCode}, #{item.industryName}, #{item.level}, #{item.parentId}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime}, #{item.remark})
</foreach>
</insert>
</mapper>

@ -1,202 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.newstocksystem.mapper.NewStocksMapper">
<resultMap type="com.ruoyi.newstocksystem.domain.NewStocks" id="NewStocksResult">
<id property="id" column="id" />
<result property="code" column="code" />
<result property="tradeDate" column="trade_date" />
<result property="open" column="open" />
<result property="close" column="close" />
<result property="changeRate" column="change_rate" />
<result property="tradeDays" column="trade_days" />
<result property="volume" column="volume" />
<result property="amount" column="amount" />
<result property="changeRate10" column="change_rate_10" />
<result property="changeRate20" column="change_rate_20" />
<result property="changeRate60" column="change_rate_60" />
<result property="avgVolume20" column="avg_volume_20" />
<result property="freeFloatMarketValue" column="free_float_market_value" />
<result property="totalMarketValue" column="total_market_value" />
<result property="agenciesHold" column="agencies_hold" />
<result property="name" column="name" />
<result property="industryId" column="industry_id" />
<result property="industryName" column="industry_name" />
</resultMap>
<sql id="selectNewStocksVo">
select id, code, trade_date, open, close, change_rate, trade_days, volume, amount, change_rate_10, change_rate_20, change_rate_60, avg_volume_20, free_float_market_value, total_market_value, agencies_hold from new_stocks
</sql>
<select id="selectNewStocksById" parameterType="Integer" resultMap="NewStocksResult">
<include refid="selectNewStocksVo" />
where id = #{id}
</select>
<select id="selectNewStocksList" parameterType="com.ruoyi.newstocksystem.domain.NewStocks" resultMap="NewStocksResult">
<include refid="selectNewStocksVo" />
<where>
<if test="code != null and code != ''">
and code = #{code}
</if>
<if test="tradeDate != null">
and trade_date = #{tradeDate}
</if>
<if test="changeRate != null">
and change_rate = #{changeRate}
</if>
</where>
order by trade_date desc, code
</select>
<select id="selectNewStocksListB" parameterType="com.ruoyi.newstocksystem.domain.NewStocks" resultMap="NewStocksResult">
select s.id, s.code, s.trade_date, s.open, s.close, s.change_rate, s.trade_days, s.volume, s.amount, s.change_rate_10, s.change_rate_20, s.change_rate_60, s.avg_volume_20, s.free_float_market_value, s.total_market_value, s.agencies_hold, b.name, b.industry_id, i.industry_name
from new_stocks s
left join new_stock_basic b on s.code = b.code
left join new_stock_industry i on b.industry_id = i.industry_id
<where>
<if test="code != null and code != ''">
and s.code = #{code}
</if>
<if test="tradeDate != null and tradeDate != ''">
and s.trade_date = #{tradeDate}
</if>
<if test="changeRate != null">
and s.change_rate = #{changeRate}
</if>
<if test="name != null and name != ''">
and b.name like concat('%', #{name}, '%')
</if>
<if test="industryName != null and industryName != ''">
and i.industry_name like concat('%', #{industryName}, '%')
</if>
</where>
order by s.trade_date desc, s.code
</select>
<select id="selectNewStrongStocksList" parameterType="com.ruoyi.newstocksystem.domain.NewStocks" resultMap="NewStocksResult">
select s.id, s.code, s.trade_date, s.open, s.close, s.change_rate, s.trade_days, s.volume, s.amount, s.change_rate_10, s.change_rate_20, s.change_rate_60, s.avg_volume_20, s.free_float_market_value, s.total_market_value, s.agencies_hold, b.name, b.industry_id, i.industry_name
from new_stocks s
left join new_stock_basic b on s.code = b.code
left join new_stock_industry i on b.industry_id = i.industry_id
<where>
<if test="tradeDate != null and tradeDate != ''">
and s.trade_date = #{tradeDate}
</if>
<if test="industryName != null and industryName != ''">
and i.industry_name like concat('%', #{industryName}, '%')
</if>
</where>
order by s.change_rate_20 desc, s.change_rate_10 desc
limit 100
</select>
<select id="selectNewLimitStocksList" parameterType="com.ruoyi.newstocksystem.domain.NewStocks" resultMap="NewStocksResult">
select s.id, s.code, s.trade_date, s.open, s.close, s.change_rate, s.trade_days, s.volume, s.amount, s.change_rate_10, s.change_rate_20, s.change_rate_60, s.avg_volume_20, s.free_float_market_value, s.total_market_value, s.agencies_hold, b.name, b.industry_id, i.industry_name
from new_stocks s
left join new_stock_basic b on s.code = b.code
left join new_stock_industry i on b.industry_id = i.industry_id
<where>
<if test="tradeDate != null and tradeDate != ''">
and s.trade_date = #{tradeDate}
</if>
<if test="industryName != null and industryName != ''">
and i.industry_name like concat('%', #{industryName}, '%')
</if>
and s.change_rate &gt;= 9.8
</where>
order by s.change_rate desc
</select>
<insert id="insertNewStocks" parameterType="com.ruoyi.newstocksystem.domain.NewStocks" useGeneratedKeys="true" keyProperty="id">
insert into new_stocks
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="code != null and code != ''">code,</if>
<if test="tradeDate != null and tradeDate != ''">trade_date,</if>
<if test="open != null">open,</if>
<if test="close != null">close,</if>
<if test="changeRate != null">change_rate,</if>
<if test="tradeDays != null">trade_days,</if>
<if test="volume != null">volume,</if>
<if test="amount != null">amount,</if>
<if test="changeRate10 != null">change_rate_10,</if>
<if test="changeRate20 != null">change_rate_20,</if>
<if test="changeRate60 != null">change_rate_60,</if>
<if test="avgVolume20 != null">avg_volume_20,</if>
<if test="freeFloatMarketValue != null">free_float_market_value,</if>
<if test="totalMarketValue != null">total_market_value,</if>
<if test="agenciesHold != null">agencies_hold,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="code != null and code != ''">#{code},</if>
<if test="tradeDate != null and tradeDate != ''">#{tradeDate},</if>
<if test="open != null">#{open},</if>
<if test="close != null">#{close},</if>
<if test="changeRate != null">#{changeRate},</if>
<if test="tradeDays != null">#{tradeDays},</if>
<if test="volume != null">#{volume},</if>
<if test="amount != null">#{amount},</if>
<if test="changeRate10 != null">#{changeRate10},</if>
<if test="changeRate20 != null">#{changeRate20},</if>
<if test="changeRate60 != null">#{changeRate60},</if>
<if test="avgVolume20 != null">#{avgVolume20},</if>
<if test="freeFloatMarketValue != null">#{freeFloatMarketValue},</if>
<if test="totalMarketValue != null">#{totalMarketValue},</if>
<if test="agenciesHold != null">#{agenciesHold},</if>
</trim>
</insert>
<insert id="batchInsertNewStocks" parameterType="java.util.List">
insert into new_stocks(
code, trade_date, open, close, change_rate, trade_days, volume, amount, change_rate_10, change_rate_20, change_rate_60, avg_volume_20, free_float_market_value, total_market_value, agencies_hold
) values
<foreach collection="list" item="item" separator=",">
(
#{item.code}, #{item.tradeDate}, #{item.open}, #{item.close}, #{item.changeRate}, #{item.tradeDays}, #{item.volume}, #{item.amount}, #{item.changeRate10}, #{item.changeRate20}, #{item.changeRate60}, #{item.avgVolume20}, #{item.freeFloatMarketValue}, #{item.totalMarketValue}, #{item.agenciesHold}
)
</foreach>
</insert>
<update id="updateNewStocks" parameterType="com.ruoyi.newstocksystem.domain.NewStocks">
update new_stocks
<trim prefix="set" suffixOverrides=",">
<if test="code != null and code != ''">code = #{code},</if>
<if test="tradeDate != null and tradeDate != ''">trade_date = #{tradeDate},</if>
<if test="open != null">open = #{open},</if>
<if test="close != null">close = #{close},</if>
<if test="changeRate != null">change_rate = #{changeRate},</if>
<if test="tradeDays != null">trade_days = #{tradeDays},</if>
<if test="volume != null">volume = #{volume},</if>
<if test="amount != null">amount = #{amount},</if>
<if test="changeRate10 != null">change_rate_10 = #{changeRate10},</if>
<if test="changeRate20 != null">change_rate_20 = #{changeRate20},</if>
<if test="changeRate60 != null">change_rate_60 = #{changeRate60},</if>
<if test="avgVolume20 != null">avg_volume_20 = #{avgVolume20},</if>
<if test="freeFloatMarketValue != null">free_float_market_value = #{freeFloatMarketValue},</if>
<if test="totalMarketValue != null">total_market_value = #{totalMarketValue},</if>
<if test="agenciesHold != null">agencies_hold = #{agenciesHold},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteNewStocksById" parameterType="Integer">
delete from new_stocks where id = #{id}
</delete>
<delete id="deleteNewStocksByIds" parameterType="String">
delete from new_stocks where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="selectNewStocksByCodeAndDate" resultMap="NewStocksResult">
<include refid="selectNewStocksVo" />
where code = #{code} and trade_date = #{tradeDate}
</select>
<select id="selectTradeDates" resultType="String">
select distinct trade_date from new_stocks order by trade_date desc
</select>
</mapper>

@ -1,6 +0,0 @@
股票代码,股票名称,行业ID,行业名称,行业级别,行业代码,父行业代码,首发上市日期,市场类型,状态,交易日期,开盘价,收盘价,涨跌停类型,涨跌停价格,当日涨跌幅,可交易日数,成交量,成交额,10日区间涨跌幅,20日区间涨跌幅,60日区间涨跌幅,20日区间平均成交量,自由流通市值,总市值,机构持仓合计
600000,浦发银行,1,银行,1,BK0475,0,1999-11-10,SH,1,2026-01-18,8.50,8.65,0,0,1.76,240,12500000,108125000,5.20,8.75,15.30,11000000,280000000000,320000000000,25.50
600519,贵州茅台,2,白酒,1,BK0477,0,2001-08-27,SH,1,2026-01-18,1850.00,1880.50,1,1880.50,1.65,240,25000,47012500,4.80,7.20,12.50,22000,2400000000000,2600000000000,45.80
000001,平安银行,1,银行,1,BK0475,0,1991-04-03,SZ,1,2026-01-18,12.80,13.05,0,0,1.92,240,8500000,110925000,6.10,9.30,18.70,7800000,350000000000,380000000000,30.20
000858,五粮液,2,白酒,1,BK0477,0,1998-04-27,SZ,1,2026-01-18,168.50,172.20,1,172.20,2.20,240,1500000,258300000,5.50,8.10,14.20,1350000,850000000000,920000000000,38.50
601318,中国平安,3,保险,1,BK0474,0,2007-03-01,SH,1,2026-01-18,48.20,49.50,-1,49.50,2.71,240,3200000,158400000,7.30,10.50,20.10,2900000,420000000000,480000000000,32.80

Binary file not shown.

@ -218,12 +218,6 @@
<version>${ruoyi.version}</version> <version>${ruoyi.version}</version>
</dependency> </dependency>
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>newstock-system</artifactId>
<version>${ruoyi.version}</version>
</dependency>
</dependencies> </dependencies>
</dependencyManagement> </dependencyManagement>
@ -235,7 +229,6 @@
<module>ruoyi-generator</module> <module>ruoyi-generator</module>
<module>ruoyi-common</module> <module>ruoyi-common</module>
<module>stock-system</module> <module>stock-system</module>
<module>newstock-system</module>
<module>book-system</module> <module>book-system</module>
</modules> </modules>
<packaging>pom</packaging> <packaging>pom</packaging>

@ -67,11 +67,6 @@
<artifactId>stock-system</artifactId> <artifactId>stock-system</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>newstock-system</artifactId>
</dependency>
<dependency> <dependency>
<groupId>com.ruoyi</groupId> <groupId>com.ruoyi</groupId>
<artifactId>book-system</artifactId> <artifactId>book-system</artifactId>

@ -6,8 +6,7 @@ spring:
druid: druid:
# 主库数据源 # 主库数据源
master: master:
# url: jdbc:mysql://localhost:3306/ry?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 url: jdbc:mysql://localhost:3306/ry?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
url: jdbc:mysql://192.168.0.222:3306/ry_refactor0118?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root username: root
password: 1qazse42W3 password: 1qazse42W3
# 从库数据源 # 从库数据源

@ -37,11 +37,7 @@ server:
logging: logging:
level: level:
com.ruoyi: debug com.ruoyi: debug
# org.springframework: warn org.springframework: warn
# 打印RequestMapping映射详情
org.springframework.web.servlet.mvc.method.annotation: TRACE
# 简化版也可只开启web模块的DEBUG
org.springframework.web: DEBUG
# Spring配置 # Spring配置
spring: spring:
@ -65,14 +61,10 @@ spring:
enabled: true enabled: true
# redis 配置 # redis 配置
redis: redis:
# # 地址
# host: localhost
# # 端口默认为6379
# port: 6379
# 地址 # 地址
host: 192.168.0.222 host: localhost
# 端口默认为6379 # 端口默认为6379
port: 6380 port: 6379
# 数据库索引 # 数据库索引
database: 0 database: 0
# 密码 # 密码
@ -83,7 +75,7 @@ spring:
pool: pool:
# 连接池中的最小空闲连接 # 连接池中的最小空闲连接
min-idle: 0 min-idle: 0
# 连接池中的最大空闲连接yi # 连接池中的最大空闲连接
max-idle: 8 max-idle: 8
# 连接池的最大数据库连接数 # 连接池的最大数据库连接数
max-active: 8 max-active: 8

@ -280,32 +280,18 @@ public class ExcelUtil<T>
} }
else else
{ {
// 增强的模糊匹配逻辑 //再进行模糊匹配,模糊匹配再失败了,才是真的失败了
String attrName = attr.name(); //或者在注解里添加模糊匹配规则
String normalizedAttrName = normalizeString(attrName); // attr 为java中的注解
// 遍历所有表头,寻找最佳匹配
for (Map.Entry<String, Integer> entry : cellMap.entrySet()) for (Map.Entry<String, Integer> entry : cellMap.entrySet())
{ {
String name = entry.getKey(); String name = entry.getKey();
if (name != null) String attrName = attr.name();
if(name.contains(attrName))
{ {
String normalizedName = normalizeString(name); column = cellMap.get(name);
fieldsMap.put(column, objects);
// 检查表头是否包含注解名称(大小写不敏感,去除空格和特殊字符) break;
if (normalizedName.contains(normalizedAttrName))
{
column = entry.getValue();
fieldsMap.put(column, objects);
break;
}
// 检查注解名称是否包含表头(双向匹配)
else if (normalizedAttrName.contains(normalizedName))
{
column = entry.getValue();
fieldsMap.put(column, objects);
break;
}
} }
} }
} }
@ -1205,7 +1191,7 @@ public class ExcelUtil<T>
if (field.isAnnotationPresent(Excel.class)) if (field.isAnnotationPresent(Excel.class))
{ {
Excel attr = field.getAnnotation(Excel.class); Excel attr = field.getAnnotation(Excel.class);
if (attr != null && (attr.type() == Type.ALL || (type != null && attr.type() == type))) if (attr != null && (attr.type() == Type.ALL || attr.type() == type))
{ {
field.setAccessible(true); field.setAccessible(true);
fields.add(new Object[] { field, attr }); fields.add(new Object[] { field, attr });
@ -1219,7 +1205,7 @@ public class ExcelUtil<T>
Excel[] excels = attrs.value(); Excel[] excels = attrs.value();
for (Excel attr : excels) for (Excel attr : excels)
{ {
if (attr != null && (attr.type() == Type.ALL || (type != null && attr.type() == type))) if (attr != null && (attr.type() == Type.ALL || attr.type() == type))
{ {
field.setAccessible(true); field.setAccessible(true);
fields.add(new Object[] { field, attr }); fields.add(new Object[] { field, attr });
@ -1244,26 +1230,6 @@ public class ExcelUtil<T>
return (short) (maxHeight * 20); return (short) (maxHeight * 20);
} }
/**
*
* @param str
* @return
*/
private String normalizeString(String str)
{
if (str == null)
{
return "";
}
// 转换为小写
str = str.toLowerCase();
// 去除空格
str = str.replaceAll("\\s+", "");
// 去除特殊字符(使用更安全的正则表达式)
str = str.replaceAll("[^a-zA-Z0-9\\u4e00-\\u9fa5]", "");
return str;
}
/** /**
* 簿 * 簿
*/ */

@ -1,44 +0,0 @@
import request from '@/utils/request'
// 查询交易账户列表
export function listAccount(query) {
return request({
url: '/booksystem/account/list',
method: 'get',
params: query
})
}
// 查询交易账户详细
export function getAccount(id) {
return request({
url: '/booksystem/account/' + id,
method: 'get'
})
}
// 新增交易账户
export function addAccount(data) {
return request({
url: '/booksystem/account',
method: 'post',
data: data
})
}
// 修改交易账户
export function updateAccount(data) {
return request({
url: '/booksystem/account',
method: 'put',
data: data
})
}
// 删除交易账户
export function delAccount(id) {
return request({
url: '/booksystem/account/' + id,
method: 'delete'
})
}

@ -1,44 +0,0 @@
import request from '@/utils/request'
// 查询当日操作列表
export function listOperations(query) {
return request({
url: '/booksystem/operations/list',
method: 'get',
params: query
})
}
// 查询当日操作详细
export function getOperations(id) {
return request({
url: '/booksystem/operations/' + id,
method: 'get'
})
}
// 新增当日操作
export function addOperations(data) {
return request({
url: '/booksystem/operations',
method: 'post',
data: data
})
}
// 修改当日操作
export function updateOperations(data) {
return request({
url: '/booksystem/operations',
method: 'put',
data: data
})
}
// 删除当日操作
export function delOperations(id) {
return request({
url: '/booksystem/operations/' + id,
method: 'delete'
})
}

@ -1,44 +0,0 @@
import request from '@/utils/request'
// 查询当日持仓统计列表
export function listStatisticremain(query) {
return request({
url: '/booksystem/statisticremain/list',
method: 'get',
params: query
})
}
// 查询当日持仓统计详细
export function getStatisticremain(id) {
return request({
url: '/booksystem/statisticremain/' + id,
method: 'get'
})
}
// 新增当日持仓统计
export function addStatisticremain(data) {
return request({
url: '/booksystem/statisticremain',
method: 'post',
data: data
})
}
// 修改当日持仓统计
export function updateStatisticremain(data) {
return request({
url: '/booksystem/statisticremain',
method: 'put',
data: data
})
}
// 删除当日持仓统计
export function delStatisticremain(id) {
return request({
url: '/booksystem/statisticremain/' + id,
method: 'delete'
})
}

@ -1,44 +0,0 @@
import request from '@/utils/request'
// 查询单笔操作统计列表
export function listStatistics(query) {
return request({
url: '/booksystem/statistics/list',
method: 'get',
params: query
})
}
// 查询单笔操作统计详细
export function getStatistics(id) {
return request({
url: '/booksystem/statistics/' + id,
method: 'get'
})
}
// 新增单笔操作统计
export function addStatistics(data) {
return request({
url: '/booksystem/statistics',
method: 'post',
data: data
})
}
// 修改单笔操作统计
export function updateStatistics(data) {
return request({
url: '/booksystem/statistics',
method: 'put',
data: data
})
}
// 删除单笔操作统计
export function delStatistics(id) {
return request({
url: '/booksystem/statistics/' + id,
method: 'delete'
})
}

@ -1,44 +0,0 @@
import request from '@/utils/request'
// 查询统计当日持仓列表
export function listStatistictotal(query) {
return request({
url: '/booksystem/statistictotal/list',
method: 'get',
params: query
})
}
// 查询统计当日持仓详细
export function getStatistictotal(id) {
return request({
url: '/booksystem/statistictotal/' + id,
method: 'get'
})
}
// 新增统计当日持仓
export function addStatistictotal(data) {
return request({
url: '/booksystem/statistictotal',
method: 'post',
data: data
})
}
// 修改统计当日持仓
export function updateStatistictotal(data) {
return request({
url: '/booksystem/statistictotal',
method: 'put',
data: data
})
}
// 删除统计当日持仓
export function delStatistictotal(id) {
return request({
url: '/booksystem/statistictotal/' + id,
method: 'delete'
})
}

@ -1,128 +0,0 @@
import request from '@/utils/request'
// 导出API
export default {
// 查询行情数据列表
listNewStocks(query) {
return request({
url: '/newstocksystem/newstocks/list',
method: 'get',
params: query
})
},
// 查询行情数据列表含基础数据
listNewStocksB(query) {
return request({
url: '/newstocksystem/newstocks/listB',
method: 'get',
params: query
})
},
// 查询强势股列表
listNewStrongStocks(query) {
return request({
url: '/newstocksystem/newstocks/listStrongStocks',
method: 'get',
params: query
})
},
// 查询涨停股列表
listNewLimitStocks(query) {
return request({
url: '/newstocksystem/newstocks/listLimitStocks',
method: 'get',
params: query
})
},
// 获取行情数据详细信息
getNewStocks(id) {
return request({
url: `/newstocksystem/newstocks/${id}`,
method: 'get'
})
},
// 新增行情数据
addNewStocks(data) {
return request({
url: '/newstocksystem/newstocks',
method: 'post',
data: data
})
},
// 修改行情数据
updateNewStocks(data) {
return request({
url: '/newstocksystem/newstocks',
method: 'put',
data: data
})
},
// 删除行情数据
deleteNewStocks(ids) {
return request({
url: `/newstocksystem/newstocks/${ids}`,
method: 'delete'
})
},
// 导出行情数据
exportNewStocks(query) {
return request({
url: '/newstocksystem/newstocks/export',
method: 'post',
params: query,
responseType: 'blob'
})
},
// 导入行情数据
importNewStocks(data) {
return request({
url: '/newstocksystem/newstocks/importData',
method: 'post',
data: data
})
},
// 分析行情数据
analyzeNewStocks(data) {
return request({
url: '/newstocksystem/newstocks/analyze',
method: 'post',
data: data
})
},
// 获取联想的数据(股票代码)
stockQueryData(query) {
return request({
url: '/newstocksystem/newstocks/stockQueryData',
method: 'get',
params: { query }
})
},
// 获取联想的数据(股票名称)
stockNameQueryData(query) {
return request({
url: '/newstocksystem/newstocks/stockNameQueryData',
method: 'get',
params: { query }
})
},
// 获取交易日期列表
getTradeDates() {
return request({
url: '/newstocksystem/newstocks/tradeDates',
method: 'get'
})
}
}

@ -1,306 +0,0 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="交易日期" prop="tradeDay">
<el-date-picker clearable size="small"
v-model="queryParams.tradeDay"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择交易日期">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['booksystem:account:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['booksystem:account:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['booksystem:account:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['booksystem:account:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="accountList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="交易日期" align="center" prop="tradeDay" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.tradeDay, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="星期" align="center" prop="weekDay" width="180" />
<el-table-column label="净资产" align="center" prop="assets" />
<el-table-column label="总资产" align="center" prop="totalAssets" />
<el-table-column label="当日盈亏" align="center" prop="profit" />
<el-table-column label="当日净资产盈亏比例" align="center" prop="assetsDiff" />
<el-table-column label="当日总资产盈亏比例" align="center" prop="totalDiff" />
<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">-->
<!-- <template slot-scope="scope">-->
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-edit"-->
<!-- @click="handleUpdate(scope.row)"-->
<!-- v-hasPermi="['booksystem:account:edit']"-->
<!-- >修改</el-button>-->
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-delete"-->
<!-- @click="handleDelete(scope.row)"-->
<!-- v-hasPermi="['booksystem:account:remove']"-->
<!-- >删除</el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改交易账户对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="交易日期" prop="tradeDay">
<el-date-picker clearable size="small"
@change="handleChange"
v-model="form.tradeDay"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择交易日期">
</el-date-picker>
</el-form-item>
<el-form-item label="净资产" prop="assets">
<el-input v-model="form.assets" placeholder="请输入净资产" />
</el-form-item>
<el-form-item label="总资产" prop="totalAssets">
<el-input v-model="form.totalAssets" placeholder="请输入总资产" />
</el-form-item>
<el-form-item label="当日盈亏" prop="profit">
<el-input v-model="form.profit" placeholder="请输入当日盈亏" />
</el-form-item>
<el-form-item label="当日净资产盈亏比例" prop="assetsDiff">
<el-input v-model="form.assetsDiff" placeholder="请输入当日净资产盈亏比例" />
</el-form-item>
<el-form-item label="当日总资产盈亏比例" prop="totalDiff">
<el-input v-model="form.totalDiff" placeholder="请输入当日总资产盈亏比例" />
</el-form-item>
<el-form-item label="用户id" prop="userId">
<el-input v-model="form.userId" placeholder="请输入用户id" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listAccount, getAccount, delAccount, addAccount, updateAccount } from "@/api/booksystem/account";
export default {
name: "Account",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
accountList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
tradeDay: null,
weekDay: null,
assets: null,
totalAssets: null,
profit: null,
assetsDiff: null,
totalDiff: null,
userId: null
},
//
form: {},
//
rules: {
},
//
weekOptions :['周日','周一', '周二', '周三', '周四', '周五', '周六'],
checkedWeek: [],
};
},
created() {
this.getList();
},
methods: {
/** 查询交易账户列表 */
getList() {
this.loading = true;
listAccount(this.queryParams).then(response => {
this.accountList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
tradeDay: null,
weekDay: null,
assets: null,
totalAssets: null,
profit: null,
assetsDiff: null,
totalDiff: null,
userId: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加交易账户";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getAccount(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改交易账户";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateAccount(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addAccount(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除交易账户编号为"' + ids + '"的数据项?').then(function() {
return delAccount(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('booksystem/account/export', {
...this.queryParams
}, `account_${new Date().getTime()}.xlsx`)
},
handleChange(value)
{
let currentDate = new Date(this.queryParams.tradeDay);
const getWeek = currentDate.getDay();
const weekArr=['周日','周一', '周二', '周三', '周四', '周五', '周六']
if(!value) return
let week = weekArr[getWeek]
this.form.weekDay = week;
console.log(' to handleDateChange week is: ',week)
},
}
};
</script>

@ -1,435 +0,0 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="股票代码" prop="code">
<el-input
v-model="queryParams.code"
placeholder="请输入股票代码"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="股票名称" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入股票名称"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="交易日期" prop="tradeDay">
<el-date-picker clearable size="small"
v-model="queryParams.tradeDay"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择交易日期">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['booksystem:operations:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['booksystem:operations:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['booksystem:operations:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['booksystem:operations:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="operationsList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="股票代码" align="center" prop="code" />
<el-table-column label="股票名称" align="center" prop="name" />
<el-table-column label="交易日期" align="center" prop="tradeDay" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.tradeDay, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="星期" align="center" prop="weekDay" width="180"/>
<el-table-column label="操作" align="center" prop="operate" />
<el-table-column label="交易价格" align="center" prop="dealPrice" />
<el-table-column label="成交量" align="center" prop="volumn" />
<el-table-column label="成交额" align="center" prop="amount" />
<el-table-column label="印花税" align="center" prop="tax" />
<el-table-column label="手续费" align="center" prop="fee" />
<el-table-column label="其他费用" align="center" prop="other" />
<el-table-column label="操作时涨跌" align="center" prop="operateDiff" />
<el-table-column label="关联操作id" align="center" prop="preId" />
<el-table-column label="操作逻辑" align="center" prop="dealLogic" />
<el-table-column label="备注" align="center" prop="bz" />
<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">-->
<!-- <template slot-scope="scope">-->
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-edit"-->
<!-- @click="handleUpdate(scope.row)"-->
<!-- v-hasPermi="['booksystem:operations:edit']"-->
<!-- >修改</el-button>-->
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-delete"-->
<!-- @click="handleDelete(scope.row)"-->
<!-- v-hasPermi="['booksystem:operations:remove']"-->
<!-- >删除</el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改当日操作对话框 -->
<el-dialog :title="title" :visible.sync="open" width="70%" append-to-body :before-close="handleClose">
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-row>
<el-col span="8">
<el-form-item label="股票代码" prop="code">
<el-input v-model="form.code" placeholder="请输入股票代码" />
</el-form-item>
</el-col>
<el-col span="8">
<el-form-item label="股票名称" prop="name">
<el-input v-model="form.name" placeholder="请输入股票名称" />
</el-form-item>
</el-col>
<el-col span="8">
<el-form-item label="交易日期" prop="tradeDay">
<el-date-picker clearable size="small"
@change="handleChange"
v-model="form.tradeDay"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择交易日期">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col span="8">
<el-form-item label="操作" prop="operate">
<el-select v-model="form.operate" placeholder="请输入操作">
<el-option
v-for="item in operate_options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col span="8">
<el-form-item label="交易价格" prop="dealPrice">
<el-input v-model="form.dealPrice" placeholder="请输入交易价格" />
</el-form-item>
</el-col>
<el-col span="8">
<el-form-item label="成交量" prop="volumn">
<el-input v-model="form.volumn" placeholder="请输入成交量" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col span="8">
<el-form-item label="成交额" prop="amount">
<el-input v-model="form.amount" placeholder="请输入成交额" />
</el-form-item>
</el-col>
<el-col span="8">
<el-form-item label="印花税" prop="tax">
<el-input v-model="form.tax" placeholder="请输入印花税" />
</el-form-item>
</el-col>
<el-col span="8">
<el-form-item label="手续费" prop="fee">
<el-input v-model="form.fee" placeholder="请输入手续费" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col span="8">
<el-form-item label="其他费用" prop="other">
<el-input v-model="form.other" placeholder="请输入其他费用" />
</el-form-item>
</el-col>
<el-col span="8">
<el-form-item label="操作时涨跌" prop="operateDiff">
<el-input v-model="form.operateDiff" placeholder="请输入操作时涨跌" />
</el-form-item>
</el-col>
<el-col span="8">
<el-form-item label="关联操作id" prop="preId">
<el-input v-model="form.preId" placeholder="请输入关联操作id" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col span="24">
<el-form-item label="操作逻辑" prop="dealLogic">
<el-input v-model="form.dealLogic" type="textarea" placeholder="请输入内容" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col span="24">
<el-form-item label="备注" prop="bz">
<el-input v-model="form.bz" type="textarea" placeholder="请输入内容" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listOperations, getOperations, delOperations, addOperations, updateOperations } from "@/api/booksystem/operations";
export default {
name: "Operations",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
operationsList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
code: null,
name: null,
tradeDay: null,
weekDay: null,
operate: null,
dealPrice: null,
volumn: null,
amount: null,
tax: null,
fee: null,
other: null,
operateDiff: null,
preId: null,
userId: null,
dealLogic: null,
bz: null
},
//
form: {},
//
rules: {
code: [
{ required: true, message: "股票代码不能为空", trigger: "blur" }
],
operate: [
{ required: true, message: "操作不能为空", trigger: "blur" }
],
},
//
operate_options: [{
value: '买入',
label: '买入'
}, {
value: '卖出',
label: '卖出'
}],
};
},
created() {
this.getList();
},
methods: {
/** 查询当日操作列表 */
getList() {
this.loading = true;
listOperations(this.queryParams).then(response => {
this.operationsList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
code: null,
name: null,
tradeDay: null,
weekDay: null,
operate: null,
dealPrice: null,
volumn: null,
amount: null,
tax: null,
fee: null,
other: null,
operateDiff: null,
preId: null,
userId: null,
dealLogic: null,
bz: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加当日操作";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getOperations(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改当日操作";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateOperations(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addOperations(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除当日操作编号为"' + ids + '"的数据项?').then(function() {
return delOperations(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('booksystem/operations/export', {
...this.queryParams
}, `operations_${new Date().getTime()}.xlsx`)
},
//
handleChange(value)
{
let currentDate = new Date(this.queryParams.tradeDay);
const getWeek = currentDate.getDay();
const weekArr=['周日','周一', '周二', '周三', '周四', '周五', '周六']
if(!value) return
let week = weekArr[getWeek]
this.form.weekDay = week;
console.log(' to handleDateChange week is: ',week)
},
//
handleClose(done) {
this.$confirm('确认退出添加操作吗?')
.then(_ => {
done();
})
.catch(_ => {});
}
}
};
</script>

@ -1,332 +0,0 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="股票代码" prop="code">
<el-input
v-model="queryParams.code"
placeholder="请输入股票代码"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="股票名称" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入股票名称"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="交易日期" prop="tradeDay">
<el-date-picker clearable size="small"
v-model="queryParams.tradeDay"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择交易日期">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['booksystem:statisticremain:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['booksystem:statisticremain:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['booksystem:statisticremain:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['booksystem:statisticremain:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="statisticremainList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="股票代码" align="center" prop="code" />
<el-table-column label="股票名称" align="center" prop="name" />
<el-table-column label="交易日期" align="center" prop="tradeDay" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.tradeDay, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="星期" align="center" prop="weekDay" />
<el-table-column label="总盈亏" align="center" prop="totalProfit" />
<el-table-column label="总盈亏比例" align="center" prop="totalDiff" />
<el-table-column label="总盈亏占整体盈亏比例" align="center" prop="totalDiffOverall" />
<el-table-column label="剩余数量" align="center" prop="remaining" />
<el-table-column label="备注" align="center" prop="bz" />
<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">-->
<!-- <template slot-scope="scope">-->
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-edit"-->
<!-- @click="handleUpdate(scope.row)"-->
<!-- v-hasPermi="['booksystem:statisticremain:edit']"-->
<!-- >修改</el-button>-->
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-delete"-->
<!-- @click="handleDelete(scope.row)"-->
<!-- v-hasPermi="['booksystem:statisticremain:remove']"-->
<!-- >删除</el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改当日持仓统计对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="股票代码" prop="code">
<el-input v-model="form.code" placeholder="请输入股票代码" />
</el-form-item>
<el-form-item label="股票名称" prop="name">
<el-input v-model="form.name" placeholder="请输入股票名称" />
</el-form-item>
<el-form-item label="交易日期" prop="tradeDay">
<el-date-picker clearable size="small"
v-model="form.tradeDay"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择交易日期">
</el-date-picker>
</el-form-item>
<el-form-item label="交易日星期" prop="weekDay">
<el-date-picker clearable size="small"
v-model="form.weekDay"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择交易日星期">
</el-date-picker>
</el-form-item>
<el-form-item label="总盈亏" prop="totalProfit">
<el-input v-model="form.totalProfit" placeholder="请输入总盈亏" />
</el-form-item>
<el-form-item label="总盈亏比例" prop="totalDiff">
<el-input v-model="form.totalDiff" placeholder="请输入总盈亏比例" />
</el-form-item>
<el-form-item label="总盈亏占整体盈亏比例" prop="totalDiffOverall">
<el-input v-model="form.totalDiffOverall" placeholder="请输入总盈亏占整体盈亏比例" />
</el-form-item>
<el-form-item label="剩余数量" prop="remaining">
<el-input v-model="form.remaining" placeholder="请输入剩余数量" />
</el-form-item>
<el-form-item label="用户id" prop="userId">
<el-input v-model="form.userId" placeholder="请输入用户id" />
</el-form-item>
<el-form-item label="备注" prop="bz">
<el-input v-model="form.bz" type="textarea" placeholder="请输入内容" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listStatisticremain, getStatisticremain, delStatisticremain, addStatisticremain, updateStatisticremain } from "@/api/booksystem/statisticremain";
export default {
name: "Statisticremain",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
statisticremainList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
code: null,
name: null,
tradeDay: null,
weekDay: null,
totalProfit: null,
totalDiff: null,
totalDiffOverall: null,
remaining: null,
userId: null,
bz: null
},
//
form: {},
//
rules: {
code: [
{ required: true, message: "股票代码不能为空", trigger: "blur" }
],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询当日持仓统计列表 */
getList() {
this.loading = true;
listStatisticremain(this.queryParams).then(response => {
this.statisticremainList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
code: null,
name: null,
tradeDay: null,
weekDay: null,
totalProfit: null,
totalDiff: null,
totalDiffOverall: null,
remaining: null,
userId: null,
bz: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加当日持仓统计";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getStatisticremain(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改当日持仓统计";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateStatisticremain(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addStatisticremain(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除当日持仓统计编号为"' + ids + '"的数据项?').then(function() {
return delStatisticremain(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('booksystem/statisticremain/export', {
...this.queryParams
}, `statisticremain_${new Date().getTime()}.xlsx`)
}
}
};
</script>

@ -1,317 +0,0 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="股票代码" prop="code">
<el-input
v-model="queryParams.code"
placeholder="请输入股票代码"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="股票名称" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入股票名称"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="交易日期" prop="tradeDay">
<el-date-picker clearable size="small"
v-model="queryParams.tradeDay"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择交易日期">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['booksystem:statistics:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['booksystem:statistics:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['booksystem:statistics:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['booksystem:statistics:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="statisticsList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="股票代码" align="center" prop="code" />
<el-table-column label="股票名称" align="center" prop="name" />
<el-table-column label="交易日期" align="center" prop="tradeDay" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.tradeDay, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="星期" align="center" prop="weekDay" />
<el-table-column label="操作id" align="center" prop="operationsId" />
<el-table-column label="当笔当日盈亏" align="center" prop="profit" />
<el-table-column label="当笔当日盈亏盈亏比例" align="center" prop="diff" />
<el-table-column label="操作id" align="center" prop="operateionId" />
<el-table-column label="备注" align="center" prop="bz" />
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改单笔操作统计对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="股票代码" prop="code">
<el-input v-model="form.code" placeholder="请输入股票代码" />
</el-form-item>
<el-form-item label="股票名称" prop="name">
<el-input v-model="form.name" placeholder="请输入股票名称" />
</el-form-item>
<el-form-item label="交易日期" prop="tradeDay">
<el-date-picker clearable size="small"
v-model="form.tradeDay"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择交易日期">
</el-date-picker>
</el-form-item>
<el-form-item label="交易日星期" prop="weekDay">
<el-date-picker clearable size="small"
v-model="form.weekDay"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择交易日星期">
</el-date-picker>
</el-form-item>
<el-form-item label="操作id" prop="operationsId">
<el-input v-model="form.operationsId" placeholder="请输入操作id" />
</el-form-item>
<el-form-item label="当笔当日盈亏" prop="profit">
<el-input v-model="form.profit" placeholder="请输入当笔当日盈亏" />
</el-form-item>
<el-form-item label="当笔当日盈亏盈亏比例" prop="diff">
<el-input v-model="form.diff" placeholder="请输入当笔当日盈亏盈亏比例" />
</el-form-item>
<el-form-item label="操作id" prop="operateionId">
<el-input v-model="form.operateionId" placeholder="请输入操作id" />
</el-form-item>
<el-form-item label="用户id" prop="userId">
<el-input v-model="form.userId" placeholder="请输入用户id" />
</el-form-item>
<el-form-item label="备注" prop="bz">
<el-input v-model="form.bz" type="textarea" placeholder="请输入内容" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listStatistics, getStatistics, delStatistics, addStatistics, updateStatistics } from "@/api/booksystem/statistics";
export default {
name: "Statistics",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
statisticsList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
code: null,
name: null,
tradeDay: null,
weekDay: null,
operationsId: null,
profit: null,
diff: null,
operateionId: null,
userId: null,
bz: null
},
//
form: {},
//
rules: {
code: [
{ required: true, message: "股票代码不能为空", trigger: "blur" }
],
operationsId: [
{ required: true, message: "操作id不能为空", trigger: "blur" }
],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询单笔操作统计列表 */
getList() {
this.loading = true;
listStatistics(this.queryParams).then(response => {
this.statisticsList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
code: null,
name: null,
tradeDay: null,
weekDay: null,
operationsId: null,
profit: null,
diff: null,
operateionId: null,
userId: null,
bz: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加单笔操作统计";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getStatistics(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改单笔操作统计";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateStatistics(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addStatistics(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除单笔操作统计编号为"' + ids + '"的数据项?').then(function() {
return delStatistics(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('booksystem/statistics/export', {
...this.queryParams
}, `statistics_${new Date().getTime()}.xlsx`)
}
}
};
</script>

@ -1,380 +0,0 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="股票代码" prop="code">
<el-input
v-model="queryParams.code"
placeholder="请输入股票代码"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="股票名称" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入股票名称"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="建仓交易日期" prop="startTradeDay">
<el-date-picker clearable size="small"
v-model="queryParams.startTradeDay"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择建仓交易日期">
</el-date-picker>
</el-form-item>
<el-form-item label="清仓交易日星期" prop="endTradeDay">
<el-date-picker clearable size="small"
v-model="queryParams.endTradeDay"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择清仓交易日星期">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['booksystem:statistictotal:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['booksystem:statistictotal:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['booksystem:statistictotal:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['booksystem:statistictotal:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="statistictotalList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="股票代码" align="center" prop="code" />
<el-table-column label="股票名称" align="center" prop="name" />
<el-table-column label="建仓交易日期" align="center" prop="startTradeDay" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.startTradeDay, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="清仓交易日星期" align="center" prop="endTradeDay" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.endTradeDay, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="总盈亏" align="center" prop="totalProfit" />
<el-table-column label="总盈亏比例" align="center" prop="totalDiff" />
<el-table-column label="建仓交易价格" align="center" prop="startPrice" />
<el-table-column label="建仓交易价格" align="center" prop="endPrice" />
<el-table-column label="总成交量" align="center" prop="volumnTotal" />
<el-table-column label="总成交额" align="center" prop="amountTotal" />
<el-table-column label="交易次数" align="center" prop="operateTimes" />
<el-table-column label="总手续费" align="center" prop="fee" />
<el-table-column label="总印花税" align="center" prop="tax" />
<el-table-column label="总其他费用" align="center" prop="other" />
<el-table-column label="备注" align="center" prop="bz" />
<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">-->
<!-- <template slot-scope="scope">-->
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-edit"-->
<!-- @click="handleUpdate(scope.row)"-->
<!-- v-hasPermi="['booksystem:statistictotal:edit']"-->
<!-- >修改</el-button>-->
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-delete"-->
<!-- @click="handleDelete(scope.row)"-->
<!-- v-hasPermi="['booksystem:statistictotal:remove']"-->
<!-- >删除</el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改统计当日持仓对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="股票代码" prop="code">
<el-input v-model="form.code" placeholder="请输入股票代码" />
</el-form-item>
<el-form-item label="股票名称" prop="name">
<el-input v-model="form.name" placeholder="请输入股票名称" />
</el-form-item>
<el-form-item label="建仓交易日期" prop="startTradeDay">
<el-date-picker clearable size="small"
v-model="form.startTradeDay"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择建仓交易日期">
</el-date-picker>
</el-form-item>
<el-form-item label="清仓交易日星期" prop="endTradeDay">
<el-date-picker clearable size="small"
v-model="form.endTradeDay"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择清仓交易日星期">
</el-date-picker>
</el-form-item>
<el-form-item label="总盈亏" prop="totalProfit">
<el-input v-model="form.totalProfit" placeholder="请输入总盈亏" />
</el-form-item>
<el-form-item label="总盈亏比例" prop="totalDiff">
<el-input v-model="form.totalDiff" placeholder="请输入总盈亏比例" />
</el-form-item>
<el-form-item label="建仓交易价格" prop="startPrice">
<el-input v-model="form.startPrice" placeholder="请输入建仓交易价格" />
</el-form-item>
<el-form-item label="建仓交易价格" prop="endPrice">
<el-input v-model="form.endPrice" placeholder="请输入建仓交易价格" />
</el-form-item>
<el-form-item label="总成交量" prop="volumnTotal">
<el-input v-model="form.volumnTotal" placeholder="请输入总成交量" />
</el-form-item>
<el-form-item label="总成交额" prop="amountTotal">
<el-input v-model="form.amountTotal" placeholder="请输入总成交额" />
</el-form-item>
<el-form-item label="交易次数" prop="operateTimes">
<el-input v-model="form.operateTimes" placeholder="请输入交易次数" />
</el-form-item>
<el-form-item label="总手续费" prop="fee">
<el-input v-model="form.fee" placeholder="请输入总手续费" />
</el-form-item>
<el-form-item label="总印花税" prop="tax">
<el-input v-model="form.tax" placeholder="请输入总印花税" />
</el-form-item>
<el-form-item label="总其他费用" prop="other">
<el-input v-model="form.other" placeholder="请输入总其他费用" />
</el-form-item>
<el-form-item label="用户id" prop="userId">
<el-input v-model="form.userId" placeholder="请输入用户id" />
</el-form-item>
<el-form-item label="备注" prop="bz">
<el-input v-model="form.bz" type="textarea" placeholder="请输入内容" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listStatistictotal, getStatistictotal, delStatistictotal, addStatistictotal, updateStatistictotal } from "@/api/booksystem/statistictotal";
export default {
name: "Statistictotal",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
statistictotalList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
code: null,
name: null,
startTradeDay: null,
endTradeDay: null,
totalProfit: null,
totalDiff: null,
startPrice: null,
endPrice: null,
volumnTotal: null,
amountTotal: null,
operateTimes: null,
fee: null,
tax: null,
other: null,
userId: null,
bz: null
},
//
form: {},
//
rules: {
code: [
{ required: true, message: "股票代码不能为空", trigger: "blur" }
],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询统计当日持仓列表 */
getList() {
this.loading = true;
listStatistictotal(this.queryParams).then(response => {
this.statistictotalList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
code: null,
name: null,
startTradeDay: null,
endTradeDay: null,
totalProfit: null,
totalDiff: null,
startPrice: null,
endPrice: null,
volumnTotal: null,
amountTotal: null,
operateTimes: null,
fee: null,
tax: null,
other: null,
userId: null,
bz: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加统计当日持仓";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getStatistictotal(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改统计当日持仓";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateStatistictotal(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addStatistictotal(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除统计当日持仓编号为"' + ids + '"的数据项?').then(function() {
return delStatistictotal(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('booksystem/statistictotal/export', {
...this.queryParams
}, `statistictotal_${new Date().getTime()}.xlsx`)
}
}
};
</script>

@ -1,532 +0,0 @@
<template>
<div class="app-container">
<!-- 搜索条件 -->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="股票代码" prop="code">
<el-input
v-model="queryParams.code"
placeholder="请输入股票代码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="股票名称" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入股票名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="交易日期" prop="tradeDate">
<el-date-picker
v-model="queryParams.tradeDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择交易日期"
clearable
/>
</el-form-item>
<el-form-item label="涨跌幅" prop="changeRate">
<el-input
v-model="queryParams.changeRate"
placeholder="请输入涨跌幅"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
<el-button type="warning" icon="el-icon-upload2" size="mini" @click="handleImport"></el-button>
<el-button type="info" icon="el-icon-s-operation" size="mini" @click="handleAnalyze"></el-button>
</el-form-item>
</el-form>
<!-- 工具栏 -->
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['newstocksystem:newstocks:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['newstocksystem:newstocks:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['newstocksystem:newstocks:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="info"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['newstocksystem:newstocks:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<!-- 数据列表 -->
<el-table
v-loading="loading"
:data="stocksList"
@selection-change="handleSelectionChange"
border
fit
highlight-current-row
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="股票代码" align="center" prop="code" />
<el-table-column label="股票名称" align="center" prop="name" />
<el-table-column label="交易日期" align="center" prop="tradeDate" width="120" />
<el-table-column label="开盘价" align="center" prop="open" />
<el-table-column label="收盘价" align="center" prop="close" />
<el-table-column label="涨跌幅" align="center" prop="changeRate" />
<el-table-column label="成交量" align="center" prop="volume" />
<el-table-column label="成交额" align="center" prop="amount" />
<el-table-column label="总市值" align="center" prop="totalMarketValue" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['newstocksystem:newstocks:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['newstocksystem:newstocks:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 导入对话框 -->
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px">
<el-upload
ref="upload"
:limit="1"
accept=".xlsx, .xls"
:headers="{ Authorization: getToken() }"
:action="upload.url"
:data="upload.data"
:auto-upload="false"
:on-change="handleFileChange"
:on-success="handleSuccess"
:on-error="handleError"
drag
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip text-center" slot="tip">
<el-checkbox v-model="upload.updateSupport"></el-checkbox>
</div>
</el-upload>
<el-form :model="upload" style="margin-top: 15px;">
<el-form-item label="交易日期" prop="tradeDate">
<el-date-picker
v-model="upload.tradeDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择交易日期"
style="width: 100%;"
/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFileForm"></el-button>
<el-button @click="upload.open = false">取消</el-button>
</div>
</el-dialog>
<!-- 分析结果对话框 -->
<el-dialog :title="'分析结果'" :visible.sync="analyzeDialogVisible" width="800px">
<el-form :model="analyzeResult" label-width="120px">
<el-form-item label="总股票数">
<el-input v-model="analyzeResult.totalStocks" disabled />
</el-form-item>
<el-form-item label="平均涨跌幅">
<el-input v-model="analyzeResult.avgChangeRate" disabled />
</el-form-item>
<el-form-item label="上涨股票数">
<el-input v-model="analyzeResult.upCount" disabled />
</el-form-item>
<el-form-item label="下跌股票数">
<el-input v-model="analyzeResult.downCount" disabled />
</el-form-item>
<el-form-item label="平盘股票数">
<el-input v-model="analyzeResult.flatCount" disabled />
</el-form-item>
<el-form-item label="上涨比例">
<el-input v-model="analyzeResult.upRatio" disabled />
</el-form-item>
<el-form-item label="下跌比例">
<el-input v-model="analyzeResult.downRatio" disabled />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="analyzeDialogVisible = false">关闭</el-button>
</div>
</el-dialog>
<!-- 新增/修改对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px">
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="股票代码" prop="code">
<el-input v-model="form.code" placeholder="请输入股票代码" />
</el-form-item>
<el-form-item label="股票名称" prop="name">
<el-input v-model="form.name" placeholder="请输入股票名称" />
</el-form-item>
<el-form-item label="交易日期" prop="tradeDate">
<el-date-picker
v-model="form.tradeDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择交易日期"
/>
</el-form-item>
<el-form-item label="开盘价" prop="open">
<el-input v-model="form.open" placeholder="请输入开盘价" />
</el-form-item>
<el-form-item label="收盘价" prop="close">
<el-input v-model="form.close" placeholder="请输入收盘价" />
</el-form-item>
<el-form-item label="涨跌幅" prop="changeRate">
<el-input v-model="form.changeRate" placeholder="请输入涨跌幅" />
</el-form-item>
<el-form-item label="成交量" prop="volume">
<el-input v-model="form.volume" placeholder="请输入成交量" />
</el-form-item>
<el-form-item label="成交额" prop="amount">
<el-input v-model="form.amount" placeholder="请输入成交额" />
</el-form-item>
<el-form-item label="总市值" prop="totalMarketValue">
<el-input v-model="form.totalMarketValue" placeholder="请输入总市值" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"></el-button>
<el-button @click="open = false">取消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { getToken } from '@/utils/auth'
import { parseTime } from '@/utils/ruoyi'
import request from '@/utils/request'
import newstocksApi from '@/api/newstocksystem/newstocks'
export default {
name: 'NewStocks',
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
stocksList: [],
//
title: '',
//
open: false,
//
analyzeDialogVisible: false,
//
analyzeResult: {},
//
queryParams: {
pageNum: 1,
pageSize: 10,
code: null,
name: null,
tradeDate: new Date(),
changeRate: null
},
//
form: {},
//
rules: {
code: [
{ required: true, message: '股票代码不能为空', trigger: 'blur' }
],
name: [
{ required: true, message: '股票名称不能为空', trigger: 'blur' }
],
tradeDate: [
{ required: true, message: '交易日期不能为空', trigger: 'blur' }
],
close: [
{ required: true, message: '收盘价不能为空', trigger: 'blur' }
]
},
//
upload: {
//
open: false,
//
title: '',
//
updateSupport: 0,
//
tradeDate: new Date(),
//
url: '/newstocksystem/newstocks/importData'
},
//
fileList: []
}
},
created() {
this.getList()
},
methods: {
/** 获取token */
getToken() {
return getToken()
},
/** 消息提示 */
msgSuccess(message) {
this.$message({ showClose: true, message: message, type: "success" })
},
/** 错误提示 */
msgError(message) {
this.$message({ showClose: true, message: message, type: "error" })
},
/** 下载文件 */
download(fileName) {
window.location.href = process.env.VUE_APP_BASE_API + "/common/download?fileName=" + encodeURI(fileName) + "&delete=" + true
},
/** 查询行情数据列表 */
getList() {
this.loading = true
newstocksApi.listNewStocksB(this.queryParams).then(response => {
this.stocksList = response.rows
this.total = response.total
this.loading = false
})
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm('queryForm')
this.handleQuery()
},
//
cancel() {
this.open = false
this.resetForm()
},
//
resetForm(formName) {
if (this.$refs[formName]) {
this.$refs[formName].resetFields()
}
this.form = {}
},
/** 新增按钮操作 */
handleAdd() {
this.resetForm()
this.open = true
this.title = '新增行情数据'
},
/** 修改按钮操作 */
handleUpdate(row) {
this.resetForm()
const id = row.id || this.ids
newstocksApi.getNewStocks(id).then(response => {
this.form = response.data
this.open = true
this.title = '修改行情数据'
})
},
/** 提交按钮 */
submitForm() {
this.$refs['form'].validate(valid => {
if (valid) {
if (this.form.id != null) {
newstocksApi.updateNewStocks(this.form).then(response => {
if (response.code === 200) {
this.msgSuccess('修改成功')
this.open = false
this.getList()
}
})
} else {
newstocksApi.addNewStocks(this.form).then(response => {
if (response.code === 200) {
this.msgSuccess('新增成功')
this.open = false
this.getList()
}
})
}
}
})
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids
this.$confirm('是否确认删除行情数据编号为"' + ids + '"的数据项?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'danger'
}).then(function() {
return newstocksApi.deleteNewStocks(ids)
}).then(response => {
if (response.code === 200) {
this.msgSuccess('删除成功')
this.getList()
}
}).catch(() => {})
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams
this.$confirm('是否确认导出所有行情数据数据?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
return newstocksApi.exportNewStocks(queryParams)
}).then(response => {
this.download(response.msg)
}).catch(() => {})
},
/** 导入按钮操作 */
handleImport() {
this.upload.title = '导入行情数据'
this.upload.open = true
},
/** 文件上传前处理 */
handleFileChange(file) {
this.fileList = [file]
},
/** 文件上传提交 */
submitFileForm() {
if (this.fileList.length === 0) {
this.msgError('请选择文件')
return
}
const formData = new FormData()
formData.append('file', this.fileList[0].raw)
formData.append('updateSupport', this.upload.updateSupport ? 1 : 0)
formData.append('tradeDate', this.upload.tradeDate)
this.upload.open = false
this.loading = true
//
request({
url: this.upload.url,
method: 'post',
data: formData,
headers: {
'Content-Type': 'multipart/form-data',
'Authorization': getToken()
}
}).then(response => {
this.loading = false
this.msgSuccess(response.msg)
this.getList()
}).catch(() => {
this.loading = false
})
},
/** 文件上传成功处理 */
handleSuccess(response, file, fileList) {
this.upload.open = false
this.loading = false
this.msgSuccess('导入成功')
this.getList()
},
/** 文件上传失败处理 */
handleError() {
this.upload.open = false
this.loading = false
this.msgError('导入失败')
},
/** 分析按钮操作 */
handleAnalyze() {
newstocksApi.analyzeNewStocks(this.queryParams).then(response => {
this.analyzeResult = response.data
this.analyzeDialogVisible = true
})
},
/** 表格选中操作 */
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length !== 1
this.multiple = !selection.length
}
}
}
</script>
<style scoped>
.app-container {
padding: 15px;
}
.mb8 {
margin-bottom: 8px;
}
.small-padding {
padding: 0 5px;
}
.fixed-width {
width: 150px;
}
</style>

@ -1,22 +0,0 @@
-- 菜单 SQL
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('交易账户', '2123', '1', 'account', 'booksystem/account/index', 1, 0, 'C', '0', '0', 'booksystem:account:list', '#', 'admin', sysdate(), '', null, '交易账户菜单');
-- 按钮父菜单ID
SELECT @parentId := LAST_INSERT_ID();
-- 按钮 SQL
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('交易账户查询', @parentId, '1', '#', '', 1, 0, 'F', '0', '0', 'booksystem:account:query', '#', 'admin', sysdate(), '', null, '');
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('交易账户新增', @parentId, '2', '#', '', 1, 0, 'F', '0', '0', 'booksystem:account:add', '#', 'admin', sysdate(), '', null, '');
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('交易账户修改', @parentId, '3', '#', '', 1, 0, 'F', '0', '0', 'booksystem:account:edit', '#', 'admin', sysdate(), '', null, '');
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('交易账户删除', @parentId, '4', '#', '', 1, 0, 'F', '0', '0', 'booksystem:account:remove', '#', 'admin', sysdate(), '', null, '');
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('交易账户导出', @parentId, '5', '#', '', 1, 0, 'F', '0', '0', 'booksystem:account:export', '#', 'admin', sysdate(), '', null, '');

@ -1,37 +0,0 @@
/*
Navicat Premium Data Transfer
Source Server : localhost
Source Server Type : MySQL
Source Server Version : 80022
Source Host : localhost:3306
Source Schema : ry
Target Server Type : MySQL
Target Server Version : 80022
File Encoding : 65001
Date: 07/04/2022 13:49:59
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for account 账户表;盘后统计或查询时统计
-- ----------------------------
DROP TABLE IF EXISTS `account`;
CREATE TABLE `account` (
`id` double NOT NULL AUTO_INCREMENT,
`trade_day` date NULL DEFAULT NULL COMMENT '交易日期',
`week_day` date NULL DEFAULT NULL COMMENT '交易日星期',
`assets` decimal(50, 2) NULL DEFAULT NULL COMMENT '净资产',
`total_assets` decimal(50, 2) NULL DEFAULT NULL COMMENT '总资产',
`profit` decimal(50, 2) NULL DEFAULT NULL COMMENT '当日盈亏',
`assets_diff` decimal(50, 2) NULL DEFAULT NULL COMMENT '当日净资产盈亏比例',
`total_diff` decimal(50, 2) NULL DEFAULT NULL COMMENT '当日总资产盈亏比例',
`user_id` bigint NULL DEFAULT NULL COMMENT '用户id',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '账户表' ROW_FORMAT = DYNAMIC;
SET FOREIGN_KEY_CHECKS = 1;

@ -1,47 +0,0 @@
/*
Navicat Premium Data Transfer
Source Server : localhost
Source Server Type : MySQL
Source Server Version : 80022
Source Host : localhost:3306
Source Schema : ry
Target Server Type : MySQL
Target Server Version : 80022
File Encoding : 65001
Date: 07/04/2022 13:49:59
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for operations 操作表
-- ----------------------------
DROP TABLE IF EXISTS `operations`;
CREATE TABLE `operations` (
`id` double NOT NULL AUTO_INCREMENT,
`code` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '股票代码',
`name` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '股票名称',
`trade_day` date NULL DEFAULT NULL COMMENT '交易日期',
`week_day` date NULL DEFAULT NULL COMMENT '交易日星期',
`operate` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '操作(含账户转入转出)',
`deal_price` decimal(50, 2) NULL DEFAULT NULL COMMENT '交易价格',
`volumn` decimal(50, 0) NULL DEFAULT NULL COMMENT '成交量',
`amount` decimal(50, 2) NULL DEFAULT NULL COMMENT '成交额',
`tax` decimal(50, 2) NULL DEFAULT NULL COMMENT '印花税',
`fee` decimal(50, 2) NULL DEFAULT NULL COMMENT '手续费',
`other` decimal(50, 2) NULL DEFAULT NULL COMMENT '其他费用',
`operate_diff` decimal(50, 2) NULL DEFAULT NULL COMMENT '操作时涨跌',
`pre_id` double NULL DEFAULT NULL COMMENT '关联操作id',
`user_id` bigint NULL DEFAULT NULL COMMENT '用户id',
`deal_logic` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '操作逻辑',
`bz` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '备注',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '操作表' ROW_FORMAT = DYNAMIC;
SET FOREIGN_KEY_CHECKS = 1;

@ -1,42 +0,0 @@
/*
Navicat Premium Data Transfer
Source Server : localhost
Source Server Type : MySQL
Source Server Version : 80022
Source Host : localhost:3306
Source Schema : ry
Target Server Type : MySQL
Target Server Version : 80022
File Encoding : 65001
Date: 07/04/2022 13:49:59
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for account_book 统计表单笔操作;清仓时统计,查询时统计,盘后统计;为当前持仓股
-- ----------------------------
DROP TABLE IF EXISTS `statistics`;
CREATE TABLE `statistics` (
`id` double NOT NULL AUTO_INCREMENT,
`code` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '股票代码',
`name` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '股票名称',
`trade_day` date NULL DEFAULT NULL COMMENT '交易日期',
`week_day` date NULL DEFAULT NULL COMMENT '交易日星期',
`operations_id` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '操作id',
`profit` decimal(50, 2) NULL DEFAULT NULL COMMENT '当笔当日盈亏',
`diff` decimal(50, 0) NULL DEFAULT NULL COMMENT '当笔当日盈亏盈亏比例',
`operateion_id` double NULL DEFAULT NULL COMMENT '操作id',
`user_id` bigint NULL DEFAULT NULL COMMENT '用户id',
`bz` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '备注',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '交易记统计表单笔操作' ROW_FORMAT = DYNAMIC;
SET FOREIGN_KEY_CHECKS = 1;

@ -1,40 +0,0 @@
/*
Navicat Premium Data Transfer
Source Server : localhost
Source Server Type : MySQL
Source Server Version : 80022
Source Host : localhost:3306
Source Schema : ry
Target Server Type : MySQL
Target Server Version : 80022
File Encoding : 65001
Date: 07/04/2022 13:49:59
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for account_book 统计表当日持仓,包含当日清仓;清仓时统计,查询时统计,盘后统计;为当前持仓股
-- ----------------------------
DROP TABLE IF EXISTS `statistics_remain`;
CREATE TABLE `statistics_remain` (
`id` double NOT NULL AUTO_INCREMENT,
`code` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '股票代码',
`name` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '股票名称',
`trade_day` date NULL DEFAULT NULL COMMENT '交易日期',
`week_day` date NULL DEFAULT NULL COMMENT '交易日星期',
`total_profit` decimal(50, 2) NULL DEFAULT NULL COMMENT '总盈亏',
`total_diff` decimal(50, 2) NULL DEFAULT NULL COMMENT '总盈亏比例',
`total_diff_overall` decimal(50, 2) NULL DEFAULT NULL COMMENT '总盈亏占整体盈亏比例',
`remaining` decimal(50, 2) NULL DEFAULT NULL COMMENT '剩余数量',
`user_id` bigint NULL DEFAULT NULL COMMENT '用户id',
`bz` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '备注',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '统计表当日持仓' ROW_FORMAT = DYNAMIC;
SET FOREIGN_KEY_CHECKS = 1;

@ -1,46 +0,0 @@
/*
Navicat Premium Data Transfer
Source Server : localhost
Source Server Type : MySQL
Source Server Version : 80022
Source Host : localhost:3306
Source Schema : ry
Target Server Type : MySQL
Target Server Version : 80022
File Encoding : 65001
Date: 07/04/2022 13:49:59
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for account_book 统计表清仓后操作
-- ----------------------------
DROP TABLE IF EXISTS `statistics_total`;
CREATE TABLE `statistics_total` (
`id` double NOT NULL AUTO_INCREMENT,
`code` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '股票代码',
`name` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '股票名称',
`start_trade_day` date NULL DEFAULT NULL COMMENT '建仓交易日期',
`end_trade_day` date NULL DEFAULT NULL COMMENT '清仓交易日星期',
`total_profit` decimal(50, 2) NULL DEFAULT NULL COMMENT '总盈亏',
`total_diff` decimal(50, 2) NULL DEFAULT NULL COMMENT '总盈亏比例',
`start_price` decimal(50, 2) NULL DEFAULT NULL COMMENT '建仓交易价格',
`end_price` decimal(50, 2) NULL DEFAULT NULL COMMENT '建仓交易价格',
`volumn_total` decimal(50, 0) NULL DEFAULT NULL COMMENT '总成交量',
`amount_total` decimal(50, 2) NULL DEFAULT NULL COMMENT '总成交额',
`operate_times` decimal(50, 2) NULL DEFAULT NULL COMMENT '交易次数',
`fee` decimal(50, 2) NULL DEFAULT NULL COMMENT '总手续费',
`tax` decimal(50, 2) NULL DEFAULT NULL COMMENT '总印花税',
`other` decimal(50, 2) NULL DEFAULT NULL COMMENT '总其他费用',
`user_id` bigint NULL DEFAULT NULL COMMENT '用户id',
`bz` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '备注',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '统计表当日持仓' ROW_FORMAT = DYNAMIC;
SET FOREIGN_KEY_CHECKS = 1;

@ -1,22 +0,0 @@
-- 菜单 SQL
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('当日持仓统计', '2123', '1', 'statisticremain', 'booksystem/statisticremain/index', 1, 0, 'C', '0', '0', 'booksystem:statisticremain:list', '#', 'admin', sysdate(), '', null, '当日持仓统计菜单');
-- 按钮父菜单ID
SELECT @parentId := LAST_INSERT_ID();
-- 按钮 SQL
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('当日持仓统计查询', @parentId, '1', '#', '', 1, 0, 'F', '0', '0', 'booksystem:statisticremain:query', '#', 'admin', sysdate(), '', null, '');
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('当日持仓统计新增', @parentId, '2', '#', '', 1, 0, 'F', '0', '0', 'booksystem:statisticremain:add', '#', 'admin', sysdate(), '', null, '');
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('当日持仓统计修改', @parentId, '3', '#', '', 1, 0, 'F', '0', '0', 'booksystem:statisticremain:edit', '#', 'admin', sysdate(), '', null, '');
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('当日持仓统计删除', @parentId, '4', '#', '', 1, 0, 'F', '0', '0', 'booksystem:statisticremain:remove', '#', 'admin', sysdate(), '', null, '');
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('当日持仓统计导出', @parentId, '5', '#', '', 1, 0, 'F', '0', '0', 'booksystem:statisticremain:export', '#', 'admin', sysdate(), '', null, '');

@ -1,583 +0,0 @@
# Stock-System 数据结构关系文档
## 1. 文档简介
本文档详细梳理了 RuoYi-Vue 项目中 stock-system 模块的所有写入数据库的数据结构及其相互关系。该模块主要用于管理和分析股票相关数据,包括基础信息、交易数据、财务数据和分析指标等。
## 2. 核心数据实体
### 2.1 股票基础信息 (StockBasic)
- **表名**: `stock_basis`
- **核心字段**:
- `id`: 主键
- `code`: 股票代码 (关联其他表的关键字段)
- `name`: 股票名称
- `blemind2`: 所属东财行业指数2级
- `blemind3`: 所属东财行业指数3级
- `listdate`: 首发上市日期
### 2.2 股票财务数据 (StockFinancial)
- **表名**: `stock_financial`
- **核心字段**:
- `id`: 主键
- `code`: 股票代码 (关联 StockBasic)
- `period`: 报告期
- `jlrtbzzl`: 净利润同比增长率
- `jlrhbzzl`: 净利润环比增长率
- `jzcsylroe`: 净资产收益率ROE
- `epsbasic`: 每股收益EPS
- `jlr`: 净利润
- `jbmgsy`: 基本每股收益
- `mgjzc`: 每股净资产BPS
### 2.3 股票指数数据 (StockIndex)
- **表名**: `stock_index`
- **核心字段**:
- `id`: 主键
- `code`: 指数代码
- `name`: 指数名称
- `tradeDay`: 交易日期
- `open`: 开盘价
- `close`: 收盘价
- `high`: 最高价
- `low`: 最低价
- `differrange`: 涨跌幅
- `volume`: 成交量
- `amount`: 成交额
- `limitupnum`: 涨停家数
- `limitdownnum`: 跌停家数
- `mv`: 总市值
- `pettm`: 市盈率PE
### 2.4 股票交易数据 (Stocks)
- **表名**: `stocks`
- **核心字段**:
- `id`: 主键
- `code`: 股票代码 (关联 StockBasic)
- `name`: 股票名称
- `blemind2`: 所属东财行业指数2级
- `blemind3`: 所属东财行业指数3级
- `listdate`: 首发上市日期
- `tradeDay`: 交易日期
- `open`: 开盘价
- `close`: 收盘价
- `high`: 最高价
- `low`: 最低价
- `differrange`: 当日涨跌幅
- `volumn`: 成交量
- `amount`: 成交额
- `differrange3/5/10/15/20/30/60`: 不同周期涨跌幅
- `islimit`: 是否涨停
- `isdrop`: 是否跌停
### 2.5 股票趋势数据 (StocksInTrend)
- **表名**: `stocks_in_trend`
- **核心字段**:
- `id`: 主键
- `code`: 股票代码 (关联 StockBasic)
- `tradeDay`: 交易日期
- `sort`: 排名
- `type`: 动量数据类型 (10日、20日)
- `name`: 股票名称
- `blemind2`: 所属东财行业指数2级
- `blemind3`: 所属东财行业指数3级
- `open`: 开盘价
- `close`: 收盘价
- `differrange`: 当日涨跌幅
- `differrange10/20/60`: 不同周期涨跌幅
- `backdifferrange10/20/60`: 不同周期最大回撤
### 2.6 股票涨跌停数据 (StocksLimit)
- **表名**: `stocks_limit`
- **核心字段**:
- `id`: 主键
- `code`: 股票代码 (关联 StockBasic)
- `tradeDay`: 交易日期
- `islimit`: 是否涨停
- `isdrop`: 是否跌停
- `blemind2`: 所属东财行业指数2级
### 2.7 股票创新高/新低数据 (StocksNewRecord)
- **表名**: `stocks_new_record`
- **核心字段**:
- `id`: 主键
- `code`: 股票代码 (关联 StockBasic)
- `tradeDay`: 交易日期
- `isHigh`: 是否300天新高
- `isLow`: 是否300天新低
- `blemind2`: 所属东财行业指数2级
### 2.8 交易日数据 (TradeDates)
- **表名**: `trade_dates`
- **核心字段**:
- `date`: 交易日期
- `week`: 周
- `trade`: 是否可交易
### 2.9 行业趋势分析数据 (Trends)
- **表名**: `trends`
- **核心字段**:
- `id`: 主键
- `tradeDay`: 交易日期
- `blemind2`: 所属东财行业指数2级
- `stocksCount`: 动量个股数量
- `trendValue`: 动量值
- `trendValueChange`: 动量值变化
- `sort`: 板块排名
- `sortChange`: 板块排名变化
- `type`: 动量数据类型 (10日、20日)
## 3. 数据结构关系图
```
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ StockBasic │────>│ StockFinancial │────>│ Stocks │
└─────────────────┘ └─────────────────┘ └─────────────────┘
│ │ │
│ │ │
▼ ▼ ▼
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ StockIndex │ │ StocksInTrend │────>│ Trends │
└─────────────────┘ └─────────────────┘ └─────────────────┘
│ │
│ │
▼ ▼
┌─────────────────┐ ┌─────────────────┐
│ TradeDates │ │ StocksLimit │
└─────────────────┘ └─────────────────┘
┌─────────────────┐
│ StocksNewRecord │
└─────────────────┘
```
## 4. 详细关系说明
### 4.1 基础数据层
- **StockBasic**: 核心基础表,存储股票基本信息,是其他表的关联基础
- **TradeDates**: 提供交易日信息,为其他表的时间维度提供参考
### 4.2 交易数据层
- **Stocks**: 存储股票每日交易数据,关联 StockBasic 和 StockFinancial
- **StockIndex**: 存储指数交易数据,反映市场整体情况
- **StockFinancial**: 存储股票财务数据,与 Stocks 表关联
### 4.3 分析数据层
- **StocksInTrend**: 基于 Stocks 表数据,计算股票趋势指标
- **StocksLimit**: 基于 Stocks 表数据,记录股票涨跌停情况
- **StocksNewRecord**: 基于 Stocks 表数据,记录股票创新高/新低情况
- **Trends**: 基于 StocksInTrend 表数据,分析行业趋势
## 5. 核心关键字段关系
### 5.1 股票标识关联
- **code**: 股票代码,贯穿所有股票相关表,是表间关联的核心字段
- **name**: 股票名称,辅助标识股票
### 5.2 时间维度关联
- **tradeDay**: 交易日期,所有交易和分析数据的时间维度
- **period**: 财务数据的报告期
- **date**: 交易日历日期
### 5.3 行业分类关联
- **blemind2**: 东财行业指数2级分类用于行业分析
- **blemind3**: 东财行业指数3级分类更细分的行业分析
### 5.4 分析指标关联
- **differrange**: 涨跌幅,核心分析指标
- **type**: 动量数据类型,区分不同周期的分析数据
- **sort**: 排名,用于趋势分析
- **trendValue**: 动量值,行业趋势分析的核心指标
## 6. 数据存储特点
### 6.1 时间序列数据
- 所有交易和分析数据都按交易日存储,形成时间序列
- 支持多周期分析3日、5日、10日、15日、20日、30日、60日
### 6.2 多维度分析
- 提供了不同周期的涨跌幅数据
- 支持按行业分类进行分析
- 包含多种技术指标(如动量值、最大回撤等)
### 6.3 数据层次结构
- **基础数据层**: 存储静态基础信息
- **交易数据层**: 存储动态交易数据
- **分析数据层**: 基于基础和交易数据生成的分析结果
### 6.4 关联完整性
- 通过股票代码 (`code`) 和交易日期 (`tradeDay`) 建立了完整的数据关联体系
- 各表之间的关联关系清晰,数据流向明确
## 7. 数据流向
1. **基础数据流入**:
- StockBasic 表导入股票基础信息
- TradeDates 表导入交易日历
2. **交易数据流入**:
- Stocks 表导入每日交易数据
- StockIndex 表导入指数数据
- StockFinancial 表导入财务报表数据
3. **分析数据生成**:
- 基于 Stocks 表数据计算生成 StocksInTrend、StocksLimit、StocksNewRecord
- 基于 StocksInTrend 表数据计算生成 Trends
## 8. 总结
Stock-System 模块采用了层次化的数据结构设计,从基础数据、交易数据到分析数据,形成了完整的数据链路。通过股票代码和交易日期两个核心维度,将各个表关联起来,构建了一个功能完备的股票数据管理系统。
该系统不仅存储了基础的股票信息和交易数据,还通过计算生成了丰富的分析指标,为股票分析和投资决策提供了全面的数据支持。数据结构设计合理,关联关系清晰,能够满足股票数据管理和分析的各种需求。
## 9. 接口与实现文件
### 9.1 股票基础信息 (StockBasic) 相关接口
#### 后端接口
| 接口路径 | 方法 | 功能描述 | 实现文件 |
|---------|------|---------|--------|
| /stocksystem/stockbasic/list | GET | 查询基础数据列表 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/StockBasicController.java |
| /stocksystem/stockbasic/export | POST | 导出基础数据列表 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/StockBasicController.java |
| /stocksystem/stockbasic/{id} | GET | 获取基础数据详细信息 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/StockBasicController.java |
| /stocksystem/stockbasic | POST | 新增基础数据 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/StockBasicController.java |
| /stocksystem/stockbasic | PUT | 修改基础数据 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/StockBasicController.java |
| /stocksystem/stockbasic/{ids} | DELETE | 删除基础数据 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/StockBasicController.java |
**实现类**: stock-system/src/main/java/com/ruoyi/stocksystem/domain/service/impl/StockBasicServiceImpl.java
#### 前端调用
**文件路径**: ruoyi-ui/src/api/stocksystem/stockbasic.js
| 方法名 | 接口路径 | 功能描述 |
|-------|---------|--------|
| listStockbasic | /stocksystem/stockbasic/list | 查询基础数据列表 |
| getStockbasic | /stocksystem/stockbasic/{id} | 查询基础数据详细 |
| addStockbasic | /stocksystem/stockbasic | 新增基础数据 |
| updateStockbasic | /stocksystem/stockbasic | 修改基础数据 |
| delStockbasic | /stocksystem/stockbasic/{id} | 删除基础数据 |
### 9.2 股票财务数据 (StockFinancial) 相关接口
#### 后端接口
| 接口路径 | 方法 | 功能描述 | 实现文件 |
|---------|------|---------|--------|
| /stocksystem/financial/list | GET | 查询A股财务数据列表 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/StockFinancialController.java |
| /stocksystem/financial/export | POST | 导出A股财务数据列表 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/StockFinancialController.java |
| /stocksystem/financial/{id} | GET | 获取A股财务数据详细信息 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/StockFinancialController.java |
| /stocksystem/financial | POST | 新增A股财务数据 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/StockFinancialController.java |
| /stocksystem/financial | PUT | 修改A股财务数据 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/StockFinancialController.java |
| /stocksystem/financial/{ids} | DELETE | 删除A股财务数据 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/StockFinancialController.java |
| /stocksystem/financial/importData | POST | 导入财报数据 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/StockFinancialController.java |
**实现类**: stock-system/src/main/java/com/ruoyi/stocksystem/domain/service/impl/StockFinancialServiceImpl.java
#### 前端调用
**文件路径**: ruoyi-ui/src/api/stocksystem/financial.js
| 方法名 | 接口路径 | 功能描述 |
|-------|---------|--------|
| listFinancial | /stocksystem/financial/list | 查询A股财务数据列表 |
| getFinancial | /stocksystem/financial/{id} | 查询A股财务数据详细 |
| addFinancial | /stocksystem/financial | 新增A股财务数据 |
| updateFinancial | /stocksystem/financial | 修改A股财务数据 |
| delFinancial | /stocksystem/financial/{id} | 删除A股财务数据 |
### 9.3 股票指数数据 (StockIndex) 相关接口
#### 后端接口
| 接口路径 | 方法 | 功能描述 | 实现文件 |
|---------|------|---------|--------|
| /stocksystem/stockindex/list | GET | 查询指数交易行情列表 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/StockIndexController.java |
| /stocksystem/stockindex/export | POST | 导出指数交易行情列表 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/StockIndexController.java |
| /stocksystem/stockindex/importData | POST | 导入指数数据 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/StockIndexController.java |
| /stocksystem/stockindex/{id} | GET | 获取指数交易行情详细信息 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/StockIndexController.java |
| /stocksystem/stockindex | POST | 新增指数交易行情 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/StockIndexController.java |
| /stocksystem/stockindex | PUT | 修改指数交易行情 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/StockIndexController.java |
| /stocksystem/stockindex/{ids} | DELETE | 删除指数交易行情 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/StockIndexController.java |
**实现类**: stock-system/src/main/java/com/ruoyi/stocksystem/domain/service/impl/StockIndexServiceImpl.java
#### 前端调用
**文件路径**: ruoyi-ui/src/api/stocksystem/stockindex.js
| 方法名 | 接口路径 | 功能描述 |
|-------|---------|--------|
| listStockindex | /stocksystem/stockindex/list | 查询指数交易行情列表 |
| getStockindex | /stocksystem/stockindex/{id} | 查询指数交易行情详细 |
| addStockindex | /stocksystem/stockindex | 新增指数交易行情 |
| updateStockindex | /stocksystem/stockindex | 修改指数交易行情 |
| delStockindex | /stocksystem/stockindex/{id} | 删除指数交易行情 |
### 9.4 股票交易数据 (Stocks) 相关接口
#### 后端接口
| 接口路径 | 方法 | 功能描述 | 实现文件 |
|---------|------|---------|--------|
| /stocksystem/stocks/list | GET | 查询行情数据列表 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/StocksController.java |
| /stocksystem/stocks/listB | GET | 查询行情数据列表含基础数据 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/StocksController.java |
| /stocksystem/stocks/listStrongStocks | GET | 查询强势股列表 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/StocksController.java |
| /stocksystem/stocks/listLimitStocks | GET | 查询涨停股列表 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/StocksController.java |
| /stocksystem/stocks/listDropStocks | GET | 查询跌停股列表 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/StocksController.java |
| /stocksystem/stocks/distribution | GET | 查询涨跌分布 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/StocksController.java |
| /stocksystem/stocks/stockindestocksdistribution | GET | 查询板块涨跌分布 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/StocksController.java |
| /stocksystem/stocks/stockHistory | GET | 查询个股历史数据(k线) | stock-system/src/main/java/com/ruoyi/stocksystem/controller/StocksController.java |
| /stocksystem/stocks/stockIndexHistory | GET | 查询板块历史数据(k线) | stock-system/src/main/java/com/ruoyi/stocksystem/controller/StocksController.java |
| /stocksystem/stocks/groupLimitlist | GET | 查询每日涨跌停板列表 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/StocksController.java |
| /stocksystem/stocks/stockQueryData | GET | 获取联想的数据(股票代码) | stock-system/src/main/java/com/ruoyi/stocksystem/controller/StocksController.java |
| /stocksystem/stocks/stockNameQueryData | GET | 获取联想的数据(股票名称) | stock-system/src/main/java/com/ruoyi/stocksystem/controller/StocksController.java |
| /stocksystem/stocks/stockIndexsNameQueryData | GET | 获取联想的数据(指数名称) | stock-system/src/main/java/com/ruoyi/stocksystem/controller/StocksController.java |
| /stocksystem/stocks/getTradeDay | GET | 获取最近的交易日 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/StocksController.java |
| /stocksystem/stocks/export | POST | 导出行情数据列表 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/StocksController.java |
| /stocksystem/stocks/importData | POST | 导入行情数据 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/StocksController.java |
**实现类**: stock-system/src/main/java/com/ruoyi/stocksystem/domain/service/impl/StocksServiceImpl.java
#### 前端调用
**文件路径**: ruoyi-ui/src/api/stocksystem/stocks.js
| 方法名 | 接口路径 | 功能描述 |
|-------|---------|--------|
| listStocks | /stocksystem/stocks/listB | 查询行情数据列表含基础数据 |
| getStocks | /stocksystem/stocks/{id} | 查询行情数据详细 |
| analysis | /stocksystem/stocks/analysis | 分析行情数据 |
| addStocks | /stocksystem/stocks | 新增行情数据 |
| updateStocks | /stocksystem/stocks | 修改行情数据 |
| delStocks | /stocksystem/stocks/{id} | 删除行情数据 |
### 9.5 股票趋势数据 (StocksInTrend) 相关接口
#### 后端接口
| 接口路径 | 方法 | 功能描述 | 实现文件 |
|---------|------|---------|--------|
| /stocksystem/trendStocks/list | GET | 查询动量个股列表 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/StocksInTrendController.java |
| /stocksystem/trendStocks/export | POST | 导出动量个股列表 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/StocksInTrendController.java |
| /stocksystem/trendStocks/{id} | GET | 获取动量个股详细信息 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/StocksInTrendController.java |
| /stocksystem/trendStocks | POST | 新增动量个股 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/StocksInTrendController.java |
| /stocksystem/trendStocks | PUT | 修改动量个股 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/StocksInTrendController.java |
| /stocksystem/trendStocks/{ids} | DELETE | 删除动量个股 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/StocksInTrendController.java |
**实现类**: stock-system/src/main/java/com/ruoyi/stocksystem/domain/service/impl/StocksInTrendServiceImpl.java
#### 前端调用
**文件路径**: ruoyi-ui/src/api/stocksystem/trendStocks.js
| 方法名 | 接口路径 | 功能描述 |
|-------|---------|--------|
| listTrendStocks | /stocksystem/trendStocks/list | 查询动量个股列表 |
| getTrendStocks | /stocksystem/trendStocks/{id} | 查询动量个股详细 |
| addTrendStocks | /stocksystem/trendStocks | 新增动量个股 |
| updateTrendStocks | /stocksystem/trendStocks | 修改动量个股 |
| delTrendStocks | /stocksystem/trendStocks/{id} | 删除动量个股 |
### 9.6 股票涨跌停数据 (StocksLimit) 相关接口
#### 后端接口
| 接口路径 | 方法 | 功能描述 | 实现文件 |
|---------|------|---------|--------|
| /stocksystem/stockslimit/list | GET | 查询每日涨跌停板列表 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/StocksLimitController.java |
| /stocksystem/stockslimit/grouplist | GET | 查询每日涨跌停板列表(按板块分组) | stock-system/src/main/java/com/ruoyi/stocksystem/controller/StocksLimitController.java |
| /stocksystem/stockslimit/export | POST | 导出每日涨跌停板列表 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/StocksLimitController.java |
| /stocksystem/stockslimit/importData | POST | 导入涨跌停数据 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/StocksLimitController.java |
| /stocksystem/stockslimit/{id} | GET | 获取每日涨跌停板详细信息 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/StocksLimitController.java |
| /stocksystem/stockslimit | POST | 新增每日涨跌停板 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/StocksLimitController.java |
| /stocksystem/stockslimit | PUT | 修改每日涨跌停板 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/StocksLimitController.java |
| /stocksystem/stockslimit/{ids} | DELETE | 删除每日涨跌停板 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/StocksLimitController.java |
**实现类**: stock-system/src/main/java/com/ruoyi/stocksystem/domain/service/impl/StocksLimitServiceImpl.java
#### 前端调用
**文件路径**: ruoyi-ui/src/api/stocksystem/stockslimit.js
| 方法名 | 接口路径 | 功能描述 |
|-------|---------|--------|
| listStockslimit | /stocksystem/stockslimit/list | 查询每日涨跌停板列表 |
| getStockslimit | /stocksystem/stockslimit/{id} | 查询每日涨跌停板详细 |
| addStockslimit | /stocksystem/stockslimit | 新增每日涨跌停板 |
| updateStockslimit | /stocksystem/stockslimit | 修改每日涨跌停板 |
| delStockslimit | /stocksystem/stockslimit/{id} | 删除每日涨跌停板 |
### 9.7 股票创新高/新低数据 (StocksNewRecord) 相关接口
#### 后端接口
| 接口路径 | 方法 | 功能描述 | 实现文件 |
|---------|------|---------|--------|
| /stocksystem/newrecord/list | GET | 查询每日创新高新低列表 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/StocksNewRecordController.java |
| /stocksystem/newrecord/export | POST | 导出每日创新高新低列表 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/StocksNewRecordController.java |
| /stocksystem/newrecord/grouplist | GET | 查询每日新高新低列表(按板块分组) | stock-system/src/main/java/com/ruoyi/stocksystem/controller/StocksNewRecordController.java |
| /stocksystem/newrecord/getAllNewRecords | GET | 查询每日新高新低列表 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/StocksNewRecordController.java |
| /stocksystem/newrecord/importData | POST | 导入创新高新低数据 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/StocksNewRecordController.java |
| /stocksystem/newrecord/{id} | GET | 获取每日创新高新低详细信息 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/StocksNewRecordController.java |
| /stocksystem/newrecord | POST | 新增每日创新高新低 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/StocksNewRecordController.java |
| /stocksystem/newrecord | PUT | 修改每日创新高新低 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/StocksNewRecordController.java |
| /stocksystem/newrecord/{ids} | DELETE | 删除每日创新高新低 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/StocksNewRecordController.java |
**实现类**: stock-system/src/main/java/com/ruoyi/stocksystem/domain/service/impl/StocksNewRecordServiceImpl.java
#### 前端调用
**文件路径**: ruoyi-ui/src/api/stocksystem/newrecord.js
| 方法名 | 接口路径 | 功能描述 |
|-------|---------|--------|
| listNewrecord | /stocksystem/newrecord/list | 查询每日创新高新低列表 |
| getNewrecord | /stocksystem/newrecord/{id} | 查询每日创新高新低详细 |
| addNewrecord | /stocksystem/newrecord | 新增每日创新高新低 |
| updateNewrecord | /stocksystem/newrecord | 修改每日创新高新低 |
| delNewrecord | /stocksystem/newrecord/{id} | 删除每日创新高新低 |
### 9.8 交易日数据 (TradeDates) 相关接口
#### 后端接口
| 接口路径 | 方法 | 功能描述 | 实现文件 |
|---------|------|---------|--------|
| /stocksystem/tradedates/list | GET | 查询可交易日期列表 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/TradeDatesController.java |
| /stocksystem/tradedates/export | POST | 导出可交易日期列表 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/TradeDatesController.java |
| /stocksystem/tradedates/{date} | GET | 获取可交易日期详细信息 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/TradeDatesController.java |
| /stocksystem/tradedates | POST | 新增可交易日期 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/TradeDatesController.java |
| /stocksystem/tradedates | PUT | 修改可交易日期 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/TradeDatesController.java |
| /stocksystem/tradedates/{dates} | DELETE | 删除可交易日期 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/TradeDatesController.java |
**实现类**: stock-system/src/main/java/com/ruoyi/stocksystem/domain/service/impl/TradeDatesServiceImpl.java
#### 前端调用
**注**: 交易日数据的前端调用主要通过其他模块间接使用,例如在获取最近交易日时调用 /stocksystem/stocks/getTradeDay 接口。
### 9.9 行业趋势分析数据 (Trends) 相关接口
#### 后端接口
| 接口路径 | 方法 | 功能描述 | 实现文件 |
|---------|------|---------|--------|
| /stocksystem/trends/list | GET | 查询动量结果列表 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/TrendsController.java |
| /stocksystem/trends/querylist | GET | 查询动量结果列表 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/TrendsController.java |
| /stocksystem/trends/querytrendstockslist | GET | 查询动量个股列表 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/TrendsController.java |
| /stocksystem/trends/listSection | GET | 查询行业趋势数据 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/TrendsController.java |
| /stocksystem/trends/listTradeVolume | GET | 查询行业交易量数据 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/TrendsController.java |
| /stocksystem/trends/listStockIndexLimitUp | GET | 查询行业涨停家数数据 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/TrendsController.java |
| /stocksystem/trends/listStockIndexLimitDown | GET | 查询行业跌停家数数据 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/TrendsController.java |
| /stocksystem/trends/listStockIndexHighRocord | GET | 查询行业创新高数据 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/TrendsController.java |
| /stocksystem/trends/listStockIndexLowRocord | GET | 查询行业创新低数据 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/TrendsController.java |
| /stocksystem/trends/listSectionByBlemind | GET | 查询板块动量值 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/TrendsController.java |
| /stocksystem/trends/export | POST | 导出动量结果列表 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/TrendsController.java |
| /stocksystem/trends/{id} | GET | 获取动量结果详细信息 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/TrendsController.java |
| /stocksystem/trends | POST | 新增动量结果 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/TrendsController.java |
| /stocksystem/trends | PUT | 修改动量结果 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/TrendsController.java |
| /stocksystem/trends/{ids} | DELETE | 删除动量结果 | stock-system/src/main/java/com/ruoyi/stocksystem/controller/TrendsController.java |
**实现类**: stock-system/src/main/java/com/ruoyi/stocksystem/domain/service/impl/TrendsServiceImpl.java
#### 前端调用
**文件路径**: ruoyi-ui/src/api/stocksystem/trends.js
| 方法名 | 接口路径 | 功能描述 |
|-------|---------|--------|
| listTrends | /stocksystem/trends/list | 查询动量结果列表 |
| listTrendsSection | /stocksystem/trends/listSection | 查询时间段内动量结果列表 |
| listTradeVolume | /stocksystem/trends/listTradeVolume | 查询行业交易量数据 |
| listStockIndexLimitUp | /stocksystem/trends/listStockIndexLimitUp | 查询指数内涨停板数量 |
| listStockIndexLimitDown | /stocksystem/trends/listStockIndexLimitDown | 查询板块内跌停板数量 |
| listStockIndexHighRocord | /stocksystem/trends/listStockIndexHighRocord | 查询创新高板块 |
| listStockIndexLowRocord | /stocksystem/trends/listStockIndexLowRocord | 查询创新低板块 |
| listSectionByBlemind | /stocksystem/trends/listSectionByBlemind | 查询板块动量值 |
| listStockHistory | /stocksystem/stocks/stockHistory | 查询个股历史k线数据 |
| listStockIndexHistory | /stocksystem/stocks/stockIndexHistory | 板块历史k线数据 |
| getTrends | /stocksystem/trends/{id} | 查询动量结果详细 |
| addTrends | /stocksystem/trends | 新增动量结果 |
| updateTrends | /stocksystem/trends | 修改动量结果 |
| delTrends | /stocksystem/trends/{id} | 删除动量结果 |
## 10. Redis 缓存使用分析
### 10.1 缓存键定义
所有缓存键常量定义在 `com.ruoyi.common.constant.Constants` 类中,主要包括:
| 缓存键常量 | 含义 | 过期时间 |
|----------|------|--------|
| `EXPIRED_TIME` | 默认过期时间 | 3天60*60*24*3秒 |
| `TRENDS` | 动量趋势数据 | - |
| `HOME_HIGH_DISTRIBUTE` | 首页新高分布 | - |
| `HOME_LOW_DISTRIBUTE` | 首页新低分布 | - |
| `HOME_TRENDS_STOCKS` | 首页动量趋势个股 | - |
| `TRENDS_SECTION_BLEMIND` | 板块趋势值 | - |
| `HOME_STRONG_STOCKS` | 首页强势个股 | - |
| `HOME_LIMIT_STOCKS` | 首页涨停个股 | - |
| `HOME_DROP_LIMIT_STOCKS` | 首页跌停个股 | - |
| `HOME_STOCKS_DISTRIBUTE` | 首页涨跌分布 | - |
| `STOCKINDEX_STOCKS_DISTRIBUTE` | 板块涨跌分布 | - |
| `STOCK_CODE_QUERY` | 个股代码联想 | - |
| `STOCK_NAME_QUERY` | 个股名称联想 | - |
| `STOCKINDEX_NAME_QUERY` | 板块名称联想 | - |
### 10.2 缓存使用场景
#### 10.2.1 股票交易数据 (Stocks) 缓存
| 接口 | 缓存键 | 功能描述 | 过期时间 |
|-----|-------|---------|--------|
| /stocksystem/stocks/listStrongStocks | HOME_STRONG_STOCKS + 日期 + "_" + 类型 | 查询强势股 | 3天 |
| /stocksystem/stocks/listLimitStocks | HOME_LIMIT_STOCKS + 日期 + "_" + 类型 | 查询涨停股 | 3天 |
| /stocksystem/stocks/listDropStocks | HOME_DROP_LIMIT_STOCKS + 日期 + "_" + 类型 | 查询跌停股 | 3天 |
| /stocksystem/stocks/distribution | HOME_STOCKS_DISTRIBUTE + 日期 + "_" + 类型 | 查询涨跌分布 | 3天 |
| /stocksystem/stocks/stockindestocksdistribution | STOCKINDEX_STOCKS_DISTRIBUTE + 日期 + "_" + 板块 | 查询板块涨跌分布 | 3天 |
| /stocksystem/stocks/groupLimitlist | 动态生成 | 查询每日涨跌停板列表 | 3天 |
| /stocksystem/stocks/stockQueryData | STOCK_CODE_QUERY | 获取个股代码联想数据 | 12小时 |
| /stocksystem/stocks/stockNameQueryData | STOCK_NAME_QUERY | 获取个股名称联想数据 | 12小时 |
| /stocksystem/stocks/stockIndexsNameQueryData | STOCKINDEX_NAME_QUERY | 获取板块名称联想数据 | 12小时 |
| /stocksystem/stocks/getTradeDay | 动态生成 | 获取最近交易日 | - |
#### 10.2.2 股票创新高/新低数据 (StocksNewRecord) 缓存
| 接口 | 缓存键 | 功能描述 | 过期时间 |
|-----|-------|---------|--------|
| /stocksystem/newrecord/grouplist | HOME_HIGH_DISTRIBUTE/HOME_LOW_DISTRIBUTE + 日期 | 查询每日新高新低列表 | 3天 |
#### 10.2.3 行业趋势分析数据 (Trends) 缓存
| 接口 | 缓存键 | 功能描述 | 过期时间 |
|-----|-------|---------|--------|
| /stocksystem/trends/querytrendstockslist | HOME_TRENDS_STOCKS + 日期 + "_" + 类型 | 查询动量趋势个股 | 3天 |
| /stocksystem/trends/listSection | TRENDS + 日期 + "_" + 类型 | 查询行情数据列表含基础数据 | 3天 |
| /stocksystem/trends/listSectionByBlemind | TRENDS_SECTION_BLEMIND + 日期 + "_" + 板块 + "_" + 类型 | 查询板块动量值 | 3天 |
### 10.3 缓存使用模式
各控制器采用统一的缓存使用模式:
1. **生成缓存键**:根据业务参数(如日期、类型、板块等)动态生成缓存键
2. **查询缓存**:使用 `redisCache.getCacheList()``redisCache.getCacheObject()` 查询缓存
3. **缓存命中处理**:如果缓存存在,直接返回缓存数据
4. **缓存未命中处理**
- 查询数据库获取数据
- 使用 `redisCache.setCacheList()``redisCache.setCacheObject()` 将数据存入缓存
- 使用 `redisCache.expire()` 设置缓存过期时间
5. **特殊情况**:当存在搜索条件时,通常不走缓存,也不缓存结果
## 11. 附录
### 11.1 数据实体对应文件路径
| 数据实体 | 文件路径 |
|---------|--------|
| StockBasic | stock-system/src/main/java/com/ruoyi/stocksystem/domain/StockBasic.java |
| StockFinancial | stock-system/src/main/java/com/ruoyi/stocksystem/domain/StockFinancial.java |
| StockIndex | stock-system/src/main/java/com/ruoyi/stocksystem/domain/StockIndex.java |
| Stocks | stock-system/src/main/java/com/ruoyi/stocksystem/domain/Stocks.java |
| StocksInTrend | stock-system/src/main/java/com/ruoyi/stocksystem/domain/StocksInTrend.java |
| StocksLimit | stock-system/src/main/java/com/ruoyi/stocksystem/domain/StocksLimit.java |
| StocksNewRecord | stock-system/src/main/java/com/ruoyi/stocksystem/domain/StocksNewRecord.java |
| TradeDates | stock-system/src/main/java/com/ruoyi/stocksystem/domain/TradeDates.java |
| Trends | stock-system/src/main/java/com/ruoyi/stocksystem/domain/Trends.java |
### 11.2 技术实现特点
- 采用了典型的 MVC 架构
- 使用 MyBatis 作为 ORM 框架与数据库交互
- 支持 Excel 导入导出功能
- 提供了丰富的分析指标和查询功能
- 数据结构设计符合金融行业特点,支持高频数据处理
- 集成了 Redis 缓存,提高查询性能
- 提供了丰富的统计分析接口,支持多维度数据查询
- 缓存键设计合理,分层清晰,便于管理和维护
- 缓存过期时间设置合理,平衡了性能和数据新鲜度

@ -1,230 +0,0 @@
-- Stock-System 优化后的数据库表结构
-- 设置字符集
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- 1. 基础数据表
-- 1.1 行业表
DROP TABLE IF EXISTS `new_stock_industry`;
CREATE TABLE `new_stock_industry` (
`industry_id` INT NOT NULL AUTO_INCREMENT COMMENT '行业ID',
`industry_level` TINYINT NOT NULL COMMENT '行业级别1-3',
`industry_code` VARCHAR(20) NOT NULL COMMENT '行业代码',
`industry_name` VARCHAR(50) NOT NULL COMMENT '行业名称',
`parent_code` VARCHAR(20) NULL COMMENT '父行业代码',
PRIMARY KEY (`industry_id`) USING BTREE,
UNIQUE INDEX `idx_industry_code` (`industry_code`) USING BTREE,
INDEX `idx_industry_level` (`industry_level`) USING BTREE,
INDEX `idx_parent_code` (`parent_code`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '行业分类表' ROW_FORMAT = Dynamic;
-- 1.2 股票基础信息表
DROP TABLE IF EXISTS `new_stock_basic`;
CREATE TABLE `new_stock_basic` (
`id` INT NOT NULL AUTO_INCREMENT COMMENT '主键ID',
`code` VARCHAR(10) NOT NULL COMMENT '股票代码',
`name` VARCHAR(20) NOT NULL COMMENT '股票名称',
`industry_id` INT NULL COMMENT '所属行业ID关联new_stock_industry',
`list_date` DATE NULL COMMENT '首发上市日期',
`market_type` VARCHAR(10) NULL COMMENT '市场类型SZ/SH',
`status` TINYINT DEFAULT 1 COMMENT '状态1-正常0-暂停上市)',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `idx_code` (`code`) USING BTREE,
INDEX `idx_industry_id` (`industry_id`) USING BTREE,
INDEX `idx_list_date` (`list_date`) USING BTREE,
INDEX `idx_market_type` (`market_type`) USING BTREE,
CONSTRAINT `fk_stock_basic_industry` FOREIGN KEY (`industry_id`) REFERENCES `new_stock_industry` (`industry_id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '股票基础信息表' ROW_FORMAT = Dynamic;
-- 2. 财务数据表
-- 2.1 财务数据表
DROP TABLE IF EXISTS `new_stock_financial`;
CREATE TABLE `new_stock_financial` (
`id` INT NOT NULL AUTO_INCREMENT COMMENT '主键ID',
`code` VARCHAR(10) NOT NULL COMMENT '股票代码关联new_stock_basic',
`period` DATE NOT NULL COMMENT '报告期',
`net_profit_yoy` DECIMAL(15,4) NULL COMMENT '净利润同比增长率',
`net_profit_qoq` DECIMAL(15,4) NULL COMMENT '净利润环比增长率',
`roe` DECIMAL(10,4) NULL COMMENT '净资产收益率ROE',
`eps` DECIMAL(10,4) NULL COMMENT '每股收益EPS',
`net_profit` DECIMAL(20,4) NULL COMMENT '净利润',
`basic_eps` DECIMAL(10,4) NULL COMMENT '基本每股收益',
`bps` DECIMAL(10,4) NULL COMMENT '每股净资产BPS',
`total_assets` DECIMAL(20,4) NULL COMMENT '总资产',
`total_liabilities` DECIMAL(20,4) NULL COMMENT '总负债',
`operating_income` DECIMAL(20,4) NULL COMMENT '营业收入',
`create_time` DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `idx_code_period` (`code`, `period`) USING BTREE,
INDEX `idx_period` (`period`) USING BTREE,
INDEX `idx_roe` (`roe`) USING BTREE,
INDEX `idx_eps` (`eps`) USING BTREE,
CONSTRAINT `fk_stock_financial_basic` FOREIGN KEY (`code`) REFERENCES `new_stock_basic` (`code`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '股票财务数据表' ROW_FORMAT = Dynamic;
-- 3. 指数数据表
-- 3.1 指数数据表
DROP TABLE IF EXISTS `new_stock_index`;
CREATE TABLE `new_stock_index` (
`id` INT NOT NULL AUTO_INCREMENT COMMENT '主键ID',
`code` VARCHAR(10) NOT NULL COMMENT '指数代码',
`name` VARCHAR(20) NOT NULL COMMENT '指数名称',
`trade_date` DATE NOT NULL COMMENT '交易日期',
`open` DECIMAL(10,2) NULL COMMENT '开盘价',
`close` DECIMAL(10,2) NULL COMMENT '收盘价',
`high` DECIMAL(10,2) NULL COMMENT '最高价',
`low` DECIMAL(10,2) NULL COMMENT '最低价',
`change_rate` DECIMAL(8,4) NULL COMMENT '涨跌幅',
`volume` BIGINT NULL COMMENT '成交量',
`amount` DECIMAL(20,2) NULL COMMENT '成交额',
`create_time` DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `idx_code_trade_date` (`code`, `trade_date`) USING BTREE,
INDEX `idx_trade_date` (`trade_date`) USING BTREE,
INDEX `idx_change_rate` (`change_rate`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '股票指数数据表' ROW_FORMAT = Dynamic;
-- 4. 交易数据表
-- 4.1 交易数据表
DROP TABLE IF EXISTS `new_stocks`;
CREATE TABLE `new_stocks` (
`id` INT NOT NULL AUTO_INCREMENT COMMENT '主键ID',
`code` VARCHAR(10) NOT NULL COMMENT '股票代码关联new_stock_basic',
`trade_date` DATE NOT NULL COMMENT '交易日期',
`open` DECIMAL(10,2) NULL COMMENT '开盘价',
`close` DECIMAL(10,2) NULL COMMENT '收盘价',
`change_rate` DECIMAL(8,4) NULL COMMENT '当日涨跌幅',
`trade_days` INT NULL COMMENT '可交易日数',
`volume` BIGINT NULL COMMENT '成交量',
`amount` DECIMAL(20,2) NULL COMMENT '成交额',
`change_rate_10` DECIMAL(8,4) NULL COMMENT '10日区间涨跌幅',
`change_rate_20` DECIMAL(8,4) NULL COMMENT '20日区间涨跌幅',
`change_rate_60` DECIMAL(8,4) NULL COMMENT '60日区间涨跌幅',
`avg_volume_20` DECIMAL(20,2) NULL COMMENT '20日区间平均成交量',
`free_float_market_value` DECIMAL(20,2) NULL COMMENT '自由流通市值',
`total_market_value` DECIMAL(20,2) NULL COMMENT '总市值',
`agencies_hold` DECIMAL(10,4) NULL COMMENT '机构持仓合计',
`create_time` DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `idx_code_trade_date` (`code`, `trade_date`) USING BTREE,
INDEX `idx_trade_date` (`trade_date`) USING BTREE,
INDEX `idx_change_rate` (`change_rate`) USING BTREE,
INDEX `idx_total_market_value` (`total_market_value`) USING BTREE,
CONSTRAINT `fk_stocks_basic` FOREIGN KEY (`code`) REFERENCES `new_stock_basic` (`code`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '股票每日交易数据表' ROW_FORMAT = Dynamic;
-- 5. 趋势数据表
-- 5.1 趋势数据表
DROP TABLE IF EXISTS `new_stock_trend`;
CREATE TABLE `new_stock_trend` (
`id` INT NOT NULL AUTO_INCREMENT COMMENT '主键ID',
`code` VARCHAR(10) NOT NULL COMMENT '股票代码关联new_stock_basic',
`trade_date` DATE NOT NULL COMMENT '交易日期',
`ma5` DECIMAL(10,2) NULL COMMENT '5日均线',
`ma10` DECIMAL(10,2) NULL COMMENT '10日均线',
`ma20` DECIMAL(10,2) NULL COMMENT '20日均线',
`ma60` DECIMAL(10,2) NULL COMMENT '60日均线',
`macd` DECIMAL(8,4) NULL COMMENT 'MACD值',
`kdj_k` DECIMAL(8,4) NULL COMMENT 'KDJ-K值',
`kdj_d` DECIMAL(8,4) NULL COMMENT 'KDJ-D值',
`kdj_j` DECIMAL(8,4) NULL COMMENT 'KDJ-J值',
`rsi` DECIMAL(8,4) NULL COMMENT 'RSI值',
`volume_ratio` DECIMAL(8,4) NULL COMMENT '量比',
`turnover_rate` DECIMAL(8,4) NULL COMMENT '换手率',
`create_time` DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `idx_code_trade_date` (`code`, `trade_date`) USING BTREE,
INDEX `idx_trade_date` (`trade_date`) USING BTREE,
CONSTRAINT `fk_stock_trend_basic` FOREIGN KEY (`code`) REFERENCES `new_stock_basic` (`code`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '股票趋势数据表' ROW_FORMAT = Dynamic;
-- 5.2 涨跌停数据表
DROP TABLE IF EXISTS `new_stock_limit`;
CREATE TABLE `new_stock_limit` (
`id` INT NOT NULL AUTO_INCREMENT COMMENT '主键ID',
`code` VARCHAR(10) NOT NULL COMMENT '股票代码关联new_stock_basic',
`trade_date` DATE NOT NULL COMMENT '交易日期',
`limit_type` TINYINT NOT NULL COMMENT '涨跌停类型1-涨停,-1-跌停)',
`limit_price` DECIMAL(10,2) NULL COMMENT '涨跌停价格',
`open_price` DECIMAL(10,2) NULL COMMENT '开盘价',
`close_price` DECIMAL(10,2) NULL COMMENT '收盘价',
`volume` BIGINT NULL COMMENT '成交量',
`amount` DECIMAL(20,2) NULL COMMENT '成交额',
`create_time` DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `idx_code_trade_date` (`code`, `trade_date`) USING BTREE,
INDEX `idx_trade_date` (`trade_date`) USING BTREE,
INDEX `idx_limit_type` (`limit_type`) USING BTREE,
CONSTRAINT `fk_stock_limit_basic` FOREIGN KEY (`code`) REFERENCES `new_stock_basic` (`code`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '股票涨跌停数据表' ROW_FORMAT = Dynamic;
-- 5.3 创新高/新低数据表
DROP TABLE IF EXISTS `new_stock_new_record`;
CREATE TABLE `new_stock_new_record` (
`id` INT NOT NULL AUTO_INCREMENT COMMENT '主键ID',
`code` VARCHAR(10) NOT NULL COMMENT '股票代码关联new_stock_basic',
`trade_date` DATE NOT NULL COMMENT '交易日期',
`record_type` TINYINT NOT NULL COMMENT '记录类型1-创新高,-1-创新低)',
`price` DECIMAL(10,2) NOT NULL COMMENT '价格',
`days` INT NULL COMMENT '创新高/新低天数',
`create_time` DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `idx_code_trade_date` (`code`, `trade_date`) USING BTREE,
INDEX `idx_trade_date` (`trade_date`) USING BTREE,
INDEX `idx_record_type` (`record_type`) USING BTREE,
CONSTRAINT `fk_stock_new_record_basic` FOREIGN KEY (`code`) REFERENCES `new_stock_basic` (`code`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '股票创新高/新低数据表' ROW_FORMAT = Dynamic;
-- 6. 交易日数据
-- 6.1 交易日历表
DROP TABLE IF EXISTS `new_trade_dates`;
CREATE TABLE `new_trade_dates` (
`id` INT NOT NULL AUTO_INCREMENT COMMENT '主键ID',
`trade_date` DATE NOT NULL COMMENT '交易日日期',
`is_trading` TINYINT DEFAULT 1 COMMENT '是否交易日1-是0-否)',
`year` SMALLINT NOT NULL COMMENT '年份',
`month` TINYINT NOT NULL COMMENT '月份',
`day` TINYINT NOT NULL COMMENT '日期',
`weekday` TINYINT NOT NULL COMMENT '星期几1-7',
`is_weekend` TINYINT DEFAULT 0 COMMENT '是否周末1-是0-否)',
`is_holiday` TINYINT DEFAULT 0 COMMENT '是否节假日1-是0-否)',
`create_time` DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `idx_trade_date` (`trade_date`) USING BTREE,
INDEX `idx_year_month` (`year`, `month`) USING BTREE,
INDEX `idx_is_trading` (`is_trading`) USING BTREE,
INDEX `idx_weekday` (`weekday`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '交易日历表' ROW_FORMAT = Dynamic;
-- 7. 行业趋势分析数据
-- 7.1 行业趋势表
DROP TABLE IF EXISTS `new_industry_trend`;
CREATE TABLE `new_industry_trend` (
`id` INT NOT NULL AUTO_INCREMENT COMMENT '主键ID',
`industry_id` INT NOT NULL COMMENT '行业ID关联new_stock_industry',
`trade_date` DATE NOT NULL COMMENT '交易日期',
`avg_change_rate` DECIMAL(8,4) NULL COMMENT '行业平均涨跌幅',
`up_stocks_count` INT NULL COMMENT '上涨股票数',
`down_stocks_count` INT NULL COMMENT '下跌股票数',
`flat_stocks_count` INT NULL COMMENT '平盘股票数',
`limit_up_count` INT NULL COMMENT '涨停股票数',
`limit_down_count` INT NULL COMMENT '跌停股票数',
`total_market_value` DECIMAL(25,2) NULL COMMENT '行业总市值',
`avg_turnover_rate` DECIMAL(8,4) NULL COMMENT '行业平均换手率',
`create_time` DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `idx_industry_trade_date` (`industry_id`, `trade_date`) USING BTREE,
INDEX `idx_trade_date` (`trade_date`) USING BTREE,
INDEX `idx_avg_change_rate` (`avg_change_rate`) USING BTREE,
CONSTRAINT `fk_industry_trend_industry` FOREIGN KEY (`industry_id`) REFERENCES `new_stock_industry` (`industry_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '行业趋势分析表' ROW_FORMAT = Dynamic;
SET FOREIGN_KEY_CHECKS = 1;

@ -337,7 +337,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select> </select>
<select id="selectStocksForHigh" parameterType="Stocks" resultMap="StocksResult"> <select id="selectStocksForHigh" parameterType="Stocks" resultMap="StocksResult">
select trade_day,code,open,MAX(close) as close,high,low,differrange20 from stocks where trade_day BETWEEN #{stradeDay} and #{tradeDay} GROUP BY code,trade_day,open,high,low,differrange20 ORDER BY differrange20 desc; select trade_day,code,open,MAX(close) as close,high,low,differrange20 from stocks where trade_day BETWEEN #{stradeDay} and #{tradeDay} GROUP BY code ORDER BY differrange20 desc;
</select> </select>
<!--插入到stocks_tmp表中的数据--> <!--插入到stocks_tmp表中的数据-->

Loading…
Cancel
Save