配置修改及部分交易部分功能
parent
283101b27b
commit
c4dd85fde5
@ -1,33 +1,109 @@
|
||||
package com.sztzjy.forex.trading_trading.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.sztzjy.forex.trading_trading.annotation.AnonymousAccess;
|
||||
import com.sztzjy.forex.trading_trading.common.mql5API.Mql5API;
|
||||
import com.sztzjy.forex.trading_trading.entity.Member;
|
||||
import com.sztzjy.forex.trading_trading.entity.mql5Entity.ExchangeFrateEntity;
|
||||
import com.sztzjy.forex.trading_trading.entity.mql5Entity.ForexData;
|
||||
import com.sztzjy.forex.trading_trading.service.MemberService;
|
||||
import io.swagger.models.auth.In;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
//学生端 交易
|
||||
@RestController
|
||||
@RequestMapping("api/trading")
|
||||
public class TradingController {
|
||||
|
||||
@Autowired
|
||||
MemberService memberService;
|
||||
|
||||
//获取市场报价
|
||||
@AnonymousAccess
|
||||
@PostMapping("getMarketQuotation")
|
||||
public JSONObject getMarketQuotation(){
|
||||
Mql5API mql5API=new Mql5API();
|
||||
ExchangeFrateEntity exchangeFrate = mql5API.getExchangeFrate();
|
||||
return exchangeFrate;
|
||||
public List<ForexData> getMarketQuotation() {
|
||||
Mql5API mql5API = new Mql5API();
|
||||
List<ForexData> marketQuotation = mql5API.getMarketQuotation();
|
||||
return marketQuotation;
|
||||
}
|
||||
|
||||
//根据交易类型获取实时数据
|
||||
@AnonymousAccess
|
||||
@PostMapping("getMarketQuotationByCode")
|
||||
public ForexData getMarketQuotationByCode(@RequestBody String code) {
|
||||
Mql5API mql5API = new Mql5API();
|
||||
ForexData forexData = mql5API.getMarketQuotationByCode(code);
|
||||
return forexData;
|
||||
}
|
||||
|
||||
//市场报价交易
|
||||
//市场报价交易 交易量为1为1000美元
|
||||
@AnonymousAccess
|
||||
@PostMapping("TransactionMarketQuotation")
|
||||
public JSONObject getMarketQuotation(JSONObject jsonObject){
|
||||
Mql5API mql5API=new Mql5API();
|
||||
ExchangeFrateEntity exchangeFrate = mql5API.getExchangeFrate();
|
||||
return exchangeFrate;
|
||||
public JSONObject getMarketQuotation(@RequestBody JSONObject jsonObject) {
|
||||
//交易品种
|
||||
String code = String.valueOf(jsonObject.get("code"));
|
||||
//交易类型
|
||||
String transactionType = String.valueOf(jsonObject.get("transactionType"));
|
||||
//买卖手(量)
|
||||
Double transactionVolume = (Double) jsonObject.get("transactionVolume");
|
||||
//买入卖出类型
|
||||
String buySellType = String.valueOf(jsonObject.get("buySellType"));
|
||||
//获取账户资金 调用member表中的
|
||||
Integer memberId = (Integer) jsonObject.get("memberId");
|
||||
Integer trainingId = (Integer) jsonObject.get("trainingId");
|
||||
Member member = memberService.getMemberByMemberIdAndTrainingId(memberId, trainingId);
|
||||
Double availableFunds = member.getAvailableFunds();
|
||||
if (transactionType.equals("sjkc")) {//市价开仓
|
||||
//美元在前
|
||||
if (code.startsWith("USD")) {
|
||||
//判断可用资金是否足够
|
||||
if(availableFunds<transactionVolume*1000){
|
||||
return JSONObject.parseObject("可用资金不足");
|
||||
}else {
|
||||
//获取当前买卖价格
|
||||
ForexData forexData = getMarketQuotationByCode(code);
|
||||
if (buySellType.equals("buy")) {
|
||||
String buyPic = forexData.getBuyPic();
|
||||
|
||||
|
||||
} else if (buySellType.equals("sell")) {
|
||||
String sellPic = forexData.getSellPic();
|
||||
|
||||
}
|
||||
availableFunds=availableFunds-transactionVolume*1000;
|
||||
member.setAvailableFunds(availableFunds);
|
||||
//获取当前已用保证金
|
||||
Double marginUsed = member.getMarginUsed();
|
||||
member.setMarginUsed(marginUsed+availableFunds);
|
||||
}
|
||||
//美元在后
|
||||
} else {
|
||||
|
||||
}
|
||||
//买入
|
||||
//卖出
|
||||
|
||||
} else if (transactionType.equals("gdkc")) {//挂单开仓
|
||||
//限价买进
|
||||
//限价卖出
|
||||
//止损买进
|
||||
//止损卖出
|
||||
|
||||
} else {
|
||||
JSONObject returnJson = JSONObject.parseObject("error");
|
||||
return returnJson;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,493 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.sztzjy.forex.trading_trading.mappers.MemberMapper">
|
||||
<resultMap id="BaseResultMap" type="com.sztzjy.forex.trading_trading.entity.Member">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
This element was generated on Tue Jun 27 13:28:23 CST 2023.
|
||||
-->
|
||||
<id column="member_id" jdbcType="BIGINT" property="memberId" />
|
||||
<result column="training_id" jdbcType="VARCHAR" property="trainingId" />
|
||||
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||
<result column="student_number" jdbcType="VARCHAR" property="studentNumber" />
|
||||
<result column="major" jdbcType="VARCHAR" property="major" />
|
||||
<result column="class_grade" jdbcType="VARCHAR" property="classGrade" />
|
||||
<result column="rank" jdbcType="INTEGER" property="rank" />
|
||||
<result column="initial_capital" jdbcType="DECIMAL" property="initialCapital" />
|
||||
<result column="total_assets" jdbcType="DECIMAL" property="totalAssets" />
|
||||
<result column="net_value" jdbcType="DECIMAL" property="netValue" />
|
||||
<result column="margin_used" jdbcType="DECIMAL" property="marginUsed" />
|
||||
<result column="available_funds" jdbcType="DECIMAL" property="availableFunds" />
|
||||
<result column="margin_level" jdbcType="DECIMAL" property="marginLevel" />
|
||||
<result column="position_profit_loss" jdbcType="DECIMAL" property="positionProfitLoss" />
|
||||
<result column="cumulative_profit_loss" jdbcType="DECIMAL" property="cumulativeProfitLoss" />
|
||||
<result column="yield" jdbcType="DECIMAL" property="yield" />
|
||||
<result column="opening_trades" jdbcType="INTEGER" property="openingTrades" />
|
||||
<result column="closing_trades" jdbcType="INTEGER" property="closingTrades" />
|
||||
</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 Tue Jun 27 13:28:23 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 Tue Jun 27 13:28:23 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 Tue Jun 27 13:28:23 CST 2023.
|
||||
-->
|
||||
member_id, training_id, name, student_number, major, class_grade, rank, initial_capital,
|
||||
total_assets, net_value, margin_used, available_funds, margin_level, position_profit_loss,
|
||||
cumulative_profit_loss, yield, opening_trades, closing_trades
|
||||
</sql>
|
||||
<select id="selectByExample" parameterType="com.sztzjy.forex.trading_trading.entity.example.MemberExample" resultMap="BaseResultMap">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
This element was generated on Tue Jun 27 13:28:23 CST 2023.
|
||||
-->
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
from sys_member
|
||||
<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.Long" resultMap="BaseResultMap">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
This element was generated on Tue Jun 27 13:28:23 CST 2023.
|
||||
-->
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from sys_member
|
||||
where member_id = #{memberId,jdbcType=BIGINT}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
This element was generated on Tue Jun 27 13:28:23 CST 2023.
|
||||
-->
|
||||
delete from sys_member
|
||||
where member_id = #{memberId,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<delete id="deleteByExample" parameterType="com.sztzjy.forex.trading_trading.entity.example.MemberExample">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
This element was generated on Tue Jun 27 13:28:23 CST 2023.
|
||||
-->
|
||||
delete from sys_member
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.sztzjy.forex.trading_trading.entity.Member">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
This element was generated on Tue Jun 27 13:28:23 CST 2023.
|
||||
-->
|
||||
insert into sys_member (member_id, training_id, name,
|
||||
student_number, major, class_grade,
|
||||
rank, initial_capital, total_assets,
|
||||
net_value, margin_used, available_funds,
|
||||
margin_level, position_profit_loss, cumulative_profit_loss,
|
||||
yield, opening_trades, closing_trades
|
||||
)
|
||||
values (#{memberId,jdbcType=BIGINT}, #{trainingId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
|
||||
#{studentNumber,jdbcType=VARCHAR}, #{major,jdbcType=VARCHAR}, #{classGrade,jdbcType=VARCHAR},
|
||||
#{rank,jdbcType=INTEGER}, #{initialCapital,jdbcType=DECIMAL}, #{totalAssets,jdbcType=DECIMAL},
|
||||
#{netValue,jdbcType=DECIMAL}, #{marginUsed,jdbcType=DECIMAL}, #{availableFunds,jdbcType=DECIMAL},
|
||||
#{marginLevel,jdbcType=DECIMAL}, #{positionProfitLoss,jdbcType=DECIMAL}, #{cumulativeProfitLoss,jdbcType=DECIMAL},
|
||||
#{yield,jdbcType=DECIMAL}, #{openingTrades,jdbcType=INTEGER}, #{closingTrades,jdbcType=INTEGER}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.sztzjy.forex.trading_trading.entity.Member">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
This element was generated on Tue Jun 27 13:28:23 CST 2023.
|
||||
-->
|
||||
insert into sys_member
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="memberId != null">
|
||||
member_id,
|
||||
</if>
|
||||
<if test="trainingId != null">
|
||||
training_id,
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name,
|
||||
</if>
|
||||
<if test="studentNumber != null">
|
||||
student_number,
|
||||
</if>
|
||||
<if test="major != null">
|
||||
major,
|
||||
</if>
|
||||
<if test="classGrade != null">
|
||||
class_grade,
|
||||
</if>
|
||||
<if test="rank != null">
|
||||
rank,
|
||||
</if>
|
||||
<if test="initialCapital != null">
|
||||
initial_capital,
|
||||
</if>
|
||||
<if test="totalAssets != null">
|
||||
total_assets,
|
||||
</if>
|
||||
<if test="netValue != null">
|
||||
net_value,
|
||||
</if>
|
||||
<if test="marginUsed != null">
|
||||
margin_used,
|
||||
</if>
|
||||
<if test="availableFunds != null">
|
||||
available_funds,
|
||||
</if>
|
||||
<if test="marginLevel != null">
|
||||
margin_level,
|
||||
</if>
|
||||
<if test="positionProfitLoss != null">
|
||||
position_profit_loss,
|
||||
</if>
|
||||
<if test="cumulativeProfitLoss != null">
|
||||
cumulative_profit_loss,
|
||||
</if>
|
||||
<if test="yield != null">
|
||||
yield,
|
||||
</if>
|
||||
<if test="openingTrades != null">
|
||||
opening_trades,
|
||||
</if>
|
||||
<if test="closingTrades != null">
|
||||
closing_trades,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="memberId != null">
|
||||
#{memberId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="trainingId != null">
|
||||
#{trainingId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
#{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="studentNumber != null">
|
||||
#{studentNumber,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="major != null">
|
||||
#{major,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="classGrade != null">
|
||||
#{classGrade,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="rank != null">
|
||||
#{rank,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="initialCapital != null">
|
||||
#{initialCapital,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="totalAssets != null">
|
||||
#{totalAssets,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="netValue != null">
|
||||
#{netValue,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="marginUsed != null">
|
||||
#{marginUsed,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="availableFunds != null">
|
||||
#{availableFunds,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="marginLevel != null">
|
||||
#{marginLevel,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="positionProfitLoss != null">
|
||||
#{positionProfitLoss,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="cumulativeProfitLoss != null">
|
||||
#{cumulativeProfitLoss,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="yield != null">
|
||||
#{yield,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="openingTrades != null">
|
||||
#{openingTrades,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="closingTrades != null">
|
||||
#{closingTrades,jdbcType=INTEGER},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample" parameterType="com.sztzjy.forex.trading_trading.entity.example.MemberExample" resultType="java.lang.Long">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
This element was generated on Tue Jun 27 13:28:23 CST 2023.
|
||||
-->
|
||||
select count(*) from sys_member
|
||||
<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 Tue Jun 27 13:28:23 CST 2023.
|
||||
-->
|
||||
update sys_member
|
||||
<set>
|
||||
<if test="record.memberId != null">
|
||||
member_id = #{record.memberId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.trainingId != null">
|
||||
training_id = #{record.trainingId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.name != null">
|
||||
name = #{record.name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.studentNumber != null">
|
||||
student_number = #{record.studentNumber,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.major != null">
|
||||
major = #{record.major,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.classGrade != null">
|
||||
class_grade = #{record.classGrade,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.rank != null">
|
||||
rank = #{record.rank,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="record.initialCapital != null">
|
||||
initial_capital = #{record.initialCapital,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="record.totalAssets != null">
|
||||
total_assets = #{record.totalAssets,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="record.netValue != null">
|
||||
net_value = #{record.netValue,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="record.marginUsed != null">
|
||||
margin_used = #{record.marginUsed,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="record.availableFunds != null">
|
||||
available_funds = #{record.availableFunds,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="record.marginLevel != null">
|
||||
margin_level = #{record.marginLevel,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="record.positionProfitLoss != null">
|
||||
position_profit_loss = #{record.positionProfitLoss,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="record.cumulativeProfitLoss != null">
|
||||
cumulative_profit_loss = #{record.cumulativeProfitLoss,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="record.yield != null">
|
||||
yield = #{record.yield,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="record.openingTrades != null">
|
||||
opening_trades = #{record.openingTrades,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="record.closingTrades != null">
|
||||
closing_trades = #{record.closingTrades,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 Tue Jun 27 13:28:23 CST 2023.
|
||||
-->
|
||||
update sys_member
|
||||
set member_id = #{record.memberId,jdbcType=BIGINT},
|
||||
training_id = #{record.trainingId,jdbcType=VARCHAR},
|
||||
name = #{record.name,jdbcType=VARCHAR},
|
||||
student_number = #{record.studentNumber,jdbcType=VARCHAR},
|
||||
major = #{record.major,jdbcType=VARCHAR},
|
||||
class_grade = #{record.classGrade,jdbcType=VARCHAR},
|
||||
rank = #{record.rank,jdbcType=INTEGER},
|
||||
initial_capital = #{record.initialCapital,jdbcType=DECIMAL},
|
||||
total_assets = #{record.totalAssets,jdbcType=DECIMAL},
|
||||
net_value = #{record.netValue,jdbcType=DECIMAL},
|
||||
margin_used = #{record.marginUsed,jdbcType=DECIMAL},
|
||||
available_funds = #{record.availableFunds,jdbcType=DECIMAL},
|
||||
margin_level = #{record.marginLevel,jdbcType=DECIMAL},
|
||||
position_profit_loss = #{record.positionProfitLoss,jdbcType=DECIMAL},
|
||||
cumulative_profit_loss = #{record.cumulativeProfitLoss,jdbcType=DECIMAL},
|
||||
yield = #{record.yield,jdbcType=DECIMAL},
|
||||
opening_trades = #{record.openingTrades,jdbcType=INTEGER},
|
||||
closing_trades = #{record.closingTrades,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.Member">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
This element was generated on Tue Jun 27 13:28:23 CST 2023.
|
||||
-->
|
||||
update sys_member
|
||||
<set>
|
||||
<if test="trainingId != null">
|
||||
training_id = #{trainingId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="studentNumber != null">
|
||||
student_number = #{studentNumber,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="major != null">
|
||||
major = #{major,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="classGrade != null">
|
||||
class_grade = #{classGrade,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="rank != null">
|
||||
rank = #{rank,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="initialCapital != null">
|
||||
initial_capital = #{initialCapital,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="totalAssets != null">
|
||||
total_assets = #{totalAssets,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="netValue != null">
|
||||
net_value = #{netValue,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="marginUsed != null">
|
||||
margin_used = #{marginUsed,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="availableFunds != null">
|
||||
available_funds = #{availableFunds,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="marginLevel != null">
|
||||
margin_level = #{marginLevel,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="positionProfitLoss != null">
|
||||
position_profit_loss = #{positionProfitLoss,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="cumulativeProfitLoss != null">
|
||||
cumulative_profit_loss = #{cumulativeProfitLoss,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="yield != null">
|
||||
yield = #{yield,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="openingTrades != null">
|
||||
opening_trades = #{openingTrades,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="closingTrades != null">
|
||||
closing_trades = #{closingTrades,jdbcType=INTEGER},
|
||||
</if>
|
||||
</set>
|
||||
where member_id = #{memberId,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.sztzjy.forex.trading_trading.entity.Member">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
This element was generated on Tue Jun 27 13:28:23 CST 2023.
|
||||
-->
|
||||
update sys_member
|
||||
set training_id = #{trainingId,jdbcType=VARCHAR},
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
student_number = #{studentNumber,jdbcType=VARCHAR},
|
||||
major = #{major,jdbcType=VARCHAR},
|
||||
class_grade = #{classGrade,jdbcType=VARCHAR},
|
||||
rank = #{rank,jdbcType=INTEGER},
|
||||
initial_capital = #{initialCapital,jdbcType=DECIMAL},
|
||||
total_assets = #{totalAssets,jdbcType=DECIMAL},
|
||||
net_value = #{netValue,jdbcType=DECIMAL},
|
||||
margin_used = #{marginUsed,jdbcType=DECIMAL},
|
||||
available_funds = #{availableFunds,jdbcType=DECIMAL},
|
||||
margin_level = #{marginLevel,jdbcType=DECIMAL},
|
||||
position_profit_loss = #{positionProfitLoss,jdbcType=DECIMAL},
|
||||
cumulative_profit_loss = #{cumulativeProfitLoss,jdbcType=DECIMAL},
|
||||
yield = #{yield,jdbcType=DECIMAL},
|
||||
opening_trades = #{openingTrades,jdbcType=INTEGER},
|
||||
closing_trades = #{closingTrades,jdbcType=INTEGER}
|
||||
where member_id = #{memberId,jdbcType=BIGINT}
|
||||
</update>
|
||||
</mapper>
|
Loading…
Reference in New Issue