pull/1/head
yz 2 years ago
parent 39b27acc52
commit a88ae0de02

@ -7,7 +7,9 @@ import com.sztzjy.forex.trading_trading.annotation.AnonymousAccess;
import com.sztzjy.forex.trading_trading.entity.PendingOrder;
import com.sztzjy.forex.trading_trading.service.PendingOrderService;
import com.sztzjy.forex.trading_trading.util.RedisUtil;
import com.sztzjy.forex.trading_trading.util.ResultEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
@ -29,7 +31,7 @@ public class PendingOrderController {
//查询挂单数据
@AnonymousAccess
@PostMapping("getPendingOrder")
public List<PendingOrder> getPendingOrder(@RequestBody JSONObject jsonObject){
public ResultEntity<List<PendingOrder>> getPendingOrder(@RequestBody JSONObject jsonObject){
String trainingId = String.valueOf(jsonObject.get("trainingId"));
String memberId = String.valueOf(jsonObject.get("memberId"));
PendingOrder pendingOrder=new PendingOrder();
@ -37,17 +39,19 @@ public class PendingOrderController {
pendingOrder.setTrainingId(trainingId);
pendingOrder.setMemberId(memberId);
List<PendingOrder> pendingOrders = pendingOrderService.selectByExample(pendingOrder);
return pendingOrders;
return new ResultEntity(HttpStatus.OK, "获取挂单数据成功",pendingOrders);
}
//撤单 撤单成功后 根据pendingOrderId删除redis键
public JSONObject cancelOrder(@RequestBody String pendingOrderId){
@AnonymousAccess
@PostMapping("cancelOrder")
public ResultEntity cancelOrder(@RequestBody String pendingOrderId){
PendingOrder pendingOrder=new PendingOrder();
pendingOrder.setPendingOrderId(pendingOrderId);
pendingOrder.setStatus(0);
pendingOrder.setStatus(1);
pendingOrderService.cancelOrder(pendingOrder);
redisUtil.del("pengingOrder_"+pendingOrder.getPendingOrderId());
return JSONObject.parseObject("撤单成功");
return new ResultEntity(HttpStatus.OK, "撤单成功");
}
//挂单自动撤单(到期自动撤单) 扫描redis pengingOrder_id 进行自动撤单
@ -59,6 +63,8 @@ public class PendingOrderController {
}
}
//挂单自动开仓
//返回挂单对象
public PendingOrder returnPendingOrder(String memberId, String trainingId, String tradingCode,String currencyName, String buySellType, Double transactionVolume, Double priceCommission, Double stopLoss, Double stopWin,Date validityTime) {
Date now = new Date();

@ -69,7 +69,7 @@ public class TakeStashController {
List<TakeStashVO> takeStashVOS=new ArrayList<>();
for (int i = 0; i < takeStashVOList.size(); i++) {
TakeStashVO takeStashVO = takeStashVOList.get(i);
if(1!=takeStashVO.getStatus()){
if(0!=takeStashVO.getStatus()){
continue;
}
String buySellType = takeStashVO.getBuySellType(); //买入或卖出
@ -116,16 +116,21 @@ public class TakeStashController {
String tradingCode = jsonObject.getString("tradingCode");
String buySellType = jsonObject.getString("buySellType");
ForexMarketData forexData = tradingController.getMarketQuotationByCode(tradingCode).getBody().getData();
TakeStash takeStash = new TakeStash();
takeStash.setStashId(stashId);
if (null != stopLoss || null != stopWin) { //判断止损止赢是否合理 如果stopLoss stopWin都为null则跳过
boolean winOrLossStopBoolean = tradingController.getWinOrLossStop(stopLoss, stopWin, buySellType, forexData);
if (winOrLossStopBoolean == false) {
return new ResultEntity(HttpStatus.UNAUTHORIZED, "止损或获利输入错误");
return new ResultEntity(HttpStatus.BAD_REQUEST, "止损或获利输入错误");
}
if (null!=stopLoss){
takeStash.setStopLoss(stopLoss);
}
if( null != stopWin){
takeStash.setStopWin(stopWin);
}
}
TakeStash takeStash = new TakeStash();
takeStash.setStashId(stashId);
takeStash.setStopLoss(stopLoss);
takeStashService.updateByPrimaryKey(takeStash);
takeStashService.updateWinLossByPrimaryKey(takeStash);
return new ResultEntity(HttpStatus.OK, "修改持仓成功");
}
@ -168,17 +173,21 @@ public class TakeStashController {
member.setMarginUsed(marginUsed);
Integer closingTrades = member.getClosingTrades();
member.setClosingTrades(closingTrades++);
memberService.updateByPrimaryKey(member);
memberService.updateByPrimaryKeySelective(member);
TakeStash takeStash = new TakeStash();
takeStash.setStashId(stashId);
takeStash.setStatus(2);
takeStash.setProfitAndLossByClose(backFund- tradingMargin); //盈亏=返还资金-进仓时使用的保证金
takeStashService.updateByPrimaryKey(takeStash);
takeStashService.updateByPrimaryKeySelective(takeStash);
return new ResultEntity(HttpStatus.OK, "平仓成功");
}
//持仓止损止盈刷新
//监听止损止盈 根据code获取当前买卖价格 如果价格高于/低于止损止盈 则按照止损止盈的值进行平仓
//获取持仓表中所有状态为0 且止损和止盈部为空的所有数据 获取当前价位如果
public void monitorStopLossProfit(){
// takeStashService.
}
//根据tradingCode获取ForexMarketData对象

@ -99,14 +99,14 @@ public class TradingController {
if (null != stopLoss || null != stopWin) { //判断止损止赢是否合理 如果stopLoss stopWin都为null则跳过
boolean winOrLossStopBoolean = getWinOrLossStop(stopLoss, stopWin, buySellType, forexData);
if (winOrLossStopBoolean == false) {
return new ResultEntity(HttpStatus.UNAUTHORIZED, "止损或获利输入错误");
return new ResultEntity(HttpStatus.BAD_REQUEST, "止损或获利输入错误");
}
}
//如果方式为卖 则止损高于卖价 获利低于买价
if (transactionType.equals("sjkc")) {//市价开仓
if (tradingCode.startsWith("USD")) { //美元在前
if (availableFunds < transactionVolume * 1000) { //判断可用资金是否足够
return new ResultEntity(HttpStatus.UNAUTHORIZED, "可用资金不足");
return new ResultEntity(HttpStatus.BAD_REQUEST, "可用资金不足");
}
margin=transactionVolume * 1000; //所需保证金
availableFunds = availableFunds - margin;
@ -121,7 +121,7 @@ public class TradingController {
} else { //美元在后 使用可用资金表达式为 买卖手*1000*卖/买价 判断可用资金是否足够 先判断是买还是卖
if ("buy".equals(buySellType)) {
if (availableFunds < transactionVolume * 1000 * buyPic) {
return new ResultEntity(HttpStatus.UNAUTHORIZED, "可用资金不足");
return new ResultEntity(HttpStatus.BAD_REQUEST, "可用资金不足");
}
margin=transactionVolume * 1000 * buyPic; //所需保证金
availableFunds = availableFunds - margin;
@ -129,7 +129,7 @@ public class TradingController {
takeStashService.insertTakeStash(takeStash);
} else if ("sell".equals(buySellType)) {
if (availableFunds < transactionVolume * 1000 * sellPic) {
return new ResultEntity(HttpStatus.UNAUTHORIZED, "可用资金不足");
return new ResultEntity(HttpStatus.BAD_REQUEST, "可用资金不足");
}
margin=transactionVolume * 1000 * sellPic; //所需保证金
availableFunds = availableFunds - margin;
@ -143,27 +143,29 @@ public class TradingController {
Date validityTime = jsonObject.getDate("validityTime"); //获取挂单有效期
if ("buyLimit".equals(buySellType)) { //限价买进(低价买进) 下单时买入价低于当前买价
if (priceCommission >= buyPic) {
return new ResultEntity(HttpStatus.UNAUTHORIZED, "限价买进价位不能高于当前买价");
return new ResultEntity(HttpStatus.BAD_REQUEST, "限价买进价位不能高于当前买价");
}
}
if ("sellLimit".equals(buySellType)) {//限价卖出(高价卖出) 下单时卖出价高于当前卖价
if (priceCommission <= sellPic) {
return new ResultEntity(HttpStatus.UNAUTHORIZED, "限价卖出价位不能低于当前卖价");
return new ResultEntity(HttpStatus.BAD_REQUEST, "限价卖出价位不能低于当前卖价");
}
}
if ("buyStop".equals(buySellType)) {//止损买进(高价买进) 下单时买入价格高于当前买价
if (priceCommission <= buyPic) {
return new ResultEntity(HttpStatus.UNAUTHORIZED, "止损买进价位不能低于当前买价");
return new ResultEntity(HttpStatus.BAD_REQUEST, "止损买进价位不能低于当前买价");
}
}
if ("sellStop".equals(buySellType)) {//止损卖出(低价卖出)下单时卖出价格低于当前卖价
if (priceCommission >= sellPic) {
return new ResultEntity(HttpStatus.UNAUTHORIZED, "止损卖出价位不能高于当前卖价");
return new ResultEntity(HttpStatus.BAD_REQUEST, "止损卖出价位不能高于当前卖价");
}
}
PendingOrder pendingOrder = pendingOrderController.returnPendingOrder(memberId, trainingId, tradingCode,currencyName,buySellType, transactionVolume, priceCommission, stopLoss, stopWin, validityTime);
pendingOrderController.insertPendingOrder(pendingOrder);//保存挂单
}
//获取交易次数预警 memberID tradingID 获取预警次数 判断是否超过 如果超过 则报警
//checkopeningTrades(memberID,tradingID){}
return new ResultEntity(HttpStatus.OK, "交易成功");
}
@ -196,7 +198,7 @@ public class TradingController {
member.setMarginUsed(marginUsed + margin); //设置已用保证金
Integer openingTrades = member.getOpeningTrades(); //获取开仓次数
member.setOpeningTrades(openingTrades++);//设置开仓次数
memberService.updateByPrimaryKey(member);
memberService.updateByPrimaryKeySelective(member);
}
//判断止损止赢 逻辑:如果方式为买 则止损低于买价 获利高于买价 / 如果方式为卖 则止损高于卖价 获利低于买价 (可以只传一个参数)

@ -0,0 +1,99 @@
package com.sztzjy.forex.trading_trading.mappers;
import com.sztzjy.forex.trading_trading.entity.PendingOrder;
import com.sztzjy.forex.trading_trading.entity.PendingOrderExample;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface PendingOrderMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table sys_pending_order
*
* @mbg.generated Mon Jul 17 13:36:48 CST 2023
*/
long countByExample(PendingOrderExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table sys_pending_order
*
* @mbg.generated Mon Jul 17 13:36:48 CST 2023
*/
int deleteByExample(PendingOrderExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table sys_pending_order
*
* @mbg.generated Mon Jul 17 13:36:48 CST 2023
*/
int deleteByPrimaryKey(String pendingOrderId);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table sys_pending_order
*
* @mbg.generated Mon Jul 17 13:36:48 CST 2023
*/
int insert(PendingOrder record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table sys_pending_order
*
* @mbg.generated Mon Jul 17 13:36:48 CST 2023
*/
int insertSelective(PendingOrder record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table sys_pending_order
*
* @mbg.generated Mon Jul 17 13:36:48 CST 2023
*/
List<PendingOrder> selectByExample(PendingOrderExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table sys_pending_order
*
* @mbg.generated Mon Jul 17 13:36:48 CST 2023
*/
PendingOrder selectByPrimaryKey(String pendingOrderId);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table sys_pending_order
*
* @mbg.generated Mon Jul 17 13:36:48 CST 2023
*/
int updateByExampleSelective(@Param("record") PendingOrder record, @Param("example") PendingOrderExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table sys_pending_order
*
* @mbg.generated Mon Jul 17 13:36:48 CST 2023
*/
int updateByExample(@Param("record") PendingOrder record, @Param("example") PendingOrderExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table sys_pending_order
*
* @mbg.generated Mon Jul 17 13:36:48 CST 2023
*/
int updateByPrimaryKeySelective(PendingOrder record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table sys_pending_order
*
* @mbg.generated Mon Jul 17 13:36:48 CST 2023
*/
int updateByPrimaryKey(PendingOrder record);
}

@ -0,0 +1,100 @@
package com.sztzjy.forex.trading_trading.mappers;
import com.sztzjy.forex.trading_trading.entity.TakeStash;
import com.sztzjy.forex.trading_trading.entity.TakeStashExample;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface TakeStashMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table sys_take_stash
*
* @mbg.generated Mon Jul 17 14:31:17 CST 2023
*/
long countByExample(TakeStashExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table sys_take_stash
*
* @mbg.generated Mon Jul 17 14:31:17 CST 2023
*/
int deleteByExample(TakeStashExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table sys_take_stash
*
* @mbg.generated Mon Jul 17 14:31:17 CST 2023
*/
int deleteByPrimaryKey(String stashId);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table sys_take_stash
*
* @mbg.generated Mon Jul 17 14:31:17 CST 2023
*/
int insert(TakeStash record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table sys_take_stash
*
* @mbg.generated Mon Jul 17 14:31:17 CST 2023
*/
int insertSelective(TakeStash record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table sys_take_stash
*
* @mbg.generated Mon Jul 17 14:31:17 CST 2023
*/
List<TakeStash> selectByExample(TakeStashExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table sys_take_stash
*
* @mbg.generated Mon Jul 17 14:31:17 CST 2023
*/
TakeStash selectByPrimaryKey(String stashId);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table sys_take_stash
*
* @mbg.generated Mon Jul 17 14:31:17 CST 2023
*/
int updateByExampleSelective(@Param("record") TakeStash record, @Param("example") TakeStashExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table sys_take_stash
*
* @mbg.generated Mon Jul 17 14:31:17 CST 2023
*/
int updateByExample(@Param("record") TakeStash record, @Param("example") TakeStashExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table sys_take_stash
*
* @mbg.generated Mon Jul 17 14:31:17 CST 2023
*/
int updateByPrimaryKeySelective(TakeStash record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table sys_take_stash
*
* @mbg.generated Mon Jul 17 14:31:17 CST 2023
*/
int updateByPrimaryKey(TakeStash record);
void updateWinLossByPrimaryKey(TakeStash takeStash);
}

@ -43,6 +43,10 @@ public class MemberService {
memberMapper.updateByPrimaryKey(member);
}
public void updateByPrimaryKeySelective(Member member) {
memberMapper.updateByPrimaryKeySelective(member);
}
public Member selectByPrimaryKey(String memberId) {
Member member = memberMapper.selectByPrimaryKey(memberId);
return member;

@ -26,6 +26,6 @@ public class PendingOrderService {
}
public void cancelOrder(PendingOrder pendingOrder){
pendingOrderMapper.updateByPrimaryKey(pendingOrder);
pendingOrderMapper.updateByPrimaryKeySelective(pendingOrder);
}
}

@ -32,7 +32,12 @@ public class TakeStashService {
return takeStash;
}
public void updateByPrimaryKey(TakeStash takeStash){
takeStashMapper.updateByPrimaryKey(takeStash);
public void updateByPrimaryKeySelective(TakeStash takeStash){
takeStashMapper.updateByPrimaryKeySelective(takeStash);
}
public void updateWinLossByPrimaryKey(TakeStash takeStash){
takeStashMapper.updateWinLossByPrimaryKey(takeStash);
}
}

@ -0,0 +1,521 @@
<?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.sztzjy.forex.trading_trading.mappers.ForexMarketDataMapper">
<resultMap id="BaseResultMap" type="com.sztzjy.forex.trading_trading.entity.ForexMarketData">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Mon Jul 17 16:15:55 CST 2023.
-->
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="buy_pic" jdbcType="DOUBLE" property="buyPic" />
<result column="close_pri" jdbcType="DOUBLE" property="closePri" />
<result column="code" jdbcType="VARCHAR" property="code" />
<result column="color" jdbcType="VARCHAR" property="color" />
<result column="currency" jdbcType="VARCHAR" property="currency" />
<result column="data_time" jdbcType="TIMESTAMP" property="dataTime" />
<result column="date" jdbcType="VARCHAR" property="date" />
<result column="high_pic" jdbcType="VARCHAR" property="highPic" />
<result column="low_pic" jdbcType="VARCHAR" property="lowPic" />
<result column="open_pri" jdbcType="VARCHAR" property="openPri" />
<result column="ranges" jdbcType="VARCHAR" property="ranges" />
<result column="sell_pic" jdbcType="VARCHAR" property="sellPic" />
<result column="yes_pic" jdbcType="VARCHAR" property="yesPic" />
<result column="diff_amo" jdbcType="VARCHAR" property="diffAmo" />
<result column="diff_per" jdbcType="VARCHAR" property="diffPer" />
<result column="is_real" jdbcType="BIT" property="isReal" />
<result column="batch_id" jdbcType="VARCHAR" property="batchId" />
</resultMap>
<sql id="Example_Where_Clause">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Mon Jul 17 16:15:55 CST 2023.
-->
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Mon Jul 17 16:15:55 CST 2023.
-->
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Mon Jul 17 16:15:55 CST 2023.
-->
id, buy_pic, close_pri, code, color, currency, data_time, date, high_pic, low_pic,
open_pri, ranges, sell_pic, yes_pic, diff_amo, diff_per, is_real, batch_id
</sql>
<select id="selectByExample" parameterType="com.sztzjy.forex.trading_trading.entity.ForexMarketDataExample" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Mon Jul 17 16:15:55 CST 2023.
-->
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from sys_forex_market_data
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Mon Jul 17 16:15:55 CST 2023.
-->
select
<include refid="Base_Column_List" />
from sys_forex_market_data
where id = #{id,jdbcType=VARCHAR}
</select>
<select id="selectLastForexMarketData" resultMap="BaseResultMap">
SELECT
<include refid="Base_Column_List" />
FROM sys_forex_market_data
WHERE batch_id = (
SELECT batch_id
FROM sys_forex_market_data
ORDER BY data_time DESC
LIMIT 1
)
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Mon Jul 17 16:15:55 CST 2023.
-->
delete from sys_forex_market_data
where id = #{id,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="com.sztzjy.forex.trading_trading.entity.ForexMarketDataExample">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Mon Jul 17 16:15:55 CST 2023.
-->
delete from sys_forex_market_data
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.sztzjy.forex.trading_trading.entity.ForexMarketData">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Mon Jul 17 16:15:55 CST 2023.
-->
insert into sys_forex_market_data (id, buy_pic, close_pri,
code, color, currency,
data_time, date, high_pic,
low_pic, open_pri, ranges,
sell_pic, yes_pic, diff_amo,
diff_per, is_real, batch_id)
values (#{id,jdbcType=VARCHAR}, #{buyPic,jdbcType=DOUBLE}, #{closePri,jdbcType=DOUBLE},
#{code,jdbcType=VARCHAR}, #{color,jdbcType=VARCHAR}, #{currency,jdbcType=VARCHAR},
#{dataTime,jdbcType=TIMESTAMP}, #{date,jdbcType=VARCHAR}, #{highPic,jdbcType=VARCHAR},
#{lowPic,jdbcType=VARCHAR}, #{openPri,jdbcType=VARCHAR}, #{ranges,jdbcType=VARCHAR},
#{sellPic,jdbcType=VARCHAR}, #{yesPic,jdbcType=VARCHAR}, #{diffAmo,jdbcType=VARCHAR},
#{diffPer,jdbcType=VARCHAR}, #{isReal,jdbcType=BIT}, #{batchId,jdbcType=VARCHAR}
)
</insert>
<insert id="insertAll" parameterType="java.util.List">
insert into sys_forex_market_data (id, buy_pic, close_pri,
code, color, currency,
data_time, date, high_pic,
low_pic, open_pri,ranges,
sell_pic, yes_pic, diff_amo,
diff_per, is_real, batch_id)
values
<foreach collection="list" item="item" separator=",">
(#{item.id,jdbcType=VARCHAR}, #{item.buyPic,jdbcType=DOUBLE}, #{item.closePri,jdbcType=DOUBLE},
#{item.code,jdbcType=VARCHAR}, #{item.color,jdbcType=VARCHAR}, #{item.currency,jdbcType=VARCHAR},
#{item.dataTime,jdbcType=TIMESTAMP}, #{item.date,jdbcType=VARCHAR}, #{item.highPic,jdbcType=VARCHAR},
#{item.lowPic,jdbcType=VARCHAR}, #{item.openPri,jdbcType=VARCHAR},#{item.ranges,jdbcType=VARCHAR},
#{item.sellPic,jdbcType=VARCHAR}, #{item.yesPic,jdbcType=VARCHAR}, #{item.diffAmo,jdbcType=DOUBLE},
#{item.diffPer,jdbcType=DOUBLE}, #{item.isReal,jdbcType=BIT}, #{item.batchId,jdbcType=VARCHAR})
</foreach>
</insert>
<insert id="insertSelective" parameterType="com.sztzjy.forex.trading_trading.entity.ForexMarketData">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Mon Jul 17 16:15:55 CST 2023.
-->
insert into sys_forex_market_data
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="buyPic != null">
buy_pic,
</if>
<if test="closePri != null">
close_pri,
</if>
<if test="code != null">
code,
</if>
<if test="color != null">
color,
</if>
<if test="currency != null">
currency,
</if>
<if test="dataTime != null">
data_time,
</if>
<if test="date != null">
date,
</if>
<if test="highPic != null">
high_pic,
</if>
<if test="lowPic != null">
low_pic,
</if>
<if test="openPri != null">
open_pri,
</if>
<if test="ranges != null">
ranges,
</if>
<if test="sellPic != null">
sell_pic,
</if>
<if test="yesPic != null">
yes_pic,
</if>
<if test="diffAmo != null">
diff_amo,
</if>
<if test="diffPer != null">
diff_per,
</if>
<if test="isReal != null">
is_real,
</if>
<if test="batchId != null">
batch_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="buyPic != null">
#{buyPic,jdbcType=DOUBLE},
</if>
<if test="closePri != null">
#{closePri,jdbcType=DOUBLE},
</if>
<if test="code != null">
#{code,jdbcType=VARCHAR},
</if>
<if test="color != null">
#{color,jdbcType=VARCHAR},
</if>
<if test="currency != null">
#{currency,jdbcType=VARCHAR},
</if>
<if test="dataTime != null">
#{dataTime,jdbcType=TIMESTAMP},
</if>
<if test="date != null">
#{date,jdbcType=VARCHAR},
</if>
<if test="highPic != null">
#{highPic,jdbcType=VARCHAR},
</if>
<if test="lowPic != null">
#{lowPic,jdbcType=VARCHAR},
</if>
<if test="openPri != null">
#{openPri,jdbcType=VARCHAR},
</if>
<if test="ranges != null">
#{ranges,jdbcType=VARCHAR},
</if>
<if test="sellPic != null">
#{sellPic,jdbcType=VARCHAR},
</if>
<if test="yesPic != null">
#{yesPic,jdbcType=VARCHAR},
</if>
<if test="diffAmo != null">
#{diffAmo,jdbcType=VARCHAR},
</if>
<if test="diffPer != null">
#{diffPer,jdbcType=VARCHAR},
</if>
<if test="isReal != null">
#{isReal,jdbcType=BIT},
</if>
<if test="batchId != null">
#{batchId,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.sztzjy.forex.trading_trading.entity.ForexMarketDataExample" resultType="java.lang.Long">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Mon Jul 17 16:15:55 CST 2023.
-->
select count(*) from sys_forex_market_data
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Mon Jul 17 16:15:55 CST 2023.
-->
update sys_forex_market_data
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=VARCHAR},
</if>
<if test="record.buyPic != null">
buy_pic = #{record.buyPic,jdbcType=DOUBLE},
</if>
<if test="record.closePri != null">
close_pri = #{record.closePri,jdbcType=DOUBLE},
</if>
<if test="record.code != null">
code = #{record.code,jdbcType=VARCHAR},
</if>
<if test="record.color != null">
color = #{record.color,jdbcType=VARCHAR},
</if>
<if test="record.currency != null">
currency = #{record.currency,jdbcType=VARCHAR},
</if>
<if test="record.dataTime != null">
data_time = #{record.dataTime,jdbcType=TIMESTAMP},
</if>
<if test="record.date != null">
date = #{record.date,jdbcType=VARCHAR},
</if>
<if test="record.highPic != null">
high_pic = #{record.highPic,jdbcType=VARCHAR},
</if>
<if test="record.lowPic != null">
low_pic = #{record.lowPic,jdbcType=VARCHAR},
</if>
<if test="record.openPri != null">
open_pri = #{record.openPri,jdbcType=VARCHAR},
</if>
<if test="record.ranges != null">
ranges = #{record.ranges,jdbcType=VARCHAR},
</if>
<if test="record.sellPic != null">
sell_pic = #{record.sellPic,jdbcType=VARCHAR},
</if>
<if test="record.yesPic != null">
yes_pic = #{record.yesPic,jdbcType=VARCHAR},
</if>
<if test="record.diffAmo != null">
diff_amo = #{record.diffAmo,jdbcType=VARCHAR},
</if>
<if test="record.diffPer != null">
diff_per = #{record.diffPer,jdbcType=VARCHAR},
</if>
<if test="record.isReal != null">
is_real = #{record.isReal,jdbcType=BIT},
</if>
<if test="record.batchId != null">
batch_id = #{record.batchId,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Mon Jul 17 16:15:55 CST 2023.
-->
update sys_forex_market_data
set id = #{record.id,jdbcType=VARCHAR},
buy_pic = #{record.buyPic,jdbcType=DOUBLE},
close_pri = #{record.closePri,jdbcType=DOUBLE},
code = #{record.code,jdbcType=VARCHAR},
color = #{record.color,jdbcType=VARCHAR},
currency = #{record.currency,jdbcType=VARCHAR},
data_time = #{record.dataTime,jdbcType=TIMESTAMP},
date = #{record.date,jdbcType=VARCHAR},
high_pic = #{record.highPic,jdbcType=VARCHAR},
low_pic = #{record.lowPic,jdbcType=VARCHAR},
open_pri = #{record.openPri,jdbcType=VARCHAR},
ranges = #{record.ranges,jdbcType=VARCHAR},
sell_pic = #{record.sellPic,jdbcType=VARCHAR},
yes_pic = #{record.yesPic,jdbcType=VARCHAR},
diff_amo = #{record.diffAmo,jdbcType=VARCHAR},
diff_per = #{record.diffPer,jdbcType=VARCHAR},
is_real = #{record.isReal,jdbcType=BIT},
batch_id = #{record.batchId,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.forex.trading_trading.entity.ForexMarketData">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Mon Jul 17 16:15:55 CST 2023.
-->
update sys_forex_market_data
<set>
<if test="buyPic != null">
buy_pic = #{buyPic,jdbcType=DOUBLE},
</if>
<if test="closePri != null">
close_pri = #{closePri,jdbcType=DOUBLE},
</if>
<if test="code != null">
code = #{code,jdbcType=VARCHAR},
</if>
<if test="color != null">
color = #{color,jdbcType=VARCHAR},
</if>
<if test="currency != null">
currency = #{currency,jdbcType=VARCHAR},
</if>
<if test="dataTime != null">
data_time = #{dataTime,jdbcType=TIMESTAMP},
</if>
<if test="date != null">
date = #{date,jdbcType=VARCHAR},
</if>
<if test="highPic != null">
high_pic = #{highPic,jdbcType=VARCHAR},
</if>
<if test="lowPic != null">
low_pic = #{lowPic,jdbcType=VARCHAR},
</if>
<if test="openPri != null">
open_pri = #{openPri,jdbcType=VARCHAR},
</if>
<if test="ranges != null">
ranges = #{ranges,jdbcType=VARCHAR},
</if>
<if test="sellPic != null">
sell_pic = #{sellPic,jdbcType=VARCHAR},
</if>
<if test="yesPic != null">
yes_pic = #{yesPic,jdbcType=VARCHAR},
</if>
<if test="diffAmo != null">
diff_amo = #{diffAmo,jdbcType=VARCHAR},
</if>
<if test="diffPer != null">
diff_per = #{diffPer,jdbcType=VARCHAR},
</if>
<if test="isReal != null">
is_real = #{isReal,jdbcType=BIT},
</if>
<if test="batchId != null">
batch_id = #{batchId,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.sztzjy.forex.trading_trading.entity.ForexMarketData">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Mon Jul 17 16:15:55 CST 2023.
-->
update sys_forex_market_data
set buy_pic = #{buyPic,jdbcType=DOUBLE},
close_pri = #{closePri,jdbcType=DOUBLE},
code = #{code,jdbcType=VARCHAR},
color = #{color,jdbcType=VARCHAR},
currency = #{currency,jdbcType=VARCHAR},
data_time = #{dataTime,jdbcType=TIMESTAMP},
date = #{date,jdbcType=VARCHAR},
high_pic = #{highPic,jdbcType=VARCHAR},
low_pic = #{lowPic,jdbcType=VARCHAR},
open_pri = #{openPri,jdbcType=VARCHAR},
ranges = #{ranges,jdbcType=VARCHAR},
sell_pic = #{sellPic,jdbcType=VARCHAR},
yes_pic = #{yesPic,jdbcType=VARCHAR},
diff_amo = #{diffAmo,jdbcType=VARCHAR},
diff_per = #{diffPer,jdbcType=VARCHAR},
is_real = #{isReal,jdbcType=BIT},
batch_id = #{batchId,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>

@ -0,0 +1,429 @@
<?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.sztzjy.forex.trading_trading.mappers.PendingOrderMapper">
<resultMap id="BaseResultMap" type="com.sztzjy.forex.trading_trading.entity.PendingOrder">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Mon Jul 17 13:36:48 CST 2023.
-->
<id column="pending_order_id" jdbcType="VARCHAR" property="pendingOrderId" />
<result column="member_id" jdbcType="VARCHAR" property="memberId" />
<result column="training_id" jdbcType="VARCHAR" property="trainingId" />
<result column="commission_time" jdbcType="TIMESTAMP" property="commissionTime" />
<result column="trading_code" jdbcType="VARCHAR" property="tradingCode" />
<result column="currency_name" jdbcType="VARCHAR" property="currencyName" />
<result column="commission_number" jdbcType="VARCHAR" property="commissionNumber" />
<result column="buy_sell_type" jdbcType="VARCHAR" property="buySellType" />
<result column="volume_transaction" jdbcType="DOUBLE" property="volumeTransaction" />
<result column="price_commission" jdbcType="DOUBLE" property="priceCommission" />
<result column="stop_loss" jdbcType="DOUBLE" property="stopLoss" />
<result column="stop_win" jdbcType="DOUBLE" property="stopWin" />
<result column="validity_time" jdbcType="TIMESTAMP" property="validityTime" />
<result column="status" jdbcType="INTEGER" property="status" />
</resultMap>
<sql id="Example_Where_Clause">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Mon Jul 17 13:36:48 CST 2023.
-->
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Mon Jul 17 13:36:48 CST 2023.
-->
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Mon Jul 17 13:36:48 CST 2023.
-->
pending_order_id, member_id, training_id, commission_time, trading_code, currency_name,
commission_number, buy_sell_type, volume_transaction, price_commission, stop_loss,
stop_win, validity_time, status
</sql>
<select id="selectByExample" parameterType="com.sztzjy.forex.trading_trading.entity.PendingOrderExample" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Mon Jul 17 13:36:48 CST 2023.
-->
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from sys_pending_order
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Mon Jul 17 13:36:48 CST 2023.
-->
select
<include refid="Base_Column_List" />
from sys_pending_order
where pending_order_id = #{pendingOrderId,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Mon Jul 17 13:36:48 CST 2023.
-->
delete from sys_pending_order
where pending_order_id = #{pendingOrderId,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="com.sztzjy.forex.trading_trading.entity.PendingOrderExample">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Mon Jul 17 13:36:48 CST 2023.
-->
delete from sys_pending_order
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.sztzjy.forex.trading_trading.entity.PendingOrder">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Mon Jul 17 13:36:48 CST 2023.
-->
insert into sys_pending_order (pending_order_id, member_id, training_id,
commission_time, trading_code, currency_name,
commission_number, buy_sell_type, volume_transaction,
price_commission, stop_loss, stop_win,
validity_time, status)
values (#{pendingOrderId,jdbcType=VARCHAR}, #{memberId,jdbcType=VARCHAR}, #{trainingId,jdbcType=VARCHAR},
#{commissionTime,jdbcType=TIMESTAMP}, #{tradingCode,jdbcType=VARCHAR}, #{currencyName,jdbcType=VARCHAR},
#{commissionNumber,jdbcType=VARCHAR}, #{buySellType,jdbcType=VARCHAR}, #{volumeTransaction,jdbcType=DOUBLE},
#{priceCommission,jdbcType=DOUBLE}, #{stopLoss,jdbcType=DOUBLE}, #{stopWin,jdbcType=DOUBLE},
#{validityTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.sztzjy.forex.trading_trading.entity.PendingOrder">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Mon Jul 17 13:36:48 CST 2023.
-->
insert into sys_pending_order
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="pendingOrderId != null">
pending_order_id,
</if>
<if test="memberId != null">
member_id,
</if>
<if test="trainingId != null">
training_id,
</if>
<if test="commissionTime != null">
commission_time,
</if>
<if test="tradingCode != null">
trading_code,
</if>
<if test="currencyName != null">
currency_name,
</if>
<if test="commissionNumber != null">
commission_number,
</if>
<if test="buySellType != null">
buy_sell_type,
</if>
<if test="volumeTransaction != null">
volume_transaction,
</if>
<if test="priceCommission != null">
price_commission,
</if>
<if test="stopLoss != null">
stop_loss,
</if>
<if test="stopWin != null">
stop_win,
</if>
<if test="validityTime != null">
validity_time,
</if>
<if test="status != null">
status,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="pendingOrderId != null">
#{pendingOrderId,jdbcType=VARCHAR},
</if>
<if test="memberId != null">
#{memberId,jdbcType=VARCHAR},
</if>
<if test="trainingId != null">
#{trainingId,jdbcType=VARCHAR},
</if>
<if test="commissionTime != null">
#{commissionTime,jdbcType=TIMESTAMP},
</if>
<if test="tradingCode != null">
#{tradingCode,jdbcType=VARCHAR},
</if>
<if test="currencyName != null">
#{currencyName,jdbcType=VARCHAR},
</if>
<if test="commissionNumber != null">
#{commissionNumber,jdbcType=VARCHAR},
</if>
<if test="buySellType != null">
#{buySellType,jdbcType=VARCHAR},
</if>
<if test="volumeTransaction != null">
#{volumeTransaction,jdbcType=DOUBLE},
</if>
<if test="priceCommission != null">
#{priceCommission,jdbcType=DOUBLE},
</if>
<if test="stopLoss != null">
#{stopLoss,jdbcType=DOUBLE},
</if>
<if test="stopWin != null">
#{stopWin,jdbcType=DOUBLE},
</if>
<if test="validityTime != null">
#{validityTime,jdbcType=TIMESTAMP},
</if>
<if test="status != null">
#{status,jdbcType=INTEGER},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.sztzjy.forex.trading_trading.entity.PendingOrderExample" resultType="java.lang.Long">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Mon Jul 17 13:36:48 CST 2023.
-->
select count(*) from sys_pending_order
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Mon Jul 17 13:36:48 CST 2023.
-->
update sys_pending_order
<set>
<if test="record.pendingOrderId != null">
pending_order_id = #{record.pendingOrderId,jdbcType=VARCHAR},
</if>
<if test="record.memberId != null">
member_id = #{record.memberId,jdbcType=VARCHAR},
</if>
<if test="record.trainingId != null">
training_id = #{record.trainingId,jdbcType=VARCHAR},
</if>
<if test="record.commissionTime != null">
commission_time = #{record.commissionTime,jdbcType=TIMESTAMP},
</if>
<if test="record.tradingCode != null">
trading_code = #{record.tradingCode,jdbcType=VARCHAR},
</if>
<if test="record.currencyName != null">
currency_name = #{record.currencyName,jdbcType=VARCHAR},
</if>
<if test="record.commissionNumber != null">
commission_number = #{record.commissionNumber,jdbcType=VARCHAR},
</if>
<if test="record.buySellType != null">
buy_sell_type = #{record.buySellType,jdbcType=VARCHAR},
</if>
<if test="record.volumeTransaction != null">
volume_transaction = #{record.volumeTransaction,jdbcType=DOUBLE},
</if>
<if test="record.priceCommission != null">
price_commission = #{record.priceCommission,jdbcType=DOUBLE},
</if>
<if test="record.stopLoss != null">
stop_loss = #{record.stopLoss,jdbcType=DOUBLE},
</if>
<if test="record.stopWin != null">
stop_win = #{record.stopWin,jdbcType=DOUBLE},
</if>
<if test="record.validityTime != null">
validity_time = #{record.validityTime,jdbcType=TIMESTAMP},
</if>
<if test="record.status != null">
status = #{record.status,jdbcType=INTEGER},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Mon Jul 17 13:36:48 CST 2023.
-->
update sys_pending_order
set pending_order_id = #{record.pendingOrderId,jdbcType=VARCHAR},
member_id = #{record.memberId,jdbcType=VARCHAR},
training_id = #{record.trainingId,jdbcType=VARCHAR},
commission_time = #{record.commissionTime,jdbcType=TIMESTAMP},
trading_code = #{record.tradingCode,jdbcType=VARCHAR},
currency_name = #{record.currencyName,jdbcType=VARCHAR},
commission_number = #{record.commissionNumber,jdbcType=VARCHAR},
buy_sell_type = #{record.buySellType,jdbcType=VARCHAR},
volume_transaction = #{record.volumeTransaction,jdbcType=DOUBLE},
price_commission = #{record.priceCommission,jdbcType=DOUBLE},
stop_loss = #{record.stopLoss,jdbcType=DOUBLE},
stop_win = #{record.stopWin,jdbcType=DOUBLE},
validity_time = #{record.validityTime,jdbcType=TIMESTAMP},
status = #{record.status,jdbcType=INTEGER}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.forex.trading_trading.entity.PendingOrder">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Mon Jul 17 13:36:48 CST 2023.
-->
update sys_pending_order
<set>
<if test="memberId != null">
member_id = #{memberId,jdbcType=VARCHAR},
</if>
<if test="trainingId != null">
training_id = #{trainingId,jdbcType=VARCHAR},
</if>
<if test="commissionTime != null">
commission_time = #{commissionTime,jdbcType=TIMESTAMP},
</if>
<if test="tradingCode != null">
trading_code = #{tradingCode,jdbcType=VARCHAR},
</if>
<if test="currencyName != null">
currency_name = #{currencyName,jdbcType=VARCHAR},
</if>
<if test="commissionNumber != null">
commission_number = #{commissionNumber,jdbcType=VARCHAR},
</if>
<if test="buySellType != null">
buy_sell_type = #{buySellType,jdbcType=VARCHAR},
</if>
<if test="volumeTransaction != null">
volume_transaction = #{volumeTransaction,jdbcType=DOUBLE},
</if>
<if test="priceCommission != null">
price_commission = #{priceCommission,jdbcType=DOUBLE},
</if>
<if test="stopLoss != null">
stop_loss = #{stopLoss,jdbcType=DOUBLE},
</if>
<if test="stopWin != null">
stop_win = #{stopWin,jdbcType=DOUBLE},
</if>
<if test="validityTime != null">
validity_time = #{validityTime,jdbcType=TIMESTAMP},
</if>
<if test="status != null">
status = #{status,jdbcType=INTEGER},
</if>
</set>
where pending_order_id = #{pendingOrderId,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.sztzjy.forex.trading_trading.entity.PendingOrder">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Mon Jul 17 13:36:48 CST 2023.
-->
update sys_pending_order
set member_id = #{memberId,jdbcType=VARCHAR},
training_id = #{trainingId,jdbcType=VARCHAR},
commission_time = #{commissionTime,jdbcType=TIMESTAMP},
trading_code = #{tradingCode,jdbcType=VARCHAR},
currency_name = #{currencyName,jdbcType=VARCHAR},
commission_number = #{commissionNumber,jdbcType=VARCHAR},
buy_sell_type = #{buySellType,jdbcType=VARCHAR},
volume_transaction = #{volumeTransaction,jdbcType=DOUBLE},
price_commission = #{priceCommission,jdbcType=DOUBLE},
stop_loss = #{stopLoss,jdbcType=DOUBLE},
stop_win = #{stopWin,jdbcType=DOUBLE},
validity_time = #{validityTime,jdbcType=TIMESTAMP},
status = #{status,jdbcType=INTEGER}
where pending_order_id = #{pendingOrderId,jdbcType=VARCHAR}
</update>
</mapper>

@ -0,0 +1,495 @@
<?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.sztzjy.forex.trading_trading.mappers.TakeStashMapper">
<resultMap id="BaseResultMap" type="com.sztzjy.forex.trading_trading.entity.TakeStash">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Mon Jul 17 14:31:17 CST 2023.
-->
<id column="stash_id" jdbcType="VARCHAR" property="stashId" />
<result column="member_id" jdbcType="VARCHAR" property="memberId" />
<result column="training_id" jdbcType="VARCHAR" property="trainingId" />
<result column="trading_code" jdbcType="VARCHAR" property="tradingCode" />
<result column="currency_name" jdbcType="VARCHAR" property="currencyName" />
<result column="order_number" jdbcType="VARCHAR" property="orderNumber" />
<result column="buy_sell_type" jdbcType="VARCHAR" property="buySellType" />
<result column="volume_transaction" jdbcType="DOUBLE" property="volumeTransaction" />
<result column="price_transaction" jdbcType="DOUBLE" property="priceTransaction" />
<result column="stop_loss" jdbcType="DOUBLE" property="stopLoss" />
<result column="stop_win" jdbcType="DOUBLE" property="stopWin" />
<result column="time_transaction" jdbcType="TIMESTAMP" property="timeTransaction" />
<result column="status" jdbcType="INTEGER" property="status" />
<result column="profit_and_loss_by_close" jdbcType="DOUBLE" property="profitAndLossByClose" />
<result column="trading_margin" jdbcType="DOUBLE" property="tradingMargin" />
</resultMap>
<sql id="Example_Where_Clause">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Mon Jul 17 14:31:17 CST 2023.
-->
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Mon Jul 17 14:31:17 CST 2023.
-->
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Mon Jul 17 14:31:17 CST 2023.
-->
stash_id, member_id, training_id, trading_code, currency_name, order_number, buy_sell_type,
volume_transaction, price_transaction, stop_loss, stop_win, time_transaction, status,
profit_and_loss_by_close, trading_margin
</sql>
<select id="selectByExample" parameterType="com.sztzjy.forex.trading_trading.entity.TakeStashExample" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Mon Jul 17 14:31:17 CST 2023.
-->
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from sys_take_stash
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Mon Jul 17 14:31:17 CST 2023.
-->
select
<include refid="Base_Column_List" />
from sys_take_stash
where stash_id = #{stashId,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Mon Jul 17 14:31:17 CST 2023.
-->
delete from sys_take_stash
where stash_id = #{stashId,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="com.sztzjy.forex.trading_trading.entity.TakeStashExample">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Mon Jul 17 14:31:17 CST 2023.
-->
delete from sys_take_stash
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.sztzjy.forex.trading_trading.entity.TakeStash">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Mon Jul 17 14:31:17 CST 2023.
-->
insert into sys_take_stash (stash_id, member_id, training_id,
trading_code, currency_name, order_number,
buy_sell_type, volume_transaction, price_transaction,
stop_loss, stop_win, time_transaction,
status, profit_and_loss_by_close, trading_margin
)
values (#{stashId,jdbcType=VARCHAR}, #{memberId,jdbcType=VARCHAR}, #{trainingId,jdbcType=VARCHAR},
#{tradingCode,jdbcType=VARCHAR}, #{currencyName,jdbcType=VARCHAR}, #{orderNumber,jdbcType=VARCHAR},
#{buySellType,jdbcType=VARCHAR}, #{volumeTransaction,jdbcType=DOUBLE}, #{priceTransaction,jdbcType=DOUBLE},
#{stopLoss,jdbcType=DOUBLE}, #{stopWin,jdbcType=DOUBLE}, #{timeTransaction,jdbcType=TIMESTAMP},
#{status,jdbcType=INTEGER}, #{profitAndLossByClose,jdbcType=DOUBLE}, #{tradingMargin,jdbcType=DOUBLE}
)
</insert>
<insert id="insertSelective" parameterType="com.sztzjy.forex.trading_trading.entity.TakeStash">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Mon Jul 17 14:31:17 CST 2023.
-->
insert into sys_take_stash
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="stashId != null">
stash_id,
</if>
<if test="memberId != null">
member_id,
</if>
<if test="trainingId != null">
training_id,
</if>
<if test="tradingCode != null">
trading_code,
</if>
<if test="currencyName != null">
currency_name,
</if>
<if test="orderNumber != null">
order_number,
</if>
<if test="buySellType != null">
buy_sell_type,
</if>
<if test="volumeTransaction != null">
volume_transaction,
</if>
<if test="priceTransaction != null">
price_transaction,
</if>
<if test="stopLoss != null">
stop_loss,
</if>
<if test="stopWin != null">
stop_win,
</if>
<if test="timeTransaction != null">
time_transaction,
</if>
<if test="status != null">
status,
</if>
<if test="profitAndLossByClose != null">
profit_and_loss_by_close,
</if>
<if test="tradingMargin != null">
trading_margin,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="stashId != null">
#{stashId,jdbcType=VARCHAR},
</if>
<if test="memberId != null">
#{memberId,jdbcType=VARCHAR},
</if>
<if test="trainingId != null">
#{trainingId,jdbcType=VARCHAR},
</if>
<if test="tradingCode != null">
#{tradingCode,jdbcType=VARCHAR},
</if>
<if test="currencyName != null">
#{currencyName,jdbcType=VARCHAR},
</if>
<if test="orderNumber != null">
#{orderNumber,jdbcType=VARCHAR},
</if>
<if test="buySellType != null">
#{buySellType,jdbcType=VARCHAR},
</if>
<if test="volumeTransaction != null">
#{volumeTransaction,jdbcType=DOUBLE},
</if>
<if test="priceTransaction != null">
#{priceTransaction,jdbcType=DOUBLE},
</if>
<if test="stopLoss != null">
#{stopLoss,jdbcType=DOUBLE},
</if>
<if test="stopWin != null">
#{stopWin,jdbcType=DOUBLE},
</if>
<if test="timeTransaction != null">
#{timeTransaction,jdbcType=TIMESTAMP},
</if>
<if test="status != null">
#{status,jdbcType=INTEGER},
</if>
<if test="profitAndLossByClose != null">
#{profitAndLossByClose,jdbcType=DOUBLE},
</if>
<if test="tradingMargin != null">
#{tradingMargin,jdbcType=DOUBLE},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.sztzjy.forex.trading_trading.entity.TakeStashExample" resultType="java.lang.Long">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Mon Jul 17 14:31:17 CST 2023.
-->
select count(*) from sys_take_stash
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Mon Jul 17 14:31:17 CST 2023.
-->
update sys_take_stash
<set>
<if test="record.stashId != null">
stash_id = #{record.stashId,jdbcType=VARCHAR},
</if>
<if test="record.memberId != null">
member_id = #{record.memberId,jdbcType=VARCHAR},
</if>
<if test="record.trainingId != null">
training_id = #{record.trainingId,jdbcType=VARCHAR},
</if>
<if test="record.tradingCode != null">
trading_code = #{record.tradingCode,jdbcType=VARCHAR},
</if>
<if test="record.currencyName != null">
currency_name = #{record.currencyName,jdbcType=VARCHAR},
</if>
<if test="record.orderNumber != null">
order_number = #{record.orderNumber,jdbcType=VARCHAR},
</if>
<if test="record.buySellType != null">
buy_sell_type = #{record.buySellType,jdbcType=VARCHAR},
</if>
<if test="record.volumeTransaction != null">
volume_transaction = #{record.volumeTransaction,jdbcType=DOUBLE},
</if>
<if test="record.priceTransaction != null">
price_transaction = #{record.priceTransaction,jdbcType=DOUBLE},
</if>
<if test="record.stopLoss != null">
stop_loss = #{record.stopLoss,jdbcType=DOUBLE},
</if>
<if test="record.stopWin != null">
stop_win = #{record.stopWin,jdbcType=DOUBLE},
</if>
<if test="record.timeTransaction != null">
time_transaction = #{record.timeTransaction,jdbcType=TIMESTAMP},
</if>
<if test="record.status != null">
status = #{record.status,jdbcType=INTEGER},
</if>
<if test="record.profitAndLossByClose != null">
profit_and_loss_by_close = #{record.profitAndLossByClose,jdbcType=DOUBLE},
</if>
<if test="record.tradingMargin != null">
trading_margin = #{record.tradingMargin,jdbcType=DOUBLE},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Mon Jul 17 14:31:17 CST 2023.
-->
update sys_take_stash
set stash_id = #{record.stashId,jdbcType=VARCHAR},
member_id = #{record.memberId,jdbcType=VARCHAR},
training_id = #{record.trainingId,jdbcType=VARCHAR},
trading_code = #{record.tradingCode,jdbcType=VARCHAR},
currency_name = #{record.currencyName,jdbcType=VARCHAR},
order_number = #{record.orderNumber,jdbcType=VARCHAR},
buy_sell_type = #{record.buySellType,jdbcType=VARCHAR},
volume_transaction = #{record.volumeTransaction,jdbcType=DOUBLE},
price_transaction = #{record.priceTransaction,jdbcType=DOUBLE},
stop_loss = #{record.stopLoss,jdbcType=DOUBLE},
stop_win = #{record.stopWin,jdbcType=DOUBLE},
time_transaction = #{record.timeTransaction,jdbcType=TIMESTAMP},
status = #{record.status,jdbcType=INTEGER},
profit_and_loss_by_close = #{record.profitAndLossByClose,jdbcType=DOUBLE},
trading_margin = #{record.tradingMargin,jdbcType=DOUBLE}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.forex.trading_trading.entity.TakeStash">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Mon Jul 17 14:31:17 CST 2023.
-->
update sys_take_stash
<set>
<if test="memberId != null">
member_id = #{memberId,jdbcType=VARCHAR},
</if>
<if test="trainingId != null">
training_id = #{trainingId,jdbcType=VARCHAR},
</if>
<if test="tradingCode != null">
trading_code = #{tradingCode,jdbcType=VARCHAR},
</if>
<if test="currencyName != null">
currency_name = #{currencyName,jdbcType=VARCHAR},
</if>
<if test="orderNumber != null">
order_number = #{orderNumber,jdbcType=VARCHAR},
</if>
<if test="buySellType != null">
buy_sell_type = #{buySellType,jdbcType=VARCHAR},
</if>
<if test="volumeTransaction != null">
volume_transaction = #{volumeTransaction,jdbcType=DOUBLE},
</if>
<if test="priceTransaction != null">
price_transaction = #{priceTransaction,jdbcType=DOUBLE},
</if>
<if test="stopLoss != null">
stop_loss = #{stopLoss,jdbcType=DOUBLE},
</if>
<if test="stopWin != null">
stop_win = #{stopWin,jdbcType=DOUBLE},
</if>
<if test="timeTransaction != null">
time_transaction = #{timeTransaction,jdbcType=TIMESTAMP},
</if>
<if test="status != null">
status = #{status,jdbcType=INTEGER},
</if>
<if test="profitAndLossByClose != null">
profit_and_loss_by_close = #{profitAndLossByClose,jdbcType=DOUBLE},
</if>
<if test="tradingMargin != null">
trading_margin = #{tradingMargin,jdbcType=DOUBLE},
</if>
</set>
where stash_id = #{stashId,jdbcType=VARCHAR}
</update>
<update id="updateWinLossByPrimaryKey" parameterType="com.sztzjy.forex.trading_trading.entity.TakeStash">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Mon Jul 17 14:31:17 CST 2023.
-->
update sys_take_stash
<set>
<if test="memberId != null">
member_id = #{memberId,jdbcType=VARCHAR},
</if>
<if test="trainingId != null">
training_id = #{trainingId,jdbcType=VARCHAR},
</if>
<if test="tradingCode != null">
trading_code = #{tradingCode,jdbcType=VARCHAR},
</if>
<if test="currencyName != null">
currency_name = #{currencyName,jdbcType=VARCHAR},
</if>
<if test="orderNumber != null">
order_number = #{orderNumber,jdbcType=VARCHAR},
</if>
<if test="buySellType != null">
buy_sell_type = #{buySellType,jdbcType=VARCHAR},
</if>
<if test="volumeTransaction != null">
volume_transaction = #{volumeTransaction,jdbcType=DOUBLE},
</if>
<if test="priceTransaction != null">
price_transaction = #{priceTransaction,jdbcType=DOUBLE},
</if>
stop_loss = #{stopLoss,jdbcType=DOUBLE},
stop_win = #{stopWin,jdbcType=DOUBLE},
<if test="timeTransaction != null">
time_transaction = #{timeTransaction,jdbcType=TIMESTAMP},
</if>
<if test="status != null">
status = #{status,jdbcType=INTEGER},
</if>
<if test="profitAndLossByClose != null">
profit_and_loss_by_close = #{profitAndLossByClose,jdbcType=DOUBLE},
</if>
<if test="tradingMargin != null">
trading_margin = #{tradingMargin,jdbcType=DOUBLE},
</if>
</set>
where stash_id = #{stashId,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.sztzjy.forex.trading_trading.entity.TakeStash">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Mon Jul 17 14:31:17 CST 2023.
-->
update sys_take_stash
set member_id = #{memberId,jdbcType=VARCHAR},
training_id = #{trainingId,jdbcType=VARCHAR},
trading_code = #{tradingCode,jdbcType=VARCHAR},
currency_name = #{currencyName,jdbcType=VARCHAR},
order_number = #{orderNumber,jdbcType=VARCHAR},
buy_sell_type = #{buySellType,jdbcType=VARCHAR},
volume_transaction = #{volumeTransaction,jdbcType=DOUBLE},
price_transaction = #{priceTransaction,jdbcType=DOUBLE},
stop_loss = #{stopLoss,jdbcType=DOUBLE},
stop_win = #{stopWin,jdbcType=DOUBLE},
time_transaction = #{timeTransaction,jdbcType=TIMESTAMP},
status = #{status,jdbcType=INTEGER},
profit_and_loss_by_close = #{profitAndLossByClose,jdbcType=DOUBLE},
trading_margin = #{tradingMargin,jdbcType=DOUBLE}
where stash_id = #{stashId,jdbcType=VARCHAR}
</update>
</mapper>
Loading…
Cancel
Save