Compare commits
37 Commits
main
...
dev_refact
| Author | SHA1 | Date |
|---|---|---|
|
|
524b63159b | 4 months ago |
|
|
0f88a02f5a | 4 months ago |
|
|
a0a0c3a839 | 4 months ago |
|
|
c25a262dc1 | 4 months ago |
|
|
cb477bcd76 | 4 months ago |
|
|
2ce533d145 | 4 months ago |
|
|
79e5fe9417 | 4 months ago |
|
|
df64d3e0c3 | 4 months ago |
|
|
870e7a04a7 | 4 months ago |
|
|
e2b609bf52 | 4 months ago |
|
|
789584e62a | 4 months ago |
|
|
c662a567bd | 4 months ago |
|
|
1faa74db11 | 4 months ago |
|
|
9f39fb2695 | 4 months ago |
|
|
62bc478c04 | 4 months ago |
|
|
eb0e6ca6b3 | 4 months ago |
|
|
726ca58325 | 4 months ago |
|
|
88c3e487b0 | 4 months ago |
|
|
a1623c3c3e | 4 months ago |
|
|
ef0bc92c61 | 4 months ago |
|
|
e66777aa00 | 4 months ago |
|
|
7d0730246f | 4 months ago |
|
|
895796b48c | 4 months ago |
|
|
df537dbac9 | 4 months ago |
|
|
d6ad9c4838 | 4 months ago |
|
|
7bf874398a | 4 months ago |
|
|
26dc129099 | 4 months ago |
|
|
698887cba5 | 4 months ago |
|
|
53e075276a | 4 months ago |
|
|
b3ed90aa42 | 4 months ago |
|
|
aef00b9b6e | 4 months ago |
|
|
f2e36a3ecb | 4 months ago |
|
|
8977d0ff84 | 4 months ago |
|
|
5c6dd7427b | 4 months ago |
|
|
27cf8f5964 | 2 years ago |
|
|
97d8f7ecee | 2 years ago |
|
|
b747888f23 | 2 years ago |
@ -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<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));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,111 @@
|
|||||||
|
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));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -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<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));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -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<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));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -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<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));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,153 @@
|
|||||||
|
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();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,265 @@
|
|||||||
|
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();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,181 @@
|
|||||||
|
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();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,181 @@
|
|||||||
|
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();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -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();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -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<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);
|
||||||
|
}
|
||||||
@ -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<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);
|
||||||
|
}
|
||||||
@ -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<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);
|
||||||
|
}
|
||||||
@ -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<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);
|
||||||
|
}
|
||||||
@ -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<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);
|
||||||
|
}
|
||||||
@ -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<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);
|
||||||
|
}
|
||||||
@ -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<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);
|
||||||
|
}
|
||||||
@ -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<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);
|
||||||
|
}
|
||||||
@ -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<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);
|
||||||
|
}
|
||||||
@ -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<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);
|
||||||
|
}
|
||||||
@ -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<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);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -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<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);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -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<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);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -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<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);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -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<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);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,91 @@
|
|||||||
|
<?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>
|
||||||
@ -0,0 +1,131 @@
|
|||||||
|
<?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>
|
||||||
@ -0,0 +1,101 @@
|
|||||||
|
<?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>
|
||||||
@ -0,0 +1,101 @@
|
|||||||
|
<?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>
|
||||||
@ -0,0 +1,131 @@
|
|||||||
|
<?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>
|
||||||
@ -0,0 +1,147 @@
|
|||||||
|
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
|
||||||
@ -0,0 +1,38 @@
|
|||||||
|
<?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>
|
||||||
@ -0,0 +1,221 @@
|
|||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,104 @@
|
|||||||
|
package com.ruoyi.newstocksystem.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PutMapping;
|
||||||
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import com.ruoyi.common.annotation.Log;
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.ruoyi.newstocksystem.domain.TStockFinancial;
|
||||||
|
import com.ruoyi.newstocksystem.service.TStockFinancialService;
|
||||||
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 股票财务数据Controller
|
||||||
|
*
|
||||||
|
* @author lxy
|
||||||
|
* @date 2026-01-21
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/newstocksystem/stockfinancial")
|
||||||
|
public class TStockFinancialController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private TStockFinancialService tStockFinancialService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询股票财务数据列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('newstocksystem:stockfinancial:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(TStockFinancial tStockFinancial)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<TStockFinancial> list = tStockFinancialService.selectTStockFinancialList(tStockFinancial);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出股票财务数据列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('newstocksystem:stockfinancial:export')")
|
||||||
|
@Log(title = "股票财务数据", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, TStockFinancial tStockFinancial)
|
||||||
|
{
|
||||||
|
List<TStockFinancial> list = tStockFinancialService.selectTStockFinancialList(tStockFinancial);
|
||||||
|
ExcelUtil<TStockFinancial> util = new ExcelUtil<TStockFinancial>(TStockFinancial.class);
|
||||||
|
util.exportExcel(response, list, "股票财务数据数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取股票财务数据详细信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('newstocksystem:stockfinancial:query')")
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||||
|
{
|
||||||
|
return AjaxResult.success(tStockFinancialService.selectTStockFinancialById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增股票财务数据
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('newstocksystem:stockfinancial:add')")
|
||||||
|
@Log(title = "股票财务数据", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@RequestBody TStockFinancial tStockFinancial)
|
||||||
|
{
|
||||||
|
return toAjax(tStockFinancialService.insertTStockFinancial(tStockFinancial));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改股票财务数据
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('newstocksystem:stockfinancial:edit')")
|
||||||
|
@Log(title = "股票财务数据", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@RequestBody TStockFinancial tStockFinancial)
|
||||||
|
{
|
||||||
|
return toAjax(tStockFinancialService.updateTStockFinancial(tStockFinancial));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除股票财务数据
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('newstocksystem:stockfinancial:remove')")
|
||||||
|
@Log(title = "股票财务数据", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public AjaxResult remove(@PathVariable Long[] ids)
|
||||||
|
{
|
||||||
|
return toAjax(tStockFinancialService.deleteTStockFinancialByIds(ids));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,104 @@
|
|||||||
|
package com.ruoyi.newstocksystem.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PutMapping;
|
||||||
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import com.ruoyi.common.annotation.Log;
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.ruoyi.newstocksystem.domain.TStocksInTrend;
|
||||||
|
import com.ruoyi.newstocksystem.service.TStocksInTrendService;
|
||||||
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 趋势中的股票Controller
|
||||||
|
*
|
||||||
|
* @author lxy
|
||||||
|
* @date 2026-01-21
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/newstocksystem/stocksintrnd")
|
||||||
|
public class TStocksInTrendController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private TStocksInTrendService tStocksInTrendService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询趋势中的股票列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('newstocksystem:stocksintrnd:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(TStocksInTrend tStocksInTrend)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<TStocksInTrend> list = tStocksInTrendService.selectTStocksInTrendList(tStocksInTrend);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出趋势中的股票列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('newstocksystem:stocksintrnd:export')")
|
||||||
|
@Log(title = "趋势中的股票", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, TStocksInTrend tStocksInTrend)
|
||||||
|
{
|
||||||
|
List<TStocksInTrend> list = tStocksInTrendService.selectTStocksInTrendList(tStocksInTrend);
|
||||||
|
ExcelUtil<TStocksInTrend> util = new ExcelUtil<TStocksInTrend>(TStocksInTrend.class);
|
||||||
|
util.exportExcel(response, list, "趋势中的股票数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取趋势中的股票详细信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('newstocksystem:stocksintrnd:query')")
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||||
|
{
|
||||||
|
return AjaxResult.success(tStocksInTrendService.selectTStocksInTrendById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增趋势中的股票
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('newstocksystem:stocksintrnd:add')")
|
||||||
|
@Log(title = "趋势中的股票", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@RequestBody TStocksInTrend tStocksInTrend)
|
||||||
|
{
|
||||||
|
return toAjax(tStocksInTrendService.insertTStocksInTrend(tStocksInTrend));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改趋势中的股票
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('newstocksystem:stocksintrnd:edit')")
|
||||||
|
@Log(title = "趋势中的股票", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@RequestBody TStocksInTrend tStocksInTrend)
|
||||||
|
{
|
||||||
|
return toAjax(tStocksInTrendService.updateTStocksInTrend(tStocksInTrend));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除趋势中的股票
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('newstocksystem:stocksintrnd:remove')")
|
||||||
|
@Log(title = "趋势中的股票", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public AjaxResult remove(@PathVariable Long[] ids)
|
||||||
|
{
|
||||||
|
return toAjax(tStocksInTrendService.deleteTStocksInTrendByIds(ids));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,115 @@
|
|||||||
|
package com.ruoyi.newstocksystem.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PutMapping;
|
||||||
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import com.ruoyi.common.annotation.Log;
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.ruoyi.newstocksystem.domain.TTrends;
|
||||||
|
import com.ruoyi.newstocksystem.service.TTrendsService;
|
||||||
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 趋势Controller
|
||||||
|
*
|
||||||
|
* @author lxy
|
||||||
|
* @date 2026-01-21
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/newstocksystem/trends")
|
||||||
|
public class TTrendsController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private TTrendsService tTrendsService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询趋势列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('newstocksystem:trends:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(TTrends tTrends)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<TTrends> list = tTrendsService.selectTTrendsList(tTrends);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出趋势列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('newstocksystem:trends:export')")
|
||||||
|
@Log(title = "趋势", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, TTrends tTrends)
|
||||||
|
{
|
||||||
|
List<TTrends> list = tTrendsService.selectTTrendsList(tTrends);
|
||||||
|
ExcelUtil<TTrends> util = new ExcelUtil<TTrends>(TTrends.class);
|
||||||
|
util.exportExcel(response, list, "趋势数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取趋势详细信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('newstocksystem:trends:query')")
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||||
|
{
|
||||||
|
return AjaxResult.success(tTrendsService.selectTTrendsById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增趋势
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('newstocksystem:trends:add')")
|
||||||
|
@Log(title = "趋势", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@RequestBody TTrends tTrends)
|
||||||
|
{
|
||||||
|
return toAjax(tTrendsService.insertTTrends(tTrends));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改趋势
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('newstocksystem:trends:edit')")
|
||||||
|
@Log(title = "趋势", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@RequestBody TTrends tTrends)
|
||||||
|
{
|
||||||
|
return toAjax(tTrendsService.updateTTrends(tTrends));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除趋势
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('newstocksystem:trends:remove')")
|
||||||
|
@Log(title = "趋势", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public AjaxResult remove(@PathVariable Long[] ids)
|
||||||
|
{
|
||||||
|
return toAjax(tTrendsService.deleteTTrendsByIds(ids));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询趋势分段列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('newstocksystem:trends:list')")
|
||||||
|
@GetMapping("/listSection")
|
||||||
|
public TableDataInfo listSection(TTrends tTrends)
|
||||||
|
{
|
||||||
|
List<?> list = tTrendsService.listTrendsSection(tTrends);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,378 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,78 @@
|
|||||||
|
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);
|
||||||
|
}
|
||||||
@ -0,0 +1,78 @@
|
|||||||
|
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);
|
||||||
|
}
|
||||||
@ -0,0 +1,110 @@
|
|||||||
|
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();
|
||||||
|
}
|
||||||
@ -0,0 +1,77 @@
|
|||||||
|
package com.ruoyi.newstocksystem.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.ruoyi.newstocksystem.domain.TIndustryBasic;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 行业基础数据Mapper接口
|
||||||
|
*
|
||||||
|
* @author lxy
|
||||||
|
* @date 2026-01-23
|
||||||
|
*/
|
||||||
|
public interface TIndustryBasicMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询行业基础数据
|
||||||
|
*
|
||||||
|
* @param industryCode 行业代码
|
||||||
|
* @return 行业基础数据
|
||||||
|
*/
|
||||||
|
public TIndustryBasic selectTIndustryBasicByCode(String industryCode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询行业基础数据列表
|
||||||
|
*
|
||||||
|
* @param industryBasic 行业基础数据
|
||||||
|
* @return 行业基础数据集合
|
||||||
|
*/
|
||||||
|
public List<TIndustryBasic> selectTIndustryBasicList(TIndustryBasic industryBasic);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增行业基础数据
|
||||||
|
*
|
||||||
|
* @param industryBasic 行业基础数据
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertTIndustryBasic(TIndustryBasic industryBasic);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改行业基础数据
|
||||||
|
*
|
||||||
|
* @param industryBasic 行业基础数据
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateTIndustryBasic(TIndustryBasic industryBasic);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除行业基础数据
|
||||||
|
*
|
||||||
|
* @param industryCode 行业代码
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteTIndustryBasicByCode(String industryCode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除行业基础数据
|
||||||
|
*
|
||||||
|
* @param industryCodes 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteTIndustryBasicByCodes(String[] industryCodes);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量Upsert行业基础数据
|
||||||
|
*
|
||||||
|
* @param industryBasicList 行业基础数据列表
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int batchUpsertIndustryBasic(List<TIndustryBasic> industryBasicList);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据行业名称查询行业基础数据
|
||||||
|
*
|
||||||
|
* @param industryName 行业名称
|
||||||
|
* @return 行业基础数据
|
||||||
|
*/
|
||||||
|
public TIndustryBasic selectTIndustryBasicByName(String industryName);
|
||||||
|
}
|
||||||
@ -0,0 +1,77 @@
|
|||||||
|
package com.ruoyi.newstocksystem.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.ruoyi.newstocksystem.domain.TStockFinancial;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 股票财务数据Mapper接口
|
||||||
|
*
|
||||||
|
* @author lxy
|
||||||
|
* @date 2026-01-21
|
||||||
|
*/
|
||||||
|
public interface TStockFinancialMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询股票财务数据
|
||||||
|
*
|
||||||
|
* @param id 股票财务数据主键
|
||||||
|
* @return 股票财务数据
|
||||||
|
*/
|
||||||
|
public TStockFinancial selectTStockFinancialById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询股票财务数据列表
|
||||||
|
*
|
||||||
|
* @param tStockFinancial 股票财务数据
|
||||||
|
* @return 股票财务数据集合
|
||||||
|
*/
|
||||||
|
public List<TStockFinancial> selectTStockFinancialList(TStockFinancial tStockFinancial);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增股票财务数据
|
||||||
|
*
|
||||||
|
* @param tStockFinancial 股票财务数据
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertTStockFinancial(TStockFinancial tStockFinancial);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改股票财务数据
|
||||||
|
*
|
||||||
|
* @param tStockFinancial 股票财务数据
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateTStockFinancial(TStockFinancial tStockFinancial);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除股票财务数据
|
||||||
|
*
|
||||||
|
* @param id 股票财务数据主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteTStockFinancialById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除股票财务数据
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteTStockFinancialByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量新增股票财务数据
|
||||||
|
*
|
||||||
|
* @param tStockFinancials 股票财务数据集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int batchInsertTStockFinancial(List<TStockFinancial> tStockFinancials);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量插入或更新股票财务数据
|
||||||
|
*
|
||||||
|
* @param tStockFinancialList 股票财务数据列表
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int batchUpsert(List<TStockFinancial> tStockFinancialList);
|
||||||
|
}
|
||||||
@ -0,0 +1,77 @@
|
|||||||
|
package com.ruoyi.newstocksystem.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.ruoyi.newstocksystem.domain.TStocksInTrend;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 趋势中的股票Mapper接口
|
||||||
|
*
|
||||||
|
* @author lxy
|
||||||
|
* @date 2026-01-21
|
||||||
|
*/
|
||||||
|
public interface TStocksInTrendMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询趋势中的股票
|
||||||
|
*
|
||||||
|
* @param id 趋势中的股票主键
|
||||||
|
* @return 趋势中的股票
|
||||||
|
*/
|
||||||
|
public TStocksInTrend selectTStocksInTrendById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询趋势中的股票列表
|
||||||
|
*
|
||||||
|
* @param tStocksInTrend 趋势中的股票
|
||||||
|
* @return 趋势中的股票集合
|
||||||
|
*/
|
||||||
|
public List<TStocksInTrend> selectTStocksInTrendList(TStocksInTrend tStocksInTrend);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增趋势中的股票
|
||||||
|
*
|
||||||
|
* @param tStocksInTrend 趋势中的股票
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertTStocksInTrend(TStocksInTrend tStocksInTrend);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改趋势中的股票
|
||||||
|
*
|
||||||
|
* @param tStocksInTrend 趋势中的股票
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateTStocksInTrend(TStocksInTrend tStocksInTrend);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除趋势中的股票
|
||||||
|
*
|
||||||
|
* @param id 趋势中的股票主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteTStocksInTrendById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除趋势中的股票
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteTStocksInTrendByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量新增趋势中的股票
|
||||||
|
*
|
||||||
|
* @param tStocksInTrends 趋势中的股票集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int batchInsertTStocksInTrend(List<TStocksInTrend> tStocksInTrends);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量插入或更新趋势中的股票数据
|
||||||
|
*
|
||||||
|
* @param tStocksInTrendList 趋势中的股票数据列表
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int batchUpsert(List<TStocksInTrend> tStocksInTrendList);
|
||||||
|
}
|
||||||
@ -0,0 +1,78 @@
|
|||||||
|
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);
|
||||||
|
}
|
||||||
@ -0,0 +1,78 @@
|
|||||||
|
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);
|
||||||
|
}
|
||||||
@ -0,0 +1,118 @@
|
|||||||
|
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();
|
||||||
|
}
|
||||||
@ -0,0 +1,78 @@
|
|||||||
|
package com.ruoyi.newstocksystem.service;
|
||||||
|
|
||||||
|
import com.ruoyi.newstocksystem.domain.TStockBasic;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 个股基础信息Service接口
|
||||||
|
*
|
||||||
|
* @author lxy
|
||||||
|
* @date 2026-01-21
|
||||||
|
*/
|
||||||
|
public interface IStockBasicService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 根据证券代码查询个股基础信息
|
||||||
|
*
|
||||||
|
* @param stockCode 证券代码
|
||||||
|
* @return 个股基础信息
|
||||||
|
*/
|
||||||
|
public TStockBasic selectStockBasicByCode(String stockCode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询个股基础信息列表
|
||||||
|
*
|
||||||
|
* @param stockBasic 个股基础信息
|
||||||
|
* @return 个股基础信息集合
|
||||||
|
*/
|
||||||
|
public List<TStockBasic> selectStockBasicList(TStockBasic stockBasic);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增个股基础信息
|
||||||
|
*
|
||||||
|
* @param stockBasic 个股基础信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertStockBasic(TStockBasic stockBasic);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改个股基础信息
|
||||||
|
*
|
||||||
|
* @param stockBasic 个股基础信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateStockBasic(TStockBasic stockBasic);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除个股基础信息
|
||||||
|
*
|
||||||
|
* @param stockCode 证券代码
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteStockBasicByCode(String stockCode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除个股基础信息
|
||||||
|
*
|
||||||
|
* @param stockCodes 需要删除的数据证券代码集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteStockBasicByCodes(String[] stockCodes);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入个股基础信息数据
|
||||||
|
*
|
||||||
|
* @param stockBasicList 个股基础信息数据
|
||||||
|
* @return 导入条数
|
||||||
|
*/
|
||||||
|
public int importStockBasic(List<TStockBasic> stockBasicList);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据行业指数代码查询个股列表
|
||||||
|
*
|
||||||
|
* @param industryIndexCode 行业指数代码
|
||||||
|
* @return 个股基础信息集合
|
||||||
|
*/
|
||||||
|
public List<TStockBasic> selectStockBasicByIndustryCode(String industryIndexCode);
|
||||||
|
}
|
||||||
@ -0,0 +1,61 @@
|
|||||||
|
package com.ruoyi.newstocksystem.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.ruoyi.newstocksystem.domain.TIndustryBasic;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 行业基础数据Service接口
|
||||||
|
*
|
||||||
|
* @author lxy
|
||||||
|
* @date 2026-01-23
|
||||||
|
*/
|
||||||
|
public interface ITIndustryBasicService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询行业基础数据
|
||||||
|
*
|
||||||
|
* @param industryCode 行业代码
|
||||||
|
* @return 行业基础数据
|
||||||
|
*/
|
||||||
|
public TIndustryBasic selectTIndustryBasicByCode(String industryCode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询行业基础数据列表
|
||||||
|
*
|
||||||
|
* @param industryBasic 行业基础数据
|
||||||
|
* @return 行业基础数据集合
|
||||||
|
*/
|
||||||
|
public List<TIndustryBasic> selectTIndustryBasicList(TIndustryBasic industryBasic);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增行业基础数据
|
||||||
|
*
|
||||||
|
* @param industryBasic 行业基础数据
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertTIndustryBasic(TIndustryBasic industryBasic);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改行业基础数据
|
||||||
|
*
|
||||||
|
* @param industryBasic 行业基础数据
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateTIndustryBasic(TIndustryBasic industryBasic);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除行业基础数据
|
||||||
|
*
|
||||||
|
* @param industryCodes 需要删除的行业代码数组
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteTIndustryBasicByCodes(String[] industryCodes);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量导入行业基础数据
|
||||||
|
*
|
||||||
|
* @param industryBasicList 行业基础数据列表
|
||||||
|
* @return 导入成功的记录数
|
||||||
|
*/
|
||||||
|
public int importIndustryBasic(List<TIndustryBasic> industryBasicList);
|
||||||
|
}
|
||||||
@ -0,0 +1,77 @@
|
|||||||
|
package com.ruoyi.newstocksystem.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.ruoyi.newstocksystem.domain.TStockFinancial;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 股票财务数据Service接口
|
||||||
|
*
|
||||||
|
* @author lxy
|
||||||
|
* @date 2026-01-21
|
||||||
|
*/
|
||||||
|
public interface TStockFinancialService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询股票财务数据
|
||||||
|
*
|
||||||
|
* @param id 股票财务数据主键
|
||||||
|
* @return 股票财务数据
|
||||||
|
*/
|
||||||
|
public TStockFinancial selectTStockFinancialById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询股票财务数据列表
|
||||||
|
*
|
||||||
|
* @param tStockFinancial 股票财务数据
|
||||||
|
* @return 股票财务数据集合
|
||||||
|
*/
|
||||||
|
public List<TStockFinancial> selectTStockFinancialList(TStockFinancial tStockFinancial);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增股票财务数据
|
||||||
|
*
|
||||||
|
* @param tStockFinancial 股票财务数据
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertTStockFinancial(TStockFinancial tStockFinancial);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改股票财务数据
|
||||||
|
*
|
||||||
|
* @param tStockFinancial 股票财务数据
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateTStockFinancial(TStockFinancial tStockFinancial);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除股票财务数据
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的股票财务数据主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteTStockFinancialByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除股票财务数据信息
|
||||||
|
*
|
||||||
|
* @param id 股票财务数据主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteTStockFinancialById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量插入或更新股票财务数据
|
||||||
|
*
|
||||||
|
* @param tStockFinancialList 股票财务数据列表
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int batchUpsert(List<TStockFinancial> tStockFinancialList);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 验证股票代码是否在基础表中存在
|
||||||
|
*
|
||||||
|
* @param stockCode 股票代码
|
||||||
|
* @return 是否存在
|
||||||
|
*/
|
||||||
|
public boolean validateStockCodeExists(String stockCode);
|
||||||
|
}
|
||||||
@ -0,0 +1,77 @@
|
|||||||
|
package com.ruoyi.newstocksystem.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.ruoyi.newstocksystem.domain.TStocksInTrend;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 趋势中的股票Service接口
|
||||||
|
*
|
||||||
|
* @author lxy
|
||||||
|
* @date 2026-01-21
|
||||||
|
*/
|
||||||
|
public interface TStocksInTrendService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询趋势中的股票
|
||||||
|
*
|
||||||
|
* @param id 趋势中的股票主键
|
||||||
|
* @return 趋势中的股票
|
||||||
|
*/
|
||||||
|
public TStocksInTrend selectTStocksInTrendById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询趋势中的股票列表
|
||||||
|
*
|
||||||
|
* @param tStocksInTrend 趋势中的股票
|
||||||
|
* @return 趋势中的股票集合
|
||||||
|
*/
|
||||||
|
public List<TStocksInTrend> selectTStocksInTrendList(TStocksInTrend tStocksInTrend);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增趋势中的股票
|
||||||
|
*
|
||||||
|
* @param tStocksInTrend 趋势中的股票
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertTStocksInTrend(TStocksInTrend tStocksInTrend);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改趋势中的股票
|
||||||
|
*
|
||||||
|
* @param tStocksInTrend 趋势中的股票
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateTStocksInTrend(TStocksInTrend tStocksInTrend);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除趋势中的股票
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的趋势中的股票主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteTStocksInTrendByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除趋势中的股票信息
|
||||||
|
*
|
||||||
|
* @param id 趋势中的股票主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteTStocksInTrendById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量插入或更新趋势中的股票
|
||||||
|
*
|
||||||
|
* @param tStocksInTrendList 趋势中的股票列表
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int batchUpsert(List<TStocksInTrend> tStocksInTrendList);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 验证股票代码是否在基础表中存在
|
||||||
|
*
|
||||||
|
* @param stockCode 股票代码
|
||||||
|
* @return 是否存在
|
||||||
|
*/
|
||||||
|
public boolean validateStockCodeExists(String stockCode);
|
||||||
|
}
|
||||||
@ -0,0 +1,134 @@
|
|||||||
|
package com.ruoyi.newstocksystem.service.impl;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.ruoyi.newstocksystem.mapper.TIndustryIndexMapper;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.ruoyi.newstocksystem.domain.TIndustryIndex;
|
||||||
|
import com.ruoyi.newstocksystem.service.IIndustryIndexService;
|
||||||
|
import com.ruoyi.newstocksystem.service.ITIndustryBasicService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 行业指数Service业务层处理
|
||||||
|
*
|
||||||
|
* @author lxy
|
||||||
|
* @date 2026-01-21
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class IndustryIndexServiceImpl implements IIndustryIndexService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private TIndustryIndexMapper industryIndexMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ITIndustryBasicService industryBasicService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TIndustryIndex selectIndustryIndexByCodeAndDate(String industryIndexCode, Date tradeDate)
|
||||||
|
{
|
||||||
|
return industryIndexMapper.selectIndustryIndexByCodeAndDate(industryIndexCode, tradeDate);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<TIndustryIndex> selectIndustryIndexList(TIndustryIndex industryIndex)
|
||||||
|
{
|
||||||
|
return industryIndexMapper.selectIndustryIndexList(industryIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<TIndustryIndex> selectDistinctIndustryIndexList()
|
||||||
|
{
|
||||||
|
return industryIndexMapper.selectDistinctIndustryIndexList();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int insertIndustryIndex(TIndustryIndex industryIndex)
|
||||||
|
{
|
||||||
|
return industryIndexMapper.insertIndustryIndex(industryIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int updateIndustryIndex(TIndustryIndex industryIndex)
|
||||||
|
{
|
||||||
|
return industryIndexMapper.updateIndustryIndex(industryIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int deleteIndustryIndexByCodeAndDate(String industryIndexCode, Date tradeDate)
|
||||||
|
{
|
||||||
|
return industryIndexMapper.deleteIndustryIndexByCodeAndDate(industryIndexCode, tradeDate);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int importIndustryIndex(List<TIndustryIndex> industryIndexList, Date tradeDate)
|
||||||
|
{
|
||||||
|
// 为每个行业指数数据设置交易日期
|
||||||
|
for (TIndustryIndex industryIndex : industryIndexList)
|
||||||
|
{
|
||||||
|
industryIndex.setTradeDate(tradeDate);
|
||||||
|
|
||||||
|
// 检查并创建或更新行业基础数据
|
||||||
|
String industryCode = industryIndex.getIndustryIndexCode();
|
||||||
|
String industryName = industryIndex.getIndustryIndexName();
|
||||||
|
|
||||||
|
// 查询行业基础数据是否存在
|
||||||
|
com.ruoyi.newstocksystem.domain.TIndustryBasic existingIndustryBasic =
|
||||||
|
industryBasicService.selectTIndustryBasicByCode(industryCode);
|
||||||
|
|
||||||
|
if (existingIndustryBasic == null)
|
||||||
|
{
|
||||||
|
// 如果行业基础数据不存在,则创建
|
||||||
|
com.ruoyi.newstocksystem.domain.TIndustryBasic industryBasic = new com.ruoyi.newstocksystem.domain.TIndustryBasic();
|
||||||
|
industryBasic.setIndustryCode(industryCode);
|
||||||
|
industryBasic.setIndustryName(industryName);
|
||||||
|
industryBasic.setIndustryLevel(2); // 默认为二级行业
|
||||||
|
industryBasic.setStatus(1); // 默认启用
|
||||||
|
industryBasic.setSortOrder(0); // 默认排序
|
||||||
|
|
||||||
|
industryBasicService.insertTIndustryBasic(industryBasic);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// 如果行业基础数据存在,检查名称是否发生变化
|
||||||
|
if (!existingIndustryBasic.getIndustryName().equals(industryName))
|
||||||
|
{
|
||||||
|
// 名称发生变化,更新行业基础数据
|
||||||
|
existingIndustryBasic.setIndustryName(industryName);
|
||||||
|
industryBasicService.updateTIndustryBasic(existingIndustryBasic);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 批量插入或更新行业指数数据
|
||||||
|
return industryIndexMapper.batchUpsertIndustryIndex(industryIndexList);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> selectTradeDates()
|
||||||
|
{
|
||||||
|
return industryIndexMapper.selectTradeDates();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean checkIndustryBasicExists(String industryCode)
|
||||||
|
{
|
||||||
|
// 检查行业基础数据是否存在
|
||||||
|
return industryBasicService.selectTIndustryBasicByCode(industryCode) != null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int createIndustryBasic(String industryCode, String industryName)
|
||||||
|
{
|
||||||
|
// 创建行业基础数据
|
||||||
|
com.ruoyi.newstocksystem.domain.TIndustryBasic industryBasic = new com.ruoyi.newstocksystem.domain.TIndustryBasic();
|
||||||
|
industryBasic.setIndustryCode(industryCode);
|
||||||
|
industryBasic.setIndustryName(industryName);
|
||||||
|
industryBasic.setIndustryLevel(2); // 默认为二级行业
|
||||||
|
industryBasic.setStatus(1); // 默认启用
|
||||||
|
industryBasic.setSortOrder(0); // 默认排序
|
||||||
|
|
||||||
|
return industryBasicService.insertTIndustryBasic(industryBasic);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,89 @@
|
|||||||
|
package com.ruoyi.newstocksystem.service.impl;
|
||||||
|
|
||||||
|
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.TStockBasic;
|
||||||
|
import com.ruoyi.newstocksystem.mapper.TStockBasicMapper;
|
||||||
|
import com.ruoyi.newstocksystem.service.IStockBasicService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 个股基础信息Service实现类
|
||||||
|
*
|
||||||
|
* @author lxy
|
||||||
|
* @date 2026-01-21
|
||||||
|
*/
|
||||||
|
@Service("newStockBasicService")
|
||||||
|
public class StockBasicServiceImpl implements IStockBasicService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private TStockBasicMapper stockBasicMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TStockBasic selectStockBasicByCode(String stockCode)
|
||||||
|
{
|
||||||
|
return stockBasicMapper.selectStockBasicByCode(stockCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<TStockBasic> selectStockBasicList(TStockBasic stockBasic)
|
||||||
|
{
|
||||||
|
return stockBasicMapper.selectStockBasicList(stockBasic);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int insertStockBasic(TStockBasic stockBasic)
|
||||||
|
{
|
||||||
|
return stockBasicMapper.insertStockBasic(stockBasic);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int updateStockBasic(TStockBasic stockBasic)
|
||||||
|
{
|
||||||
|
return stockBasicMapper.updateStockBasic(stockBasic);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int deleteStockBasicByCode(String stockCode)
|
||||||
|
{
|
||||||
|
return stockBasicMapper.deleteStockBasicByCode(stockCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int deleteStockBasicByCodes(String[] stockCodes)
|
||||||
|
{
|
||||||
|
return stockBasicMapper.deleteStockBasicByCodes(stockCodes);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public int importStockBasic(List<TStockBasic> stockBasicList)
|
||||||
|
{
|
||||||
|
if (stockBasicList == null || stockBasicList.isEmpty())
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int count = 0;
|
||||||
|
int batchSize = 500;
|
||||||
|
|
||||||
|
// 分批导入数据(使用 upsert 方式,自动处理新增和更新)
|
||||||
|
for (int i = 0; i < stockBasicList.size(); i += batchSize)
|
||||||
|
{
|
||||||
|
int end = Math.min(i + batchSize, stockBasicList.size());
|
||||||
|
List<TStockBasic> batchList = stockBasicList.subList(i, end);
|
||||||
|
count += stockBasicMapper.batchUpsertStockBasic(batchList);
|
||||||
|
}
|
||||||
|
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<TStockBasic> selectStockBasicByIndustryCode(String industryIndexCode)
|
||||||
|
{
|
||||||
|
return stockBasicMapper.selectStockBasicByIndustryCode(industryIndexCode);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,278 @@
|
|||||||
|
package com.ruoyi.newstocksystem.service.impl;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import com.ruoyi.newstocksystem.domain.TIndustryBasic;
|
||||||
|
import com.ruoyi.newstocksystem.domain.TStockBasic;
|
||||||
|
import com.ruoyi.newstocksystem.domain.TStockHighLowStatus;
|
||||||
|
import com.ruoyi.newstocksystem.mapper.TStockHighLowStatusMapper;
|
||||||
|
import com.ruoyi.newstocksystem.service.IIndustryIndexService;
|
||||||
|
import com.ruoyi.newstocksystem.service.IStockBasicService;
|
||||||
|
import com.ruoyi.newstocksystem.service.IStockHighLowStatusService;
|
||||||
|
import com.ruoyi.newstocksystem.service.ITIndustryBasicService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 个股新高新低状态Service实现类
|
||||||
|
*
|
||||||
|
* @author lxy
|
||||||
|
* @date 2026-01-21
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class StockHighLowStatusServiceImpl implements IStockHighLowStatusService
|
||||||
|
{
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger(StockHighLowStatusServiceImpl.class);
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private TStockHighLowStatusMapper stockHighLowStatusMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IStockBasicService stockBasicService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IIndustryIndexService industryIndexService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ITIndustryBasicService industryBasicService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TStockHighLowStatus selectStockHighLowStatusByCodeAndDate(String stockCode, Date tradeDate)
|
||||||
|
{
|
||||||
|
return stockHighLowStatusMapper.selectStockHighLowStatusByCodeAndDate(stockCode, tradeDate);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<TStockHighLowStatus> selectStockHighLowStatusList(TStockHighLowStatus stockHighLowStatus)
|
||||||
|
{
|
||||||
|
return stockHighLowStatusMapper.selectStockHighLowStatusList(stockHighLowStatus);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<TStockHighLowStatus> selectStockHighLowStatusListWithBasic(TStockHighLowStatus stockHighLowStatus)
|
||||||
|
{
|
||||||
|
return stockHighLowStatusMapper.selectStockHighLowStatusListWithBasic(stockHighLowStatus);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int insertStockHighLowStatus(TStockHighLowStatus stockHighLowStatus)
|
||||||
|
{
|
||||||
|
return stockHighLowStatusMapper.insertStockHighLowStatus(stockHighLowStatus);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int updateStockHighLowStatus(TStockHighLowStatus stockHighLowStatus)
|
||||||
|
{
|
||||||
|
return stockHighLowStatusMapper.updateStockHighLowStatus(stockHighLowStatus);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int deleteStockHighLowStatusByCodeAndDate(String stockCode, Date tradeDate)
|
||||||
|
{
|
||||||
|
return stockHighLowStatusMapper.deleteStockHighLowStatusByCodeAndDate(stockCode, tradeDate);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public int importStockHighLowStatus(List<TStockHighLowStatus> stockHighLowStatusList, Date tradeDate)
|
||||||
|
{
|
||||||
|
if (stockHighLowStatusList == null || stockHighLowStatusList.isEmpty())
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 设置交易日期
|
||||||
|
for (TStockHighLowStatus stockHighLowStatus : stockHighLowStatusList)
|
||||||
|
{
|
||||||
|
if (stockHighLowStatus.getTradeDate() == null)
|
||||||
|
{
|
||||||
|
stockHighLowStatus.setTradeDate(tradeDate);
|
||||||
|
}
|
||||||
|
// 设置默认值
|
||||||
|
if (stockHighLowStatus.getIsNewHigh() == null)
|
||||||
|
{
|
||||||
|
stockHighLowStatus.setIsNewHigh(0);
|
||||||
|
}
|
||||||
|
if (stockHighLowStatus.getIsNewLow() == null)
|
||||||
|
{
|
||||||
|
stockHighLowStatus.setIsNewLow(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
long startTime = System.currentTimeMillis();
|
||||||
|
logger.info("开始处理股票基础数据,待处理记录数: {}", stockHighLowStatusList.size());
|
||||||
|
|
||||||
|
// 收集所有需要检查的行业代码
|
||||||
|
Set<String> industryCodes = new HashSet<>();
|
||||||
|
for (TStockHighLowStatus stockHighLowStatus : stockHighLowStatusList)
|
||||||
|
{
|
||||||
|
if (stockHighLowStatus.getIndustryIndexCode() != null && !stockHighLowStatus.getIndustryIndexCode().trim().isEmpty())
|
||||||
|
{
|
||||||
|
industryCodes.add(stockHighLowStatus.getIndustryIndexCode());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查并确保行业基础数据存在
|
||||||
|
logger.info("开始检查行业基础数据,需要检查的行业代码数量: {}", industryCodes.size());
|
||||||
|
if (!industryCodes.isEmpty())
|
||||||
|
{
|
||||||
|
// 检查每个行业代码是否存在,如果不存在则创建
|
||||||
|
for (String industryCode : industryCodes)
|
||||||
|
{
|
||||||
|
if (!industryIndexService.checkIndustryBasicExists(industryCode))
|
||||||
|
{
|
||||||
|
// 如果行业基础数据不存在,创建一个基础记录
|
||||||
|
String industryName = industryCode; // 使用代码作为默认名称
|
||||||
|
if (stockHighLowStatusList != null) {
|
||||||
|
// 尝试从数据中获取行业名称
|
||||||
|
for (TStockHighLowStatus status : stockHighLowStatusList) {
|
||||||
|
if (status.getIndustryIndexCode() != null && status.getIndustryIndexCode().equals(industryCode)) {
|
||||||
|
if (status.getIndustryIndexName() != null) {
|
||||||
|
industryName = status.getIndustryIndexName();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
industryIndexService.createIndustryBasic(industryCode, industryName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 收集所有需要检查的股票代码
|
||||||
|
Set<String> stockCodes = new HashSet<>();
|
||||||
|
for (TStockHighLowStatus stockHighLowStatus : stockHighLowStatusList)
|
||||||
|
{
|
||||||
|
stockCodes.add(stockHighLowStatus.getStockCode());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 一次性读取所有存在的股票基础数据
|
||||||
|
logger.info("开始批量读取股票基础数据,股票代码数量: {}", stockCodes.size());
|
||||||
|
long loadStart = System.currentTimeMillis();
|
||||||
|
|
||||||
|
List<TStockBasic> existingBasics = stockBasicService.selectStockBasicList(new TStockBasic());
|
||||||
|
|
||||||
|
// 将现有基础数据转换为Map以便快速查找
|
||||||
|
Map<String, TStockBasic> existingBasicsMap = new HashMap<>();
|
||||||
|
for (TStockBasic basic : existingBasics)
|
||||||
|
{
|
||||||
|
if (stockCodes.contains(basic.getStockCode()))
|
||||||
|
{
|
||||||
|
existingBasicsMap.put(basic.getStockCode(), basic);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
long loadEnd = System.currentTimeMillis();
|
||||||
|
logger.info("股票基础数据读取完成,耗时: {} ms", (loadEnd - loadStart));
|
||||||
|
|
||||||
|
// 准备需要插入的数据
|
||||||
|
List<TStockBasic> newBasicsToInsert = new ArrayList<>();
|
||||||
|
|
||||||
|
logger.info("开始比较和分类股票基础数据");
|
||||||
|
long compareStart = System.currentTimeMillis();
|
||||||
|
|
||||||
|
for (TStockHighLowStatus stockHighLowStatus : stockHighLowStatusList)
|
||||||
|
{
|
||||||
|
TStockBasic existingBasic = existingBasicsMap.get(stockHighLowStatus.getStockCode());
|
||||||
|
|
||||||
|
if (existingBasic == null)
|
||||||
|
{
|
||||||
|
// 如果不存在,创建新的股票基础数据记录
|
||||||
|
// 对于新高新低状态,我们可能没有足够的信息来填充完整的股票基础数据
|
||||||
|
// 因此我们创建一个只有股票代码的最小记录
|
||||||
|
TStockBasic newBasic = new TStockBasic();
|
||||||
|
newBasic.setStockCode(stockHighLowStatus.getStockCode());
|
||||||
|
// 设置一些默认值以避免数据库约束错误
|
||||||
|
newBasic.setStockName(stockHighLowStatus.getStockCode()); // 使用股票代码作为名称
|
||||||
|
if (stockHighLowStatus.getIndustryIndexCode() != null && !stockHighLowStatus.getIndustryIndexCode().trim().isEmpty()) {
|
||||||
|
newBasic.setIndustryIndexCode(stockHighLowStatus.getIndustryIndexCode());
|
||||||
|
} else {
|
||||||
|
newBasic.setIndustryIndexCode("");
|
||||||
|
}
|
||||||
|
if (stockHighLowStatus.getIndustryIndexName() != null) {
|
||||||
|
newBasic.setIndustryIndexName(stockHighLowStatus.getIndustryIndexName());
|
||||||
|
} else {
|
||||||
|
newBasic.setIndustryIndexName("");
|
||||||
|
}
|
||||||
|
newBasic.setIsSt(0); // 默认不是ST股票
|
||||||
|
newBasic.setIsStarSt(0); // 默认不是*ST股票
|
||||||
|
|
||||||
|
// 注意:这里没有股票名称,所以我们使用股票代码作为名称或跳过插入
|
||||||
|
// 根据业务需求,我们可以选择不插入,或者使用股票代码作为名称
|
||||||
|
// 这里我们暂时只插入股票代码
|
||||||
|
if (stockHighLowStatus.getStockCode() != null)
|
||||||
|
{
|
||||||
|
newBasicsToInsert.add(newBasic);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 不需要更新已有基础数据,因为新高新低状态没有提供相关信息
|
||||||
|
}
|
||||||
|
|
||||||
|
long compareEnd = System.currentTimeMillis();
|
||||||
|
logger.info("股票基础数据比较完成,耗时: {} ms", (compareEnd - compareStart));
|
||||||
|
|
||||||
|
// 批量插入新的股票基础数据
|
||||||
|
if (!newBasicsToInsert.isEmpty())
|
||||||
|
{
|
||||||
|
logger.info("准备批量插入 {} 条新的股票基础数据", newBasicsToInsert.size());
|
||||||
|
long insertStart = System.currentTimeMillis();
|
||||||
|
stockBasicService.importStockBasic(newBasicsToInsert); // 使用importStockBasic方法进行批量插入
|
||||||
|
long insertEnd = System.currentTimeMillis();
|
||||||
|
logger.info("股票基础数据插入完成,耗时: {} ms", (insertEnd - insertStart));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
logger.info("无需插入新的股票基础数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
long checkTime = System.currentTimeMillis();
|
||||||
|
logger.info("股票基础数据处理完成,耗时: {} ms", (checkTime - startTime));
|
||||||
|
|
||||||
|
// 批量插入新高新低状态数据
|
||||||
|
int count = 0;
|
||||||
|
int batchSize = 500;
|
||||||
|
|
||||||
|
logger.info("开始批量插入新高新低状态数据,总记录数: {}", stockHighLowStatusList.size());
|
||||||
|
long statusDataStartTime = System.currentTimeMillis();
|
||||||
|
|
||||||
|
for (int i = 0; i < stockHighLowStatusList.size(); i += batchSize)
|
||||||
|
{
|
||||||
|
int end = Math.min(i + batchSize, stockHighLowStatusList.size());
|
||||||
|
List<TStockHighLowStatus> batchList = stockHighLowStatusList.subList(i, end);
|
||||||
|
int batchCount = stockHighLowStatusMapper.batchUpsertStockHighLowStatus(batchList);
|
||||||
|
count += batchCount;
|
||||||
|
|
||||||
|
logger.info("批次 [{}-{}] 新高新低状态数据插入完成,本次插入: {} 条", i, end, batchCount);
|
||||||
|
}
|
||||||
|
|
||||||
|
long statusDataEndTime = System.currentTimeMillis();
|
||||||
|
logger.info("新高新低状态数据批量插入完成,总插入: {} 条,耗时: {} ms", count, (statusDataEndTime - statusDataStartTime));
|
||||||
|
|
||||||
|
long totalTime = System.currentTimeMillis() - startTime;
|
||||||
|
logger.info("导入任务完成,总耗时: {} ms", totalTime);
|
||||||
|
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<TStockHighLowStatus> selectNewHighStockList(TStockHighLowStatus stockHighLowStatus)
|
||||||
|
{
|
||||||
|
return stockHighLowStatusMapper.selectNewHighStockList(stockHighLowStatus);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<TStockHighLowStatus> selectNewLowStockList(TStockHighLowStatus stockHighLowStatus)
|
||||||
|
{
|
||||||
|
return stockHighLowStatusMapper.selectNewLowStockList(stockHighLowStatus);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,95 @@
|
|||||||
|
package com.ruoyi.newstocksystem.service.impl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.ruoyi.newstocksystem.mapper.TIndustryIndexMapper;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.ruoyi.newstocksystem.mapper.TIndustryBasicMapper;
|
||||||
|
import com.ruoyi.newstocksystem.domain.TIndustryBasic;
|
||||||
|
import com.ruoyi.newstocksystem.service.ITIndustryBasicService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 行业基础数据Service业务层处理
|
||||||
|
*
|
||||||
|
* @author lxy
|
||||||
|
* @date 2026-01-23
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class TIndustryBasicServiceImpl implements ITIndustryBasicService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private TIndustryBasicMapper tIndustryBasicMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询行业基础数据
|
||||||
|
*
|
||||||
|
* @param industryCode 行业代码
|
||||||
|
* @return 行业基础数据
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public TIndustryBasic selectTIndustryBasicByCode(String industryCode)
|
||||||
|
{
|
||||||
|
return tIndustryBasicMapper.selectTIndustryBasicByCode(industryCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询行业基础数据列表
|
||||||
|
*
|
||||||
|
* @param industryBasic 行业基础数据
|
||||||
|
* @return 行业基础数据
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<TIndustryBasic> selectTIndustryBasicList(TIndustryBasic industryBasic)
|
||||||
|
{
|
||||||
|
return tIndustryBasicMapper.selectTIndustryBasicList(industryBasic);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增行业基础数据
|
||||||
|
*
|
||||||
|
* @param industryBasic 行业基础数据
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertTIndustryBasic(TIndustryBasic industryBasic)
|
||||||
|
{
|
||||||
|
return tIndustryBasicMapper.insertTIndustryBasic(industryBasic);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改行业基础数据
|
||||||
|
*
|
||||||
|
* @param industryBasic 行业基础数据
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateTIndustryBasic(TIndustryBasic industryBasic)
|
||||||
|
{
|
||||||
|
return tIndustryBasicMapper.updateTIndustryBasic(industryBasic);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除行业基础数据
|
||||||
|
*
|
||||||
|
* @param industryCodes 需要删除的行业代码数组
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteTIndustryBasicByCodes(String[] industryCodes)
|
||||||
|
{
|
||||||
|
return tIndustryBasicMapper.deleteTIndustryBasicByCodes(industryCodes);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量导入行业基础数据
|
||||||
|
*
|
||||||
|
* @param industryBasicList 行业基础数据列表
|
||||||
|
* @return 导入成功的记录数
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int importIndustryBasic(List<TIndustryBasic> industryBasicList)
|
||||||
|
{
|
||||||
|
return tIndustryBasicMapper.batchUpsertIndustryBasic(industryBasicList);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,115 @@
|
|||||||
|
package com.ruoyi.newstocksystem.service.impl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.ruoyi.newstocksystem.mapper.TStockFinancialMapper;
|
||||||
|
import com.ruoyi.newstocksystem.domain.TStockFinancial;
|
||||||
|
import com.ruoyi.newstocksystem.service.TStockFinancialService;
|
||||||
|
import com.ruoyi.newstocksystem.mapper.TStockBasicMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 股票财务数据Service业务层处理
|
||||||
|
*
|
||||||
|
* @author lxy
|
||||||
|
* @date 2026-01-21
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class TStockFinancialServiceImpl implements TStockFinancialService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private TStockFinancialMapper tStockFinancialMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private TStockBasicMapper tStockBasicMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询股票财务数据
|
||||||
|
*
|
||||||
|
* @param id 股票财务数据主键
|
||||||
|
* @return 股票财务数据
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public TStockFinancial selectTStockFinancialById(Long id)
|
||||||
|
{
|
||||||
|
return tStockFinancialMapper.selectTStockFinancialById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询股票财务数据列表
|
||||||
|
*
|
||||||
|
* @param tStockFinancial 股票财务数据
|
||||||
|
* @return 股票财务数据
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<TStockFinancial> selectTStockFinancialList(TStockFinancial tStockFinancial)
|
||||||
|
{
|
||||||
|
return tStockFinancialMapper.selectTStockFinancialList(tStockFinancial);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增股票财务数据
|
||||||
|
*
|
||||||
|
* @param tStockFinancial 股票财务数据
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertTStockFinancial(TStockFinancial tStockFinancial)
|
||||||
|
{
|
||||||
|
return tStockFinancialMapper.insertTStockFinancial(tStockFinancial);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改股票财务数据
|
||||||
|
*
|
||||||
|
* @param tStockFinancial 股票财务数据
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateTStockFinancial(TStockFinancial tStockFinancial)
|
||||||
|
{
|
||||||
|
return tStockFinancialMapper.updateTStockFinancial(tStockFinancial);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除股票财务数据
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的股票财务数据主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteTStockFinancialByIds(Long[] ids)
|
||||||
|
{
|
||||||
|
return tStockFinancialMapper.deleteTStockFinancialByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除股票财务数据信息
|
||||||
|
*
|
||||||
|
* @param id 股票财务数据主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteTStockFinancialById(Long id)
|
||||||
|
{
|
||||||
|
return tStockFinancialMapper.deleteTStockFinancialById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量插入或更新股票财务数据
|
||||||
|
*
|
||||||
|
* @param tStockFinancialList 股票财务数据列表
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int batchUpsert(List<TStockFinancial> tStockFinancialList)
|
||||||
|
{
|
||||||
|
return tStockFinancialMapper.batchUpsert(tStockFinancialList);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean validateStockCodeExists(String stockCode)
|
||||||
|
{
|
||||||
|
return tStockBasicMapper.selectStockBasicByCode(stockCode) != null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,115 @@
|
|||||||
|
package com.ruoyi.newstocksystem.service.impl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.ruoyi.newstocksystem.mapper.TStocksInTrendMapper;
|
||||||
|
import com.ruoyi.newstocksystem.domain.TStocksInTrend;
|
||||||
|
import com.ruoyi.newstocksystem.service.TStocksInTrendService;
|
||||||
|
import com.ruoyi.newstocksystem.mapper.TStockBasicMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 趋势中的股票Service业务层处理
|
||||||
|
*
|
||||||
|
* @author lxy
|
||||||
|
* @date 2026-01-21
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class TStocksInTrendServiceImpl implements TStocksInTrendService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private TStocksInTrendMapper tStocksInTrendMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private TStockBasicMapper tStockBasicMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询趋势中的股票
|
||||||
|
*
|
||||||
|
* @param id 趋势中的股票主键
|
||||||
|
* @return 趋势中的股票
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public TStocksInTrend selectTStocksInTrendById(Long id)
|
||||||
|
{
|
||||||
|
return tStocksInTrendMapper.selectTStocksInTrendById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询趋势中的股票列表
|
||||||
|
*
|
||||||
|
* @param tStocksInTrend 趋势中的股票
|
||||||
|
* @return 趋势中的股票
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<TStocksInTrend> selectTStocksInTrendList(TStocksInTrend tStocksInTrend)
|
||||||
|
{
|
||||||
|
return tStocksInTrendMapper.selectTStocksInTrendList(tStocksInTrend);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增趋势中的股票
|
||||||
|
*
|
||||||
|
* @param tStocksInTrend 趋势中的股票
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertTStocksInTrend(TStocksInTrend tStocksInTrend)
|
||||||
|
{
|
||||||
|
return tStocksInTrendMapper.insertTStocksInTrend(tStocksInTrend);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改趋势中的股票
|
||||||
|
*
|
||||||
|
* @param tStocksInTrend 趋势中的股票
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateTStocksInTrend(TStocksInTrend tStocksInTrend)
|
||||||
|
{
|
||||||
|
return tStocksInTrendMapper.updateTStocksInTrend(tStocksInTrend);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除趋势中的股票
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的趋势中的股票主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteTStocksInTrendByIds(Long[] ids)
|
||||||
|
{
|
||||||
|
return tStocksInTrendMapper.deleteTStocksInTrendByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除趋势中的股票信息
|
||||||
|
*
|
||||||
|
* @param id 趋势中的股票主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteTStocksInTrendById(Long id)
|
||||||
|
{
|
||||||
|
return tStocksInTrendMapper.deleteTStocksInTrendById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量插入或更新趋势中的股票
|
||||||
|
*
|
||||||
|
* @param tStocksInTrendList 趋势中的股票列表
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int batchUpsert(List<TStocksInTrend> tStocksInTrendList)
|
||||||
|
{
|
||||||
|
return tStocksInTrendMapper.batchUpsert(tStocksInTrendList);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean validateStockCodeExists(String stockCode)
|
||||||
|
{
|
||||||
|
return tStockBasicMapper.selectStockBasicByCode(stockCode) != null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,229 @@
|
|||||||
|
<?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.TIndustryIndexMapper">
|
||||||
|
<resultMap type="com.ruoyi.newstocksystem.domain.TIndustryIndex" id="IndustryIndexResult">
|
||||||
|
<result property="industryIndexCode" column="industry_index_code" />
|
||||||
|
<result property="industryIndexName" column="industry_index_name" />
|
||||||
|
<result property="componentCount" column="component_count" />
|
||||||
|
<result property="tradeDate" column="trade_date" />
|
||||||
|
<result property="openPrice" column="open_price" />
|
||||||
|
<result property="closePrice" column="close_price" />
|
||||||
|
<result property="highPrice" column="high_price" />
|
||||||
|
<result property="lowPrice" column="low_price" />
|
||||||
|
<result property="volume" column="volume" />
|
||||||
|
<result property="turnover" column="turnover" />
|
||||||
|
<result property="totalMarketCap" column="total_market_cap" />
|
||||||
|
<result property="freeCirculationCap" column="free_circulation_cap" />
|
||||||
|
<result property="priceChangeRate" column="price_change_rate" />
|
||||||
|
<result property="peTtm" column="pe_ttm" />
|
||||||
|
<result property="peTtmMedian" column="pe_ttm_median" />
|
||||||
|
<result property="upCount" column="up_count" />
|
||||||
|
<result property="downCount" column="down_count" />
|
||||||
|
<result property="limitUpCount" column="limit_up_count" />
|
||||||
|
<result property="limitDownCount" column="limit_down_count" />
|
||||||
|
<result property="noChangeCount" column="no_change_count" />
|
||||||
|
<result property="suspendCount" column="suspend_count" />
|
||||||
|
<result property="newHighFlag" column="new_high_flag" />
|
||||||
|
<result property="newLowFlag" column="new_low_flag" />
|
||||||
|
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
<result property="updateTime" column="update_time" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectIndustryIndexVo">
|
||||||
|
select industry_index_code, industry_index_name, component_count, trade_date,
|
||||||
|
open_price, close_price, high_price, low_price, volume, turnover,
|
||||||
|
total_market_cap, free_circulation_cap, price_change_rate, pe_ttm, pe_ttm_median,
|
||||||
|
up_count, down_count, limit_up_count, limit_down_count, no_change_count,
|
||||||
|
suspend_count, new_high_flag, new_low_flag, create_time, update_time
|
||||||
|
from t_industry_index
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectIndustryIndexByCodeAndDate" resultMap="IndustryIndexResult">
|
||||||
|
<include refid="selectIndustryIndexVo" />
|
||||||
|
where industry_index_code = #{param1} and trade_date = #{param2}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectIndustryIndexList" parameterType="com.ruoyi.newstocksystem.domain.TIndustryIndex" resultMap="IndustryIndexResult">
|
||||||
|
<include refid="selectIndustryIndexVo" />
|
||||||
|
<where>
|
||||||
|
<if test="industryIndexCode != null and industryIndexCode != ''">
|
||||||
|
and industry_index_code = #{industryIndexCode}
|
||||||
|
</if>
|
||||||
|
<if test="industryIndexName != null and industryIndexName != ''">
|
||||||
|
and industry_index_name like concat('%', #{industryIndexName}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="tradeDate != null">
|
||||||
|
and trade_date = #{tradeDate}
|
||||||
|
</if>
|
||||||
|
<if test="params.beginTradeDate != null and params.beginTradeDate != ''">
|
||||||
|
and trade_date >= #{params.beginTradeDate}
|
||||||
|
</if>
|
||||||
|
<if test="params.endTradeDate != null and params.endTradeDate != ''">
|
||||||
|
and trade_date <= #{params.endTradeDate}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
order by trade_date desc, industry_index_code asc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectDistinctIndustryIndexList" resultMap="IndustryIndexResult">
|
||||||
|
select distinct industry_index_code, industry_index_name
|
||||||
|
from t_industry_index
|
||||||
|
order by industry_index_code
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectTradeDates" resultType="String">
|
||||||
|
select distinct DATE_FORMAT(trade_date, '%Y-%m-%d') as trade_date
|
||||||
|
from t_industry_index
|
||||||
|
order by trade_date desc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertIndustryIndex" parameterType="com.ruoyi.newstocksystem.domain.TIndustryIndex">
|
||||||
|
insert into t_industry_index
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="industryIndexCode != null and industryIndexCode != ''">industry_index_code,</if>
|
||||||
|
<if test="industryIndexName != null and industryIndexName != ''">industry_index_name,</if>
|
||||||
|
<if test="componentCount != null">component_count,</if>
|
||||||
|
<if test="tradeDate != null">trade_date,</if>
|
||||||
|
<if test="openPrice != null">open_price,</if>
|
||||||
|
<if test="closePrice != null">close_price,</if>
|
||||||
|
<if test="highPrice != null">high_price,</if>
|
||||||
|
<if test="lowPrice != null">low_price,</if>
|
||||||
|
<if test="volume != null">volume,</if>
|
||||||
|
<if test="turnover != null">turnover,</if>
|
||||||
|
<if test="totalMarketCap != null">total_market_cap,</if>
|
||||||
|
<if test="freeCirculationCap != null">free_circulation_cap,</if>
|
||||||
|
<if test="priceChangeRate != null">price_change_rate,</if>
|
||||||
|
<if test="peTtm != null">pe_ttm,</if>
|
||||||
|
<if test="peTtmMedian != null">pe_ttm_median,</if>
|
||||||
|
<if test="upCount != null">up_count,</if>
|
||||||
|
<if test="downCount != null">down_count,</if>
|
||||||
|
<if test="limitUpCount != null">limit_up_count,</if>
|
||||||
|
<if test="limitDownCount != null">limit_down_count,</if>
|
||||||
|
<if test="noChangeCount != null">no_change_count,</if>
|
||||||
|
<if test="suspendCount != null">suspend_count,</if>
|
||||||
|
<if test="newHighFlag != null">new_high_flag,</if>
|
||||||
|
<if test="newLowFlag != null">new_low_flag,</if>
|
||||||
|
|
||||||
|
create_time,
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="industryIndexCode != null and industryIndexCode != ''">#{industryIndexCode},</if>
|
||||||
|
<if test="industryIndexName != null and industryIndexName != ''">#{industryIndexName},</if>
|
||||||
|
<if test="componentCount != null">#{componentCount},</if>
|
||||||
|
<if test="tradeDate != null">#{tradeDate},</if>
|
||||||
|
<if test="openPrice != null">#{openPrice},</if>
|
||||||
|
<if test="closePrice != null">#{closePrice},</if>
|
||||||
|
<if test="highPrice != null">#{highPrice},</if>
|
||||||
|
<if test="lowPrice != null">#{lowPrice},</if>
|
||||||
|
<if test="volume != null">#{volume},</if>
|
||||||
|
<if test="turnover != null">#{turnover},</if>
|
||||||
|
<if test="totalMarketCap != null">#{totalMarketCap},</if>
|
||||||
|
<if test="freeCirculationCap != null">#{freeCirculationCap},</if>
|
||||||
|
<if test="priceChangeRate != null">#{priceChangeRate},</if>
|
||||||
|
<if test="peTtm != null">#{peTtm},</if>
|
||||||
|
<if test="peTtmMedian != null">#{peTtmMedian},</if>
|
||||||
|
<if test="upCount != null">#{upCount},</if>
|
||||||
|
<if test="downCount != null">#{downCount},</if>
|
||||||
|
<if test="limitUpCount != null">#{limitUpCount},</if>
|
||||||
|
<if test="limitDownCount != null">#{limitDownCount},</if>
|
||||||
|
<if test="noChangeCount != null">#{noChangeCount},</if>
|
||||||
|
<if test="suspendCount != null">#{suspendCount},</if>
|
||||||
|
<if test="newHighFlag != null">#{newHighFlag},</if>
|
||||||
|
<if test="newLowFlag != null">#{newLowFlag},</if>
|
||||||
|
|
||||||
|
NOW(),
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateIndustryIndex" parameterType="com.ruoyi.newstocksystem.domain.TIndustryIndex">
|
||||||
|
update t_industry_index
|
||||||
|
<trim prefix="set" suffixOverrides=",">
|
||||||
|
<if test="industryIndexName != null and industryIndexName != ''">industry_index_name = #{industryIndexName},</if>
|
||||||
|
<if test="componentCount != null">component_count = #{componentCount},</if>
|
||||||
|
<if test="openPrice != null">open_price = #{openPrice},</if>
|
||||||
|
<if test="closePrice != null">close_price = #{closePrice},</if>
|
||||||
|
<if test="highPrice != null">high_price = #{highPrice},</if>
|
||||||
|
<if test="lowPrice != null">low_price = #{lowPrice},</if>
|
||||||
|
<if test="volume != null">volume = #{volume},</if>
|
||||||
|
<if test="turnover != null">turnover = #{turnover},</if>
|
||||||
|
<if test="totalMarketCap != null">total_market_cap = #{totalMarketCap},</if>
|
||||||
|
<if test="freeCirculationCap != null">free_circulation_cap = #{freeCirculationCap},</if>
|
||||||
|
<if test="priceChangeRate != null">price_change_rate = #{priceChangeRate},</if>
|
||||||
|
<if test="peTtm != null">pe_ttm = #{peTtm},</if>
|
||||||
|
<if test="peTtmMedian != null">pe_ttm_median = #{peTtmMedian},</if>
|
||||||
|
<if test="upCount != null">up_count = #{upCount},</if>
|
||||||
|
<if test="downCount != null">down_count = #{downCount},</if>
|
||||||
|
<if test="limitUpCount != null">limit_up_count = #{limitUpCount},</if>
|
||||||
|
<if test="limitDownCount != null">limit_down_count = #{limitDownCount},</if>
|
||||||
|
<if test="noChangeCount != null">no_change_count = #{noChangeCount},</if>
|
||||||
|
<if test="suspendCount != null">suspend_count = #{suspendCount},</if>
|
||||||
|
<if test="newHighFlag != null">new_high_flag = #{newHighFlag},</if>
|
||||||
|
<if test="newLowFlag != null">new_low_flag = #{newLowFlag},</if>
|
||||||
|
|
||||||
|
update_time = NOW(),
|
||||||
|
</trim>
|
||||||
|
where industry_index_code = #{industryIndexCode} and trade_date = #{tradeDate}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteIndustryIndexByCodeAndDate">
|
||||||
|
delete from t_industry_index where industry_index_code = #{param1} and trade_date = #{param2}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<insert id="batchInsertIndustryIndex" parameterType="java.util.List">
|
||||||
|
insert into t_industry_index(industry_index_code, industry_index_name, component_count, trade_date,
|
||||||
|
open_price, close_price, high_price, low_price, volume, turnover,
|
||||||
|
total_market_cap, free_circulation_cap, price_change_rate, pe_ttm, pe_ttm_median,
|
||||||
|
up_count, down_count, limit_up_count, limit_down_count, no_change_count,
|
||||||
|
suspend_count, new_high_flag, new_low_flag, create_time)
|
||||||
|
values
|
||||||
|
<foreach collection="list" item="item" separator=",">
|
||||||
|
(#{item.industryIndexCode}, #{item.industryIndexName}, #{item.componentCount}, #{item.tradeDate},
|
||||||
|
#{item.openPrice}, #{item.closePrice}, #{item.highPrice}, #{item.lowPrice}, #{item.volume}, #{item.turnover},
|
||||||
|
#{item.totalMarketCap}, #{item.freeCirculationCap}, #{item.priceChangeRate}, #{item.peTtm}, #{item.peTtmMedian},
|
||||||
|
#{item.upCount}, #{item.downCount}, #{item.limitUpCount}, #{item.limitDownCount}, #{item.noChangeCount},
|
||||||
|
#{item.suspendCount}, #{item.newHighFlag}, #{item.newLowFlag}, NOW())
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<insert id="batchUpsertIndustryIndex" parameterType="java.util.List">
|
||||||
|
insert into t_industry_index(industry_index_code, industry_index_name, component_count, trade_date,
|
||||||
|
open_price, close_price, high_price, low_price, volume, turnover,
|
||||||
|
total_market_cap, free_circulation_cap, price_change_rate, pe_ttm, pe_ttm_median,
|
||||||
|
up_count, down_count, limit_up_count, limit_down_count, no_change_count,
|
||||||
|
suspend_count, new_high_flag, new_low_flag, create_time)
|
||||||
|
values
|
||||||
|
<foreach collection="list" item="item" separator=",">
|
||||||
|
(#{item.industryIndexCode}, #{item.industryIndexName}, #{item.componentCount}, #{item.tradeDate},
|
||||||
|
#{item.openPrice}, #{item.closePrice}, #{item.highPrice}, #{item.lowPrice}, #{item.volume}, #{item.turnover},
|
||||||
|
#{item.totalMarketCap}, #{item.freeCirculationCap}, #{item.priceChangeRate}, #{item.peTtm}, #{item.peTtmMedian},
|
||||||
|
#{item.upCount}, #{item.downCount}, #{item.limitUpCount}, #{item.limitDownCount}, #{item.noChangeCount},
|
||||||
|
#{item.suspendCount}, #{item.newHighFlag}, #{item.newLowFlag}, NOW())
|
||||||
|
</foreach>
|
||||||
|
ON DUPLICATE KEY UPDATE
|
||||||
|
industry_index_name = VALUES(industry_index_name),
|
||||||
|
component_count = VALUES(component_count),
|
||||||
|
open_price = VALUES(open_price),
|
||||||
|
close_price = VALUES(close_price),
|
||||||
|
high_price = VALUES(high_price),
|
||||||
|
low_price = VALUES(low_price),
|
||||||
|
volume = VALUES(volume),
|
||||||
|
turnover = VALUES(turnover),
|
||||||
|
total_market_cap = VALUES(total_market_cap),
|
||||||
|
free_circulation_cap = VALUES(free_circulation_cap),
|
||||||
|
price_change_rate = VALUES(price_change_rate),
|
||||||
|
pe_ttm = VALUES(pe_ttm),
|
||||||
|
pe_ttm_median = VALUES(pe_ttm_median),
|
||||||
|
up_count = VALUES(up_count),
|
||||||
|
down_count = VALUES(down_count),
|
||||||
|
limit_up_count = VALUES(limit_up_count),
|
||||||
|
limit_down_count = VALUES(limit_down_count),
|
||||||
|
no_change_count = VALUES(no_change_count),
|
||||||
|
suspend_count = VALUES(suspend_count),
|
||||||
|
new_high_flag = VALUES(new_high_flag),
|
||||||
|
new_low_flag = VALUES(new_low_flag),
|
||||||
|
update_time = NOW()
|
||||||
|
</insert>
|
||||||
|
</mapper>
|
||||||
@ -0,0 +1,132 @@
|
|||||||
|
<?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>
|
||||||
@ -0,0 +1,111 @@
|
|||||||
|
<?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>
|
||||||
@ -0,0 +1,202 @@
|
|||||||
|
<?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 >= 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>
|
||||||
@ -0,0 +1,141 @@
|
|||||||
|
<?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.TStockBasicMapper">
|
||||||
|
<resultMap type="com.ruoyi.newstocksystem.domain.TStockBasic" id="StockBasicResult">
|
||||||
|
<id property="stockCode" column="stock_code" />
|
||||||
|
<result property="stockName" column="stock_name" />
|
||||||
|
<result property="listingDate" column="listing_date" />
|
||||||
|
<result property="listingDays" column="listing_days" />
|
||||||
|
<result property="isSt" column="is_st" />
|
||||||
|
<result property="isStarSt" column="is_star_st" />
|
||||||
|
<result property="industryIndexCode" column="industry_index_code" />
|
||||||
|
<result property="industryIndexName" column="industry_index_name" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
<result property="updateTime" column="update_time" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectStockBasicVo">
|
||||||
|
select stock_code, stock_name, listing_date, listing_days, is_st, is_star_st,
|
||||||
|
industry_index_code, industry_index_name, create_time, update_time
|
||||||
|
from t_stock_basic
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectStockBasicByCode" parameterType="String" resultMap="StockBasicResult">
|
||||||
|
<include refid="selectStockBasicVo" />
|
||||||
|
where stock_code = #{stockCode}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectStockBasicList" parameterType="com.ruoyi.newstocksystem.domain.TStockBasic" resultMap="StockBasicResult">
|
||||||
|
<include refid="selectStockBasicVo" />
|
||||||
|
<where>
|
||||||
|
<if test="stockCode != null and stockCode != ''">
|
||||||
|
and stock_code like concat('%', #{stockCode}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="stockName != null and stockName != ''">
|
||||||
|
and stock_name like concat('%', #{stockName}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="isSt != null">
|
||||||
|
and is_st = #{isSt}
|
||||||
|
</if>
|
||||||
|
<if test="isStarSt != null">
|
||||||
|
and is_star_st = #{isStarSt}
|
||||||
|
</if>
|
||||||
|
<if test="industryIndexCode != null and industryIndexCode != ''">
|
||||||
|
and industry_index_code = #{industryIndexCode}
|
||||||
|
</if>
|
||||||
|
<if test="industryIndexName != null and industryIndexName != ''">
|
||||||
|
and industry_index_name like concat('%', #{industryIndexName}, '%')
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
order by stock_code asc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectStockBasicByIndustryCode" parameterType="String" resultMap="StockBasicResult">
|
||||||
|
<include refid="selectStockBasicVo" />
|
||||||
|
where industry_index_code = #{industryIndexCode}
|
||||||
|
order by stock_code asc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertStockBasic" parameterType="com.ruoyi.newstocksystem.domain.TStockBasic">
|
||||||
|
insert into t_stock_basic
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="stockCode != null and stockCode != ''">stock_code,</if>
|
||||||
|
<if test="stockName != null and stockName != ''">stock_name,</if>
|
||||||
|
<if test="listingDate != null">listing_date,</if>
|
||||||
|
<if test="listingDays != null">listing_days,</if>
|
||||||
|
<if test="isSt != null">is_st,</if>
|
||||||
|
<if test="isStarSt != null">is_star_st,</if>
|
||||||
|
<if test="industryIndexCode != null and industryIndexCode != ''">industry_index_code,</if>
|
||||||
|
<if test="industryIndexName != null and industryIndexName != ''">industry_index_name,</if>
|
||||||
|
create_time,
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="stockCode != null and stockCode != ''">#{stockCode},</if>
|
||||||
|
<if test="stockName != null and stockName != ''">#{stockName},</if>
|
||||||
|
<if test="listingDate != null">#{listingDate},</if>
|
||||||
|
<if test="listingDays != null">#{listingDays},</if>
|
||||||
|
<if test="isSt != null">#{isSt},</if>
|
||||||
|
<if test="isStarSt != null">#{isStarSt},</if>
|
||||||
|
<if test="industryIndexCode != null and industryIndexCode != ''">#{industryIndexCode},</if>
|
||||||
|
<if test="industryIndexName != null and industryIndexName != ''">#{industryIndexName},</if>
|
||||||
|
NOW(),
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateStockBasic" parameterType="com.ruoyi.newstocksystem.domain.TStockBasic">
|
||||||
|
update t_stock_basic
|
||||||
|
<trim prefix="set" suffixOverrides=",">
|
||||||
|
<if test="stockName != null and stockName != ''">stock_name = #{stockName},</if>
|
||||||
|
<if test="listingDate != null">listing_date = #{listingDate},</if>
|
||||||
|
<if test="listingDays != null">listing_days = #{listingDays},</if>
|
||||||
|
<if test="isSt != null">is_st = #{isSt},</if>
|
||||||
|
<if test="isStarSt != null">is_star_st = #{isStarSt},</if>
|
||||||
|
<if test="industryIndexCode != null and industryIndexCode != ''">industry_index_code = #{industryIndexCode},</if>
|
||||||
|
<if test="industryIndexName != null and industryIndexName != ''">industry_index_name = #{industryIndexName},</if>
|
||||||
|
update_time = NOW(),
|
||||||
|
</trim>
|
||||||
|
where stock_code = #{stockCode}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteStockBasicByCode" parameterType="String">
|
||||||
|
delete from t_stock_basic where stock_code = #{stockCode}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteStockBasicByCodes" parameterType="String">
|
||||||
|
delete from t_stock_basic where stock_code in
|
||||||
|
<foreach item="stockCode" collection="array" open="(" separator="," close=")">
|
||||||
|
#{stockCode}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<insert id="batchInsertStockBasic" parameterType="java.util.List">
|
||||||
|
insert into t_stock_basic(stock_code, stock_name, listing_date, listing_days,
|
||||||
|
is_st, is_star_st, industry_index_code, industry_index_name, create_time)
|
||||||
|
values
|
||||||
|
<foreach collection="list" item="item" separator=",">
|
||||||
|
(#{item.stockCode}, #{item.stockName}, #{item.listingDate}, #{item.listingDays},
|
||||||
|
#{item.isSt}, #{item.isStarSt}, #{item.industryIndexCode}, #{item.industryIndexName}, NOW())
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<insert id="batchUpsertStockBasic" parameterType="java.util.List">
|
||||||
|
insert into t_stock_basic(stock_code, stock_name, listing_date, listing_days,
|
||||||
|
is_st, is_star_st, industry_index_code, industry_index_name, create_time)
|
||||||
|
values
|
||||||
|
<foreach collection="list" item="item" separator=",">
|
||||||
|
(#{item.stockCode}, #{item.stockName}, #{item.listingDate}, #{item.listingDays},
|
||||||
|
#{item.isSt}, #{item.isStarSt}, #{item.industryIndexCode}, #{item.industryIndexName}, NOW())
|
||||||
|
</foreach>
|
||||||
|
ON DUPLICATE KEY UPDATE
|
||||||
|
stock_name = VALUES(stock_name),
|
||||||
|
listing_date = VALUES(listing_date),
|
||||||
|
listing_days = VALUES(listing_days),
|
||||||
|
is_st = VALUES(is_st),
|
||||||
|
is_star_st = VALUES(is_star_st),
|
||||||
|
industry_index_code = VALUES(industry_index_code),
|
||||||
|
industry_index_name = VALUES(industry_index_name),
|
||||||
|
update_time = NOW()
|
||||||
|
</insert>
|
||||||
|
</mapper>
|
||||||
@ -0,0 +1,269 @@
|
|||||||
|
<?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.TStockDailyTradeMapper">
|
||||||
|
<resultMap type="com.ruoyi.newstocksystem.domain.TStockDailyTrade" id="StockDailyTradeResult">
|
||||||
|
<result property="stockCode" column="stock_code" />
|
||||||
|
<result property="tradeDate" column="trade_date" />
|
||||||
|
<result property="openPrice" column="open_price" />
|
||||||
|
<result property="closePrice" column="close_price" />
|
||||||
|
<result property="highPrice" column="high_price" />
|
||||||
|
<result property="lowPrice" column="low_price" />
|
||||||
|
<result property="priceChangeRate" column="price_change_rate" />
|
||||||
|
<result property="volume" column="volume" />
|
||||||
|
<result property="turnover" column="turnover" />
|
||||||
|
<result property="freeCirculationCap" column="free_circulation_cap" />
|
||||||
|
<result property="agenciesHold" column="agencies_hold" />
|
||||||
|
<result property="avgVolume20" column="avg_volume20" />
|
||||||
|
<result property="isLimitUp" column="is_limit_up" />
|
||||||
|
<result property="isLimitDown" column="is_limit_down" />
|
||||||
|
<result property="momentum10d" column="momentum_10d" />
|
||||||
|
<result property="momentum20d" column="momentum_20d" />
|
||||||
|
<result property="momentum60d" column="momentum_60d" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<resultMap type="com.ruoyi.newstocksystem.domain.TStockDailyTrade" id="StockDailyTradeWithBasicResult" extends="StockDailyTradeResult">
|
||||||
|
<result property="stockName" column="stock_name" />
|
||||||
|
<result property="industryIndexCode" column="industry_index_code" />
|
||||||
|
<result property="industryIndexName" column="industry_index_name" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectStockDailyTradeVo">
|
||||||
|
select stock_code, trade_date, open_price, close_price, high_price, low_price,
|
||||||
|
price_change_rate, volume, turnover, free_circulation_cap,
|
||||||
|
agencies_hold, avg_volume20,
|
||||||
|
is_limit_up, is_limit_down, momentum_10d, momentum_20d, momentum_60d, create_time
|
||||||
|
from t_stock_daily_trade
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<sql id="selectStockDailyTradeWithBasicVo">
|
||||||
|
select t.stock_code, t.trade_date, t.open_price, t.close_price, t.high_price, t.low_price,
|
||||||
|
t.price_change_rate, t.volume, t.turnover, t.free_circulation_cap,
|
||||||
|
t.agencies_hold, t.avg_volume20,
|
||||||
|
t.is_limit_up, t.is_limit_down, t.momentum_10d, t.momentum_20d, t.momentum_60d, t.create_time,
|
||||||
|
b.stock_name, b.industry_index_code, b.industry_index_name
|
||||||
|
from t_stock_daily_trade t
|
||||||
|
left join t_stock_basic b on t.stock_code = b.stock_code
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectStockDailyTradeByCodeAndDate" resultMap="StockDailyTradeResult">
|
||||||
|
<include refid="selectStockDailyTradeVo" />
|
||||||
|
where stock_code = #{stockCode} and trade_date = #{tradeDate}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectStockDailyTradeList" parameterType="com.ruoyi.newstocksystem.domain.TStockDailyTrade" resultMap="StockDailyTradeResult">
|
||||||
|
<include refid="selectStockDailyTradeVo" />
|
||||||
|
<where>
|
||||||
|
<if test="stockCode != null and stockCode != ''">
|
||||||
|
and stock_code = #{stockCode}
|
||||||
|
</if>
|
||||||
|
<if test="tradeDate != null">
|
||||||
|
and trade_date = #{tradeDate}
|
||||||
|
</if>
|
||||||
|
<if test="isLimitUp != null">
|
||||||
|
and is_limit_up = #{isLimitUp}
|
||||||
|
</if>
|
||||||
|
<if test="isLimitDown != null">
|
||||||
|
and is_limit_down = #{isLimitDown}
|
||||||
|
</if>
|
||||||
|
<if test="params.beginTradeDate != null and params.beginTradeDate != ''">
|
||||||
|
and trade_date >= #{params.beginTradeDate}
|
||||||
|
</if>
|
||||||
|
<if test="params.endTradeDate != null and params.endTradeDate != ''">
|
||||||
|
and trade_date <= #{params.endTradeDate}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
order by trade_date desc, stock_code asc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectStockDailyTradeListWithBasic" parameterType="com.ruoyi.newstocksystem.domain.TStockDailyTrade" resultMap="StockDailyTradeWithBasicResult">
|
||||||
|
<include refid="selectStockDailyTradeWithBasicVo" />
|
||||||
|
<where>
|
||||||
|
<if test="stockCode != null and stockCode != ''">
|
||||||
|
and t.stock_code like concat('%', #{stockCode}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="stockName != null and stockName != ''">
|
||||||
|
and b.stock_name like concat('%', #{stockName}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="tradeDate != null">
|
||||||
|
and t.trade_date = #{tradeDate}
|
||||||
|
</if>
|
||||||
|
<if test="industryIndexCode != null and industryIndexCode != ''">
|
||||||
|
and b.industry_index_code = #{industryIndexCode}
|
||||||
|
</if>
|
||||||
|
<if test="isLimitUp != null">
|
||||||
|
and t.is_limit_up = #{isLimitUp}
|
||||||
|
</if>
|
||||||
|
<if test="isLimitDown != null">
|
||||||
|
and t.is_limit_down = #{isLimitDown}
|
||||||
|
</if>
|
||||||
|
<if test="params.beginTradeDate != null and params.beginTradeDate != ''">
|
||||||
|
and t.trade_date >= #{params.beginTradeDate}
|
||||||
|
</if>
|
||||||
|
<if test="params.endTradeDate != null and params.endTradeDate != ''">
|
||||||
|
and t.trade_date <= #{params.endTradeDate}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
order by t.trade_date desc, t.stock_code asc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectTradeDates" resultType="String">
|
||||||
|
select distinct DATE_FORMAT(trade_date, '%Y-%m-%d') as trade_date
|
||||||
|
from t_stock_daily_trade
|
||||||
|
order by trade_date desc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectLastTradeDate" resultType="String">
|
||||||
|
select DATE_FORMAT(max(trade_date), '%Y-%m-%d') as trade_date
|
||||||
|
from t_stock_daily_trade
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectLimitUpStockList" parameterType="com.ruoyi.newstocksystem.domain.TStockDailyTrade" resultMap="StockDailyTradeWithBasicResult">
|
||||||
|
<include refid="selectStockDailyTradeWithBasicVo" />
|
||||||
|
<where>
|
||||||
|
t.is_limit_up = 1
|
||||||
|
<if test="tradeDate != null">
|
||||||
|
and t.trade_date = #{tradeDate}
|
||||||
|
</if>
|
||||||
|
<if test="industryIndexCode != null and industryIndexCode != ''">
|
||||||
|
and b.industry_index_code = #{industryIndexCode}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
order by t.price_change_rate desc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectStrongStockList" parameterType="com.ruoyi.newstocksystem.domain.TStockDailyTrade" resultMap="StockDailyTradeWithBasicResult">
|
||||||
|
<include refid="selectStockDailyTradeWithBasicVo" />
|
||||||
|
<where>
|
||||||
|
<if test="tradeDate != null">
|
||||||
|
and t.trade_date = #{tradeDate}
|
||||||
|
</if>
|
||||||
|
<if test="industryIndexCode != null and industryIndexCode != ''">
|
||||||
|
and b.industry_index_code = #{industryIndexCode}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
order by t.momentum_20d desc, t.momentum_10d desc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertStockDailyTrade" parameterType="com.ruoyi.newstocksystem.domain.TStockDailyTrade">
|
||||||
|
insert into t_stock_daily_trade
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="stockCode != null and stockCode != ''">stock_code,</if>
|
||||||
|
<if test="tradeDate != null">trade_date,</if>
|
||||||
|
<if test="openPrice != null">open_price,</if>
|
||||||
|
<if test="closePrice != null">close_price,</if>
|
||||||
|
<if test="highPrice != null">high_price,</if>
|
||||||
|
<if test="lowPrice != null">low_price,</if>
|
||||||
|
<if test="priceChangeRate != null">price_change_rate,</if>
|
||||||
|
<if test="volume != null">volume,</if>
|
||||||
|
<if test="turnover != null">turnover,</if>
|
||||||
|
<if test="freeCirculationCap != null">free_circulation_cap,</if>
|
||||||
|
<if test="agenciesHold != null">agencies_hold,</if>
|
||||||
|
<if test="avgVolume20 != null">avg_volume20,</if>
|
||||||
|
<if test="isLimitUp != null">is_limit_up,</if>
|
||||||
|
<if test="isLimitDown != null">is_limit_down,</if>
|
||||||
|
<if test="momentum10d != null">momentum_10d,</if>
|
||||||
|
<if test="momentum20d != null">momentum_20d,</if>
|
||||||
|
<if test="momentum60d != null">momentum_60d,</if>
|
||||||
|
create_time,
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="stockCode != null and stockCode != ''">#{stockCode},</if>
|
||||||
|
<if test="tradeDate != null">#{tradeDate},</if>
|
||||||
|
<if test="openPrice != null">#{openPrice},</if>
|
||||||
|
<if test="closePrice != null">#{closePrice},</if>
|
||||||
|
<if test="highPrice != null">#{highPrice},</if>
|
||||||
|
<if test="lowPrice != null">#{lowPrice},</if>
|
||||||
|
<if test="priceChangeRate != null">#{priceChangeRate},</if>
|
||||||
|
<if test="volume != null">#{volume},</if>
|
||||||
|
<if test="turnover != null">#{turnover},</if>
|
||||||
|
<if test="freeCirculationCap != null">#{freeCirculationCap},</if>
|
||||||
|
<if test="agenciesHold != null">#{agenciesHold},</if>
|
||||||
|
<if test="avgVolume20 != null">#{avgVolume20},</if>
|
||||||
|
<if test="isLimitUp != null">#{isLimitUp},</if>
|
||||||
|
<if test="isLimitDown != null">#{isLimitDown},</if>
|
||||||
|
<if test="momentum10d != null">#{momentum10d},</if>
|
||||||
|
<if test="momentum20d != null">#{momentum20d},</if>
|
||||||
|
<if test="momentum60d != null">#{momentum60d},</if>
|
||||||
|
NOW(),
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateStockDailyTrade" parameterType="com.ruoyi.newstocksystem.domain.TStockDailyTrade">
|
||||||
|
update t_stock_daily_trade
|
||||||
|
<trim prefix="set" suffixOverrides=",">
|
||||||
|
<if test="openPrice != null">open_price = #{openPrice},</if>
|
||||||
|
<if test="closePrice != null">close_price = #{closePrice},</if>
|
||||||
|
<if test="highPrice != null">high_price = #{highPrice},</if>
|
||||||
|
<if test="lowPrice != null">low_price = #{lowPrice},</if>
|
||||||
|
<if test="priceChangeRate != null">price_change_rate = #{priceChangeRate},</if>
|
||||||
|
<if test="volume != null">volume = #{volume},</if>
|
||||||
|
<if test="turnover != null">turnover = #{turnover},</if>
|
||||||
|
<if test="freeCirculationCap != null">free_circulation_cap = #{freeCirculationCap},</if>
|
||||||
|
<if test="agenciesHold != null">agencies_hold = #{agenciesHold},</if>
|
||||||
|
<if test="avgVolume20 != null">avg_volume20 = #{avgVolume20},</if>
|
||||||
|
<if test="isLimitUp != null">is_limit_up = #{isLimitUp},</if>
|
||||||
|
<if test="isLimitDown != null">is_limit_down = #{isLimitDown},</if>
|
||||||
|
<if test="momentum10d != null">momentum_10d = #{momentum10d},</if>
|
||||||
|
<if test="momentum20d != null">momentum_20d = #{momentum20d},</if>
|
||||||
|
<if test="momentum60d != null">momentum_60d = #{momentum60d},</if>
|
||||||
|
</trim>
|
||||||
|
where stock_code = #{stockCode} and trade_date = #{tradeDate}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteStockDailyTradeByCodeAndDate">
|
||||||
|
delete from t_stock_daily_trade where stock_code = #{stockCode} and trade_date = #{tradeDate}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<insert id="batchInsertStockDailyTrade" parameterType="java.util.List">
|
||||||
|
insert into t_stock_daily_trade(stock_code, trade_date, open_price, close_price, high_price, low_price,
|
||||||
|
price_change_rate, volume, turnover, free_circulation_cap, agencies_hold, avg_volume20,
|
||||||
|
is_limit_up, is_limit_down, momentum_10d, momentum_20d, momentum_60d, create_time)
|
||||||
|
values
|
||||||
|
<foreach collection="list" item="item" separator=",">
|
||||||
|
(#{item.stockCode}, #{item.tradeDate}, #{item.openPrice}, #{item.closePrice}, #{item.highPrice}, #{item.lowPrice},
|
||||||
|
#{item.priceChangeRate}, #{item.volume}, #{item.turnover}, #{item.freeCirculationCap}, #{item.agenciesHold}, #{item.avgVolume20},
|
||||||
|
#{item.isLimitUp}, #{item.isLimitDown}, #{item.momentum10d}, #{item.momentum20d}, #{item.momentum60d}, NOW())
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<insert id="batchUpsertStockDailyTrade" parameterType="java.util.List">
|
||||||
|
insert into t_stock_daily_trade(stock_code, trade_date, open_price, close_price, high_price, low_price,
|
||||||
|
price_change_rate, volume, turnover, free_circulation_cap, agencies_hold, avg_volume20,
|
||||||
|
is_limit_up, is_limit_down, momentum_10d, momentum_20d, momentum_60d, create_time)
|
||||||
|
values
|
||||||
|
<foreach collection="list" item="item" separator=",">
|
||||||
|
(#{item.stockCode}, #{item.tradeDate}, #{item.openPrice}, #{item.closePrice}, #{item.highPrice}, #{item.lowPrice},
|
||||||
|
#{item.priceChangeRate}, #{item.volume}, #{item.turnover}, #{item.freeCirculationCap}, #{item.agenciesHold}, #{item.avgVolume20},
|
||||||
|
#{item.isLimitUp}, #{item.isLimitDown}, #{item.momentum10d}, #{item.momentum20d}, #{item.momentum60d}, NOW())
|
||||||
|
</foreach>
|
||||||
|
ON DUPLICATE KEY UPDATE
|
||||||
|
open_price = VALUES(open_price),
|
||||||
|
close_price = VALUES(close_price),
|
||||||
|
high_price = VALUES(high_price),
|
||||||
|
low_price = VALUES(low_price),
|
||||||
|
price_change_rate = VALUES(price_change_rate),
|
||||||
|
volume = VALUES(volume),
|
||||||
|
turnover = VALUES(turnover),
|
||||||
|
free_circulation_cap = VALUES(free_circulation_cap),
|
||||||
|
agencies_hold = VALUES(agencies_hold),
|
||||||
|
avg_volume20 = VALUES(avg_volume20),
|
||||||
|
is_limit_up = VALUES(is_limit_up),
|
||||||
|
is_limit_down = VALUES(is_limit_down),
|
||||||
|
momentum_10d = VALUES(momentum_10d),
|
||||||
|
momentum_20d = VALUES(momentum_20d),
|
||||||
|
momentum_60d = VALUES(momentum_60d)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<select id="checkTradeDataExistsByDate" parameterType="Date" resultType="int">
|
||||||
|
select count(1) from t_stock_daily_trade where trade_date = #{tradeDate}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectPreviousTradeDate" parameterType="Date" resultType="Date">
|
||||||
|
select max(trade_date) as trade_date
|
||||||
|
from t_stock_daily_trade
|
||||||
|
where trade_date < #{currentDate}
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
@ -0,0 +1,177 @@
|
|||||||
|
<?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.TStockHighLowStatusMapper">
|
||||||
|
<resultMap type="com.ruoyi.newstocksystem.domain.TStockHighLowStatus" id="StockHighLowStatusResult">
|
||||||
|
<result property="stockCode" column="stock_code" />
|
||||||
|
<result property="tradeDate" column="trade_date" />
|
||||||
|
<result property="isNewHigh" column="is_new_high" />
|
||||||
|
<result property="isNewLow" column="is_new_low" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<resultMap type="com.ruoyi.newstocksystem.domain.TStockHighLowStatus" id="StockHighLowStatusWithBasicResult" extends="StockHighLowStatusResult">
|
||||||
|
<result property="stockName" column="stock_name" />
|
||||||
|
<result property="industryIndexCode" column="industry_index_code" />
|
||||||
|
<result property="industryIndexName" column="industry_index_name" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectStockHighLowStatusVo">
|
||||||
|
select stock_code, trade_date, is_new_high, is_new_low, create_time
|
||||||
|
from t_stock_high_low_status
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<sql id="selectStockHighLowStatusWithBasicVo">
|
||||||
|
select
|
||||||
|
h.stock_code,
|
||||||
|
h.trade_date,
|
||||||
|
h.is_new_high,
|
||||||
|
h.is_new_low,
|
||||||
|
h.create_time,
|
||||||
|
b.stock_name,
|
||||||
|
b.industry_index_code,
|
||||||
|
b.industry_index_name
|
||||||
|
from t_stock_high_low_status h
|
||||||
|
left join t_stock_basic b on h.stock_code = b.stock_code
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectStockHighLowStatusByCodeAndDate" resultMap="StockHighLowStatusResult">
|
||||||
|
<include refid="selectStockHighLowStatusVo" />
|
||||||
|
where stock_code = #{stockCode} and trade_date = #{tradeDate}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectStockHighLowStatusList" parameterType="com.ruoyi.newstocksystem.domain.TStockHighLowStatus" resultMap="StockHighLowStatusResult">
|
||||||
|
<include refid="selectStockHighLowStatusVo" />
|
||||||
|
<where>
|
||||||
|
<if test="stockCode != null and stockCode != ''">
|
||||||
|
and stock_code = #{stockCode}
|
||||||
|
</if>
|
||||||
|
<if test="tradeDate != null">
|
||||||
|
and trade_date = #{tradeDate}
|
||||||
|
</if>
|
||||||
|
<if test="isNewHigh != null">
|
||||||
|
and is_new_high = #{isNewHigh}
|
||||||
|
</if>
|
||||||
|
<if test="isNewLow != null">
|
||||||
|
and is_new_low = #{isNewLow}
|
||||||
|
</if>
|
||||||
|
<if test="params.beginTradeDate != null and params.beginTradeDate != ''">
|
||||||
|
and trade_date >= #{params.beginTradeDate}
|
||||||
|
</if>
|
||||||
|
<if test="params.endTradeDate != null and params.endTradeDate != ''">
|
||||||
|
and trade_date <= #{params.endTradeDate}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
order by trade_date desc, stock_code asc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectStockHighLowStatusListWithBasic" parameterType="com.ruoyi.newstocksystem.domain.TStockHighLowStatus" resultMap="StockHighLowStatusWithBasicResult">
|
||||||
|
<include refid="selectStockHighLowStatusWithBasicVo" />
|
||||||
|
<where>
|
||||||
|
<if test="stockCode != null and stockCode != ''">
|
||||||
|
and h.stock_code like concat('%', #{stockCode}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="stockName != null and stockName != ''">
|
||||||
|
and b.stock_name like concat('%', #{stockName}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="tradeDate != null">
|
||||||
|
and h.trade_date = #{tradeDate}
|
||||||
|
</if>
|
||||||
|
<if test="industryIndexCode != null and industryIndexCode != ''">
|
||||||
|
and b.industry_index_code = #{industryIndexCode}
|
||||||
|
</if>
|
||||||
|
<if test="isNewHigh != null">
|
||||||
|
and h.is_new_high = #{isNewHigh}
|
||||||
|
</if>
|
||||||
|
<if test="isNewLow != null">
|
||||||
|
and h.is_new_low = #{isNewLow}
|
||||||
|
</if>
|
||||||
|
<if test="params.beginTradeDate != null and params.beginTradeDate != ''">
|
||||||
|
and h.trade_date >= #{params.beginTradeDate}
|
||||||
|
</if>
|
||||||
|
<if test="params.endTradeDate != null and params.endTradeDate != ''">
|
||||||
|
and h.trade_date <= #{params.endTradeDate}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
order by h.trade_date desc, h.stock_code asc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectNewHighStockList" parameterType="com.ruoyi.newstocksystem.domain.TStockHighLowStatus" resultMap="StockHighLowStatusWithBasicResult">
|
||||||
|
<include refid="selectStockHighLowStatusWithBasicVo" />
|
||||||
|
<where>
|
||||||
|
h.is_new_high = 1
|
||||||
|
<if test="tradeDate != null">
|
||||||
|
and h.trade_date = #{tradeDate}
|
||||||
|
</if>
|
||||||
|
<if test="industryIndexCode != null and industryIndexCode != ''">
|
||||||
|
and b.industry_index_code = #{industryIndexCode}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
order by h.trade_date desc, h.stock_code asc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectNewLowStockList" parameterType="com.ruoyi.newstocksystem.domain.TStockHighLowStatus" resultMap="StockHighLowStatusWithBasicResult">
|
||||||
|
<include refid="selectStockHighLowStatusWithBasicVo" />
|
||||||
|
<where>
|
||||||
|
h.is_new_low = 1
|
||||||
|
<if test="tradeDate != null">
|
||||||
|
and h.trade_date = #{tradeDate}
|
||||||
|
</if>
|
||||||
|
<if test="industryIndexCode != null and industryIndexCode != ''">
|
||||||
|
and b.industry_index_code = #{industryIndexCode}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
order by h.trade_date desc, h.stock_code asc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertStockHighLowStatus" parameterType="com.ruoyi.newstocksystem.domain.TStockHighLowStatus">
|
||||||
|
insert into t_stock_high_low_status
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="stockCode != null and stockCode != ''">stock_code,</if>
|
||||||
|
<if test="tradeDate != null">trade_date,</if>
|
||||||
|
<if test="isNewHigh != null">is_new_high,</if>
|
||||||
|
<if test="isNewLow != null">is_new_low,</if>
|
||||||
|
create_time,
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="stockCode != null and stockCode != ''">#{stockCode},</if>
|
||||||
|
<if test="tradeDate != null">#{tradeDate},</if>
|
||||||
|
<if test="isNewHigh != null">#{isNewHigh},</if>
|
||||||
|
<if test="isNewLow != null">#{isNewLow},</if>
|
||||||
|
NOW(),
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateStockHighLowStatus" parameterType="com.ruoyi.newstocksystem.domain.TStockHighLowStatus">
|
||||||
|
update t_stock_high_low_status
|
||||||
|
<trim prefix="set" suffixOverrides=",">
|
||||||
|
<if test="isNewHigh != null">is_new_high = #{isNewHigh},</if>
|
||||||
|
<if test="isNewLow != null">is_new_low = #{isNewLow},</if>
|
||||||
|
</trim>
|
||||||
|
where stock_code = #{stockCode} and trade_date = #{tradeDate}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteStockHighLowStatusByCodeAndDate">
|
||||||
|
delete from t_stock_high_low_status where stock_code = #{stockCode} and trade_date = #{tradeDate}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<insert id="batchInsertStockHighLowStatus" parameterType="java.util.List">
|
||||||
|
insert into t_stock_high_low_status(stock_code, trade_date, is_new_high, is_new_low, create_time)
|
||||||
|
values
|
||||||
|
<foreach collection="list" item="item" separator=",">
|
||||||
|
(#{item.stockCode}, #{item.tradeDate}, #{item.isNewHigh}, #{item.isNewLow}, NOW())
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<insert id="batchUpsertStockHighLowStatus" parameterType="java.util.List">
|
||||||
|
insert into t_stock_high_low_status(stock_code, trade_date, is_new_high, is_new_low, create_time)
|
||||||
|
values
|
||||||
|
<foreach collection="list" item="item" separator=",">
|
||||||
|
(#{item.stockCode}, #{item.tradeDate}, #{item.isNewHigh}, #{item.isNewLow}, NOW())
|
||||||
|
</foreach>
|
||||||
|
ON DUPLICATE KEY UPDATE
|
||||||
|
is_new_high = VALUES(is_new_high),
|
||||||
|
is_new_low = VALUES(is_new_low)
|
||||||
|
</insert>
|
||||||
|
</mapper>
|
||||||
@ -0,0 +1,141 @@
|
|||||||
|
<?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.TIndustryBasicMapper">
|
||||||
|
|
||||||
|
<resultMap type="com.ruoyi.newstocksystem.domain.TIndustryBasic" id="TIndustryBasicResult">
|
||||||
|
<result property="industryCode" column="industry_code" />
|
||||||
|
<result property="industryName" column="industry_name" />
|
||||||
|
<result property="industryLevel" column="industry_level" />
|
||||||
|
<result property="status" column="status" />
|
||||||
|
<result property="sortOrder" column="sort_order" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
<result property="updateTime" column="update_time" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectTIndustryBasicVo">
|
||||||
|
select industry_code, industry_name, industry_level, status, sort_order, create_time, update_time
|
||||||
|
from t_industry_basic
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectTIndustryBasicByCode" parameterType="String" resultMap="TIndustryBasicResult">
|
||||||
|
<include refid="selectTIndustryBasicVo"/>
|
||||||
|
where industry_code = #{industryCode}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectTIndustryBasicList" parameterType="com.ruoyi.newstocksystem.domain.TIndustryBasic" resultMap="TIndustryBasicResult">
|
||||||
|
<include refid="selectTIndustryBasicVo"/>
|
||||||
|
<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="industryLevel != null ">
|
||||||
|
AND industry_level = #{industryLevel}
|
||||||
|
</if>
|
||||||
|
<if test="status != null ">
|
||||||
|
AND status = #{status}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
order by sort_order asc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectTIndustryBasicByName" parameterType="String" resultMap="TIndustryBasicResult">
|
||||||
|
<include refid="selectTIndustryBasicVo"/>
|
||||||
|
where industry_name = #{industryName}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertTIndustryBasic" parameterType="com.ruoyi.newstocksystem.domain.TIndustryBasic" useGeneratedKeys="false">
|
||||||
|
insert into t_industry_basic
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="industryCode != null and industryCode != ''">
|
||||||
|
industry_code,
|
||||||
|
</if>
|
||||||
|
<if test="industryName != null and industryName != ''">
|
||||||
|
industry_name,
|
||||||
|
</if>
|
||||||
|
<if test="industryLevel != null">
|
||||||
|
industry_level,
|
||||||
|
</if>
|
||||||
|
<if test="status != null">
|
||||||
|
status,
|
||||||
|
</if>
|
||||||
|
<if test="sortOrder != null">
|
||||||
|
sort_order,
|
||||||
|
</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="industryLevel != null">
|
||||||
|
#{industryLevel},
|
||||||
|
</if>
|
||||||
|
<if test="status != null">
|
||||||
|
#{status},
|
||||||
|
</if>
|
||||||
|
<if test="sortOrder != null">
|
||||||
|
#{sortOrder},
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateTIndustryBasic" parameterType="com.ruoyi.newstocksystem.domain.TIndustryBasic">
|
||||||
|
update t_industry_basic
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="industryName != null and industryName != ''">
|
||||||
|
industry_name = #{industryName},
|
||||||
|
</if>
|
||||||
|
<if test="industryLevel != null">
|
||||||
|
industry_level = #{industryLevel},
|
||||||
|
</if>
|
||||||
|
<if test="status != null">
|
||||||
|
status = #{status},
|
||||||
|
</if>
|
||||||
|
<if test="sortOrder != null">
|
||||||
|
sort_order = #{sortOrder},
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null">
|
||||||
|
update_time = #{updateTime},
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
where industry_code = #{industryCode}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteTIndustryBasicByCode" parameterType="String">
|
||||||
|
delete from t_industry_basic where industry_code = #{industryCode}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteTIndustryBasicByCodes" parameterType="String">
|
||||||
|
delete from t_industry_basic where industry_code in
|
||||||
|
<foreach item="industryCode" collection="array" open="(" separator="," close=")">
|
||||||
|
#{industryCode}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<insert id="batchUpsertIndustryBasic" parameterType="com.ruoyi.newstocksystem.domain.TIndustryBasic">
|
||||||
|
INSERT INTO t_industry_basic(
|
||||||
|
industry_code, industry_name, industry_level,
|
||||||
|
status, sort_order, create_time, update_time
|
||||||
|
) VALUES
|
||||||
|
<foreach collection="list" item="item" separator=",">
|
||||||
|
(
|
||||||
|
#{item.industryCode}, #{item.industryName}, #{item.industryLevel},
|
||||||
|
#{item.status}, #{item.sortOrder}, now(), now()
|
||||||
|
)
|
||||||
|
</foreach>
|
||||||
|
ON DUPLICATE KEY UPDATE
|
||||||
|
industry_name = VALUES(industry_name),
|
||||||
|
industry_level = VALUES(industry_level),
|
||||||
|
status = VALUES(status),
|
||||||
|
sort_order = VALUES(sort_order),
|
||||||
|
update_time = now()
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@ -0,0 +1,143 @@
|
|||||||
|
<?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.TStockFinancialMapper">
|
||||||
|
|
||||||
|
<resultMap type="TStockFinancial" id="TStockFinancialResult">
|
||||||
|
<id property="id" column="id" />
|
||||||
|
<result property="stockCode" column="stock_code" />
|
||||||
|
<result property="reportPeriod" column="report_period" />
|
||||||
|
<result property="netProfitGrowthRateYoy" column="net_profit_growth_rate_yoy" />
|
||||||
|
<result property="netProfitGrowthRateQoq" column="net_profit_growth_rate_qoq" />
|
||||||
|
<result property="roe" column="roe" />
|
||||||
|
<result property="epsBasic" column="eps_basic" />
|
||||||
|
<result property="netProfit" column="net_profit" />
|
||||||
|
<result property="basicEps" column="basic_eps" />
|
||||||
|
<result property="bps" column="bps" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
<result property="updateTime" column="update_time" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectTStockFinancialVo">
|
||||||
|
select id, stock_code, report_period, net_profit_growth_rate_yoy, net_profit_growth_rate_qoq, roe, eps_basic, net_profit, basic_eps, bps, create_time, update_time from t_stock_financial
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectTStockFinancialById" parameterType="Long" resultMap="TStockFinancialResult">
|
||||||
|
<include refid="selectTStockFinancialVo"/>
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectTStockFinancialList" parameterType="TStockFinancial" resultMap="TStockFinancialResult">
|
||||||
|
<include refid="selectTStockFinancialVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="stockCode != null and stockCode != ''">and stock_code = #{stockCode}</if>
|
||||||
|
<if test="reportPeriod != null ">and report_period = #{reportPeriod}</if>
|
||||||
|
<if test="netProfitGrowthRateYoy != null ">and net_profit_growth_rate_yoy = #{netProfitGrowthRateYoy}</if>
|
||||||
|
<if test="netProfitGrowthRateQoq != null ">and net_profit_growth_rate_qoq = #{netProfitGrowthRateQoq}</if>
|
||||||
|
<if test="roe != null ">and roe = #{roe}</if>
|
||||||
|
<if test="epsBasic != null ">and eps_basic = #{epsBasic}</if>
|
||||||
|
<if test="netProfit != null ">and net_profit = #{netProfit}</if>
|
||||||
|
<if test="basicEps != null ">and basic_eps = #{basicEps}</if>
|
||||||
|
<if test="bps != null ">and bps = #{bps}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertTStockFinancial" parameterType="TStockFinancial" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
insert into t_stock_financial
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="stockCode != null and stockCode != ''">stock_code,</if>
|
||||||
|
<if test="reportPeriod != null">report_period,</if>
|
||||||
|
<if test="netProfitGrowthRateYoy != null">net_profit_growth_rate_yoy,</if>
|
||||||
|
<if test="netProfitGrowthRateQoq != null">net_profit_growth_rate_qoq,</if>
|
||||||
|
<if test="roe != null">roe,</if>
|
||||||
|
<if test="epsBasic != null">eps_basic,</if>
|
||||||
|
<if test="netProfit != null">net_profit,</if>
|
||||||
|
<if test="basicEps != null">basic_eps,</if>
|
||||||
|
<if test="bps != null">bps,</if>
|
||||||
|
<if test="createTime != null">create_time,</if>
|
||||||
|
<if test="updateTime != null">update_time,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="stockCode != null and stockCode != ''">#{stockCode},</if>
|
||||||
|
<if test="reportPeriod != null">#{reportPeriod},</if>
|
||||||
|
<if test="netProfitGrowthRateYoy != null">#{netProfitGrowthRateYoy},</if>
|
||||||
|
<if test="netProfitGrowthRateQoq != null">#{netProfitGrowthRateQoq},</if>
|
||||||
|
<if test="roe != null">#{roe},</if>
|
||||||
|
<if test="epsBasic != null">#{epsBasic},</if>
|
||||||
|
<if test="netProfit != null">#{netProfit},</if>
|
||||||
|
<if test="basicEps != null">#{basicEps},</if>
|
||||||
|
<if test="bps != null">#{bps},</if>
|
||||||
|
<if test="createTime != null">#{createTime},</if>
|
||||||
|
<if test="updateTime != null">#{updateTime},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateTStockFinancial" parameterType="TStockFinancial">
|
||||||
|
update t_stock_financial
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="stockCode != null and stockCode != ''">stock_code = #{stockCode},</if>
|
||||||
|
<if test="reportPeriod != null">report_period = #{reportPeriod},</if>
|
||||||
|
<if test="netProfitGrowthRateYoy != null">net_profit_growth_rate_yoy = #{netProfitGrowthRateYoy},</if>
|
||||||
|
<if test="netProfitGrowthRateQoq != null">net_profit_growth_rate_qoq = #{netProfitGrowthRateQoq},</if>
|
||||||
|
<if test="roe != null">roe = #{roe},</if>
|
||||||
|
<if test="epsBasic != null">eps_basic = #{epsBasic},</if>
|
||||||
|
<if test="netProfit != null">net_profit = #{netProfit},</if>
|
||||||
|
<if test="basicEps != null">basic_eps = #{basicEps},</if>
|
||||||
|
<if test="bps != null">bps = #{bps},</if>
|
||||||
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||||
|
</trim>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteTStockFinancialById" parameterType="Long">
|
||||||
|
delete from t_stock_financial where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteTStockFinancialByIds" parameterType="String">
|
||||||
|
delete from t_stock_financial where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<insert id="batchUpsert" parameterType="java.util.List">
|
||||||
|
INSERT INTO t_stock_financial (
|
||||||
|
stock_code,
|
||||||
|
report_period,
|
||||||
|
net_profit_growth_rate_yoy,
|
||||||
|
net_profit_growth_rate_qoq,
|
||||||
|
roe,
|
||||||
|
eps_basic,
|
||||||
|
net_profit,
|
||||||
|
basic_eps,
|
||||||
|
bps,
|
||||||
|
create_time,
|
||||||
|
update_time
|
||||||
|
) VALUES
|
||||||
|
<foreach collection="list" item="item" separator=",">
|
||||||
|
(
|
||||||
|
#{item.stockCode},
|
||||||
|
#{item.reportPeriod},
|
||||||
|
#{item.netProfitGrowthRateYoy},
|
||||||
|
#{item.netProfitGrowthRateQoq},
|
||||||
|
#{item.roe},
|
||||||
|
#{item.epsBasic},
|
||||||
|
#{item.netProfit},
|
||||||
|
#{item.basicEps},
|
||||||
|
#{item.bps},
|
||||||
|
#{item.createTime},
|
||||||
|
#{item.updateTime}
|
||||||
|
)
|
||||||
|
</foreach>
|
||||||
|
ON DUPLICATE KEY UPDATE
|
||||||
|
net_profit_growth_rate_yoy = VALUES(net_profit_growth_rate_yoy),
|
||||||
|
net_profit_growth_rate_qoq = VALUES(net_profit_growth_rate_qoq),
|
||||||
|
roe = VALUES(roe),
|
||||||
|
eps_basic = VALUES(eps_basic),
|
||||||
|
net_profit = VALUES(net_profit),
|
||||||
|
basic_eps = VALUES(basic_eps),
|
||||||
|
bps = VALUES(bps),
|
||||||
|
update_time = VALUES(update_time)
|
||||||
|
</insert>
|
||||||
|
</mapper>
|
||||||
@ -0,0 +1,110 @@
|
|||||||
|
<?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.TStocksInTrendMapper">
|
||||||
|
|
||||||
|
<resultMap type="TStocksInTrend" id="TStocksInTrendResult">
|
||||||
|
<id property="id" column="id" />
|
||||||
|
<result property="stockCode" column="stock_code" />
|
||||||
|
<result property="tradeDate" column="trade_date" />
|
||||||
|
<result property="rank" column="rank" />
|
||||||
|
<result property="momentumType" column="momentum_type" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
<result property="updateTime" column="update_time" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectTStocksInTrendVo">
|
||||||
|
select id, stock_code, trade_date, `rank`, momentum_type, create_time, update_time from t_stocks_in_trend
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectTStocksInTrendById" parameterType="Long" resultMap="TStocksInTrendResult">
|
||||||
|
<include refid="selectTStocksInTrendVo"/>
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectTStocksInTrendList" parameterType="TStocksInTrend" resultMap="TStocksInTrendResult">
|
||||||
|
<include refid="selectTStocksInTrendVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="stockCode != null and stockCode != ''">and stock_code = #{stockCode}</if>
|
||||||
|
<if test="tradeDate != null ">and trade_date = #{tradeDate}</if>
|
||||||
|
<if test="rank != null ">and `rank` = #{rank}</if>
|
||||||
|
<if test="momentumType != null and momentumType != ''">and momentum_type = #{momentumType}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertTStocksInTrend" parameterType="TStocksInTrend" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
insert into t_stocks_in_trend
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="stockCode != null and stockCode != ''">stock_code,</if>
|
||||||
|
<if test="tradeDate != null">trade_date,</if>
|
||||||
|
<if test="rank != null">`rank`,</if>
|
||||||
|
<if test="momentumType != null and momentumType != ''">momentum_type,</if>
|
||||||
|
<if test="createTime != null">create_time,</if>
|
||||||
|
<if test="updateTime != null">update_time,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="stockCode != null and stockCode != ''">#{stockCode},</if>
|
||||||
|
<if test="tradeDate != null">#{tradeDate},</if>
|
||||||
|
<if test="rank != null">#{rank},</if>
|
||||||
|
<if test="momentumType != null and momentumType != ''">#{momentumType},</if>
|
||||||
|
<if test="createTime != null">#{createTime},</if>
|
||||||
|
<if test="updateTime != null">#{updateTime},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateTStocksInTrend" parameterType="TStocksInTrend">
|
||||||
|
update t_stocks_in_trend
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="stockCode != null and stockCode != ''">stock_code = #{stockCode},</if>
|
||||||
|
<if test="tradeDate != null">trade_date = #{tradeDate},</if>
|
||||||
|
<if test="rank != null">`rank` = #{rank},</if>
|
||||||
|
<if test="momentumType != null and momentumType != ''">momentum_type = #{momentumType},</if>
|
||||||
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||||
|
</trim>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteTStocksInTrendById" parameterType="Long">
|
||||||
|
delete from t_stocks_in_trend where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteTStocksInTrendByIds" parameterType="String">
|
||||||
|
delete from t_stocks_in_trend where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<insert id="batchInsertTStocksInTrend" parameterType="java.util.List">
|
||||||
|
insert into t_stocks_in_trend (stock_code, trade_date, `rank`, momentum_type, create_time, update_time)
|
||||||
|
values
|
||||||
|
<foreach collection="list" item="item" separator=",">
|
||||||
|
(#{item.stockCode}, #{item.tradeDate}, #{item.rank}, #{item.momentumType}, #{item.createTime}, #{item.updateTime})
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<insert id="batchUpsert" parameterType="java.util.List">
|
||||||
|
INSERT INTO t_stocks_in_trend (
|
||||||
|
stock_code,
|
||||||
|
trade_date,
|
||||||
|
`rank`,
|
||||||
|
momentum_type,
|
||||||
|
create_time,
|
||||||
|
update_time
|
||||||
|
) VALUES
|
||||||
|
<foreach collection="list" item="item" separator=",">
|
||||||
|
(
|
||||||
|
#{item.stockCode},
|
||||||
|
#{item.tradeDate},
|
||||||
|
#{item.rank},
|
||||||
|
#{item.momentumType},
|
||||||
|
#{item.createTime},
|
||||||
|
#{item.updateTime}
|
||||||
|
)
|
||||||
|
</foreach>
|
||||||
|
ON DUPLICATE KEY UPDATE
|
||||||
|
`rank` = VALUES(`rank`),
|
||||||
|
update_time = VALUES(update_time)
|
||||||
|
</insert>
|
||||||
|
</mapper>
|
||||||
@ -0,0 +1,198 @@
|
|||||||
|
<?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.TTrendsMapper">
|
||||||
|
|
||||||
|
<resultMap type="TTrends" id="TTrendsResult">
|
||||||
|
<id property="id" column="id" />
|
||||||
|
<result property="tradeDate" column="trade_date" />
|
||||||
|
<result property="industryName" column="industry_name" />
|
||||||
|
<result property="stocksCount" column="stocks_count" />
|
||||||
|
<result property="trendValue" column="trend_value" />
|
||||||
|
<result property="trendValueChange" column="trend_value_change" />
|
||||||
|
<result property="rank" column="rank" />
|
||||||
|
<result property="rankChange" column="rank_change" />
|
||||||
|
<result property="momentumType" column="momentum_type" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
<result property="updateTime" column="update_time" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectTTrendsVo">
|
||||||
|
select id, trade_date, industry_name, stocks_count, trend_value, trend_value_change, `rank`, `rank_change`, momentum_type, create_time, update_time from t_trends
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectTTrendsById" parameterType="Long" resultMap="TTrendsResult">
|
||||||
|
<include refid="selectTTrendsVo"/>
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectTTrendsList" parameterType="TTrends" resultMap="TTrendsResult">
|
||||||
|
<include refid="selectTTrendsVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="tradeDate != null ">and trade_date = #{tradeDate}</if>
|
||||||
|
<if test="industryName != null and industryName != ''">and industry_name = #{industryName}</if>
|
||||||
|
<if test="stocksCount != null ">and stocks_count = #{stocksCount}</if>
|
||||||
|
<if test="trendValue != null ">and trend_value = #{trendValue}</if>
|
||||||
|
<if test="trendValueChange != null ">and trend_value_change = #{trendValueChange}</if>
|
||||||
|
<if test="rank != null ">and rank = #{rank}</if>
|
||||||
|
<if test="rankChange != null ">and rank_change = #{rankChange}</if>
|
||||||
|
<if test="momentumType != null and momentumType != ''">and momentum_type = #{momentumType}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertTTrends" parameterType="TTrends" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
insert into t_trends
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="tradeDate != null">trade_date,</if>
|
||||||
|
<if test="industryName != null and industryName != ''">industry_name,</if>
|
||||||
|
<if test="stocksCount != null">stocks_count,</if>
|
||||||
|
<if test="trendValue != null">trend_value,</if>
|
||||||
|
<if test="trendValueChange != null">trend_value_change,</if>
|
||||||
|
<if test="rank != null">`rank`,</if>
|
||||||
|
<if test="rankChange != null">`rank_change`,</if>
|
||||||
|
<if test="momentumType != null and momentumType != ''">momentum_type,</if>
|
||||||
|
<if test="createTime != null">create_time,</if>
|
||||||
|
<if test="updateTime != null">update_time,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="tradeDate != null">#{tradeDate},</if>
|
||||||
|
<if test="industryName != null and industryName != ''">#{industryName},</if>
|
||||||
|
<if test="stocksCount != null">#{stocksCount},</if>
|
||||||
|
<if test="trendValue != null">#{trendValue},</if>
|
||||||
|
<if test="trendValueChange != null">#{trendValueChange},</if>
|
||||||
|
<if test="rank != null">#{rank},</if>
|
||||||
|
<if test="rankChange != null">#{rankChange},</if>
|
||||||
|
<if test="momentumType != null and momentumType != ''">#{momentumType},</if>
|
||||||
|
<if test="createTime != null">#{createTime},</if>
|
||||||
|
<if test="updateTime != null">#{updateTime},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateTTrends" parameterType="TTrends">
|
||||||
|
update t_trends
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="tradeDate != null">trade_date = #{tradeDate},</if>
|
||||||
|
<if test="industryName != null and industryName != ''">industry_name = #{industryName},</if>
|
||||||
|
<if test="stocksCount != null">stocks_count = #{stocksCount},</if>
|
||||||
|
<if test="trendValue != null">trend_value = #{trendValue},</if>
|
||||||
|
<if test="trendValueChange != null">trend_value_change = #{trendValueChange},</if>
|
||||||
|
<if test="rank != null">`rank` = #{rank},</if>
|
||||||
|
<if test="rankChange != null">`rank_change` = #{rankChange},</if>
|
||||||
|
<if test="momentumType != null and momentumType != ''">momentum_type = #{momentumType},</if>
|
||||||
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||||
|
</trim>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteTTrendsById" parameterType="Long">
|
||||||
|
delete from t_trends where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteTTrendsByIds" parameterType="String">
|
||||||
|
delete from t_trends where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<insert id="batchUpsert" parameterType="java.util.List">
|
||||||
|
INSERT INTO t_trends (
|
||||||
|
trade_date,
|
||||||
|
industry_name,
|
||||||
|
stocks_count,
|
||||||
|
trend_value,
|
||||||
|
trend_value_change,
|
||||||
|
`rank`,
|
||||||
|
`rank_change`,
|
||||||
|
momentum_type,
|
||||||
|
create_time,
|
||||||
|
update_time
|
||||||
|
) VALUES
|
||||||
|
<foreach collection="list" item="item" separator=",">
|
||||||
|
(
|
||||||
|
#{item.tradeDate},
|
||||||
|
#{item.industryName},
|
||||||
|
#{item.stocksCount},
|
||||||
|
#{item.trendValue},
|
||||||
|
#{item.trendValueChange},
|
||||||
|
#{item.rank},
|
||||||
|
#{item.rankChange},
|
||||||
|
#{item.momentumType},
|
||||||
|
#{item.createTime},
|
||||||
|
#{item.updateTime}
|
||||||
|
)
|
||||||
|
</foreach>
|
||||||
|
ON DUPLICATE KEY UPDATE
|
||||||
|
stocks_count = VALUES(stocks_count),
|
||||||
|
trend_value = VALUES(trend_value),
|
||||||
|
trend_value_change = VALUES(trend_value_change),
|
||||||
|
`rank` = VALUES(`rank`),
|
||||||
|
`rank_change` = VALUES(`rank_change`),
|
||||||
|
update_time = VALUES(update_time)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<select id="checkTrendsExistsByDate" parameterType="Date" resultType="int">
|
||||||
|
select count(1) from t_trends where trade_date = #{tradeDate}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 获取最近10个交易日 -->
|
||||||
|
<select id="getRecentTradeDates" parameterType="String" resultType="Date">
|
||||||
|
SELECT DISTINCT trade_date
|
||||||
|
FROM t_trends
|
||||||
|
WHERE momentum_type = #{momentumType}
|
||||||
|
ORDER BY trade_date DESC
|
||||||
|
LIMIT 10
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 获取所有行业名称 -->
|
||||||
|
<select id="getAllIndustryNames" parameterType="String" resultType="String">
|
||||||
|
SELECT DISTINCT industry_name
|
||||||
|
FROM t_trends
|
||||||
|
WHERE momentum_type = #{momentumType}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 获取指定行业在指定日期的排名 -->
|
||||||
|
<select id="getIndustryRankByDate" parameterType="map" resultType="Integer">
|
||||||
|
SELECT `rank`
|
||||||
|
FROM t_trends
|
||||||
|
WHERE momentum_type = #{momentumType}
|
||||||
|
AND industry_name = #{industryName}
|
||||||
|
AND trade_date = #{tradeDate}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 获取指定行业在指定日期范围内的趋势数据 -->
|
||||||
|
<select id="getTrendsByIndustryAndDateRange" parameterType="map" resultMap="TTrendsResult">
|
||||||
|
SELECT *
|
||||||
|
FROM t_trends
|
||||||
|
WHERE momentum_type = #{momentumType}
|
||||||
|
AND industry_name = #{industryName}
|
||||||
|
AND trade_date BETWEEN #{startDate} AND #{endDate}
|
||||||
|
ORDER BY trade_date DESC
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 获取指定日期往前10个交易日的所有日期 -->
|
||||||
|
<select id="getPreviousTradeDates" parameterType="map" resultType="Date">
|
||||||
|
SELECT DISTINCT trade_date
|
||||||
|
FROM t_trends
|
||||||
|
WHERE momentum_type = #{momentumType}
|
||||||
|
AND trade_date <= #{currentDate}
|
||||||
|
ORDER BY trade_date DESC
|
||||||
|
LIMIT 10
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 获取指定日期和动量类型的所有趋势数据 -->
|
||||||
|
<select id="getTrendsByDateAndType" parameterType="TTrends" resultMap="TTrendsResult">
|
||||||
|
SELECT *
|
||||||
|
FROM t_trends
|
||||||
|
WHERE trade_date = #{tradeDate}
|
||||||
|
AND momentum_type = #{momentumType}
|
||||||
|
ORDER BY `rank`
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 获取最后一个已分析的交易日 -->
|
||||||
|
<select id="selectLastAnalyzedDate" resultType="String">
|
||||||
|
SELECT DATE_FORMAT(MAX(trade_date), '%Y-%m-%d') AS last_date
|
||||||
|
FROM t_trends
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
@ -0,0 +1,6 @@
|
|||||||
|
股票代码,股票名称,行业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.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue