新增退出时机表,完成投资报告页面接口

master
xiaoCJ 1 year ago
parent e75e0469f0
commit d406177ca9

@ -25,12 +25,12 @@ public class ProfitDistributionController {
private ProfitDistributionService profitDistributionService;
@AnonymousAccess
@PostMapping("/submit")
@ApiOperation("页面提交")
public void submit(@ApiParam("传id,flowID,用户输入8个框的内容(可用资金,自有资金和优先级LP必传)") ProfitDistribution profitDistribution) {
profitDistributionService.submit(profitDistribution);
}
// @AnonymousAccess
// @PostMapping("/submit")
// @ApiOperation("页面提交")
// public void submit(@ApiParam("传id(UUID),flowID,用户输入8个框的内容(可用资金,自有资金和优先级LP必传)") ProfitDistribution profitDistribution) {
// profitDistributionService.submit(profitDistribution);
// }
@AnonymousAccess
@GetMapping("/echo")

@ -1,5 +1,6 @@
package com.sztzjy.fund_investment.service.serviceImpl;
import cn.hutool.core.util.IdUtil;
import com.sztzjy.fund_investment.config.Constant;
import com.sztzjy.fund_investment.entity.TrainingReport;
import com.sztzjy.fund_investment.entity.TrainingReportExample;
@ -29,7 +30,9 @@ public class InvestmentReportServiceImpl implements InvestmentReportService {
TrainingReportMapper trainingReportMapper;
/**
/**
*
*
* @author xcj
* @Date 2023/12/4
*/
@ -41,19 +44,20 @@ public class InvestmentReportServiceImpl implements InvestmentReportService {
if (!fileExtension.equals(".pdf") && !fileExtension.equals(".doc") && !fileExtension.equals(".docx")) {
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "文件必须为word或pdf");
}
List<TrainingReport> trainingReports = getTrainingReports(flowId);
TrainingReportExample trainingReportExample = new TrainingReportExample();
trainingReportExample.createCriteria().andFlowIdEqualTo(flowId).andStepEqualTo(Constant.TZBG);
List<TrainingReport> trainingReports = trainingReportMapper.selectByExampleWithBLOBs(trainingReportExample);
//只允许提交一次,判断是否只提交了心得没提交报告
if (!trainingReports.isEmpty()) {
TrainingReport trainingReport = trainingReports.get(0);
if (StringUtils.isNotBlank(trainingReport.getReportName())) {
if (StringUtils.isNotBlank(trainingReport.getReportName()) && StringUtils.isNotBlank(trainingReport.getUrl())) {
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "不允许重复提交!");
} else {
trainingReport.setUrl(filePath);
trainingReport.setReportName(fileName);
trainingReport.setUploadtime(new Date());
trainingReport.setStep(Constant.TZBG);
trainingReportMapper.updateByPrimaryKey(trainingReport);
trainingReportMapper.updateByPrimaryKeySelective(trainingReport);
return new ResultEntity<>(HttpStatus.OK, "报告上传成功!");
}
} else { //没上传报告没提交心得的情况
@ -91,17 +95,21 @@ public class InvestmentReportServiceImpl implements InvestmentReportService {
if (StringUtils.isBlank(trainingReport.getId()) || StringUtils.isBlank(trainingReport.getFlowId()) || StringUtils.isBlank(trainingReport.getSchoolId())) {
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "提交失败缺少所需的ID");
}
List<TrainingReport> trainingReports = getTrainingReports(trainingReport.getFlowId());
TrainingReportExample trainingReportExample = new TrainingReportExample();
trainingReportExample.createCriteria().andFlowIdEqualTo(trainingReport.getFlowId()).andStepEqualTo(Constant.TZBG);
List<TrainingReport> trainingReports = trainingReportMapper.selectByExampleWithBLOBs(trainingReportExample);
if (!trainingReports.isEmpty()) {
TrainingReport dataTrainingReport = trainingReports.get(0);
if (StringUtils.isNotBlank(dataTrainingReport.getExperience())) {
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "不允许重复提交!");
} else { //提交了报告没提交心得
trainingReport.setExperience(trainingReport.getExperience());
trainingReport.setUploadtime(new Date());
trainingReportMapper.updateByPrimaryKey(trainingReport);
dataTrainingReport.setExperience(trainingReport.getExperience());
dataTrainingReport.setUploadtime(new Date());
trainingReportMapper.updateByPrimaryKeyWithBLOBs(dataTrainingReport);
}
} else { //为空新增
trainingReport.setUploadtime(new Date());
trainingReport.setStep(Constant.TZBG);
trainingReportMapper.insert(trainingReport);
}
return new ResultEntity<>(HttpStatus.OK, "提交成功!");

@ -14,6 +14,7 @@ import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.List;
/**
* @Author xcj
@ -31,6 +32,111 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService
private PerformanceScoreService performanceScoreService;
/*
* @author xcj
* @Date 2023/12/11
*/
// @Override
// public void submit(ProfitDistribution profitDistribution) {
// //查看基金募集属于哪种情况
// String flowId = profitDistribution.getFlowId();
// Fundraising fundraising = fundraisingService.selectByFlowId(flowId);
// ExitTime exitTime = exitTimeMapper.selectByPrimaryKey(flowId);
// BigDecimal fundraisingAmount = fundraising.getFundraisingAmount(); //资金募集总金额
// BigDecimal priorityLp = fundraising.getPriorityLp(); //优先级LP本金
// BigDecimal subordinatedLp = fundraising.getSubordinatedLp();//劣后级LP本金
// BigDecimal bankLoan = fundraising.getBankLoan(); //银行借款本金
// BigDecimal exitFundEarnings = exitTime.getExitFundEarnings();//投资收益
// BigDecimal userRoundOwnFunds = profitDistribution.getUserRoundOwnFunds();//用户/第一轮自有资金
// BigDecimal userRoundPreferredLp = profitDistribution.getUserRoundPreferredLp(); //用户/第一轮优先级LP
// BigDecimal remainingOwnFunds = profitDistribution.getRemainingOwnFunds();//用户/第二轮自有资金
// BigDecimal remainingEarningsPreferredLp = profitDistribution.getRemainingEarningsPreferredLp();//用户/第二轮优先级LP
// BigDecimal rightOwnFunds = fundraising.getOwnFunds();//正确/第一轮自有资金
// BigDecimal rightFundraisingAmount = priorityLp.add(priorityLp.multiply(BigDecimal.valueOf(0.1))).setScale(2, RoundingMode.HALF_UP);//第一轮/优先级LP
// //1.归还自有资金的本金归还优先级LP本金+本金*10% (两个值必填且都一样,提高优先级复用)
// profitDistribution.setRoundOwnFunds(rightOwnFunds);
// profitDistribution.setRoundPreferredLp(rightFundraisingAmount);
// Integer type = fundraising.getType();
// //计算可用资金是否正确
// BigDecimal rightAvailableFunds = fundraisingAmount.add(exitFundEarnings).setScale(2, RoundingMode.HALF_UP);//可用资金
// BigDecimal residualIncome = rightAvailableFunds.subtract(rightOwnFunds).subtract(rightFundraisingAmount); //剩余分配减去优先级LP和自有资金
// if (profitDistribution.getUserAvailableFunds().compareTo(rightAvailableFunds) == 0) {
// performanceScoreService.calculateScoreByModule("profitDistributionAvailablefundsScore", 1, flowId);
// }
// if (type == 1) { //1:自有资金/优先级LP
// // 2.剩余收益分配比例为自有资金25%优先级LP75%
// BigDecimal twoRightOwnFunds = residualIncome.multiply(BigDecimal.valueOf(0.25)).setScale(2, RoundingMode.HALF_UP);//剩余自有资金
// BigDecimal twoRightFundraisingAmount = residualIncome.subtract(twoRightOwnFunds); //剩余优先级LP
// profitDistribution.setRemainingOwnFunds(twoRightOwnFunds);
// profitDistribution.setRemainingEarningsPreferredLp(twoRightFundraisingAmount);
// profitDistributionMapper.insert(profitDistribution);
// //算分 共五分可用资金1分其他共4分错一个不得分
// if (rightOwnFunds.compareTo(userRoundOwnFunds) == 0 && rightFundraisingAmount.compareTo(userRoundPreferredLp) == 0 &&
// twoRightOwnFunds.compareTo(remainingOwnFunds) == 0 && twoRightFundraisingAmount.compareTo(remainingEarningsPreferredLp) == 0) {
// performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId);
// }
// } else if (type == 2) { //2:自有资金/优先级LP/劣后级LP
// BigDecimal userRemainingEarningsSubordinatedLp = profitDistribution.getUserRemainingEarningsSubordinatedLp();//用户/剩余收益劣后级LP
// BigDecimal userRoundSubordinatedLp = profitDistribution.getUserRoundSubordinatedLp();//用户/第一轮劣后级LP
//// 第一轮归还劣后级LP本金
// profitDistribution.setRoundSubordinatedLp(subordinatedLp);
// residualIncome = residualIncome.subtract(subordinatedLp); //剩余收益
//// 2.剩余收益分配比例为自有资金25%优先级LP 30%劣后级LP 45%
// BigDecimal twoRightOwnFunds = residualIncome.multiply(BigDecimal.valueOf(0.25)).setScale(2, RoundingMode.HALF_UP);//剩余自有资金
// BigDecimal twoRightFundraisingAmount = residualIncome.multiply(BigDecimal.valueOf(0.35)).setScale(2, RoundingMode.HALF_UP);//剩余自有资金
// BigDecimal twoRightSubordinatedLp = residualIncome.subtract(twoRightOwnFunds).subtract(twoRightFundraisingAmount); //剩余劣后级LP
// profitDistribution.setRemainingOwnFunds(twoRightOwnFunds);
// profitDistribution.setRemainingEarningsPreferredLp(twoRightFundraisingAmount);
// profitDistribution.setRemainingEarningsSubordinatedLp(twoRightSubordinatedLp);
// profitDistributionMapper.insert(profitDistribution);
// if (rightOwnFunds.compareTo(userRoundOwnFunds) == 0 && rightFundraisingAmount.compareTo(userRoundPreferredLp) == 0 &&
// twoRightOwnFunds.compareTo(remainingOwnFunds) == 0 && twoRightFundraisingAmount.compareTo(remainingEarningsPreferredLp) == 0 &&
// userRoundSubordinatedLp.compareTo(subordinatedLp) == 0 && userRemainingEarningsSubordinatedLp.compareTo(twoRightSubordinatedLp) == 0) {
// performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId);
// }
// } else if (type == 3) { //3:自有资金/优先级LP/银行借款
// BigDecimal userRoundBankLoan = profitDistribution.getUserRoundBankLoan(); //用户/银行借款
// BigDecimal rightBankLoan = bankLoan.add(bankLoan.multiply(BigDecimal.valueOf(0.0475))).setScale(2, RoundingMode.HALF_UP); //银行借款/+利息4.75%
// profitDistribution.setRoundBankLoan(rightBankLoan);
// residualIncome = residualIncome.subtract(rightBankLoan); //剩余收益
// // 2.剩余收益分配比例为自有资金25%优先级LP75%
// BigDecimal twoRightOwnFunds = residualIncome.multiply(BigDecimal.valueOf(0.25)).setScale(2, RoundingMode.HALF_UP);//剩余自有资金
// BigDecimal twoRightFundraisingAmount = residualIncome.subtract(twoRightOwnFunds); //剩余优先级LP
// profitDistribution.setRemainingOwnFunds(twoRightOwnFunds);
// profitDistribution.setRemainingEarningsPreferredLp(twoRightFundraisingAmount);
// profitDistributionMapper.insert(profitDistribution);
// if (rightOwnFunds.compareTo(userRoundOwnFunds) == 0 && rightFundraisingAmount.compareTo(userRoundPreferredLp) == 0 &&
// twoRightOwnFunds.compareTo(remainingOwnFunds) == 0 && twoRightFundraisingAmount.compareTo(remainingEarningsPreferredLp) == 0 &&
// rightBankLoan.compareTo(userRoundBankLoan) == 0) {
// performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId);
// }
// } else { //4:自有资金/优先级LP/劣后级LP/银行借款
// BigDecimal userRemainingEarningsSubordinatedLp = profitDistribution.getUserRemainingEarningsSubordinatedLp();//用户/剩余收益劣后级LP
// BigDecimal userRoundSubordinatedLp = profitDistribution.getUserRoundSubordinatedLp();//用户/第一轮劣后级LP
// BigDecimal userRoundBankLoan = profitDistribution.getUserRoundBankLoan(); //用户/银行借款
// // 第一轮归还劣后级LP本金和银行利息
// profitDistribution.setRoundSubordinatedLp(subordinatedLp);
// BigDecimal rightBankLoan = bankLoan.add(bankLoan.multiply(BigDecimal.valueOf(0.0475))); //银行借款/+利息4.75%
// profitDistribution.setRoundBankLoan(rightBankLoan);
// residualIncome = residualIncome.subtract(subordinatedLp).subtract(rightBankLoan); //剩余收益
// //2.剩余收益分配比例为自有资金25%优先级LP 30%劣后级LP 45%
// BigDecimal twoRightOwnFunds = residualIncome.multiply(BigDecimal.valueOf(0.25)).setScale(2, RoundingMode.HALF_UP);//剩余自有资金
// BigDecimal twoRightFundraisingAmount = residualIncome.multiply(BigDecimal.valueOf(0.35)).setScale(2, RoundingMode.HALF_UP);//剩余自有资金
// BigDecimal twoRightSubordinatedLp = residualIncome.subtract(twoRightOwnFunds).subtract(twoRightFundraisingAmount); //剩余劣后级LP
// profitDistribution.setRemainingOwnFunds(twoRightOwnFunds);
// profitDistribution.setRemainingEarningsPreferredLp(twoRightFundraisingAmount);
// profitDistribution.setRemainingEarningsSubordinatedLp(twoRightSubordinatedLp);
// profitDistributionMapper.insert(profitDistribution);
// if (rightOwnFunds.compareTo(userRoundOwnFunds) == 0 && rightFundraisingAmount.compareTo(userRoundPreferredLp) == 0 &&
// twoRightOwnFunds.compareTo(remainingOwnFunds) == 0 && twoRightFundraisingAmount.compareTo(remainingEarningsPreferredLp) == 0 &&
// rightBankLoan.compareTo(userRoundBankLoan) == 0 && userRoundSubordinatedLp.compareTo(subordinatedLp) == 0 &&
// userRemainingEarningsSubordinatedLp.compareTo(twoRightSubordinatedLp) == 0) {
// performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId);
// }
// }
// }
/*
* @author xcj
* @Date 2023/12/11
@ -51,24 +157,43 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService
BigDecimal remainingOwnFunds = profitDistribution.getRemainingOwnFunds();//用户/第二轮自有资金
BigDecimal remainingEarningsPreferredLp = profitDistribution.getRemainingEarningsPreferredLp();//用户/第二轮优先级LP
BigDecimal rightOwnFunds = fundraising.getOwnFunds();//正确/第一轮自有资金
BigDecimal rightFundraisingAmount = priorityLp.add(priorityLp.multiply(BigDecimal.valueOf(0.1))).setScale(2, RoundingMode.HALF_UP);//第一轮/优先级LP
//1.归还自有资金的本金归还优先级LP本金+本金*10% (两个值必填且都一样,提高优先级复用)
profitDistribution.setRoundOwnFunds(rightOwnFunds);
profitDistribution.setRoundPreferredLp(rightFundraisingAmount);
Integer type = fundraising.getType();
//计算可用资金是否正确
BigDecimal rightAvailableFunds = fundraisingAmount.add(exitFundEarnings).setScale(2, RoundingMode.HALF_UP);//可用资金
BigDecimal residualIncome = rightAvailableFunds.subtract(rightOwnFunds).subtract(rightFundraisingAmount); //剩余分配减去优先级LP和自有资金
profitDistribution.setAvailableFunds(rightAvailableFunds); //设置可用资金
if (profitDistribution.getUserAvailableFunds().compareTo(rightAvailableFunds) == 0) {
performanceScoreService.calculateScoreByModule("profitDistributionAvailablefundsScore", 1, flowId);
}
BigDecimal rightFundraisingAmount = priorityLp.add(priorityLp.multiply(BigDecimal.valueOf(0.1))).setScale(2, RoundingMode.HALF_UP);//第一轮/优先级LP
BigDecimal subtract = rightAvailableFunds.subtract(rightFundraisingAmount); //可用资金 - 第一轮/优先级LP
BigDecimal residualIncome = rightAvailableFunds.subtract(rightOwnFunds).subtract(rightFundraisingAmount);//剩余分配金额减去优先级LP和自有资金
if (type == 1) { //1:自有资金/优先级LP
profitDistribution.setRemainingOwnFunds(BigDecimal.ZERO);
profitDistribution.setRemainingEarningsPreferredLp(BigDecimal.ZERO);
if (exitFundEarnings.compareTo(BigDecimal.ZERO) <= 0) { //盈利<0 亏损状态
if (rightAvailableFunds.compareTo(BigDecimal.ZERO)<=0){
profitDistribution.setRoundPreferredLp(BigDecimal.ZERO);//可用资金都给优先级LP 其余都为0
}else {
profitDistribution.setRoundPreferredLp(rightAvailableFunds);//可用资金都给优先级LP 其余都为0
}
profitDistribution.setRoundOwnFunds(BigDecimal.ZERO);
profitDistributionMapper.insert(profitDistribution);
return;
}
if (subtract.compareTo(rightOwnFunds) <= 0&& subtract.compareTo(BigDecimal.ZERO) > 0) { //如果可用资金 - 优先级LP <= 需要分配的自有资金剩余金额全部给 自有资金第二轮都为0
profitDistribution.setRoundPreferredLp(rightFundraisingAmount);
profitDistribution.setRoundOwnFunds(subtract);
profitDistributionMapper.insert(profitDistribution);
return;
}
profitDistribution.setRoundOwnFunds(rightOwnFunds);
profitDistribution.setRoundPreferredLp(rightFundraisingAmount);
// 2.剩余收益分配比例为自有资金25%优先级LP75%
BigDecimal twoRightOwnFunds = residualIncome.multiply(BigDecimal.valueOf(0.25)).setScale(2, RoundingMode.HALF_UP);//剩余自有资金
BigDecimal twoRightFundraisingAmount = residualIncome.subtract(twoRightOwnFunds); //剩余优先级LP
profitDistribution.setRemainingOwnFunds(twoRightOwnFunds);
profitDistribution.setRemainingEarningsPreferredLp(twoRightFundraisingAmount);
profitDistributionMapper.updateByPrimaryKey(profitDistribution);
profitDistributionMapper.insert(profitDistribution);
//算分 共五分可用资金1分其他共4分错一个不得分
if (rightOwnFunds.compareTo(userRoundOwnFunds) == 0 && rightFundraisingAmount.compareTo(userRoundPreferredLp) == 0 &&
twoRightOwnFunds.compareTo(remainingOwnFunds) == 0 && twoRightFundraisingAmount.compareTo(remainingEarningsPreferredLp) == 0) {
@ -87,7 +212,7 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService
profitDistribution.setRemainingOwnFunds(twoRightOwnFunds);
profitDistribution.setRemainingEarningsPreferredLp(twoRightFundraisingAmount);
profitDistribution.setRemainingEarningsSubordinatedLp(twoRightSubordinatedLp);
profitDistributionMapper.updateByPrimaryKey(profitDistribution);
profitDistributionMapper.insert(profitDistribution);
if (rightOwnFunds.compareTo(userRoundOwnFunds) == 0 && rightFundraisingAmount.compareTo(userRoundPreferredLp) == 0 &&
twoRightOwnFunds.compareTo(remainingOwnFunds) == 0 && twoRightFundraisingAmount.compareTo(remainingEarningsPreferredLp) == 0 &&
userRoundSubordinatedLp.compareTo(subordinatedLp) == 0 && userRemainingEarningsSubordinatedLp.compareTo(twoRightSubordinatedLp) == 0) {
@ -103,7 +228,7 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService
BigDecimal twoRightFundraisingAmount = residualIncome.subtract(twoRightOwnFunds); //剩余优先级LP
profitDistribution.setRemainingOwnFunds(twoRightOwnFunds);
profitDistribution.setRemainingEarningsPreferredLp(twoRightFundraisingAmount);
profitDistributionMapper.updateByPrimaryKey(profitDistribution);
profitDistributionMapper.insert(profitDistribution);
if (rightOwnFunds.compareTo(userRoundOwnFunds) == 0 && rightFundraisingAmount.compareTo(userRoundPreferredLp) == 0 &&
twoRightOwnFunds.compareTo(remainingOwnFunds) == 0 && twoRightFundraisingAmount.compareTo(remainingEarningsPreferredLp) == 0 &&
rightBankLoan.compareTo(userRoundBankLoan) == 0) {
@ -125,7 +250,7 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService
profitDistribution.setRemainingOwnFunds(twoRightOwnFunds);
profitDistribution.setRemainingEarningsPreferredLp(twoRightFundraisingAmount);
profitDistribution.setRemainingEarningsSubordinatedLp(twoRightSubordinatedLp);
profitDistributionMapper.updateByPrimaryKey(profitDistribution);
profitDistributionMapper.insert(profitDistribution);
if (rightOwnFunds.compareTo(userRoundOwnFunds) == 0 && rightFundraisingAmount.compareTo(userRoundPreferredLp) == 0 &&
twoRightOwnFunds.compareTo(remainingOwnFunds) == 0 && twoRightFundraisingAmount.compareTo(remainingEarningsPreferredLp) == 0 &&
rightBankLoan.compareTo(userRoundBankLoan) == 0 && userRoundSubordinatedLp.compareTo(subordinatedLp) == 0 &&
@ -144,7 +269,7 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService
public ProfitDistribution echo(String flowId) {
ProfitDistributionExample profitDistributionExample = new ProfitDistributionExample();
profitDistributionExample.createCriteria().andFlowIdEqualTo(flowId);
profitDistributionMapper.selectByExample(profitDistributionExample);
return null;
List<ProfitDistribution> profitDistributions = profitDistributionMapper.selectByExample(profitDistributionExample);
return profitDistributions.get(0);
}
}

@ -0,0 +1,486 @@
<?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.fund_investment.mapper.ProfitDistributionMapper">
<resultMap id="BaseResultMap" type="com.sztzjy.fund_investment.entity.ProfitDistribution">
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="flow_id" jdbcType="VARCHAR" property="flowId" />
<result column="project_name" jdbcType="VARCHAR" property="projectName" />
<result column="investment_amount" jdbcType="DECIMAL" property="investmentAmount" />
<result column="exit_stock_price" jdbcType="DECIMAL" property="exitStockPrice" />
<result column="fund_earnings" jdbcType="DECIMAL" property="fundEarnings" />
<result column="available_funds" jdbcType="DECIMAL" property="availableFunds" />
<result column="round_own_funds" jdbcType="DECIMAL" property="roundOwnFunds" />
<result column="round_subordinated_lp" jdbcType="DECIMAL" property="roundSubordinatedLp" />
<result column="round_preferred_lp" jdbcType="DECIMAL" property="roundPreferredLp" />
<result column="round_bank_loan" jdbcType="DECIMAL" property="roundBankLoan" />
<result column="remaining_own_funds" jdbcType="DECIMAL" property="remainingOwnFunds" />
<result column="remaining_earnings_subordinated_lp" jdbcType="DECIMAL" property="remainingEarningsSubordinatedLp" />
<result column="remaining_earnings_preferred_lp" jdbcType="DECIMAL" property="remainingEarningsPreferredLp" />
<result column="user_available_funds" jdbcType="DECIMAL" property="userAvailableFunds" />
<result column="user_round_own_funds" jdbcType="DECIMAL" property="userRoundOwnFunds" />
<result column="user_round_subordinated_lp" jdbcType="DECIMAL" property="userRoundSubordinatedLp" />
<result column="user_round_preferred_lp" jdbcType="DECIMAL" property="userRoundPreferredLp" />
<result column="user_round_bank_loan" jdbcType="DECIMAL" property="userRoundBankLoan" />
<result column="user_remaining_own_funds" jdbcType="DECIMAL" property="userRemainingOwnFunds" />
<result column="user_remaining_earnings_subordinated_lp" jdbcType="DECIMAL" property="userRemainingEarningsSubordinatedLp" />
<result column="user_remaining_earnings_preferred_lp" jdbcType="DECIMAL" property="userRemainingEarningsPreferredLp" />
</resultMap>
<sql id="Example_Where_Clause">
<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">
<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">
id, flow_id, project_name, investment_amount, exit_stock_price, fund_earnings, available_funds,
round_own_funds, round_subordinated_lp, round_preferred_lp, round_bank_loan, remaining_own_funds,
remaining_earnings_subordinated_lp, remaining_earnings_preferred_lp, user_available_funds,
user_round_own_funds, user_round_subordinated_lp, user_round_preferred_lp, user_round_bank_loan,
user_remaining_own_funds, user_remaining_earnings_subordinated_lp, user_remaining_earnings_preferred_lp
</sql>
<select id="selectByExample" parameterType="com.sztzjy.fund_investment.entity.ProfitDistributionExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from profit_distribution
<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">
select
<include refid="Base_Column_List" />
from profit_distribution
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from profit_distribution
where id = #{id,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="com.sztzjy.fund_investment.entity.ProfitDistributionExample">
delete from profit_distribution
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.sztzjy.fund_investment.entity.ProfitDistribution">
insert into profit_distribution (id, flow_id, project_name,
investment_amount, exit_stock_price, fund_earnings,
available_funds, round_own_funds, round_subordinated_lp,
round_preferred_lp, round_bank_loan, remaining_own_funds,
remaining_earnings_subordinated_lp, remaining_earnings_preferred_lp,
user_available_funds, user_round_own_funds,
user_round_subordinated_lp, user_round_preferred_lp,
user_round_bank_loan, user_remaining_own_funds,
user_remaining_earnings_subordinated_lp, user_remaining_earnings_preferred_lp
)
values (#{id,jdbcType=VARCHAR}, #{flowId,jdbcType=VARCHAR}, #{projectName,jdbcType=VARCHAR},
#{investmentAmount,jdbcType=DECIMAL}, #{exitStockPrice,jdbcType=DECIMAL}, #{fundEarnings,jdbcType=DECIMAL},
#{availableFunds,jdbcType=DECIMAL}, #{roundOwnFunds,jdbcType=DECIMAL}, #{roundSubordinatedLp,jdbcType=DECIMAL},
#{roundPreferredLp,jdbcType=DECIMAL}, #{roundBankLoan,jdbcType=DECIMAL}, #{remainingOwnFunds,jdbcType=DECIMAL},
#{remainingEarningsSubordinatedLp,jdbcType=DECIMAL}, #{remainingEarningsPreferredLp,jdbcType=DECIMAL},
#{userAvailableFunds,jdbcType=DECIMAL}, #{userRoundOwnFunds,jdbcType=DECIMAL},
#{userRoundSubordinatedLp,jdbcType=DECIMAL}, #{userRoundPreferredLp,jdbcType=DECIMAL},
#{userRoundBankLoan,jdbcType=DECIMAL}, #{userRemainingOwnFunds,jdbcType=DECIMAL},
#{userRemainingEarningsSubordinatedLp,jdbcType=DECIMAL}, #{userRemainingEarningsPreferredLp,jdbcType=DECIMAL}
)
</insert>
<insert id="insertSelective" parameterType="com.sztzjy.fund_investment.entity.ProfitDistribution">
insert into profit_distribution
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="flowId != null">
flow_id,
</if>
<if test="projectName != null">
project_name,
</if>
<if test="investmentAmount != null">
investment_amount,
</if>
<if test="exitStockPrice != null">
exit_stock_price,
</if>
<if test="fundEarnings != null">
fund_earnings,
</if>
<if test="availableFunds != null">
available_funds,
</if>
<if test="roundOwnFunds != null">
round_own_funds,
</if>
<if test="roundSubordinatedLp != null">
round_subordinated_lp,
</if>
<if test="roundPreferredLp != null">
round_preferred_lp,
</if>
<if test="roundBankLoan != null">
round_bank_loan,
</if>
<if test="remainingOwnFunds != null">
remaining_own_funds,
</if>
<if test="remainingEarningsSubordinatedLp != null">
remaining_earnings_subordinated_lp,
</if>
<if test="remainingEarningsPreferredLp != null">
remaining_earnings_preferred_lp,
</if>
<if test="userAvailableFunds != null">
user_available_funds,
</if>
<if test="userRoundOwnFunds != null">
user_round_own_funds,
</if>
<if test="userRoundSubordinatedLp != null">
user_round_subordinated_lp,
</if>
<if test="userRoundPreferredLp != null">
user_round_preferred_lp,
</if>
<if test="userRoundBankLoan != null">
user_round_bank_loan,
</if>
<if test="userRemainingOwnFunds != null">
user_remaining_own_funds,
</if>
<if test="userRemainingEarningsSubordinatedLp != null">
user_remaining_earnings_subordinated_lp,
</if>
<if test="userRemainingEarningsPreferredLp != null">
user_remaining_earnings_preferred_lp,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="flowId != null">
#{flowId,jdbcType=VARCHAR},
</if>
<if test="projectName != null">
#{projectName,jdbcType=VARCHAR},
</if>
<if test="investmentAmount != null">
#{investmentAmount,jdbcType=DECIMAL},
</if>
<if test="exitStockPrice != null">
#{exitStockPrice,jdbcType=DECIMAL},
</if>
<if test="fundEarnings != null">
#{fundEarnings,jdbcType=DECIMAL},
</if>
<if test="availableFunds != null">
#{availableFunds,jdbcType=DECIMAL},
</if>
<if test="roundOwnFunds != null">
#{roundOwnFunds,jdbcType=DECIMAL},
</if>
<if test="roundSubordinatedLp != null">
#{roundSubordinatedLp,jdbcType=DECIMAL},
</if>
<if test="roundPreferredLp != null">
#{roundPreferredLp,jdbcType=DECIMAL},
</if>
<if test="roundBankLoan != null">
#{roundBankLoan,jdbcType=DECIMAL},
</if>
<if test="remainingOwnFunds != null">
#{remainingOwnFunds,jdbcType=DECIMAL},
</if>
<if test="remainingEarningsSubordinatedLp != null">
#{remainingEarningsSubordinatedLp,jdbcType=DECIMAL},
</if>
<if test="remainingEarningsPreferredLp != null">
#{remainingEarningsPreferredLp,jdbcType=DECIMAL},
</if>
<if test="userAvailableFunds != null">
#{userAvailableFunds,jdbcType=DECIMAL},
</if>
<if test="userRoundOwnFunds != null">
#{userRoundOwnFunds,jdbcType=DECIMAL},
</if>
<if test="userRoundSubordinatedLp != null">
#{userRoundSubordinatedLp,jdbcType=DECIMAL},
</if>
<if test="userRoundPreferredLp != null">
#{userRoundPreferredLp,jdbcType=DECIMAL},
</if>
<if test="userRoundBankLoan != null">
#{userRoundBankLoan,jdbcType=DECIMAL},
</if>
<if test="userRemainingOwnFunds != null">
#{userRemainingOwnFunds,jdbcType=DECIMAL},
</if>
<if test="userRemainingEarningsSubordinatedLp != null">
#{userRemainingEarningsSubordinatedLp,jdbcType=DECIMAL},
</if>
<if test="userRemainingEarningsPreferredLp != null">
#{userRemainingEarningsPreferredLp,jdbcType=DECIMAL},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.sztzjy.fund_investment.entity.ProfitDistributionExample" resultType="java.lang.Long">
select count(*) from profit_distribution
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update profit_distribution
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=VARCHAR},
</if>
<if test="record.flowId != null">
flow_id = #{record.flowId,jdbcType=VARCHAR},
</if>
<if test="record.projectName != null">
project_name = #{record.projectName,jdbcType=VARCHAR},
</if>
<if test="record.investmentAmount != null">
investment_amount = #{record.investmentAmount,jdbcType=DECIMAL},
</if>
<if test="record.exitStockPrice != null">
exit_stock_price = #{record.exitStockPrice,jdbcType=DECIMAL},
</if>
<if test="record.fundEarnings != null">
fund_earnings = #{record.fundEarnings,jdbcType=DECIMAL},
</if>
<if test="record.availableFunds != null">
available_funds = #{record.availableFunds,jdbcType=DECIMAL},
</if>
<if test="record.roundOwnFunds != null">
round_own_funds = #{record.roundOwnFunds,jdbcType=DECIMAL},
</if>
<if test="record.roundSubordinatedLp != null">
round_subordinated_lp = #{record.roundSubordinatedLp,jdbcType=DECIMAL},
</if>
<if test="record.roundPreferredLp != null">
round_preferred_lp = #{record.roundPreferredLp,jdbcType=DECIMAL},
</if>
<if test="record.roundBankLoan != null">
round_bank_loan = #{record.roundBankLoan,jdbcType=DECIMAL},
</if>
<if test="record.remainingOwnFunds != null">
remaining_own_funds = #{record.remainingOwnFunds,jdbcType=DECIMAL},
</if>
<if test="record.remainingEarningsSubordinatedLp != null">
remaining_earnings_subordinated_lp = #{record.remainingEarningsSubordinatedLp,jdbcType=DECIMAL},
</if>
<if test="record.remainingEarningsPreferredLp != null">
remaining_earnings_preferred_lp = #{record.remainingEarningsPreferredLp,jdbcType=DECIMAL},
</if>
<if test="record.userAvailableFunds != null">
user_available_funds = #{record.userAvailableFunds,jdbcType=DECIMAL},
</if>
<if test="record.userRoundOwnFunds != null">
user_round_own_funds = #{record.userRoundOwnFunds,jdbcType=DECIMAL},
</if>
<if test="record.userRoundSubordinatedLp != null">
user_round_subordinated_lp = #{record.userRoundSubordinatedLp,jdbcType=DECIMAL},
</if>
<if test="record.userRoundPreferredLp != null">
user_round_preferred_lp = #{record.userRoundPreferredLp,jdbcType=DECIMAL},
</if>
<if test="record.userRoundBankLoan != null">
user_round_bank_loan = #{record.userRoundBankLoan,jdbcType=DECIMAL},
</if>
<if test="record.userRemainingOwnFunds != null">
user_remaining_own_funds = #{record.userRemainingOwnFunds,jdbcType=DECIMAL},
</if>
<if test="record.userRemainingEarningsSubordinatedLp != null">
user_remaining_earnings_subordinated_lp = #{record.userRemainingEarningsSubordinatedLp,jdbcType=DECIMAL},
</if>
<if test="record.userRemainingEarningsPreferredLp != null">
user_remaining_earnings_preferred_lp = #{record.userRemainingEarningsPreferredLp,jdbcType=DECIMAL},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update profit_distribution
set id = #{record.id,jdbcType=VARCHAR},
flow_id = #{record.flowId,jdbcType=VARCHAR},
project_name = #{record.projectName,jdbcType=VARCHAR},
investment_amount = #{record.investmentAmount,jdbcType=DECIMAL},
exit_stock_price = #{record.exitStockPrice,jdbcType=DECIMAL},
fund_earnings = #{record.fundEarnings,jdbcType=DECIMAL},
available_funds = #{record.availableFunds,jdbcType=DECIMAL},
round_own_funds = #{record.roundOwnFunds,jdbcType=DECIMAL},
round_subordinated_lp = #{record.roundSubordinatedLp,jdbcType=DECIMAL},
round_preferred_lp = #{record.roundPreferredLp,jdbcType=DECIMAL},
round_bank_loan = #{record.roundBankLoan,jdbcType=DECIMAL},
remaining_own_funds = #{record.remainingOwnFunds,jdbcType=DECIMAL},
remaining_earnings_subordinated_lp = #{record.remainingEarningsSubordinatedLp,jdbcType=DECIMAL},
remaining_earnings_preferred_lp = #{record.remainingEarningsPreferredLp,jdbcType=DECIMAL},
user_available_funds = #{record.userAvailableFunds,jdbcType=DECIMAL},
user_round_own_funds = #{record.userRoundOwnFunds,jdbcType=DECIMAL},
user_round_subordinated_lp = #{record.userRoundSubordinatedLp,jdbcType=DECIMAL},
user_round_preferred_lp = #{record.userRoundPreferredLp,jdbcType=DECIMAL},
user_round_bank_loan = #{record.userRoundBankLoan,jdbcType=DECIMAL},
user_remaining_own_funds = #{record.userRemainingOwnFunds,jdbcType=DECIMAL},
user_remaining_earnings_subordinated_lp = #{record.userRemainingEarningsSubordinatedLp,jdbcType=DECIMAL},
user_remaining_earnings_preferred_lp = #{record.userRemainingEarningsPreferredLp,jdbcType=DECIMAL}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.fund_investment.entity.ProfitDistribution">
update profit_distribution
<set>
<if test="flowId != null">
flow_id = #{flowId,jdbcType=VARCHAR},
</if>
<if test="projectName != null">
project_name = #{projectName,jdbcType=VARCHAR},
</if>
<if test="investmentAmount != null">
investment_amount = #{investmentAmount,jdbcType=DECIMAL},
</if>
<if test="exitStockPrice != null">
exit_stock_price = #{exitStockPrice,jdbcType=DECIMAL},
</if>
<if test="fundEarnings != null">
fund_earnings = #{fundEarnings,jdbcType=DECIMAL},
</if>
<if test="availableFunds != null">
available_funds = #{availableFunds,jdbcType=DECIMAL},
</if>
<if test="roundOwnFunds != null">
round_own_funds = #{roundOwnFunds,jdbcType=DECIMAL},
</if>
<if test="roundSubordinatedLp != null">
round_subordinated_lp = #{roundSubordinatedLp,jdbcType=DECIMAL},
</if>
<if test="roundPreferredLp != null">
round_preferred_lp = #{roundPreferredLp,jdbcType=DECIMAL},
</if>
<if test="roundBankLoan != null">
round_bank_loan = #{roundBankLoan,jdbcType=DECIMAL},
</if>
<if test="remainingOwnFunds != null">
remaining_own_funds = #{remainingOwnFunds,jdbcType=DECIMAL},
</if>
<if test="remainingEarningsSubordinatedLp != null">
remaining_earnings_subordinated_lp = #{remainingEarningsSubordinatedLp,jdbcType=DECIMAL},
</if>
<if test="remainingEarningsPreferredLp != null">
remaining_earnings_preferred_lp = #{remainingEarningsPreferredLp,jdbcType=DECIMAL},
</if>
<if test="userAvailableFunds != null">
user_available_funds = #{userAvailableFunds,jdbcType=DECIMAL},
</if>
<if test="userRoundOwnFunds != null">
user_round_own_funds = #{userRoundOwnFunds,jdbcType=DECIMAL},
</if>
<if test="userRoundSubordinatedLp != null">
user_round_subordinated_lp = #{userRoundSubordinatedLp,jdbcType=DECIMAL},
</if>
<if test="userRoundPreferredLp != null">
user_round_preferred_lp = #{userRoundPreferredLp,jdbcType=DECIMAL},
</if>
<if test="userRoundBankLoan != null">
user_round_bank_loan = #{userRoundBankLoan,jdbcType=DECIMAL},
</if>
<if test="userRemainingOwnFunds != null">
user_remaining_own_funds = #{userRemainingOwnFunds,jdbcType=DECIMAL},
</if>
<if test="userRemainingEarningsSubordinatedLp != null">
user_remaining_earnings_subordinated_lp = #{userRemainingEarningsSubordinatedLp,jdbcType=DECIMAL},
</if>
<if test="userRemainingEarningsPreferredLp != null">
user_remaining_earnings_preferred_lp = #{userRemainingEarningsPreferredLp,jdbcType=DECIMAL},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.sztzjy.fund_investment.entity.ProfitDistribution">
update profit_distribution
set flow_id = #{flowId,jdbcType=VARCHAR},
project_name = #{projectName,jdbcType=VARCHAR},
investment_amount = #{investmentAmount,jdbcType=DECIMAL},
exit_stock_price = #{exitStockPrice,jdbcType=DECIMAL},
fund_earnings = #{fundEarnings,jdbcType=DECIMAL},
available_funds = #{availableFunds,jdbcType=DECIMAL},
round_own_funds = #{roundOwnFunds,jdbcType=DECIMAL},
round_subordinated_lp = #{roundSubordinatedLp,jdbcType=DECIMAL},
round_preferred_lp = #{roundPreferredLp,jdbcType=DECIMAL},
round_bank_loan = #{roundBankLoan,jdbcType=DECIMAL},
remaining_own_funds = #{remainingOwnFunds,jdbcType=DECIMAL},
remaining_earnings_subordinated_lp = #{remainingEarningsSubordinatedLp,jdbcType=DECIMAL},
remaining_earnings_preferred_lp = #{remainingEarningsPreferredLp,jdbcType=DECIMAL},
user_available_funds = #{userAvailableFunds,jdbcType=DECIMAL},
user_round_own_funds = #{userRoundOwnFunds,jdbcType=DECIMAL},
user_round_subordinated_lp = #{userRoundSubordinatedLp,jdbcType=DECIMAL},
user_round_preferred_lp = #{userRoundPreferredLp,jdbcType=DECIMAL},
user_round_bank_loan = #{userRoundBankLoan,jdbcType=DECIMAL},
user_remaining_own_funds = #{userRemainingOwnFunds,jdbcType=DECIMAL},
user_remaining_earnings_subordinated_lp = #{userRemainingEarningsSubordinatedLp,jdbcType=DECIMAL},
user_remaining_earnings_preferred_lp = #{userRemainingEarningsPreferredLp,jdbcType=DECIMAL}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>
Loading…
Cancel
Save