新增对训练实训的预警页面操作,marginWarning表新增trainingId字段

pull/1/head
xiaoCJ 2 years ago
parent cd52c4d6d8
commit ddfe097e8b

@ -3,6 +3,7 @@ package com.sztzjy.forex.trading_trading.controller;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.sztzjy.forex.trading_trading.config.Constant;
import com.sztzjy.forex.trading_trading.entity.*; import com.sztzjy.forex.trading_trading.entity.*;
import com.sztzjy.forex.trading_trading.mappers.*; import com.sztzjy.forex.trading_trading.mappers.*;
import com.sztzjy.forex.trading_trading.service.WainingService; import com.sztzjy.forex.trading_trading.service.WainingService;
@ -41,7 +42,7 @@ public class WarningController {
@GetMapping("/getMarginWarning") @GetMapping("/getMarginWarning")
@ApiOperation("保证金预警页面展示") @ApiOperation("保证金预警页面展示")
public ResultEntity<MarginWarning> getMarginWarning(@ApiParam("姓名") @RequestParam String userName, public ResultEntity<MarginWarning> getMarginWarning(@ApiParam("姓名") @RequestParam String userName,
@ApiParam("任务ID") @RequestParam String trainingId, @ApiParam("任务ID") @RequestParam(required = false) String trainingId,
@ApiParam("成员ID") @RequestParam String memberId) { @ApiParam("成员ID") @RequestParam String memberId) {
return new ResultEntity<>(wainingService.getMarginWarning(userName, trainingId, memberId)); return new ResultEntity<>(wainingService.getMarginWarning(userName, trainingId, memberId));
@ -53,7 +54,7 @@ public class WarningController {
public ResultEntity<MarginWarning> saveWarningLevel(@ApiParam("预警水平") @RequestParam Integer warningLevel, public ResultEntity<MarginWarning> saveWarningLevel(@ApiParam("预警水平") @RequestParam Integer warningLevel,
@ApiParam("成员ID") @RequestParam String memberId, @ApiParam("成员ID") @RequestParam String memberId,
@ApiParam("姓名") @RequestParam String userName, @ApiParam("姓名") @RequestParam String userName,
@ApiParam("任务ID") @RequestParam String trainingId) { @ApiParam("任务ID") @RequestParam(required = false) String trainingId) {
return new ResultEntity<>(wainingService.saveWarningLevel(warningLevel, memberId, userName, trainingId)); return new ResultEntity<>(wainingService.saveWarningLevel(warningLevel, memberId, userName, trainingId));
} }
@ -61,7 +62,7 @@ public class WarningController {
@GetMapping("/getMarginWarningRecord") @GetMapping("/getMarginWarningRecord")
@ApiOperation("查询保证金预警记录") @ApiOperation("查询保证金预警记录")
public ResultEntity<PageInfo<MarginWarningRecord>> getMarginWarningRecord(@ApiParam("姓名") @RequestParam String userName, public ResultEntity<PageInfo<MarginWarningRecord>> getMarginWarningRecord(@ApiParam("姓名") @RequestParam String userName,
@ApiParam("任务ID") @RequestParam String trainingId, @ApiParam("任务ID") @RequestParam(required = false) String trainingId,
@ApiParam("首页页码") @RequestParam Integer index, @ApiParam("首页页码") @RequestParam Integer index,
@ApiParam("页面条数") @RequestParam Integer size) { @ApiParam("页面条数") @RequestParam Integer size) {
return new ResultEntity<>(wainingService.getMarginWarningRecord(index, size, userName, trainingId)); return new ResultEntity<>(wainingService.getMarginWarningRecord(index, size, userName, trainingId));
@ -94,11 +95,14 @@ public class WarningController {
@GetMapping("/getMarketWarning") @GetMapping("/getMarketWarning")
@ApiOperation("查询行情预警") @ApiOperation("查询行情预警")
public ResultEntity<PageInfo<MarketWarning>> getMarketWarning(@ApiParam("姓名") @RequestParam String name, public ResultEntity<PageInfo<MarketWarning>> getMarketWarning(@ApiParam("姓名") @RequestParam String name,
@ApiParam("任务ID") @RequestParam String trainingId, @ApiParam("任务ID") @RequestParam (required = false)String trainingId,
@ApiParam("首页页码") @RequestParam Integer index, @ApiParam("首页页码") @RequestParam Integer index,
@ApiParam("页面条数") @RequestParam Integer size) { @ApiParam("页面条数") @RequestParam Integer size) {
PageHelper.startPage(index, size); PageHelper.startPage(index, size);
MarketWarningExample marketWarningExample = new MarketWarningExample(); MarketWarningExample marketWarningExample = new MarketWarningExample();
if (trainingId == null || trainingId.isEmpty()) {
trainingId = Constant.PRACTICE_TRAINING_ID;
}
marketWarningExample.createCriteria().andNameEqualTo(name).andTariningidEqualTo(trainingId); marketWarningExample.createCriteria().andNameEqualTo(name).andTariningidEqualTo(trainingId);
List<MarketWarning> marketWarnings = marketWarningMapper.selectByExample(marketWarningExample); List<MarketWarning> marketWarnings = marketWarningMapper.selectByExample(marketWarningExample);
PageInfo<MarketWarning> pageInfo = new PageInfo<>(marketWarnings); PageInfo<MarketWarning> pageInfo = new PageInfo<>(marketWarnings);
@ -109,11 +113,14 @@ public class WarningController {
@GetMapping("/getMarketWarningRecord") @GetMapping("/getMarketWarningRecord")
@ApiOperation("查询行情预警记录") @ApiOperation("查询行情预警记录")
public ResultEntity<PageInfo<MarketWarningRecord>> getMarketWarningRecord(@ApiParam("姓名") @RequestParam String name, public ResultEntity<PageInfo<MarketWarningRecord>> getMarketWarningRecord(@ApiParam("姓名") @RequestParam String name,
@ApiParam("任务ID") @RequestParam String trainingId, @ApiParam("任务ID") @RequestParam (required = false)String trainingId,
@ApiParam("首页页码") @RequestParam Integer index, @ApiParam("首页页码") @RequestParam Integer index,
@ApiParam("页面条数") @RequestParam Integer size) { @ApiParam("页面条数") @RequestParam Integer size) {
PageHelper.startPage(index, size); PageHelper.startPage(index, size);
MarketWarningRecordExample marketWarningRecordExample = new MarketWarningRecordExample(); MarketWarningRecordExample marketWarningRecordExample = new MarketWarningRecordExample();
if (trainingId == null || trainingId.isEmpty()) {
trainingId = Constant.PRACTICE_TRAINING_ID;
}
marketWarningRecordExample.createCriteria().andNameEqualTo(name).andTariningidEqualTo(trainingId); marketWarningRecordExample.createCriteria().andNameEqualTo(name).andTariningidEqualTo(trainingId);
List<MarketWarningRecord> marketWarningRecords = marketWarningRecordMapper.selectByExample(marketWarningRecordExample); List<MarketWarningRecord> marketWarningRecords = marketWarningRecordMapper.selectByExample(marketWarningRecordExample);
PageInfo<MarketWarningRecord> pageInfo = new PageInfo<>(marketWarningRecords); PageInfo<MarketWarningRecord> pageInfo = new PageInfo<>(marketWarningRecords);
@ -148,7 +155,7 @@ public class WarningController {
//新增持仓时长预警 //新增持仓时长预警
@PostMapping("/addAlertHoldDuration") @PostMapping("/addAlertHoldDuration")
@ApiOperation("新增持仓时长预警") @ApiOperation("新增持仓时长预警")
public String addAlertHoldDuration(@ApiParam("持仓时长预警对象") @RequestBody AlertHoldDuration alertHoldDuration) { public ResultEntity<String> addAlertHoldDuration(@ApiParam("持仓时长预警对象") @RequestBody AlertHoldDuration alertHoldDuration) {
return wainingService.addAlertHoldDuration(alertHoldDuration); return wainingService.addAlertHoldDuration(alertHoldDuration);
} }
@ -202,11 +209,14 @@ public class WarningController {
@GetMapping("/getAlertHoldDurationRecord") @GetMapping("/getAlertHoldDurationRecord")
@ApiOperation("查询持仓时长预警记录表") @ApiOperation("查询持仓时长预警记录表")
public ResultEntity<PageInfo<AlertHoldDurationRecord>> getAlertHoldDurationRecord(@ApiParam("memberId") @RequestParam String memberId, public ResultEntity<PageInfo<AlertHoldDurationRecord>> getAlertHoldDurationRecord(@ApiParam("memberId") @RequestParam String memberId,
@ApiParam("trainingId") @RequestParam String trainingId, @ApiParam("trainingId") @RequestParam(required = false) String trainingId,
@ApiParam("首页页码") @RequestParam Integer index, @ApiParam("首页页码") @RequestParam Integer index,
@ApiParam("页面条数") @RequestParam Integer size) { @ApiParam("页面条数") @RequestParam Integer size) {
PageHelper.startPage(index, size); PageHelper.startPage(index, size);
AlertHoldDurationRecordExample alertHoldDurationRecordExample = new AlertHoldDurationRecordExample(); AlertHoldDurationRecordExample alertHoldDurationRecordExample = new AlertHoldDurationRecordExample();
if (trainingId == null || trainingId.isEmpty()) {
trainingId = Constant.PRACTICE_TRAINING_ID;
}
alertHoldDurationRecordExample.createCriteria().andTrainingidEqualTo(trainingId).andMemberidEqualTo(memberId); alertHoldDurationRecordExample.createCriteria().andTrainingidEqualTo(trainingId).andMemberidEqualTo(memberId);
List<AlertHoldDurationRecord> alertHoldDurationRecords = alertHoldDurationRecordMapper.selectByExample(alertHoldDurationRecordExample); List<AlertHoldDurationRecord> alertHoldDurationRecords = alertHoldDurationRecordMapper.selectByExample(alertHoldDurationRecordExample);
// List<AlertHoldDurationRecord> resultAHDR = new ArrayList<>(); // List<AlertHoldDurationRecord> resultAHDR = new ArrayList<>();
@ -222,11 +232,14 @@ public class WarningController {
@GetMapping("/getAlertHoldDuration") @GetMapping("/getAlertHoldDuration")
@ApiOperation("查询持仓时长预警表") @ApiOperation("查询持仓时长预警表")
public ResultEntity<PageInfo<AlertHoldDuration>> getAlertHoldDuration(@ApiParam("memberId") @RequestParam String memberId, public ResultEntity<PageInfo<AlertHoldDuration>> getAlertHoldDuration(@ApiParam("memberId") @RequestParam String memberId,
@ApiParam("trainingId") @RequestParam String trainingId, @ApiParam("trainingId") @RequestParam(required = false) String trainingId,
@ApiParam("首页页码") @RequestParam Integer index, @ApiParam("首页页码") @RequestParam Integer index,
@ApiParam("页面条数") @RequestParam Integer size) { @ApiParam("页面条数") @RequestParam Integer size) {
PageHelper.startPage(index, size); PageHelper.startPage(index, size);
AlertHoldDurationExample alertHoldDurationExample = new AlertHoldDurationExample(); AlertHoldDurationExample alertHoldDurationExample = new AlertHoldDurationExample();
if (trainingId == null || trainingId.isEmpty()) {
trainingId = Constant.PRACTICE_TRAINING_ID;
}
alertHoldDurationExample.createCriteria().andTrainingidEqualTo(trainingId).andMemberidEqualTo(memberId); alertHoldDurationExample.createCriteria().andTrainingidEqualTo(trainingId).andMemberidEqualTo(memberId);
List<AlertHoldDuration> alertHoldDurations = alertHoldDurationMapper.selectByExample(alertHoldDurationExample); List<AlertHoldDuration> alertHoldDurations = alertHoldDurationMapper.selectByExample(alertHoldDurationExample);
Set<String> uniqueCombinations = new HashSet<>(); // 创建Set集合用于存储唯一的匹配项 Set<String> uniqueCombinations = new HashSet<>(); // 创建Set集合用于存储唯一的匹配项
@ -264,11 +277,14 @@ public class WarningController {
@GetMapping("/getTransactionNumberWarning") @GetMapping("/getTransactionNumberWarning")
@ApiOperation("交易次数预警查询") @ApiOperation("交易次数预警查询")
public ResultEntity<PageInfo<TransactionNumberWarning>> getTransactionNumberWarning(@ApiParam("memberId") @RequestParam String memberId, public ResultEntity<PageInfo<TransactionNumberWarning>> getTransactionNumberWarning(@ApiParam("memberId") @RequestParam String memberId,
@ApiParam("memberId") @RequestParam String trainingId, @ApiParam("memberId") @RequestParam(required = false) String trainingId,
@ApiParam("首页页码") @RequestParam Integer index, @ApiParam("首页页码") @RequestParam Integer index,
@ApiParam("页面条数") @RequestParam Integer size) { @ApiParam("页面条数") @RequestParam Integer size) {
PageHelper.startPage(index, size); PageHelper.startPage(index, size);
TransactionNumberWarningExample tnwr = new TransactionNumberWarningExample(); TransactionNumberWarningExample tnwr = new TransactionNumberWarningExample();
if (trainingId == null || trainingId.isEmpty()) {
trainingId = Constant.PRACTICE_TRAINING_ID;
}
tnwr.createCriteria().andTrainingIdEqualTo(trainingId).andMemberIdEqualTo(memberId); tnwr.createCriteria().andTrainingIdEqualTo(trainingId).andMemberIdEqualTo(memberId);
List<TransactionNumberWarning> tnwrs = transactionNumberWarningMapper.selectByExample(tnwr); List<TransactionNumberWarning> tnwrs = transactionNumberWarningMapper.selectByExample(tnwr);
PageInfo<TransactionNumberWarning> pageInfo = new PageInfo(tnwrs); PageInfo<TransactionNumberWarning> pageInfo = new PageInfo(tnwrs);
@ -290,11 +306,14 @@ public class WarningController {
@GetMapping("/getTransactionNumberWarningRecord") @GetMapping("/getTransactionNumberWarningRecord")
@ApiOperation("交易次数预警记录查询") @ApiOperation("交易次数预警记录查询")
public ResultEntity<PageInfo<TransactionNumberWarningRecord>> getTransactionNumberWarningRecord(@ApiParam("memberId") @RequestParam String memberId, public ResultEntity<PageInfo<TransactionNumberWarningRecord>> getTransactionNumberWarningRecord(@ApiParam("memberId") @RequestParam String memberId,
@ApiParam("memberId") @RequestParam String trainingId, @ApiParam("memberId") @RequestParam(required = false) String trainingId,
@ApiParam("首页页码") @RequestParam Integer index, @ApiParam("首页页码") @RequestParam Integer index,
@ApiParam("页面条数") @RequestParam Integer size) { @ApiParam("页面条数") @RequestParam Integer size) {
PageHelper.startPage(index, size); PageHelper.startPage(index, size);
TransactionNumberWarningRecordExample tnwre = new TransactionNumberWarningRecordExample(); TransactionNumberWarningRecordExample tnwre = new TransactionNumberWarningRecordExample();
if (trainingId == null || trainingId.isEmpty()) {
trainingId = Constant.PRACTICE_TRAINING_ID;
}
tnwre.createCriteria().andTrainingIdEqualTo(trainingId).andMemberIdEqualTo(memberId); tnwre.createCriteria().andTrainingIdEqualTo(trainingId).andMemberIdEqualTo(memberId);
List<TransactionNumberWarningRecord> tnwrs = transactionNumberWarningRecordMapper.selectByExample(tnwre); List<TransactionNumberWarningRecord> tnwrs = transactionNumberWarningRecordMapper.selectByExample(tnwre);
PageInfo<TransactionNumberWarningRecord> pageInfo = new PageInfo<>(tnwrs); PageInfo<TransactionNumberWarningRecord> pageInfo = new PageInfo<>(tnwrs);

@ -1,16 +1,14 @@
package com.sztzjy.forex.trading_trading.entity; package com.sztzjy.forex.trading_trading.entity;
import org.apache.ibatis.annotations.Mapper;
import java.util.Date; import java.util.Date;
@Mapper
public class MarginWarning { public class MarginWarning {
/** /**
* *
* This field was generated by MyBatis Generator. * This field was generated by MyBatis Generator.
* This field corresponds to the database column sys_margin_warning.id * This field corresponds to the database column sys_margin_warning.id
* *
* @mbg.generated Wed Jul 19 14:40:28 CST 2023 * @mbg.generated Fri Aug 04 14:34:22 CST 2023
*/ */
private String id; private String id;
@ -19,16 +17,25 @@ public class MarginWarning {
* This field was generated by MyBatis Generator. * This field was generated by MyBatis Generator.
* This field corresponds to the database column sys_margin_warning.member_id * This field corresponds to the database column sys_margin_warning.member_id
* *
* @mbg.generated Wed Jul 19 14:40:28 CST 2023 * @mbg.generated Fri Aug 04 14:34:22 CST 2023
*/ */
private String memberId; private String memberId;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column sys_margin_warning.trainingId
*
* @mbg.generated Fri Aug 04 14:34:22 CST 2023
*/
private String trainingid;
/** /**
* *
* This field was generated by MyBatis Generator. * This field was generated by MyBatis Generator.
* This field corresponds to the database column sys_margin_warning.account * This field corresponds to the database column sys_margin_warning.account
* *
* @mbg.generated Wed Jul 19 14:40:28 CST 2023 * @mbg.generated Fri Aug 04 14:34:22 CST 2023
*/ */
private String account; private String account;
@ -37,7 +44,7 @@ public class MarginWarning {
* This field was generated by MyBatis Generator. * This field was generated by MyBatis Generator.
* This field corresponds to the database column sys_margin_warning.name * This field corresponds to the database column sys_margin_warning.name
* *
* @mbg.generated Wed Jul 19 14:40:28 CST 2023 * @mbg.generated Fri Aug 04 14:34:22 CST 2023
*/ */
private String name; private String name;
@ -46,7 +53,7 @@ public class MarginWarning {
* This field was generated by MyBatis Generator. * This field was generated by MyBatis Generator.
* This field corresponds to the database column sys_margin_warning.margin_used * This field corresponds to the database column sys_margin_warning.margin_used
* *
* @mbg.generated Wed Jul 19 14:40:28 CST 2023 * @mbg.generated Fri Aug 04 14:34:22 CST 2023
*/ */
private Double marginUsed; private Double marginUsed;
@ -55,7 +62,7 @@ public class MarginWarning {
* This field was generated by MyBatis Generator. * This field was generated by MyBatis Generator.
* This field corresponds to the database column sys_margin_warning.net_value * This field corresponds to the database column sys_margin_warning.net_value
* *
* @mbg.generated Wed Jul 19 14:40:28 CST 2023 * @mbg.generated Fri Aug 04 14:34:22 CST 2023
*/ */
private Double netValue; private Double netValue;
@ -64,7 +71,7 @@ public class MarginWarning {
* This field was generated by MyBatis Generator. * This field was generated by MyBatis Generator.
* This field corresponds to the database column sys_margin_warning.margin_level * This field corresponds to the database column sys_margin_warning.margin_level
* *
* @mbg.generated Wed Jul 19 14:40:28 CST 2023 * @mbg.generated Fri Aug 04 14:34:22 CST 2023
*/ */
private Double marginLevel; private Double marginLevel;
@ -73,7 +80,7 @@ public class MarginWarning {
* This field was generated by MyBatis Generator. * This field was generated by MyBatis Generator.
* This field corresponds to the database column sys_margin_warning.warning_level * This field corresponds to the database column sys_margin_warning.warning_level
* *
* @mbg.generated Wed Jul 19 14:40:28 CST 2023 * @mbg.generated Fri Aug 04 14:34:22 CST 2023
*/ */
private Integer warningLevel; private Integer warningLevel;
@ -82,7 +89,7 @@ public class MarginWarning {
* This field was generated by MyBatis Generator. * This field was generated by MyBatis Generator.
* This field corresponds to the database column sys_margin_warning.status * This field corresponds to the database column sys_margin_warning.status
* *
* @mbg.generated Wed Jul 19 14:40:28 CST 2023 * @mbg.generated Fri Aug 04 14:34:22 CST 2023
*/ */
private Integer status; private Integer status;
@ -91,7 +98,7 @@ public class MarginWarning {
* This field was generated by MyBatis Generator. * This field was generated by MyBatis Generator.
* This field corresponds to the database column sys_margin_warning.isdelete * This field corresponds to the database column sys_margin_warning.isdelete
* *
* @mbg.generated Wed Jul 19 14:40:28 CST 2023 * @mbg.generated Fri Aug 04 14:34:22 CST 2023
*/ */
private Integer isdelete; private Integer isdelete;
@ -100,7 +107,7 @@ public class MarginWarning {
* This field was generated by MyBatis Generator. * This field was generated by MyBatis Generator.
* This field corresponds to the database column sys_margin_warning.set_time * This field corresponds to the database column sys_margin_warning.set_time
* *
* @mbg.generated Wed Jul 19 14:40:28 CST 2023 * @mbg.generated Fri Aug 04 14:34:22 CST 2023
*/ */
private Date setTime; private Date setTime;
@ -110,7 +117,7 @@ public class MarginWarning {
* *
* @return the value of sys_margin_warning.id * @return the value of sys_margin_warning.id
* *
* @mbg.generated Wed Jul 19 14:40:28 CST 2023 * @mbg.generated Fri Aug 04 14:34:22 CST 2023
*/ */
public String getId() { public String getId() {
return id; return id;
@ -122,7 +129,7 @@ public class MarginWarning {
* *
* @param id the value for sys_margin_warning.id * @param id the value for sys_margin_warning.id
* *
* @mbg.generated Wed Jul 19 14:40:28 CST 2023 * @mbg.generated Fri Aug 04 14:34:22 CST 2023
*/ */
public void setId(String id) { public void setId(String id) {
this.id = id == null ? null : id.trim(); this.id = id == null ? null : id.trim();
@ -134,7 +141,7 @@ public class MarginWarning {
* *
* @return the value of sys_margin_warning.member_id * @return the value of sys_margin_warning.member_id
* *
* @mbg.generated Wed Jul 19 14:40:28 CST 2023 * @mbg.generated Fri Aug 04 14:34:22 CST 2023
*/ */
public String getMemberId() { public String getMemberId() {
return memberId; return memberId;
@ -146,19 +153,43 @@ public class MarginWarning {
* *
* @param memberId the value for sys_margin_warning.member_id * @param memberId the value for sys_margin_warning.member_id
* *
* @mbg.generated Wed Jul 19 14:40:28 CST 2023 * @mbg.generated Fri Aug 04 14:34:22 CST 2023
*/ */
public void setMemberId(String memberId) { public void setMemberId(String memberId) {
this.memberId = memberId == null ? null : memberId.trim(); this.memberId = memberId == null ? null : memberId.trim();
} }
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column sys_margin_warning.trainingId
*
* @return the value of sys_margin_warning.trainingId
*
* @mbg.generated Fri Aug 04 14:34:22 CST 2023
*/
public String getTrainingid() {
return trainingid;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column sys_margin_warning.trainingId
*
* @param trainingid the value for sys_margin_warning.trainingId
*
* @mbg.generated Fri Aug 04 14:34:22 CST 2023
*/
public void setTrainingid(String trainingid) {
this.trainingid = trainingid == null ? null : trainingid.trim();
}
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method returns the value of the database column sys_margin_warning.account * This method returns the value of the database column sys_margin_warning.account
* *
* @return the value of sys_margin_warning.account * @return the value of sys_margin_warning.account
* *
* @mbg.generated Wed Jul 19 14:40:28 CST 2023 * @mbg.generated Fri Aug 04 14:34:22 CST 2023
*/ */
public String getAccount() { public String getAccount() {
return account; return account;
@ -170,7 +201,7 @@ public class MarginWarning {
* *
* @param account the value for sys_margin_warning.account * @param account the value for sys_margin_warning.account
* *
* @mbg.generated Wed Jul 19 14:40:28 CST 2023 * @mbg.generated Fri Aug 04 14:34:22 CST 2023
*/ */
public void setAccount(String account) { public void setAccount(String account) {
this.account = account == null ? null : account.trim(); this.account = account == null ? null : account.trim();
@ -182,7 +213,7 @@ public class MarginWarning {
* *
* @return the value of sys_margin_warning.name * @return the value of sys_margin_warning.name
* *
* @mbg.generated Wed Jul 19 14:40:28 CST 2023 * @mbg.generated Fri Aug 04 14:34:22 CST 2023
*/ */
public String getName() { public String getName() {
return name; return name;
@ -194,7 +225,7 @@ public class MarginWarning {
* *
* @param name the value for sys_margin_warning.name * @param name the value for sys_margin_warning.name
* *
* @mbg.generated Wed Jul 19 14:40:28 CST 2023 * @mbg.generated Fri Aug 04 14:34:22 CST 2023
*/ */
public void setName(String name) { public void setName(String name) {
this.name = name == null ? null : name.trim(); this.name = name == null ? null : name.trim();
@ -206,7 +237,7 @@ public class MarginWarning {
* *
* @return the value of sys_margin_warning.margin_used * @return the value of sys_margin_warning.margin_used
* *
* @mbg.generated Wed Jul 19 14:40:28 CST 2023 * @mbg.generated Fri Aug 04 14:34:22 CST 2023
*/ */
public Double getMarginUsed() { public Double getMarginUsed() {
return marginUsed; return marginUsed;
@ -218,7 +249,7 @@ public class MarginWarning {
* *
* @param marginUsed the value for sys_margin_warning.margin_used * @param marginUsed the value for sys_margin_warning.margin_used
* *
* @mbg.generated Wed Jul 19 14:40:28 CST 2023 * @mbg.generated Fri Aug 04 14:34:22 CST 2023
*/ */
public void setMarginUsed(Double marginUsed) { public void setMarginUsed(Double marginUsed) {
this.marginUsed = marginUsed; this.marginUsed = marginUsed;
@ -230,7 +261,7 @@ public class MarginWarning {
* *
* @return the value of sys_margin_warning.net_value * @return the value of sys_margin_warning.net_value
* *
* @mbg.generated Wed Jul 19 14:40:28 CST 2023 * @mbg.generated Fri Aug 04 14:34:22 CST 2023
*/ */
public Double getNetValue() { public Double getNetValue() {
return netValue; return netValue;
@ -242,7 +273,7 @@ public class MarginWarning {
* *
* @param netValue the value for sys_margin_warning.net_value * @param netValue the value for sys_margin_warning.net_value
* *
* @mbg.generated Wed Jul 19 14:40:28 CST 2023 * @mbg.generated Fri Aug 04 14:34:22 CST 2023
*/ */
public void setNetValue(Double netValue) { public void setNetValue(Double netValue) {
this.netValue = netValue; this.netValue = netValue;
@ -254,7 +285,7 @@ public class MarginWarning {
* *
* @return the value of sys_margin_warning.margin_level * @return the value of sys_margin_warning.margin_level
* *
* @mbg.generated Wed Jul 19 14:40:28 CST 2023 * @mbg.generated Fri Aug 04 14:34:22 CST 2023
*/ */
public Double getMarginLevel() { public Double getMarginLevel() {
return marginLevel; return marginLevel;
@ -266,7 +297,7 @@ public class MarginWarning {
* *
* @param marginLevel the value for sys_margin_warning.margin_level * @param marginLevel the value for sys_margin_warning.margin_level
* *
* @mbg.generated Wed Jul 19 14:40:28 CST 2023 * @mbg.generated Fri Aug 04 14:34:22 CST 2023
*/ */
public void setMarginLevel(Double marginLevel) { public void setMarginLevel(Double marginLevel) {
this.marginLevel = marginLevel; this.marginLevel = marginLevel;
@ -278,7 +309,7 @@ public class MarginWarning {
* *
* @return the value of sys_margin_warning.warning_level * @return the value of sys_margin_warning.warning_level
* *
* @mbg.generated Wed Jul 19 14:40:28 CST 2023 * @mbg.generated Fri Aug 04 14:34:22 CST 2023
*/ */
public Integer getWarningLevel() { public Integer getWarningLevel() {
return warningLevel; return warningLevel;
@ -290,7 +321,7 @@ public class MarginWarning {
* *
* @param warningLevel the value for sys_margin_warning.warning_level * @param warningLevel the value for sys_margin_warning.warning_level
* *
* @mbg.generated Wed Jul 19 14:40:28 CST 2023 * @mbg.generated Fri Aug 04 14:34:22 CST 2023
*/ */
public void setWarningLevel(Integer warningLevel) { public void setWarningLevel(Integer warningLevel) {
this.warningLevel = warningLevel; this.warningLevel = warningLevel;
@ -302,7 +333,7 @@ public class MarginWarning {
* *
* @return the value of sys_margin_warning.status * @return the value of sys_margin_warning.status
* *
* @mbg.generated Wed Jul 19 14:40:28 CST 2023 * @mbg.generated Fri Aug 04 14:34:22 CST 2023
*/ */
public Integer getStatus() { public Integer getStatus() {
return status; return status;
@ -314,7 +345,7 @@ public class MarginWarning {
* *
* @param status the value for sys_margin_warning.status * @param status the value for sys_margin_warning.status
* *
* @mbg.generated Wed Jul 19 14:40:28 CST 2023 * @mbg.generated Fri Aug 04 14:34:22 CST 2023
*/ */
public void setStatus(Integer status) { public void setStatus(Integer status) {
this.status = status; this.status = status;
@ -326,7 +357,7 @@ public class MarginWarning {
* *
* @return the value of sys_margin_warning.isdelete * @return the value of sys_margin_warning.isdelete
* *
* @mbg.generated Wed Jul 19 14:40:28 CST 2023 * @mbg.generated Fri Aug 04 14:34:22 CST 2023
*/ */
public Integer getIsdelete() { public Integer getIsdelete() {
return isdelete; return isdelete;
@ -338,7 +369,7 @@ public class MarginWarning {
* *
* @param isdelete the value for sys_margin_warning.isdelete * @param isdelete the value for sys_margin_warning.isdelete
* *
* @mbg.generated Wed Jul 19 14:40:28 CST 2023 * @mbg.generated Fri Aug 04 14:34:22 CST 2023
*/ */
public void setIsdelete(Integer isdelete) { public void setIsdelete(Integer isdelete) {
this.isdelete = isdelete; this.isdelete = isdelete;
@ -350,7 +381,7 @@ public class MarginWarning {
* *
* @return the value of sys_margin_warning.set_time * @return the value of sys_margin_warning.set_time
* *
* @mbg.generated Wed Jul 19 14:40:28 CST 2023 * @mbg.generated Fri Aug 04 14:34:22 CST 2023
*/ */
public Date getSetTime() { public Date getSetTime() {
return setTime; return setTime;
@ -362,7 +393,7 @@ public class MarginWarning {
* *
* @param setTime the value for sys_margin_warning.set_time * @param setTime the value for sys_margin_warning.set_time
* *
* @mbg.generated Wed Jul 19 14:40:28 CST 2023 * @mbg.generated Fri Aug 04 14:34:22 CST 2023
*/ */
public void setSetTime(Date setTime) { public void setSetTime(Date setTime) {
this.setTime = setTime; this.setTime = setTime;

@ -9,7 +9,7 @@ public class MarginWarningExample {
* This field was generated by MyBatis Generator. * This field was generated by MyBatis Generator.
* This field corresponds to the database table sys_margin_warning * This field corresponds to the database table sys_margin_warning
* *
* @mbg.generated Wed Jul 19 14:40:28 CST 2023 * @mbg.generated Fri Aug 04 14:34:22 CST 2023
*/ */
protected String orderByClause; protected String orderByClause;
@ -17,7 +17,7 @@ public class MarginWarningExample {
* This field was generated by MyBatis Generator. * This field was generated by MyBatis Generator.
* This field corresponds to the database table sys_margin_warning * This field corresponds to the database table sys_margin_warning
* *
* @mbg.generated Wed Jul 19 14:40:28 CST 2023 * @mbg.generated Fri Aug 04 14:34:22 CST 2023
*/ */
protected boolean distinct; protected boolean distinct;
@ -25,7 +25,7 @@ public class MarginWarningExample {
* This field was generated by MyBatis Generator. * This field was generated by MyBatis Generator.
* This field corresponds to the database table sys_margin_warning * This field corresponds to the database table sys_margin_warning
* *
* @mbg.generated Wed Jul 19 14:40:28 CST 2023 * @mbg.generated Fri Aug 04 14:34:22 CST 2023
*/ */
protected List<Criteria> oredCriteria; protected List<Criteria> oredCriteria;
@ -33,7 +33,7 @@ public class MarginWarningExample {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table sys_margin_warning * This method corresponds to the database table sys_margin_warning
* *
* @mbg.generated Wed Jul 19 14:40:28 CST 2023 * @mbg.generated Fri Aug 04 14:34:22 CST 2023
*/ */
public MarginWarningExample() { public MarginWarningExample() {
oredCriteria = new ArrayList<>(); oredCriteria = new ArrayList<>();
@ -43,7 +43,7 @@ public class MarginWarningExample {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table sys_margin_warning * This method corresponds to the database table sys_margin_warning
* *
* @mbg.generated Wed Jul 19 14:40:28 CST 2023 * @mbg.generated Fri Aug 04 14:34:22 CST 2023
*/ */
public void setOrderByClause(String orderByClause) { public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause; this.orderByClause = orderByClause;
@ -53,7 +53,7 @@ public class MarginWarningExample {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table sys_margin_warning * This method corresponds to the database table sys_margin_warning
* *
* @mbg.generated Wed Jul 19 14:40:28 CST 2023 * @mbg.generated Fri Aug 04 14:34:22 CST 2023
*/ */
public String getOrderByClause() { public String getOrderByClause() {
return orderByClause; return orderByClause;
@ -63,7 +63,7 @@ public class MarginWarningExample {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table sys_margin_warning * This method corresponds to the database table sys_margin_warning
* *
* @mbg.generated Wed Jul 19 14:40:28 CST 2023 * @mbg.generated Fri Aug 04 14:34:22 CST 2023
*/ */
public void setDistinct(boolean distinct) { public void setDistinct(boolean distinct) {
this.distinct = distinct; this.distinct = distinct;
@ -73,7 +73,7 @@ public class MarginWarningExample {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table sys_margin_warning * This method corresponds to the database table sys_margin_warning
* *
* @mbg.generated Wed Jul 19 14:40:28 CST 2023 * @mbg.generated Fri Aug 04 14:34:22 CST 2023
*/ */
public boolean isDistinct() { public boolean isDistinct() {
return distinct; return distinct;
@ -83,7 +83,7 @@ public class MarginWarningExample {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table sys_margin_warning * This method corresponds to the database table sys_margin_warning
* *
* @mbg.generated Wed Jul 19 14:40:28 CST 2023 * @mbg.generated Fri Aug 04 14:34:22 CST 2023
*/ */
public List<Criteria> getOredCriteria() { public List<Criteria> getOredCriteria() {
return oredCriteria; return oredCriteria;
@ -93,7 +93,7 @@ public class MarginWarningExample {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table sys_margin_warning * This method corresponds to the database table sys_margin_warning
* *
* @mbg.generated Wed Jul 19 14:40:28 CST 2023 * @mbg.generated Fri Aug 04 14:34:22 CST 2023
*/ */
public void or(Criteria criteria) { public void or(Criteria criteria) {
oredCriteria.add(criteria); oredCriteria.add(criteria);
@ -103,7 +103,7 @@ public class MarginWarningExample {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table sys_margin_warning * This method corresponds to the database table sys_margin_warning
* *
* @mbg.generated Wed Jul 19 14:40:28 CST 2023 * @mbg.generated Fri Aug 04 14:34:22 CST 2023
*/ */
public Criteria or() { public Criteria or() {
Criteria criteria = createCriteriaInternal(); Criteria criteria = createCriteriaInternal();
@ -115,7 +115,7 @@ public class MarginWarningExample {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table sys_margin_warning * This method corresponds to the database table sys_margin_warning
* *
* @mbg.generated Wed Jul 19 14:40:28 CST 2023 * @mbg.generated Fri Aug 04 14:34:22 CST 2023
*/ */
public Criteria createCriteria() { public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal(); Criteria criteria = createCriteriaInternal();
@ -129,7 +129,7 @@ public class MarginWarningExample {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table sys_margin_warning * This method corresponds to the database table sys_margin_warning
* *
* @mbg.generated Wed Jul 19 14:40:28 CST 2023 * @mbg.generated Fri Aug 04 14:34:22 CST 2023
*/ */
protected Criteria createCriteriaInternal() { protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria(); Criteria criteria = new Criteria();
@ -140,7 +140,7 @@ public class MarginWarningExample {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table sys_margin_warning * This method corresponds to the database table sys_margin_warning
* *
* @mbg.generated Wed Jul 19 14:40:28 CST 2023 * @mbg.generated Fri Aug 04 14:34:22 CST 2023
*/ */
public void clear() { public void clear() {
oredCriteria.clear(); oredCriteria.clear();
@ -152,7 +152,7 @@ public class MarginWarningExample {
* This class was generated by MyBatis Generator. * This class was generated by MyBatis Generator.
* This class corresponds to the database table sys_margin_warning * This class corresponds to the database table sys_margin_warning
* *
* @mbg.generated Wed Jul 19 14:40:28 CST 2023 * @mbg.generated Fri Aug 04 14:34:22 CST 2023
*/ */
protected abstract static class GeneratedCriteria { protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria; protected List<Criterion> criteria;
@ -335,6 +335,76 @@ public class MarginWarningExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andTrainingidIsNull() {
addCriterion("trainingId is null");
return (Criteria) this;
}
public Criteria andTrainingidIsNotNull() {
addCriterion("trainingId is not null");
return (Criteria) this;
}
public Criteria andTrainingidEqualTo(String value) {
addCriterion("trainingId =", value, "trainingid");
return (Criteria) this;
}
public Criteria andTrainingidNotEqualTo(String value) {
addCriterion("trainingId <>", value, "trainingid");
return (Criteria) this;
}
public Criteria andTrainingidGreaterThan(String value) {
addCriterion("trainingId >", value, "trainingid");
return (Criteria) this;
}
public Criteria andTrainingidGreaterThanOrEqualTo(String value) {
addCriterion("trainingId >=", value, "trainingid");
return (Criteria) this;
}
public Criteria andTrainingidLessThan(String value) {
addCriterion("trainingId <", value, "trainingid");
return (Criteria) this;
}
public Criteria andTrainingidLessThanOrEqualTo(String value) {
addCriterion("trainingId <=", value, "trainingid");
return (Criteria) this;
}
public Criteria andTrainingidLike(String value) {
addCriterion("trainingId like", value, "trainingid");
return (Criteria) this;
}
public Criteria andTrainingidNotLike(String value) {
addCriterion("trainingId not like", value, "trainingid");
return (Criteria) this;
}
public Criteria andTrainingidIn(List<String> values) {
addCriterion("trainingId in", values, "trainingid");
return (Criteria) this;
}
public Criteria andTrainingidNotIn(List<String> values) {
addCriterion("trainingId not in", values, "trainingid");
return (Criteria) this;
}
public Criteria andTrainingidBetween(String value1, String value2) {
addCriterion("trainingId between", value1, value2, "trainingid");
return (Criteria) this;
}
public Criteria andTrainingidNotBetween(String value1, String value2) {
addCriterion("trainingId not between", value1, value2, "trainingid");
return (Criteria) this;
}
public Criteria andAccountIsNull() { public Criteria andAccountIsNull() {
addCriterion("account is null"); addCriterion("account is null");
return (Criteria) this; return (Criteria) this;
@ -900,7 +970,7 @@ public class MarginWarningExample {
* This class was generated by MyBatis Generator. * This class was generated by MyBatis Generator.
* This class corresponds to the database table sys_margin_warning * This class corresponds to the database table sys_margin_warning
* *
* @mbg.generated do_not_delete_during_merge Wed Jul 19 14:40:28 CST 2023 * @mbg.generated do_not_delete_during_merge Fri Aug 04 14:34:22 CST 2023
*/ */
public static class Criteria extends GeneratedCriteria { public static class Criteria extends GeneratedCriteria {
protected Criteria() { protected Criteria() {
@ -912,7 +982,7 @@ public class MarginWarningExample {
* This class was generated by MyBatis Generator. * This class was generated by MyBatis Generator.
* This class corresponds to the database table sys_margin_warning * This class corresponds to the database table sys_margin_warning
* *
* @mbg.generated Wed Jul 19 14:40:28 CST 2023 * @mbg.generated Fri Aug 04 14:34:22 CST 2023
*/ */
public static class Criterion { public static class Criterion {
private String condition; private String condition;

@ -12,7 +12,7 @@ public interface MarginWarningMapper {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table sys_margin_warning * This method corresponds to the database table sys_margin_warning
* *
* @mbg.generated Wed Jul 19 14:40:28 CST 2023 * @mbg.generated Fri Aug 04 14:34:22 CST 2023
*/ */
long countByExample(MarginWarningExample example); long countByExample(MarginWarningExample example);
@ -20,7 +20,7 @@ public interface MarginWarningMapper {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table sys_margin_warning * This method corresponds to the database table sys_margin_warning
* *
* @mbg.generated Wed Jul 19 14:40:28 CST 2023 * @mbg.generated Fri Aug 04 14:34:22 CST 2023
*/ */
int deleteByExample(MarginWarningExample example); int deleteByExample(MarginWarningExample example);
@ -28,7 +28,7 @@ public interface MarginWarningMapper {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table sys_margin_warning * This method corresponds to the database table sys_margin_warning
* *
* @mbg.generated Wed Jul 19 14:40:28 CST 2023 * @mbg.generated Fri Aug 04 14:34:22 CST 2023
*/ */
int deleteByPrimaryKey(String id); int deleteByPrimaryKey(String id);
@ -36,7 +36,7 @@ public interface MarginWarningMapper {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table sys_margin_warning * This method corresponds to the database table sys_margin_warning
* *
* @mbg.generated Wed Jul 19 14:40:28 CST 2023 * @mbg.generated Fri Aug 04 14:34:22 CST 2023
*/ */
int insert(MarginWarning record); int insert(MarginWarning record);
@ -44,7 +44,7 @@ public interface MarginWarningMapper {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table sys_margin_warning * This method corresponds to the database table sys_margin_warning
* *
* @mbg.generated Wed Jul 19 14:40:28 CST 2023 * @mbg.generated Fri Aug 04 14:34:22 CST 2023
*/ */
int insertSelective(MarginWarning record); int insertSelective(MarginWarning record);
@ -52,7 +52,7 @@ public interface MarginWarningMapper {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table sys_margin_warning * This method corresponds to the database table sys_margin_warning
* *
* @mbg.generated Wed Jul 19 14:40:28 CST 2023 * @mbg.generated Fri Aug 04 14:34:22 CST 2023
*/ */
List<MarginWarning> selectByExample(MarginWarningExample example); List<MarginWarning> selectByExample(MarginWarningExample example);
@ -60,7 +60,7 @@ public interface MarginWarningMapper {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table sys_margin_warning * This method corresponds to the database table sys_margin_warning
* *
* @mbg.generated Wed Jul 19 14:40:28 CST 2023 * @mbg.generated Fri Aug 04 14:34:22 CST 2023
*/ */
MarginWarning selectByPrimaryKey(String id); MarginWarning selectByPrimaryKey(String id);
@ -68,7 +68,7 @@ public interface MarginWarningMapper {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table sys_margin_warning * This method corresponds to the database table sys_margin_warning
* *
* @mbg.generated Wed Jul 19 14:40:28 CST 2023 * @mbg.generated Fri Aug 04 14:34:22 CST 2023
*/ */
int updateByExampleSelective(@Param("record") MarginWarning record, @Param("example") MarginWarningExample example); int updateByExampleSelective(@Param("record") MarginWarning record, @Param("example") MarginWarningExample example);
@ -76,7 +76,7 @@ public interface MarginWarningMapper {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table sys_margin_warning * This method corresponds to the database table sys_margin_warning
* *
* @mbg.generated Wed Jul 19 14:40:28 CST 2023 * @mbg.generated Fri Aug 04 14:34:22 CST 2023
*/ */
int updateByExample(@Param("record") MarginWarning record, @Param("example") MarginWarningExample example); int updateByExample(@Param("record") MarginWarning record, @Param("example") MarginWarningExample example);
@ -84,7 +84,7 @@ public interface MarginWarningMapper {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table sys_margin_warning * This method corresponds to the database table sys_margin_warning
* *
* @mbg.generated Wed Jul 19 14:40:28 CST 2023 * @mbg.generated Fri Aug 04 14:34:22 CST 2023
*/ */
int updateByPrimaryKeySelective(MarginWarning record); int updateByPrimaryKeySelective(MarginWarning record);
@ -92,7 +92,7 @@ public interface MarginWarningMapper {
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table sys_margin_warning * This method corresponds to the database table sys_margin_warning
* *
* @mbg.generated Wed Jul 19 14:40:28 CST 2023 * @mbg.generated Fri Aug 04 14:34:22 CST 2023
*/ */
int updateByPrimaryKey(MarginWarning record); int updateByPrimaryKey(MarginWarning record);
} }

@ -128,7 +128,7 @@ public class TrainingService {
} }
} }
List<String> statusOrder = Arrays.asList("ONGOING", "NOT_STARTED", "FINISHED"); List<String> statusOrder = Arrays.asList("ONGOING", "NOT_STARTED", "FINISHED");
trainingList.sort(Comparator.comparingInt(training -> statusOrder.indexOf(training.getStatus()))); trainingList.sort(Comparator.comparingInt(training -> statusOrder.indexOf(training.getStatus()))); //将状态变成索引的 0 1 2进行升序
return new PageInfo<>(trainingList); return new PageInfo<>(trainingList);
} }
return new PageInfo<>(); return new PageInfo<>();

@ -3,12 +3,13 @@ package com.sztzjy.forex.trading_trading.service;
import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.IdUtil;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.sztzjy.forex.trading_trading.config.Constant;
import com.sztzjy.forex.trading_trading.config.websocket.WebSocket; import com.sztzjy.forex.trading_trading.config.websocket.WebSocket;
import com.sztzjy.forex.trading_trading.controller.TakeStashController;
import com.sztzjy.forex.trading_trading.entity.*; import com.sztzjy.forex.trading_trading.entity.*;
import com.sztzjy.forex.trading_trading.mappers.*; import com.sztzjy.forex.trading_trading.mappers.*;
import com.sztzjy.forex.trading_trading.util.ForexMarketDateUtil; import com.sztzjy.forex.trading_trading.util.ForexMarketDateUtil;
import com.sztzjy.forex.trading_trading.util.RedisUtil; import com.sztzjy.forex.trading_trading.util.RedisUtil;
import com.sztzjy.forex.trading_trading.util.ResultEntity;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
@ -65,13 +66,24 @@ public class WainingService {
mwre.createCriteria().andMarginWarningIdEqualTo(marginWarning.getId()); mwre.createCriteria().andMarginWarningIdEqualTo(marginWarning.getId());
List<MarginWarningRecord> marginWarningRecords = marginWarningRecordMapper.selectByExample(mwre); List<MarginWarningRecord> marginWarningRecords = marginWarningRecordMapper.selectByExample(mwre);
for (MarginWarningRecord marginWarningRecord : marginWarningRecords) { for (MarginWarningRecord marginWarningRecord : marginWarningRecords) {
Double memberLevel = member.getMarginLevel(); Double marginUsed = member.getMarginUsed(); //已用保证金
Double cumulativeProfitLoss = member.getCumulativeProfitLoss(); //累计盈亏
Double initialCapital = member.getInitialCapital(); //初始资金
Double positionProfitLoss = memberService.flashTotalPositionProfitLoss(memberId); //获取持仓盈亏
Double netValue = initialCapital + cumulativeProfitLoss + positionProfitLoss; //净值 = 持仓盈亏 + 累计盈亏 + 期初资金
double marginLevel;
if (marginUsed != null && marginUsed != 0) {
marginLevel = (netValue / marginUsed) * 100; //保证金水平 = 净值/已用保证金 (%)
} else {
marginLevel = 0.0; // 或者可以根据你的需求设置一个默认值
}
Integer warningLevel = marginWarning.getWarningLevel(); Integer warningLevel = marginWarning.getWarningLevel();
if (memberLevel <= warningLevel) { if (marginLevel <= warningLevel) {
Date date = new Date(); Date date = new Date();
Timestamp current = new Timestamp(date.getTime()); Timestamp current = new Timestamp(date.getTime());
marginWarningRecord.setWarningTime(current); marginWarningRecord.setWarningTime(current);
marginWarningRecord.setEarlyWarningLevel(memberLevel); marginWarningRecord.setEarlyWarningLevel(marginLevel);
marginWarningRecordMapper.updateByPrimaryKeySelective(marginWarningRecord); marginWarningRecordMapper.updateByPrimaryKeySelective(marginWarningRecord);
WebSocket.sendMessage(message); WebSocket.sendMessage(message);
} }
@ -87,6 +99,10 @@ public class WainingService {
marginWarningExample.createCriteria().andNameEqualTo(userName).andMemberIdEqualTo(memberId); marginWarningExample.createCriteria().andNameEqualTo(userName).andMemberIdEqualTo(memberId);
List<MarginWarning> marginWarningList = marginWarningMapper.selectByExample(marginWarningExample); List<MarginWarning> marginWarningList = marginWarningMapper.selectByExample(marginWarningExample);
MarginWarningRecordExample marginWarningRecordExample = new MarginWarningRecordExample(); MarginWarningRecordExample marginWarningRecordExample = new MarginWarningRecordExample();
if (trainingId == null || trainingId.isEmpty()) {
trainingId = Constant.PRACTICE_TRAINING_ID;
marginWarning.setTrainingid(trainingId);
}
marginWarningRecordExample.createCriteria().andNameEqualTo(userName).andTrainingidEqualTo(trainingId); marginWarningRecordExample.createCriteria().andNameEqualTo(userName).andTrainingidEqualTo(trainingId);
Member member = memberMapper.selectByPrimaryKey(memberId); Member member = memberMapper.selectByPrimaryKey(memberId);
@ -96,7 +112,13 @@ public class WainingService {
Double positionProfitLoss = memberService.flashTotalPositionProfitLoss(memberId); //获取持仓盈亏 Double positionProfitLoss = memberService.flashTotalPositionProfitLoss(memberId); //获取持仓盈亏
Double netValue = initialCapital + cumulativeProfitLoss + positionProfitLoss; //净值 = 持仓盈亏 + 累计盈亏 + 期初资金 Double netValue = initialCapital + cumulativeProfitLoss + positionProfitLoss; //净值 = 持仓盈亏 + 累计盈亏 + 期初资金
Double marginLevel = (netValue / marginUsed) * 100; //保证金水平 = 净值/已用保证金 (%) double marginLevel;
if (marginUsed != null && marginUsed != 0) {
marginLevel = (netValue / marginUsed) * 100; //保证金水平 = 净值/已用保证金 (%)
} else {
marginLevel = 0.0; // 或者可以根据你的需求设置一个默认值
}
// 如果表里有数据直接返回 // 如果表里有数据直接返回
if (marginWarningList != null && !marginWarningList.isEmpty()) { if (marginWarningList != null && !marginWarningList.isEmpty()) {
for (MarginWarning warning : marginWarningList) { for (MarginWarning warning : marginWarningList) {
@ -109,11 +131,11 @@ public class WainingService {
// 表里没有就从member表里取好封装返回 // 表里没有就从member表里取好封装返回
marginWarning.setAccount(userName); marginWarning.setAccount(userName);
BeanUtils.copyProperties(member, marginWarning); BeanUtils.copyProperties(member, marginWarning);
marginWarning.setStatus(0); marginWarning.setStatus(1);
marginWarning.setId(IdUtil.simpleUUID()); marginWarning.setId(IdUtil.simpleUUID());
marginWarning.setMarginLevel(marginLevel); //保证金水平 marginWarning.setMarginLevel(marginLevel); //保证金水平
marginWarning.setNetValue(netValue); //净值 marginWarning.setNetValue(netValue);//净值
marginWarning.setTrainingid(trainingId);
marginWarningMapper.insert(marginWarning); marginWarningMapper.insert(marginWarning);
return marginWarning; return marginWarning;
} }
@ -134,11 +156,14 @@ public class WainingService {
warning.setStatus(1); warning.setStatus(1);
warning.setAccount(userName); warning.setAccount(userName);
warning.setWarningLevel(warningLevel); warning.setWarningLevel(warningLevel);
if (trainingId == null || trainingId.isEmpty()) {
trainingId = Constant.PRACTICE_TRAINING_ID;
}
warning.setTrainingid(trainingId);
marginWarningMapper.updateByPrimaryKeySelective(warning); marginWarningMapper.updateByPrimaryKeySelective(warning);
BeanUtils.copyProperties(warning, marginWarningRecord); BeanUtils.copyProperties(warning, marginWarningRecord);
marginWarningRecord.setId(IdUtil.simpleUUID()); marginWarningRecord.setId(IdUtil.simpleUUID());
marginWarningRecord.setMarginWarningId(warning.getId()); marginWarningRecord.setMarginWarningId(warning.getId());
marginWarningRecord.setTrainingid(trainingId);
marginWarningRecordMapper.insert(marginWarningRecord); marginWarningRecordMapper.insert(marginWarningRecord);
return warning; return warning;
} }
@ -151,6 +176,9 @@ public class WainingService {
public PageInfo<MarginWarningRecord> getMarginWarningRecord(Integer index, Integer size, String userName, String trainingId) { public PageInfo<MarginWarningRecord> getMarginWarningRecord(Integer index, Integer size, String userName, String trainingId) {
PageHelper.startPage(index, size); PageHelper.startPage(index, size);
MarginWarningRecordExample marginWarningRecordExample = new MarginWarningRecordExample(); MarginWarningRecordExample marginWarningRecordExample = new MarginWarningRecordExample();
if (trainingId == null) {
trainingId = Constant.PRACTICE_TRAINING_ID;
}
marginWarningRecordExample.createCriteria().andTrainingidEqualTo(trainingId).andNameEqualTo(userName); marginWarningRecordExample.createCriteria().andTrainingidEqualTo(trainingId).andNameEqualTo(userName);
List<MarginWarningRecord> marginWarningRecords = marginWarningRecordMapper.selectByExample(marginWarningRecordExample); List<MarginWarningRecord> marginWarningRecords = marginWarningRecordMapper.selectByExample(marginWarningRecordExample);
return new PageInfo<>(marginWarningRecords); return new PageInfo<>(marginWarningRecords);
@ -166,13 +194,17 @@ public class WainingService {
// 新增行情预警,并在达到预警值时将数据存入记录表 // 新增行情预警,并在达到预警值时将数据存入记录表
public void addMarketWarning(MarketWarning marketWarning) { public void addMarketWarning(MarketWarning marketWarning) {
String trainingId = marketWarning.getTariningid(); String trainingId = marketWarning.getTariningid();
if (trainingId == null || trainingId.isEmpty()) {
marketWarning.setTariningid(Constant.PRACTICE_TRAINING_ID);
}
Training training = trainingMapper.selectByPrimaryKey(trainingId); Training training = trainingMapper.selectByPrimaryKey(trainingId);
if (training.getStatus().equals("ONGOING")) { if (training != null && "ONGOING".equals(training.getStatus()) || (trainingId != null && marketWarning.getTariningid().equals(Constant.PRACTICE_TRAINING_ID))) {
// 记录表需要设置预警水平和预警时间 为报警时候的值 // 记录表需要设置预警水平和预警时间 为报警时候的值
String marketWarningId = IdUtil.simpleUUID(); String marketWarningId = IdUtil.simpleUUID();
marketWarning.setId(marketWarningId); marketWarning.setId(marketWarningId);
MarketWarningRecord marketWarningRecord = new MarketWarningRecord(); MarketWarningRecord marketWarningRecord = new MarketWarningRecord();
marketWarning.setTime(new Timestamp(new Date().getTime())); marketWarning.setTime(new Timestamp(new Date().getTime()));
marketWarning.setStatus(1);
marketWarningMapper.insert(marketWarning); marketWarningMapper.insert(marketWarning);
BeanUtils.copyProperties(marketWarning, marketWarningRecord); BeanUtils.copyProperties(marketWarning, marketWarningRecord);
marketWarningRecord.setMarketWarningId(marketWarningId); marketWarningRecord.setMarketWarningId(marketWarningId);
@ -238,11 +270,14 @@ public class WainingService {
} }
//新增持仓时长预警 //新增持仓时长预警
public String addAlertHoldDuration(AlertHoldDuration alertHoldDuration) { public ResultEntity<String> addAlertHoldDuration(AlertHoldDuration alertHoldDuration) {
String trainingid = alertHoldDuration.getTrainingid(); String trainingid = alertHoldDuration.getTrainingid();
if (trainingid == null || trainingid.isEmpty()) {
alertHoldDuration.setTrainingid(Constant.PRACTICE_TRAINING_ID);
}
String symbol = alertHoldDuration.getSymbol(); String symbol = alertHoldDuration.getSymbol();
AlertHoldDurationExample alertHoldDurationExample = new AlertHoldDurationExample(); AlertHoldDurationExample alertHoldDurationExample = new AlertHoldDurationExample();
alertHoldDurationExample.createCriteria().andSymbolEqualTo(symbol).andWariningHoldDurationEqualTo(alertHoldDuration.getWariningHoldDuration()); alertHoldDurationExample.createCriteria().andSymbolEqualTo(symbol).andWariningHoldDurationEqualTo(alertHoldDuration.getWariningHoldDuration()).andTrainingidEqualTo(alertHoldDuration.getTrainingid());
List<AlertHoldDuration> alertHoldDurations = alertHoldDurationMapper.selectByExample(alertHoldDurationExample); List<AlertHoldDuration> alertHoldDurations = alertHoldDurationMapper.selectByExample(alertHoldDurationExample);
if (alertHoldDurations.isEmpty()) { if (alertHoldDurations.isEmpty()) {
TakeStashExample takeStashExample = new TakeStashExample(); TakeStashExample takeStashExample = new TakeStashExample();
@ -254,6 +289,7 @@ public class WainingService {
alertHoldDuration.setSetTime(new Timestamp(new Date().getTime())); alertHoldDuration.setSetTime(new Timestamp(new Date().getTime()));
alertHoldDuration.setStashid(stashId); alertHoldDuration.setStashid(stashId);
alertHoldDuration.setId(IdUtil.simpleUUID()); alertHoldDuration.setId(IdUtil.simpleUUID());
alertHoldDuration.setStatus(1);
alertHoldDurationMapper.insert(alertHoldDuration); alertHoldDurationMapper.insert(alertHoldDuration);
String durationId = alertHoldDuration.getId(); String durationId = alertHoldDuration.getId();
@ -273,10 +309,11 @@ public class WainingService {
b(); b();
} }
} }
return new ResultEntity<>(HttpStatus.OK, "新增成功");
} }
return "该品种下没有交易记录"; return new ResultEntity<>(HttpStatus.BAD_REQUEST, "该品种下没有交易记录");
} }
return "400 该预警已存在"; return new ResultEntity<>(HttpStatus.BAD_REQUEST, "400 该预警已存在");
} }
// 持仓时长预警对比定时任务 // 持仓时长预警对比定时任务
@ -339,9 +376,14 @@ public class WainingService {
//新增交易时长预警 //新增交易时长预警
public String addTransactionNumberWarning(TransactionNumberWarning transactionNumberWarning) { public String addTransactionNumberWarning(TransactionNumberWarning transactionNumberWarning) {
String trainingId = transactionNumberWarning.getTrainingId();
if (trainingId == null || trainingId.isEmpty()) {
transactionNumberWarning.setTrainingId(Constant.PRACTICE_TRAINING_ID);
}
TransactionNumberWarningRecord tnwr = new TransactionNumberWarningRecord(); TransactionNumberWarningRecord tnwr = new TransactionNumberWarningRecord();
transactionNumberWarning.setSetTime(new Timestamp(new Date().getTime())); transactionNumberWarning.setSetTime(new Timestamp(new Date().getTime()));
transactionNumberWarning.setId(IdUtil.simpleUUID()); transactionNumberWarning.setId(IdUtil.simpleUUID());
transactionNumberWarning.setStatus(1);
tnwr.setId(IdUtil.simpleUUID()); tnwr.setId(IdUtil.simpleUUID());
BeanUtils.copyProperties(transactionNumberWarning, tnwr); BeanUtils.copyProperties(transactionNumberWarning, tnwr);
transactionNumberWarningMapper.insert(transactionNumberWarning); transactionNumberWarningMapper.insert(transactionNumberWarning);

@ -5,10 +5,11 @@
<!-- <!--
WARNING - @mbg.generated WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Wed Jul 19 14:40:28 CST 2023. This element was generated on Fri Aug 04 14:34:22 CST 2023.
--> -->
<id column="id" jdbcType="VARCHAR" property="id" /> <id column="id" jdbcType="VARCHAR" property="id" />
<result column="member_id" jdbcType="VARCHAR" property="memberId" /> <result column="member_id" jdbcType="VARCHAR" property="memberId" />
<result column="trainingId" jdbcType="VARCHAR" property="trainingid" />
<result column="account" jdbcType="VARCHAR" property="account" /> <result column="account" jdbcType="VARCHAR" property="account" />
<result column="name" jdbcType="VARCHAR" property="name" /> <result column="name" jdbcType="VARCHAR" property="name" />
<result column="margin_used" jdbcType="DOUBLE" property="marginUsed" /> <result column="margin_used" jdbcType="DOUBLE" property="marginUsed" />
@ -23,7 +24,7 @@
<!-- <!--
WARNING - @mbg.generated WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Wed Jul 19 14:40:28 CST 2023. This element was generated on Fri Aug 04 14:34:22 CST 2023.
--> -->
<where> <where>
<foreach collection="oredCriteria" item="criteria" separator="or"> <foreach collection="oredCriteria" item="criteria" separator="or">
@ -57,7 +58,7 @@
<!-- <!--
WARNING - @mbg.generated WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Wed Jul 19 14:40:28 CST 2023. This element was generated on Fri Aug 04 14:34:22 CST 2023.
--> -->
<where> <where>
<foreach collection="example.oredCriteria" item="criteria" separator="or"> <foreach collection="example.oredCriteria" item="criteria" separator="or">
@ -91,16 +92,16 @@
<!-- <!--
WARNING - @mbg.generated WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Wed Jul 19 14:40:28 CST 2023. This element was generated on Fri Aug 04 14:34:22 CST 2023.
--> -->
id, member_id, account, name, margin_used, net_value, margin_level, warning_level, id, member_id, trainingId, account, name, margin_used, net_value, margin_level, warning_level,
status, isdelete, set_time status, isdelete, set_time
</sql> </sql>
<select id="selectByExample" parameterType="com.sztzjy.forex.trading_trading.entity.MarginWarningExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="com.sztzjy.forex.trading_trading.entity.MarginWarningExample" resultMap="BaseResultMap">
<!-- <!--
WARNING - @mbg.generated WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Wed Jul 19 14:40:28 CST 2023. This element was generated on Fri Aug 04 14:34:22 CST 2023.
--> -->
select select
<if test="distinct"> <if test="distinct">
@ -119,7 +120,7 @@
<!-- <!--
WARNING - @mbg.generated WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Wed Jul 19 14:40:28 CST 2023. This element was generated on Fri Aug 04 14:34:22 CST 2023.
--> -->
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
@ -130,7 +131,7 @@
<!-- <!--
WARNING - @mbg.generated WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Wed Jul 19 14:40:28 CST 2023. This element was generated on Fri Aug 04 14:34:22 CST 2023.
--> -->
delete from sys_margin_warning delete from sys_margin_warning
where id = #{id,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR}
@ -139,7 +140,7 @@
<!-- <!--
WARNING - @mbg.generated WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Wed Jul 19 14:40:28 CST 2023. This element was generated on Fri Aug 04 14:34:22 CST 2023.
--> -->
delete from sys_margin_warning delete from sys_margin_warning
<if test="_parameter != null"> <if test="_parameter != null">
@ -150,22 +151,24 @@
<!-- <!--
WARNING - @mbg.generated WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Wed Jul 19 14:40:28 CST 2023. This element was generated on Fri Aug 04 14:34:22 CST 2023.
--> -->
insert into sys_margin_warning (id, member_id, account, insert into sys_margin_warning (id, member_id, trainingId,
name, margin_used, net_value, account, name, margin_used,
margin_level, warning_level, status, net_value, margin_level, warning_level,
isdelete, set_time) status, isdelete, set_time
values (#{id,jdbcType=VARCHAR}, #{memberId,jdbcType=VARCHAR}, #{account,jdbcType=VARCHAR}, )
#{name,jdbcType=VARCHAR}, #{marginUsed,jdbcType=DOUBLE}, #{netValue,jdbcType=DOUBLE}, values (#{id,jdbcType=VARCHAR}, #{memberId,jdbcType=VARCHAR}, #{trainingid,jdbcType=VARCHAR},
#{marginLevel,jdbcType=DOUBLE}, #{warningLevel,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, #{account,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{marginUsed,jdbcType=DOUBLE},
#{isdelete,jdbcType=INTEGER}, #{setTime,jdbcType=TIMESTAMP}) #{netValue,jdbcType=DOUBLE}, #{marginLevel,jdbcType=DOUBLE}, #{warningLevel,jdbcType=INTEGER},
#{status,jdbcType=INTEGER}, #{isdelete,jdbcType=INTEGER}, #{setTime,jdbcType=TIMESTAMP}
)
</insert> </insert>
<insert id="insertSelective" parameterType="com.sztzjy.forex.trading_trading.entity.MarginWarning"> <insert id="insertSelective" parameterType="com.sztzjy.forex.trading_trading.entity.MarginWarning">
<!-- <!--
WARNING - @mbg.generated WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Wed Jul 19 14:40:28 CST 2023. This element was generated on Fri Aug 04 14:34:22 CST 2023.
--> -->
insert into sys_margin_warning insert into sys_margin_warning
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
@ -175,6 +178,9 @@
<if test="memberId != null"> <if test="memberId != null">
member_id, member_id,
</if> </if>
<if test="trainingid != null">
trainingId,
</if>
<if test="account != null"> <if test="account != null">
account, account,
</if> </if>
@ -210,6 +216,9 @@
<if test="memberId != null"> <if test="memberId != null">
#{memberId,jdbcType=VARCHAR}, #{memberId,jdbcType=VARCHAR},
</if> </if>
<if test="trainingid != null">
#{trainingid,jdbcType=VARCHAR},
</if>
<if test="account != null"> <if test="account != null">
#{account,jdbcType=VARCHAR}, #{account,jdbcType=VARCHAR},
</if> </if>
@ -243,7 +252,7 @@
<!-- <!--
WARNING - @mbg.generated WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Wed Jul 19 14:40:28 CST 2023. This element was generated on Fri Aug 04 14:34:22 CST 2023.
--> -->
select count(*) from sys_margin_warning select count(*) from sys_margin_warning
<if test="_parameter != null"> <if test="_parameter != null">
@ -254,7 +263,7 @@
<!-- <!--
WARNING - @mbg.generated WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Wed Jul 19 14:40:28 CST 2023. This element was generated on Fri Aug 04 14:34:22 CST 2023.
--> -->
update sys_margin_warning update sys_margin_warning
<set> <set>
@ -264,6 +273,9 @@
<if test="record.memberId != null"> <if test="record.memberId != null">
member_id = #{record.memberId,jdbcType=VARCHAR}, member_id = #{record.memberId,jdbcType=VARCHAR},
</if> </if>
<if test="record.trainingid != null">
trainingId = #{record.trainingid,jdbcType=VARCHAR},
</if>
<if test="record.account != null"> <if test="record.account != null">
account = #{record.account,jdbcType=VARCHAR}, account = #{record.account,jdbcType=VARCHAR},
</if> </if>
@ -300,11 +312,12 @@
<!-- <!--
WARNING - @mbg.generated WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Wed Jul 19 14:40:28 CST 2023. This element was generated on Fri Aug 04 14:34:22 CST 2023.
--> -->
update sys_margin_warning update sys_margin_warning
set id = #{record.id,jdbcType=VARCHAR}, set id = #{record.id,jdbcType=VARCHAR},
member_id = #{record.memberId,jdbcType=VARCHAR}, member_id = #{record.memberId,jdbcType=VARCHAR},
trainingId = #{record.trainingid,jdbcType=VARCHAR},
account = #{record.account,jdbcType=VARCHAR}, account = #{record.account,jdbcType=VARCHAR},
name = #{record.name,jdbcType=VARCHAR}, name = #{record.name,jdbcType=VARCHAR},
margin_used = #{record.marginUsed,jdbcType=DOUBLE}, margin_used = #{record.marginUsed,jdbcType=DOUBLE},
@ -322,13 +335,16 @@
<!-- <!--
WARNING - @mbg.generated WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Wed Jul 19 14:40:28 CST 2023. This element was generated on Fri Aug 04 14:34:22 CST 2023.
--> -->
update sys_margin_warning update sys_margin_warning
<set> <set>
<if test="memberId != null"> <if test="memberId != null">
member_id = #{memberId,jdbcType=VARCHAR}, member_id = #{memberId,jdbcType=VARCHAR},
</if> </if>
<if test="trainingid != null">
trainingId = #{trainingid,jdbcType=VARCHAR},
</if>
<if test="account != null"> <if test="account != null">
account = #{account,jdbcType=VARCHAR}, account = #{account,jdbcType=VARCHAR},
</if> </if>
@ -363,10 +379,11 @@
<!-- <!--
WARNING - @mbg.generated WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Wed Jul 19 14:40:28 CST 2023. This element was generated on Fri Aug 04 14:34:22 CST 2023.
--> -->
update sys_margin_warning update sys_margin_warning
set member_id = #{memberId,jdbcType=VARCHAR}, set member_id = #{memberId,jdbcType=VARCHAR},
trainingId = #{trainingid,jdbcType=VARCHAR},
account = #{account,jdbcType=VARCHAR}, account = #{account,jdbcType=VARCHAR},
name = #{name,jdbcType=VARCHAR}, name = #{name,jdbcType=VARCHAR},
margin_used = #{marginUsed,jdbcType=DOUBLE}, margin_used = #{marginUsed,jdbcType=DOUBLE},

Loading…
Cancel
Save