diff --git a/book-system/src/main/java/com/ruoyi/booksystem/controller/AccountController.java b/book-system/src/main/java/com/ruoyi/booksystem/controller/AccountController.java new file mode 100644 index 0000000..7b25c9a --- /dev/null +++ b/book-system/src/main/java/com/ruoyi/booksystem/controller/AccountController.java @@ -0,0 +1,104 @@ +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 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 list = accountService.selectAccountList(account); + ExcelUtil util = new ExcelUtil(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)); + } +} diff --git a/book-system/src/main/java/com/ruoyi/booksystem/controller/OperationsController.java b/book-system/src/main/java/com/ruoyi/booksystem/controller/OperationsController.java new file mode 100644 index 0000000..6a6ef4c --- /dev/null +++ b/book-system/src/main/java/com/ruoyi/booksystem/controller/OperationsController.java @@ -0,0 +1,104 @@ +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.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 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 list = operationsService.selectOperationsList(operations); + ExcelUtil util = new ExcelUtil(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) + { + 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)); + } +} diff --git a/book-system/src/main/java/com/ruoyi/booksystem/controller/StatisticsController.java b/book-system/src/main/java/com/ruoyi/booksystem/controller/StatisticsController.java new file mode 100644 index 0000000..ac7a721 --- /dev/null +++ b/book-system/src/main/java/com/ruoyi/booksystem/controller/StatisticsController.java @@ -0,0 +1,104 @@ +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 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 list = statisticsService.selectStatisticsList(statistics); + ExcelUtil util = new ExcelUtil(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)); + } +} diff --git a/book-system/src/main/java/com/ruoyi/booksystem/controller/StatisticsRemainController.java b/book-system/src/main/java/com/ruoyi/booksystem/controller/StatisticsRemainController.java new file mode 100644 index 0000000..825b786 --- /dev/null +++ b/book-system/src/main/java/com/ruoyi/booksystem/controller/StatisticsRemainController.java @@ -0,0 +1,104 @@ +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 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 list = statisticsRemainService.selectStatisticsRemainList(statisticsRemain); + ExcelUtil util = new ExcelUtil(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)); + } +} diff --git a/book-system/src/main/java/com/ruoyi/booksystem/controller/StatisticsTotalController.java b/book-system/src/main/java/com/ruoyi/booksystem/controller/StatisticsTotalController.java new file mode 100644 index 0000000..8aa2ea4 --- /dev/null +++ b/book-system/src/main/java/com/ruoyi/booksystem/controller/StatisticsTotalController.java @@ -0,0 +1,104 @@ +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 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 list = statisticsTotalService.selectStatisticsTotalList(statisticsTotal); + ExcelUtil util = new ExcelUtil(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)); + } +} diff --git a/book-system/src/main/java/com/ruoyi/booksystem/domain/Account.java b/book-system/src/main/java/com/ruoyi/booksystem/domain/Account.java new file mode 100644 index 0000000..4db857e --- /dev/null +++ b/book-system/src/main/java/com/ruoyi/booksystem/domain/Account.java @@ -0,0 +1,154 @@ +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; + + /** 交易日星期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "交易日星期", width = 30, dateFormat = "yyyy-MM-dd") + private Date 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(Date weekDay) + { + this.weekDay = weekDay; + } + + public Date 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(); + } +} diff --git a/book-system/src/main/java/com/ruoyi/booksystem/domain/Operations.java b/book-system/src/main/java/com/ruoyi/booksystem/domain/Operations.java new file mode 100644 index 0000000..3043e84 --- /dev/null +++ b/book-system/src/main/java/com/ruoyi/booksystem/domain/Operations.java @@ -0,0 +1,266 @@ +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; + + /** 交易日星期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "交易日星期", width = 30, dateFormat = "yyyy-MM-dd") + private Date 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(Date weekDay) + { + this.weekDay = weekDay; + } + + public Date 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(); + } +} diff --git a/book-system/src/main/java/com/ruoyi/booksystem/domain/Statistics.java b/book-system/src/main/java/com/ruoyi/booksystem/domain/Statistics.java new file mode 100644 index 0000000..6ccf2e2 --- /dev/null +++ b/book-system/src/main/java/com/ruoyi/booksystem/domain/Statistics.java @@ -0,0 +1,182 @@ +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; + + /** 交易日星期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "交易日星期", width = 30, dateFormat = "yyyy-MM-dd") + private Date 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(Date weekDay) + { + this.weekDay = weekDay; + } + + public Date 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(); + } +} diff --git a/book-system/src/main/java/com/ruoyi/booksystem/domain/StatisticsRemain.java b/book-system/src/main/java/com/ruoyi/booksystem/domain/StatisticsRemain.java new file mode 100644 index 0000000..cd50201 --- /dev/null +++ b/book-system/src/main/java/com/ruoyi/booksystem/domain/StatisticsRemain.java @@ -0,0 +1,182 @@ +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; + + /** 交易日星期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "交易日星期", width = 30, dateFormat = "yyyy-MM-dd") + private Date 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(Date weekDay) + { + this.weekDay = weekDay; + } + + public Date 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(); + } +} diff --git a/book-system/src/main/java/com/ruoyi/booksystem/domain/StatisticsTotal.java b/book-system/src/main/java/com/ruoyi/booksystem/domain/StatisticsTotal.java new file mode 100644 index 0000000..ed5b87e --- /dev/null +++ b/book-system/src/main/java/com/ruoyi/booksystem/domain/StatisticsTotal.java @@ -0,0 +1,266 @@ +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(); + } +} diff --git a/book-system/src/main/java/com/ruoyi/booksystem/mapper/AccountMapper.java b/book-system/src/main/java/com/ruoyi/booksystem/mapper/AccountMapper.java new file mode 100644 index 0000000..0296e48 --- /dev/null +++ b/book-system/src/main/java/com/ruoyi/booksystem/mapper/AccountMapper.java @@ -0,0 +1,61 @@ +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 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); +} diff --git a/book-system/src/main/java/com/ruoyi/booksystem/mapper/OperationsMapper.java b/book-system/src/main/java/com/ruoyi/booksystem/mapper/OperationsMapper.java new file mode 100644 index 0000000..53b9856 --- /dev/null +++ b/book-system/src/main/java/com/ruoyi/booksystem/mapper/OperationsMapper.java @@ -0,0 +1,61 @@ +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 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); +} diff --git a/book-system/src/main/java/com/ruoyi/booksystem/mapper/StatisticsMapper.java b/book-system/src/main/java/com/ruoyi/booksystem/mapper/StatisticsMapper.java new file mode 100644 index 0000000..db5de01 --- /dev/null +++ b/book-system/src/main/java/com/ruoyi/booksystem/mapper/StatisticsMapper.java @@ -0,0 +1,61 @@ +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 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); +} diff --git a/book-system/src/main/java/com/ruoyi/booksystem/mapper/StatisticsRemainMapper.java b/book-system/src/main/java/com/ruoyi/booksystem/mapper/StatisticsRemainMapper.java new file mode 100644 index 0000000..f4ddb9d --- /dev/null +++ b/book-system/src/main/java/com/ruoyi/booksystem/mapper/StatisticsRemainMapper.java @@ -0,0 +1,61 @@ +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 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); +} diff --git a/book-system/src/main/java/com/ruoyi/booksystem/mapper/StatisticsTotalMapper.java b/book-system/src/main/java/com/ruoyi/booksystem/mapper/StatisticsTotalMapper.java new file mode 100644 index 0000000..72dc097 --- /dev/null +++ b/book-system/src/main/java/com/ruoyi/booksystem/mapper/StatisticsTotalMapper.java @@ -0,0 +1,61 @@ +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 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); +} diff --git a/book-system/src/main/java/com/ruoyi/booksystem/service/IAccountService.java b/book-system/src/main/java/com/ruoyi/booksystem/service/IAccountService.java new file mode 100644 index 0000000..2486d43 --- /dev/null +++ b/book-system/src/main/java/com/ruoyi/booksystem/service/IAccountService.java @@ -0,0 +1,61 @@ +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 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); +} diff --git a/book-system/src/main/java/com/ruoyi/booksystem/service/IOperationsService.java b/book-system/src/main/java/com/ruoyi/booksystem/service/IOperationsService.java new file mode 100644 index 0000000..c6f6b71 --- /dev/null +++ b/book-system/src/main/java/com/ruoyi/booksystem/service/IOperationsService.java @@ -0,0 +1,61 @@ +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 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); +} diff --git a/book-system/src/main/java/com/ruoyi/booksystem/service/IStatisticsRemainService.java b/book-system/src/main/java/com/ruoyi/booksystem/service/IStatisticsRemainService.java new file mode 100644 index 0000000..f38cc32 --- /dev/null +++ b/book-system/src/main/java/com/ruoyi/booksystem/service/IStatisticsRemainService.java @@ -0,0 +1,61 @@ +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 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); +} diff --git a/book-system/src/main/java/com/ruoyi/booksystem/service/IStatisticsService.java b/book-system/src/main/java/com/ruoyi/booksystem/service/IStatisticsService.java new file mode 100644 index 0000000..742f6a8 --- /dev/null +++ b/book-system/src/main/java/com/ruoyi/booksystem/service/IStatisticsService.java @@ -0,0 +1,61 @@ +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 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); +} diff --git a/book-system/src/main/java/com/ruoyi/booksystem/service/IStatisticsTotalService.java b/book-system/src/main/java/com/ruoyi/booksystem/service/IStatisticsTotalService.java new file mode 100644 index 0000000..743f34e --- /dev/null +++ b/book-system/src/main/java/com/ruoyi/booksystem/service/IStatisticsTotalService.java @@ -0,0 +1,61 @@ +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 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); +} diff --git a/book-system/src/main/java/com/ruoyi/booksystem/service/impl/AccountServiceImpl.java b/book-system/src/main/java/com/ruoyi/booksystem/service/impl/AccountServiceImpl.java new file mode 100644 index 0000000..b67af11 --- /dev/null +++ b/book-system/src/main/java/com/ruoyi/booksystem/service/impl/AccountServiceImpl.java @@ -0,0 +1,93 @@ +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 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); + } +} diff --git a/book-system/src/main/java/com/ruoyi/booksystem/service/impl/OperationsServiceImpl.java b/book-system/src/main/java/com/ruoyi/booksystem/service/impl/OperationsServiceImpl.java new file mode 100644 index 0000000..4939022 --- /dev/null +++ b/book-system/src/main/java/com/ruoyi/booksystem/service/impl/OperationsServiceImpl.java @@ -0,0 +1,93 @@ +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 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); + } +} diff --git a/book-system/src/main/java/com/ruoyi/booksystem/service/impl/StatisticsRemainServiceImpl.java b/book-system/src/main/java/com/ruoyi/booksystem/service/impl/StatisticsRemainServiceImpl.java new file mode 100644 index 0000000..8834b3d --- /dev/null +++ b/book-system/src/main/java/com/ruoyi/booksystem/service/impl/StatisticsRemainServiceImpl.java @@ -0,0 +1,93 @@ +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 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); + } +} diff --git a/book-system/src/main/java/com/ruoyi/booksystem/service/impl/StatisticsServiceImpl.java b/book-system/src/main/java/com/ruoyi/booksystem/service/impl/StatisticsServiceImpl.java new file mode 100644 index 0000000..a4e1c6a --- /dev/null +++ b/book-system/src/main/java/com/ruoyi/booksystem/service/impl/StatisticsServiceImpl.java @@ -0,0 +1,93 @@ +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 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); + } +} diff --git a/book-system/src/main/java/com/ruoyi/booksystem/service/impl/StatisticsTotalServiceImpl.java b/book-system/src/main/java/com/ruoyi/booksystem/service/impl/StatisticsTotalServiceImpl.java new file mode 100644 index 0000000..c48e9b4 --- /dev/null +++ b/book-system/src/main/java/com/ruoyi/booksystem/service/impl/StatisticsTotalServiceImpl.java @@ -0,0 +1,93 @@ +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 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); + } +} diff --git a/book-system/src/main/resources/mapper/booksystem/AccountMapper.xml b/book-system/src/main/resources/mapper/booksystem/AccountMapper.xml new file mode 100644 index 0000000..7ac7520 --- /dev/null +++ b/book-system/src/main/resources/mapper/booksystem/AccountMapper.xml @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + select id, trade_day, week_day, assets, total_assets, profit, assets_diff, total_diff, user_id from account + + + + + + + + insert into account + + trade_day, + week_day, + assets, + total_assets, + profit, + assets_diff, + total_diff, + user_id, + + + #{tradeDay}, + #{weekDay}, + #{assets}, + #{totalAssets}, + #{profit}, + #{assetsDiff}, + #{totalDiff}, + #{userId}, + + + + + update account + + trade_day = #{tradeDay}, + week_day = #{weekDay}, + assets = #{assets}, + total_assets = #{totalAssets}, + profit = #{profit}, + assets_diff = #{assetsDiff}, + total_diff = #{totalDiff}, + user_id = #{userId}, + + where id = #{id} + + + + delete from account where id = #{id} + + + + delete from account where id in + + #{id} + + + \ No newline at end of file diff --git a/book-system/src/main/resources/mapper/booksystem/OperationsMapper.xml b/book-system/src/main/resources/mapper/booksystem/OperationsMapper.xml new file mode 100644 index 0000000..61b229b --- /dev/null +++ b/book-system/src/main/resources/mapper/booksystem/OperationsMapper.xml @@ -0,0 +1,131 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + insert into operations + + code, + name, + trade_day, + week_day, + operate, + deal_price, + volumn, + amount, + tax, + fee, + other, + operate_diff, + pre_id, + user_id, + deal_logic, + bz, + + + #{code}, + #{name}, + #{tradeDay}, + #{weekDay}, + #{operate}, + #{dealPrice}, + #{volumn}, + #{amount}, + #{tax}, + #{fee}, + #{other}, + #{operateDiff}, + #{preId}, + #{userId}, + #{dealLogic}, + #{bz}, + + + + + update operations + + code = #{code}, + name = #{name}, + trade_day = #{tradeDay}, + week_day = #{weekDay}, + operate = #{operate}, + deal_price = #{dealPrice}, + volumn = #{volumn}, + amount = #{amount}, + tax = #{tax}, + fee = #{fee}, + other = #{other}, + operate_diff = #{operateDiff}, + pre_id = #{preId}, + user_id = #{userId}, + deal_logic = #{dealLogic}, + bz = #{bz}, + + where id = #{id} + + + + delete from operations where id = #{id} + + + + delete from operations where id in + + #{id} + + + \ No newline at end of file diff --git a/book-system/src/main/resources/mapper/booksystem/StatisticsMapper.xml b/book-system/src/main/resources/mapper/booksystem/StatisticsMapper.xml new file mode 100644 index 0000000..0066e05 --- /dev/null +++ b/book-system/src/main/resources/mapper/booksystem/StatisticsMapper.xml @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + select id, code, name, trade_day, week_day, operations_id, profit, diff, operateion_id, user_id, bz from statistics + + + + + + + + insert into statistics + + code, + name, + trade_day, + week_day, + operations_id, + profit, + diff, + operateion_id, + user_id, + bz, + + + #{code}, + #{name}, + #{tradeDay}, + #{weekDay}, + #{operationsId}, + #{profit}, + #{diff}, + #{operateionId}, + #{userId}, + #{bz}, + + + + + update statistics + + code = #{code}, + name = #{name}, + trade_day = #{tradeDay}, + week_day = #{weekDay}, + operations_id = #{operationsId}, + profit = #{profit}, + diff = #{diff}, + operateion_id = #{operateionId}, + user_id = #{userId}, + bz = #{bz}, + + where id = #{id} + + + + delete from statistics where id = #{id} + + + + delete from statistics where id in + + #{id} + + + \ No newline at end of file diff --git a/book-system/src/main/resources/mapper/booksystem/StatisticsRemainMapper.xml b/book-system/src/main/resources/mapper/booksystem/StatisticsRemainMapper.xml new file mode 100644 index 0000000..a6350d4 --- /dev/null +++ b/book-system/src/main/resources/mapper/booksystem/StatisticsRemainMapper.xml @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + select id, code, name, trade_day, week_day, total_profit, total_diff, total_diff_overall, remaining, user_id, bz from statistics_remain + + + + + + + + insert into statistics_remain + + code, + name, + trade_day, + week_day, + total_profit, + total_diff, + total_diff_overall, + remaining, + user_id, + bz, + + + #{code}, + #{name}, + #{tradeDay}, + #{weekDay}, + #{totalProfit}, + #{totalDiff}, + #{totalDiffOverall}, + #{remaining}, + #{userId}, + #{bz}, + + + + + update statistics_remain + + code = #{code}, + name = #{name}, + trade_day = #{tradeDay}, + week_day = #{weekDay}, + total_profit = #{totalProfit}, + total_diff = #{totalDiff}, + total_diff_overall = #{totalDiffOverall}, + remaining = #{remaining}, + user_id = #{userId}, + bz = #{bz}, + + where id = #{id} + + + + delete from statistics_remain where id = #{id} + + + + delete from statistics_remain where id in + + #{id} + + + \ No newline at end of file diff --git a/book-system/src/main/resources/mapper/booksystem/StatisticsTotalMapper.xml b/book-system/src/main/resources/mapper/booksystem/StatisticsTotalMapper.xml new file mode 100644 index 0000000..35a4f0d --- /dev/null +++ b/book-system/src/main/resources/mapper/booksystem/StatisticsTotalMapper.xml @@ -0,0 +1,131 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + insert into statistics_total + + 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, + + + #{code}, + #{name}, + #{startTradeDay}, + #{endTradeDay}, + #{totalProfit}, + #{totalDiff}, + #{startPrice}, + #{endPrice}, + #{volumnTotal}, + #{amountTotal}, + #{operateTimes}, + #{fee}, + #{tax}, + #{other}, + #{userId}, + #{bz}, + + + + + update statistics_total + + code = #{code}, + name = #{name}, + start_trade_day = #{startTradeDay}, + end_trade_day = #{endTradeDay}, + total_profit = #{totalProfit}, + total_diff = #{totalDiff}, + start_price = #{startPrice}, + end_price = #{endPrice}, + volumn_total = #{volumnTotal}, + amount_total = #{amountTotal}, + operate_times = #{operateTimes}, + fee = #{fee}, + tax = #{tax}, + other = #{other}, + user_id = #{userId}, + bz = #{bz}, + + where id = #{id} + + + + delete from statistics_total where id = #{id} + + + + delete from statistics_total where id in + + #{id} + + + \ No newline at end of file diff --git a/ruoyi-ui/src/api/booksystem/account.js b/ruoyi-ui/src/api/booksystem/account.js new file mode 100644 index 0000000..bc534ae --- /dev/null +++ b/ruoyi-ui/src/api/booksystem/account.js @@ -0,0 +1,44 @@ +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' + }) +} diff --git a/ruoyi-ui/src/api/booksystem/operations.js b/ruoyi-ui/src/api/booksystem/operations.js new file mode 100644 index 0000000..66983ca --- /dev/null +++ b/ruoyi-ui/src/api/booksystem/operations.js @@ -0,0 +1,44 @@ +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' + }) +} diff --git a/ruoyi-ui/src/api/booksystem/statisticremain.js b/ruoyi-ui/src/api/booksystem/statisticremain.js new file mode 100644 index 0000000..4624d27 --- /dev/null +++ b/ruoyi-ui/src/api/booksystem/statisticremain.js @@ -0,0 +1,44 @@ +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' + }) +} diff --git a/ruoyi-ui/src/api/booksystem/statistics.js b/ruoyi-ui/src/api/booksystem/statistics.js new file mode 100644 index 0000000..232cceb --- /dev/null +++ b/ruoyi-ui/src/api/booksystem/statistics.js @@ -0,0 +1,44 @@ +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' + }) +} diff --git a/ruoyi-ui/src/api/booksystem/statistictotal.js b/ruoyi-ui/src/api/booksystem/statistictotal.js new file mode 100644 index 0000000..53c2d85 --- /dev/null +++ b/ruoyi-ui/src/api/booksystem/statistictotal.js @@ -0,0 +1,44 @@ +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' + }) +} diff --git a/ruoyi-ui/src/views/booksystem/account/index.vue b/ruoyi-ui/src/views/booksystem/account/index.vue new file mode 100644 index 0000000..a6eb9be --- /dev/null +++ b/ruoyi-ui/src/views/booksystem/account/index.vue @@ -0,0 +1,367 @@ + + + diff --git a/ruoyi-ui/src/views/booksystem/operations/index.vue b/ruoyi-ui/src/views/booksystem/operations/index.vue new file mode 100644 index 0000000..cb96de0 --- /dev/null +++ b/ruoyi-ui/src/views/booksystem/operations/index.vue @@ -0,0 +1,475 @@ + + + diff --git a/ruoyi-ui/src/views/booksystem/statisticremain/index.vue b/ruoyi-ui/src/views/booksystem/statisticremain/index.vue new file mode 100644 index 0000000..ccee9f2 --- /dev/null +++ b/ruoyi-ui/src/views/booksystem/statisticremain/index.vue @@ -0,0 +1,391 @@ + + + diff --git a/ruoyi-ui/src/views/booksystem/statistics/index.vue b/ruoyi-ui/src/views/booksystem/statistics/index.vue new file mode 100644 index 0000000..bcb4024 --- /dev/null +++ b/ruoyi-ui/src/views/booksystem/statistics/index.vue @@ -0,0 +1,394 @@ + + + diff --git a/ruoyi-ui/src/views/booksystem/statistictotal/index.vue b/ruoyi-ui/src/views/booksystem/statistictotal/index.vue new file mode 100644 index 0000000..0151cc4 --- /dev/null +++ b/ruoyi-ui/src/views/booksystem/statistictotal/index.vue @@ -0,0 +1,481 @@ + + + diff --git a/sql/accountMenu.sql b/sql/accountMenu.sql new file mode 100644 index 0000000..8f56bf6 --- /dev/null +++ b/sql/accountMenu.sql @@ -0,0 +1,22 @@ +-- 菜单 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, ''); \ No newline at end of file diff --git a/sql/nstocks/account.sql b/sql/nstocks/account.sql new file mode 100644 index 0000000..c84c796 --- /dev/null +++ b/sql/nstocks/account.sql @@ -0,0 +1,37 @@ +/* + 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; diff --git a/sql/nstocks/operations.sql b/sql/nstocks/operations.sql new file mode 100644 index 0000000..b15b548 --- /dev/null +++ b/sql/nstocks/operations.sql @@ -0,0 +1,47 @@ +/* + 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; + + diff --git a/sql/nstocks/statistics.sql b/sql/nstocks/statistics.sql new file mode 100644 index 0000000..9732e2f --- /dev/null +++ b/sql/nstocks/statistics.sql @@ -0,0 +1,42 @@ +/* + 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; \ No newline at end of file diff --git a/sql/nstocks/statistics_remain.sql b/sql/nstocks/statistics_remain.sql new file mode 100644 index 0000000..caeaee3 --- /dev/null +++ b/sql/nstocks/statistics_remain.sql @@ -0,0 +1,40 @@ +/* + 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; \ No newline at end of file diff --git a/sql/nstocks/statistics_total.sql b/sql/nstocks/statistics_total.sql new file mode 100644 index 0000000..c21e197 --- /dev/null +++ b/sql/nstocks/statistics_total.sql @@ -0,0 +1,46 @@ +/* + 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; \ No newline at end of file diff --git a/sql/statisticremainMenu.sql b/sql/statisticremainMenu.sql new file mode 100644 index 0000000..82a136b --- /dev/null +++ b/sql/statisticremainMenu.sql @@ -0,0 +1,22 @@ +-- 菜单 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, ''); \ No newline at end of file