新增相对估值法所有功能

master
yz 1 year ago
parent 48b2309ee8
commit d717607320

@ -1,5 +1,6 @@
package com.sztzjy.fund_investment.controller;
import cn.hutool.core.util.CharsetUtil;
import cn.hutool.core.util.IdUtil;
import com.github.pagehelper.PageInfo;
import com.itextpdf.text.*;
@ -15,6 +16,7 @@ import com.sztzjy.fund_investment.mapper.ProjectPoolMapper;
import com.sztzjy.fund_investment.service.ISysProjectDueDiligenceService;
import com.sztzjy.fund_investment.util.ResultEntity;
import com.sztzjy.fund_investment.util.excel.FilePortUtil;
import com.sztzjy.fund_investment.util.file.IFileUtil;
import com.sztzjy.fund_investment.util.pdfUtils.HeaderAndFooterEvent;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -26,7 +28,11 @@ import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.awt.*;
import java.io.BufferedInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.URLEncoder;
import java.nio.file.Files;
import java.util.*;
import java.util.List;
@ -44,6 +50,9 @@ public class ProjectDueDiligence {
ProjectPoolMapper projectPoolMapper;
@Autowired
HeaderAndFooterEvent headerAndFooterEvent;
@Autowired
private IFileUtil fileUtil;
//*************公司业务尽职调查
@GetMapping("getProjectPoolNameByFlowId")
@ -212,10 +221,10 @@ public class ProjectDueDiligence {
return new ResultEntity(HttpStatus.OK, "财务报表选取下拉框,展示成功", list);
}
@GetMapping("selectProFinancialIndexDetailList")
@PostMapping("selectProFinancialIndexDetailList")
@ApiOperation("财务指标查询")
@AnonymousAccess
public ResultEntity<PageInfo<ProFinancialIndexDetail>> selectProFinancialIndexDetailList(@ApiParam("节点id的集合List") @RequestParam List<String> proFinancialIndexIdList,
public ResultEntity<PageInfo<ProFinancialIndexDetail>> selectProFinancialIndexDetailList(@ApiParam("节点id的集合List") @RequestBody List<String> proFinancialIndexIdList,
@ApiParam("流程ID") @RequestParam String flowId,
@ApiParam("条数") @RequestParam Integer size,
@ApiParam("页数") @RequestParam Integer index) {
@ -223,10 +232,10 @@ public class ProjectDueDiligence {
return new ResultEntity(HttpStatus.OK, "财务指标查询成功", pageInfo);
}
@GetMapping("selectProFinancialStatementDetailList")
@PostMapping("selectProFinancialStatementDetailList")
@ApiOperation("财务报表查询")
@AnonymousAccess
public ResultEntity<PageInfo<ProFinancialStatementDetail>> selectProFinancialStatementDetailList(@ApiParam("节点id的集合List") @RequestParam List<String> proFinancialStatementIdList,
public ResultEntity<PageInfo<ProFinancialStatementDetail>> selectProFinancialStatementDetailList(@ApiParam("节点id的集合List") @RequestBody List<String> proFinancialStatementIdList,
@ApiParam("流程ID") @RequestParam String flowId,
@ApiParam("条数") @RequestParam Integer size,
@ApiParam("页数") @RequestParam Integer index) {
@ -313,12 +322,14 @@ public class ProjectDueDiligence {
@GetMapping("exportFinanceDueDiligencePDF")
@ApiOperation("财务尽调生成报告")
@AnonymousAccess
public void exportFinanceDueDiligencePDF(@ApiParam("HttpServletResponse") HttpServletResponse response,
public void exportFinanceDueDiligencePDF(HttpServletResponse response,
@ApiParam("流程ID") @RequestParam String flowId) throws IOException, DocumentException {
String projectPoolName=getProjectPoolNameByFlowId(flowId); //公司名称
Document document = new Document();
// 创建 PdfWriter 对象 第一个参数是对文档对象的引用,第二个参数是文件的实际名称,在该名称中还会给出其输出路径。
response.setContentType("application/octet-stream");
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(("output" + "." + "pdf"), CharsetUtil.UTF_8));
PdfWriter writer = PdfWriter.getInstance(document, response.getOutputStream());
writer.setPageEvent(new HeaderAndFooterEvent());
document.open();

@ -2,6 +2,7 @@ package com.sztzjy.fund_investment.controller;
import com.sztzjy.fund_investment.annotation.AnonymousAccess;
import com.sztzjy.fund_investment.entity.EduProjectValuation;
import com.sztzjy.fund_investment.service.ISysProjectValuationAnswerSerivce;
import com.sztzjy.fund_investment.service.ISysProjectValuationService;
import com.sztzjy.fund_investment.util.ResultEntity;
import io.swagger.annotations.Api;
@ -14,6 +15,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.math.BigDecimal;
import java.util.List;
//yz
@ -23,6 +25,8 @@ import java.util.List;
public class ProjectValuation {
@Autowired
ISysProjectValuationService projectValuationService;
@Autowired
ISysProjectValuationAnswerSerivce projectValuationAnswerSerivce;
@GetMapping("getPE")
@ApiOperation("相对估值法-PE市盈率法")
@ -33,7 +37,7 @@ public class ProjectValuation {
}
@GetMapping("getPB")
@ApiOperation("相对估值法-PE市盈率法")
@ApiOperation("相对估值法-PB市盈率法")
@AnonymousAccess
public ResultEntity<List<EduProjectValuation>> getPB(@ApiParam("流程ID") @RequestParam String flowId) {
List<EduProjectValuation> projectValuationList=projectValuationService.getPB(flowId);
@ -41,11 +45,58 @@ public class ProjectValuation {
}
@GetMapping("getPS")
@ApiOperation("相对估值法-PE市盈率法")
@ApiOperation("相对估值法-PS市盈率法")
@AnonymousAccess
public ResultEntity<List<EduProjectValuation>> getPS(@ApiParam("流程ID") @RequestParam String flowId) {
List<EduProjectValuation> projectValuationList=projectValuationService.getPS(flowId);
return new ResultEntity(HttpStatus.OK, "相对估值法-PS市盈率法展示成功", projectValuationList);
}
@GetMapping("getValuePerShare")
@ApiOperation("相对估值法-PE/PB/PS市盈率法-每股价值")
@AnonymousAccess
public ResultEntity<List<EduProjectValuation>> getPEValuePerShare(@ApiParam("流程ID") @RequestParam String flowId,
@ApiParam("PE/PB/PS") @RequestParam String method) {
BigDecimal valuePerShare=projectValuationAnswerSerivce.selectByFlowIdAndMethod(flowId,method);
return new ResultEntity(HttpStatus.OK, "相对估值法-"+method+"市盈率法-每股价值", valuePerShare);
}
@GetMapping("updatePE")
@ApiOperation("相对估值法-PE市盈率法-修改")
@AnonymousAccess
public ResultEntity updatePE(@ApiParam("流程ID") @RequestParam String flowId,
@ApiParam("修改值") @RequestParam BigDecimal valuePerShare) {
Boolean aBoolean = projectValuationService.updatePE(flowId, valuePerShare);
if(aBoolean){
return new ResultEntity(HttpStatus.OK, "相对估值法-PE市盈率法修改成功");
}
return new ResultEntity(HttpStatus.BAD_REQUEST, "您计算的值有误,请检查!(相对估值法-PE市盈率法)");
}
@GetMapping("updatePB")
@ApiOperation("相对估值法-PB市盈率法-修改")
@AnonymousAccess
public ResultEntity updatePB(@ApiParam("流程ID") @RequestParam String flowId,
@ApiParam("修改值") @RequestParam BigDecimal valuePerShare) {
Boolean aBoolean = projectValuationService.updatePB(flowId, valuePerShare);
if(aBoolean){
return new ResultEntity(HttpStatus.OK, "相对估值法-PB市盈率法修改成功");
}
return new ResultEntity(HttpStatus.BAD_REQUEST, "您计算的值有误,请检查!(相对估值法-PB市盈率法)");
}
@GetMapping("updatePS")
@ApiOperation("相对估值法-PS市盈率法-修改")
@AnonymousAccess
public ResultEntity updatePS(@ApiParam("流程ID") @RequestParam String flowId,
@ApiParam("修改值") @RequestParam BigDecimal valuePerShare) {
Boolean aBoolean = projectValuationService.updatePS(flowId, valuePerShare);
if(aBoolean){
return new ResultEntity(HttpStatus.OK, "相对估值法-PS市盈率法修改成功");
}
return new ResultEntity(HttpStatus.BAD_REQUEST, "您计算的值有误,请检查!(相对估值法-PS市盈率法)");
}
}

@ -0,0 +1,55 @@
package com.sztzjy.fund_investment.entity;
import java.math.BigDecimal;
import io.swagger.annotations.ApiModelProperty;
/**
*
* @author xcj
* edu_project_valuation_answer
*/
public class EduProjectValuationAnswer {
@ApiModelProperty("相对估值法答案ID")
private String answerId;
@ApiModelProperty("流程ID")
private String flowId;
@ApiModelProperty("使用方法 PE PB PS")
private String method;
@ApiModelProperty("每股价值")
private BigDecimal valuePerShare;
public String getAnswerId() {
return answerId;
}
public void setAnswerId(String answerId) {
this.answerId = answerId == null ? null : answerId.trim();
}
public String getFlowId() {
return flowId;
}
public void setFlowId(String flowId) {
this.flowId = flowId == null ? null : flowId.trim();
}
public String getMethod() {
return method;
}
public void setMethod(String method) {
this.method = method == null ? null : method.trim();
}
public BigDecimal getValuePerShare() {
return valuePerShare;
}
public void setValuePerShare(BigDecimal valuePerShare) {
this.valuePerShare = valuePerShare;
}
}

@ -0,0 +1,470 @@
package com.sztzjy.fund_investment.entity;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
public class EduProjectValuationAnswerExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public EduProjectValuationAnswerExample() {
oredCriteria = new ArrayList<>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andAnswerIdIsNull() {
addCriterion("answer_id is null");
return (Criteria) this;
}
public Criteria andAnswerIdIsNotNull() {
addCriterion("answer_id is not null");
return (Criteria) this;
}
public Criteria andAnswerIdEqualTo(String value) {
addCriterion("answer_id =", value, "answerId");
return (Criteria) this;
}
public Criteria andAnswerIdNotEqualTo(String value) {
addCriterion("answer_id <>", value, "answerId");
return (Criteria) this;
}
public Criteria andAnswerIdGreaterThan(String value) {
addCriterion("answer_id >", value, "answerId");
return (Criteria) this;
}
public Criteria andAnswerIdGreaterThanOrEqualTo(String value) {
addCriterion("answer_id >=", value, "answerId");
return (Criteria) this;
}
public Criteria andAnswerIdLessThan(String value) {
addCriterion("answer_id <", value, "answerId");
return (Criteria) this;
}
public Criteria andAnswerIdLessThanOrEqualTo(String value) {
addCriterion("answer_id <=", value, "answerId");
return (Criteria) this;
}
public Criteria andAnswerIdLike(String value) {
addCriterion("answer_id like", value, "answerId");
return (Criteria) this;
}
public Criteria andAnswerIdNotLike(String value) {
addCriterion("answer_id not like", value, "answerId");
return (Criteria) this;
}
public Criteria andAnswerIdIn(List<String> values) {
addCriterion("answer_id in", values, "answerId");
return (Criteria) this;
}
public Criteria andAnswerIdNotIn(List<String> values) {
addCriterion("answer_id not in", values, "answerId");
return (Criteria) this;
}
public Criteria andAnswerIdBetween(String value1, String value2) {
addCriterion("answer_id between", value1, value2, "answerId");
return (Criteria) this;
}
public Criteria andAnswerIdNotBetween(String value1, String value2) {
addCriterion("answer_id not between", value1, value2, "answerId");
return (Criteria) this;
}
public Criteria andFlowIdIsNull() {
addCriterion("flow_id is null");
return (Criteria) this;
}
public Criteria andFlowIdIsNotNull() {
addCriterion("flow_id is not null");
return (Criteria) this;
}
public Criteria andFlowIdEqualTo(String value) {
addCriterion("flow_id =", value, "flowId");
return (Criteria) this;
}
public Criteria andFlowIdNotEqualTo(String value) {
addCriterion("flow_id <>", value, "flowId");
return (Criteria) this;
}
public Criteria andFlowIdGreaterThan(String value) {
addCriterion("flow_id >", value, "flowId");
return (Criteria) this;
}
public Criteria andFlowIdGreaterThanOrEqualTo(String value) {
addCriterion("flow_id >=", value, "flowId");
return (Criteria) this;
}
public Criteria andFlowIdLessThan(String value) {
addCriterion("flow_id <", value, "flowId");
return (Criteria) this;
}
public Criteria andFlowIdLessThanOrEqualTo(String value) {
addCriterion("flow_id <=", value, "flowId");
return (Criteria) this;
}
public Criteria andFlowIdLike(String value) {
addCriterion("flow_id like", value, "flowId");
return (Criteria) this;
}
public Criteria andFlowIdNotLike(String value) {
addCriterion("flow_id not like", value, "flowId");
return (Criteria) this;
}
public Criteria andFlowIdIn(List<String> values) {
addCriterion("flow_id in", values, "flowId");
return (Criteria) this;
}
public Criteria andFlowIdNotIn(List<String> values) {
addCriterion("flow_id not in", values, "flowId");
return (Criteria) this;
}
public Criteria andFlowIdBetween(String value1, String value2) {
addCriterion("flow_id between", value1, value2, "flowId");
return (Criteria) this;
}
public Criteria andFlowIdNotBetween(String value1, String value2) {
addCriterion("flow_id not between", value1, value2, "flowId");
return (Criteria) this;
}
public Criteria andMethodIsNull() {
addCriterion("method is null");
return (Criteria) this;
}
public Criteria andMethodIsNotNull() {
addCriterion("method is not null");
return (Criteria) this;
}
public Criteria andMethodEqualTo(String value) {
addCriterion("method =", value, "method");
return (Criteria) this;
}
public Criteria andMethodNotEqualTo(String value) {
addCriterion("method <>", value, "method");
return (Criteria) this;
}
public Criteria andMethodGreaterThan(String value) {
addCriterion("method >", value, "method");
return (Criteria) this;
}
public Criteria andMethodGreaterThanOrEqualTo(String value) {
addCriterion("method >=", value, "method");
return (Criteria) this;
}
public Criteria andMethodLessThan(String value) {
addCriterion("method <", value, "method");
return (Criteria) this;
}
public Criteria andMethodLessThanOrEqualTo(String value) {
addCriterion("method <=", value, "method");
return (Criteria) this;
}
public Criteria andMethodLike(String value) {
addCriterion("method like", value, "method");
return (Criteria) this;
}
public Criteria andMethodNotLike(String value) {
addCriterion("method not like", value, "method");
return (Criteria) this;
}
public Criteria andMethodIn(List<String> values) {
addCriterion("method in", values, "method");
return (Criteria) this;
}
public Criteria andMethodNotIn(List<String> values) {
addCriterion("method not in", values, "method");
return (Criteria) this;
}
public Criteria andMethodBetween(String value1, String value2) {
addCriterion("method between", value1, value2, "method");
return (Criteria) this;
}
public Criteria andMethodNotBetween(String value1, String value2) {
addCriterion("method not between", value1, value2, "method");
return (Criteria) this;
}
public Criteria andValuePerShareIsNull() {
addCriterion("value_per_share is null");
return (Criteria) this;
}
public Criteria andValuePerShareIsNotNull() {
addCriterion("value_per_share is not null");
return (Criteria) this;
}
public Criteria andValuePerShareEqualTo(BigDecimal value) {
addCriterion("value_per_share =", value, "valuePerShare");
return (Criteria) this;
}
public Criteria andValuePerShareNotEqualTo(BigDecimal value) {
addCriterion("value_per_share <>", value, "valuePerShare");
return (Criteria) this;
}
public Criteria andValuePerShareGreaterThan(BigDecimal value) {
addCriterion("value_per_share >", value, "valuePerShare");
return (Criteria) this;
}
public Criteria andValuePerShareGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("value_per_share >=", value, "valuePerShare");
return (Criteria) this;
}
public Criteria andValuePerShareLessThan(BigDecimal value) {
addCriterion("value_per_share <", value, "valuePerShare");
return (Criteria) this;
}
public Criteria andValuePerShareLessThanOrEqualTo(BigDecimal value) {
addCriterion("value_per_share <=", value, "valuePerShare");
return (Criteria) this;
}
public Criteria andValuePerShareIn(List<BigDecimal> values) {
addCriterion("value_per_share in", values, "valuePerShare");
return (Criteria) this;
}
public Criteria andValuePerShareNotIn(List<BigDecimal> values) {
addCriterion("value_per_share not in", values, "valuePerShare");
return (Criteria) this;
}
public Criteria andValuePerShareBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("value_per_share between", value1, value2, "valuePerShare");
return (Criteria) this;
}
public Criteria andValuePerShareNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("value_per_share not between", value1, value2, "valuePerShare");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

@ -27,7 +27,7 @@ public class ProfitManagement {
@ApiModelProperty("持股数量")
private BigDecimal shareCount;
@ApiModelProperty("上市时间/数据库存的是以日为单位的数字/一个月为30")
@ApiModelProperty("上市时间")
private Integer marketTime;
@ApiModelProperty("股票价格")

@ -0,0 +1,32 @@
package com.sztzjy.fund_investment.mapper;
import com.sztzjy.fund_investment.entity.EduProjectValuationAnswer;
import com.sztzjy.fund_investment.entity.EduProjectValuationAnswerExample;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface EduProjectValuationAnswerMapper {
long countByExample(EduProjectValuationAnswerExample example);
int deleteByExample(EduProjectValuationAnswerExample example);
int deleteByPrimaryKey(String answerId);
int insert(EduProjectValuationAnswer record);
int insertSelective(EduProjectValuationAnswer record);
List<EduProjectValuationAnswer> selectByExample(EduProjectValuationAnswerExample example);
EduProjectValuationAnswer selectByPrimaryKey(String answerId);
int updateByExampleSelective(@Param("record") EduProjectValuationAnswer record, @Param("example") EduProjectValuationAnswerExample example);
int updateByExample(@Param("record") EduProjectValuationAnswer record, @Param("example") EduProjectValuationAnswerExample example);
int updateByPrimaryKeySelective(EduProjectValuationAnswer record);
int updateByPrimaryKey(EduProjectValuationAnswer record);
}

@ -3,10 +3,8 @@ package com.sztzjy.fund_investment.mapper;
import com.sztzjy.fund_investment.entity.ProfitManagement;
import com.sztzjy.fund_investment.entity.ProfitManagementExample;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface ProfitManagementMapper {
long countByExample(ProfitManagementExample example);

@ -0,0 +1,7 @@
package com.sztzjy.fund_investment.service;
import java.math.BigDecimal;
public interface ISysProjectValuationAnswerSerivce {
BigDecimal selectByFlowIdAndMethod(String flowId, String method);
}

@ -2,10 +2,17 @@ package com.sztzjy.fund_investment.service;
import com.sztzjy.fund_investment.entity.EduProjectValuation;
import java.math.BigDecimal;
import java.util.List;
public interface ISysProjectValuationService {
List<EduProjectValuation> getPE(String flowId);
List<EduProjectValuation> getPB(String flowId);
List<EduProjectValuation> getPS(String flowId);
Boolean updatePE(String flowId, BigDecimal valuePerShare);
Boolean updatePB(String flowId, BigDecimal valuePerShare);
Boolean updatePS(String flowId, BigDecimal valuePerShare);
}

@ -0,0 +1,30 @@
package com.sztzjy.fund_investment.service.serviceImpl;
import com.sztzjy.fund_investment.entity.EduProjectValuationAnswer;
import com.sztzjy.fund_investment.entity.EduProjectValuationAnswerExample;
import com.sztzjy.fund_investment.mapper.EduProjectValuationAnswerMapper;
import com.sztzjy.fund_investment.service.ISysProjectValuationAnswerSerivce;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.List;
@Service
public class SysProjectValuationAnswerSerivceImpl implements ISysProjectValuationAnswerSerivce {
@Autowired
EduProjectValuationAnswerMapper answerMapper;
@Override
public BigDecimal selectByFlowIdAndMethod(String flowId, String method) {
EduProjectValuationAnswerExample example = new EduProjectValuationAnswerExample();
EduProjectValuationAnswerExample.Criteria criteria = example.createCriteria();
criteria.andFlowIdEqualTo(flowId).andMethodEqualTo(method);
List<EduProjectValuationAnswer> eduProjectValuationAnswers = answerMapper.selectByExample(example);
if(eduProjectValuationAnswers.size()==0){
return BigDecimal.ZERO;
}
BigDecimal valuePerShare = answerMapper.selectByExample(example).get(0).getValuePerShare();
return valuePerShare;
}
}

@ -1,14 +1,19 @@
package com.sztzjy.fund_investment.service.serviceImpl;
import com.sztzjy.fund_investment.entity.EduProjectValuation;
import com.sztzjy.fund_investment.entity.EduProjectValuationAnswer;
import com.sztzjy.fund_investment.entity.EduProjectValuationExample;
import com.sztzjy.fund_investment.mapper.EduProjectValuationAnswerMapper;
import com.sztzjy.fund_investment.mapper.EduProjectValuationMapper;
import com.sztzjy.fund_investment.mapper.FoundProjectMapper;
import com.sztzjy.fund_investment.service.ISysProjectValuationAnswerSerivce;
import com.sztzjy.fund_investment.service.ISysProjectValuationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.List;
import java.util.UUID;
@Service
public class SysProjectValuationServiceImpl implements ISysProjectValuationService {
@ -16,6 +21,10 @@ public class SysProjectValuationServiceImpl implements ISysProjectValuationServi
FoundProjectMapper foundProjectMapper;
@Autowired
EduProjectValuationMapper projectValuationMapper;
@Autowired
EduProjectValuationAnswerMapper projectValuationAnswerMapper;
@Autowired
ISysProjectValuationAnswerSerivce answerSerivce;
@Override
public List<EduProjectValuation> getPE(String flowId) {
@ -46,4 +55,124 @@ public class SysProjectValuationServiceImpl implements ISysProjectValuationServi
List<EduProjectValuation> projectValuationList = projectValuationMapper.selectByExample(example);
return projectValuationList;
}
//更新PE每股价值
//1判断每股价值是否正确
//2insert到edu_project_valuation_answer中
//计算规则 3个对比公司 (每股市价/每股收益/增长率)取平均 *增长率*每股价值
@Override
public Boolean updatePE(String flowId, BigDecimal valuePerShare) {
BigDecimal bigDecimal = answerSerivce.selectByFlowIdAndMethod(flowId, "PE");
if (bigDecimal.compareTo(BigDecimal.ZERO)>0){
return true;
}
List<EduProjectValuation> valuationList = getPE(flowId);
BigDecimal flag=BigDecimal.ZERO;
BigDecimal growthRate1=BigDecimal.ZERO;
BigDecimal earnings1=BigDecimal.ZERO;
for (int i = 0; i < valuationList.size(); i++) {
EduProjectValuation valuation = valuationList.get(i);
if(flag.compareTo(BigDecimal.ZERO)==0){
growthRate1=valuation.getGrowthRate1();
earnings1=valuation.getEarnings1();
}
BigDecimal marketPrice = valuation.getMarketPrice(); //对比公司 每股市价
BigDecimal earnings = valuation.getEarnings(); //对比公司 每股收益
BigDecimal growthRate = valuation.getGrowthRate(); //对比公司 增长率
flag = flag.add(marketPrice.divide(earnings).divide(growthRate));
}
BigDecimal avg = flag.divide(BigDecimal.valueOf(3)); //平均数
BigDecimal answer = avg.multiply(growthRate1).multiply(earnings1).setScale(2,BigDecimal.ROUND_HALF_UP);
if(answer.compareTo(valuePerShare)!=0){
return false;
}
if(bigDecimal.compareTo(BigDecimal.ZERO)==0){
EduProjectValuationAnswer projectValuationAnswer=new EduProjectValuationAnswer();
String uuid = String.valueOf(UUID.randomUUID());
projectValuationAnswer.setAnswerId(uuid);
projectValuationAnswer.setFlowId(flowId);
projectValuationAnswer.setMethod("PE");
projectValuationAnswer.setValuePerShare(answer);
projectValuationAnswerMapper.insert(projectValuationAnswer);
}
return true;
}
@Override
public Boolean updatePB(String flowId, BigDecimal valuePerShare) {
BigDecimal bigDecimal = answerSerivce.selectByFlowIdAndMethod(flowId, "PB");
if (bigDecimal.compareTo(BigDecimal.ZERO)>0){
return true;
}
List<EduProjectValuation> valuationList = getPB(flowId);
BigDecimal flag=BigDecimal.ZERO;
BigDecimal netWorth1=BigDecimal.ZERO;
BigDecimal netInterest1=BigDecimal.ZERO;
for (int i = 0; i < valuationList.size(); i++) {
EduProjectValuation valuation = valuationList.get(i);
if(flag.compareTo(BigDecimal.ZERO)==0){
netWorth1 = valuation.getNetWorth1();
netInterest1 = valuation.getNetInterest1();
}
BigDecimal marketPrice = valuation.getMarketPrice(); //对比公司 每股市价
BigDecimal netWorth = valuation.getNetWorth();//对比公司 每股净资产
BigDecimal netInterest = valuation.getNetInterest();//对比公司 权益净利率
flag = flag.add(marketPrice.divide(netWorth).divide(netInterest));
}
BigDecimal avg = flag.divide(BigDecimal.valueOf(3)); //平均数
BigDecimal answer = avg.multiply(netWorth1).multiply(netInterest1).setScale(2,BigDecimal.ROUND_HALF_UP);
if(answer.compareTo(valuePerShare)!=0){
return false;
}
if(bigDecimal.compareTo(BigDecimal.ZERO)==0){
EduProjectValuationAnswer projectValuationAnswer=new EduProjectValuationAnswer();
String uuid = String.valueOf(UUID.randomUUID());
projectValuationAnswer.setAnswerId(uuid);
projectValuationAnswer.setFlowId(flowId);
projectValuationAnswer.setMethod("PB");
projectValuationAnswer.setValuePerShare(answer);
projectValuationAnswerMapper.insert(projectValuationAnswer);
}
return true;
}
@Override
public Boolean updatePS(String flowId, BigDecimal valuePerShare) {
BigDecimal bigDecimal = answerSerivce.selectByFlowIdAndMethod(flowId, "PS");
if (bigDecimal.compareTo(BigDecimal.ZERO)>0){
return true;
}
List<EduProjectValuation> valuationList = getPB(flowId);
BigDecimal flag=BigDecimal.ZERO;
BigDecimal operatingIncome1=BigDecimal.ZERO;
BigDecimal netOperatinginterestRate1=BigDecimal.ZERO;
for (int i = 0; i < valuationList.size(); i++) {
EduProjectValuation valuation = valuationList.get(i);
if(flag.compareTo(BigDecimal.ZERO)==0){
operatingIncome1 = valuation.getOperatingIncome1();
netOperatinginterestRate1 = valuation.getNetOperatinginterestRate1();
}
BigDecimal marketPrice = valuation.getMarketPrice(); //对比公司 每股市价
BigDecimal operatingIncome = valuation.getOperatingIncome();//对比公司 每股营业收入
BigDecimal netOperatinginterestRate = valuation.getNetOperatinginterestRate();//对比公司 营业净利率
flag = flag.add(marketPrice.divide(operatingIncome).divide(netOperatinginterestRate));
}
BigDecimal avg = flag.divide(BigDecimal.valueOf(3)); //平均数
BigDecimal answer = avg.multiply(operatingIncome1).multiply(netOperatinginterestRate1).setScale(2,BigDecimal.ROUND_HALF_UP);
if(answer.compareTo(valuePerShare)!=0){
return false;
}
if(bigDecimal.compareTo(BigDecimal.ZERO)==0){
EduProjectValuationAnswer projectValuationAnswer=new EduProjectValuationAnswer();
String uuid = String.valueOf(UUID.randomUUID());
projectValuationAnswer.setAnswerId(uuid);
projectValuationAnswer.setFlowId(flowId);
projectValuationAnswer.setMethod("PS");
projectValuationAnswer.setValuePerShare(answer);
projectValuationAnswerMapper.insert(projectValuationAnswer);
}
return true;
}
}

@ -0,0 +1,196 @@
<?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.EduProjectValuationAnswerMapper">
<resultMap id="BaseResultMap" type="com.sztzjy.fund_investment.entity.EduProjectValuationAnswer">
<id column="answer_id" jdbcType="VARCHAR" property="answerId" />
<result column="flow_id" jdbcType="VARCHAR" property="flowId" />
<result column="method" jdbcType="VARCHAR" property="method" />
<result column="value_per_share" jdbcType="DECIMAL" property="valuePerShare" />
</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">
answer_id, flow_id, method, value_per_share
</sql>
<select id="selectByExample" parameterType="com.sztzjy.fund_investment.entity.EduProjectValuationAnswerExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from edu_project_valuation_answer
<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 edu_project_valuation_answer
where answer_id = #{answerId,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from edu_project_valuation_answer
where answer_id = #{answerId,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="com.sztzjy.fund_investment.entity.EduProjectValuationAnswerExample">
delete from edu_project_valuation_answer
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.sztzjy.fund_investment.entity.EduProjectValuationAnswer">
insert into edu_project_valuation_answer (answer_id, flow_id, method,
value_per_share)
values (#{answerId,jdbcType=VARCHAR}, #{flowId,jdbcType=VARCHAR}, #{method,jdbcType=VARCHAR},
#{valuePerShare,jdbcType=DECIMAL})
</insert>
<insert id="insertSelective" parameterType="com.sztzjy.fund_investment.entity.EduProjectValuationAnswer">
insert into edu_project_valuation_answer
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="answerId != null">
answer_id,
</if>
<if test="flowId != null">
flow_id,
</if>
<if test="method != null">
method,
</if>
<if test="valuePerShare != null">
value_per_share,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="answerId != null">
#{answerId,jdbcType=VARCHAR},
</if>
<if test="flowId != null">
#{flowId,jdbcType=VARCHAR},
</if>
<if test="method != null">
#{method,jdbcType=VARCHAR},
</if>
<if test="valuePerShare != null">
#{valuePerShare,jdbcType=DECIMAL},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.sztzjy.fund_investment.entity.EduProjectValuationAnswerExample" resultType="java.lang.Long">
select count(*) from edu_project_valuation_answer
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update edu_project_valuation_answer
<set>
<if test="record.answerId != null">
answer_id = #{record.answerId,jdbcType=VARCHAR},
</if>
<if test="record.flowId != null">
flow_id = #{record.flowId,jdbcType=VARCHAR},
</if>
<if test="record.method != null">
method = #{record.method,jdbcType=VARCHAR},
</if>
<if test="record.valuePerShare != null">
value_per_share = #{record.valuePerShare,jdbcType=DECIMAL},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update edu_project_valuation_answer
set answer_id = #{record.answerId,jdbcType=VARCHAR},
flow_id = #{record.flowId,jdbcType=VARCHAR},
method = #{record.method,jdbcType=VARCHAR},
value_per_share = #{record.valuePerShare,jdbcType=DECIMAL}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.fund_investment.entity.EduProjectValuationAnswer">
update edu_project_valuation_answer
<set>
<if test="flowId != null">
flow_id = #{flowId,jdbcType=VARCHAR},
</if>
<if test="method != null">
method = #{method,jdbcType=VARCHAR},
</if>
<if test="valuePerShare != null">
value_per_share = #{valuePerShare,jdbcType=DECIMAL},
</if>
</set>
where answer_id = #{answerId,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.sztzjy.fund_investment.entity.EduProjectValuationAnswer">
update edu_project_valuation_answer
set flow_id = #{flowId,jdbcType=VARCHAR},
method = #{method,jdbcType=VARCHAR},
value_per_share = #{valuePerShare,jdbcType=DECIMAL}
where answer_id = #{answerId,jdbcType=VARCHAR}
</update>
</mapper>

@ -288,4 +288,578 @@
fund_earnings = #{fundEarnings,jdbcType=DECIMAL}
where id = #{id,jdbcType=VARCHAR}
</update>
<resultMap id="BaseResultMap" type="com.sztzjy.fund_investment.entity.ProfitManagement">
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="flow_id" jdbcType="VARCHAR" property="flowId" />
<result column="investment_amount" jdbcType="DECIMAL" property="investmentAmount" />
<result column="share_ratio" jdbcType="DECIMAL" property="shareRatio" />
<result column="total_equity" jdbcType="DECIMAL" property="totalEquity" />
<result column="share_count" jdbcType="DECIMAL" property="shareCount" />
<result column="market_time" jdbcType="INTEGER" property="marketTime" />
<result column="stock_price" jdbcType="DECIMAL" property="stockPrice" />
<result column="market_value" jdbcType="DECIMAL" property="marketValue" />
<result column="fund_earnings" jdbcType="DECIMAL" property="fundEarnings" />
</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, investment_amount, share_ratio, total_equity, share_count, market_time,
stock_price, market_value, fund_earnings
</sql>
<select id="selectByExample" parameterType="com.sztzjy.fund_investment.entity.ProfitManagementExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from profit_management
<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_management
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from profit_management
where id = #{id,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="com.sztzjy.fund_investment.entity.ProfitManagementExample">
delete from profit_management
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.sztzjy.fund_investment.entity.ProfitManagement">
insert into profit_management (id, flow_id, investment_amount,
share_ratio, total_equity, share_count,
market_time, stock_price, market_value,
fund_earnings)
values (#{id,jdbcType=VARCHAR}, #{flowId,jdbcType=VARCHAR}, #{investmentAmount,jdbcType=DECIMAL},
#{shareRatio,jdbcType=DECIMAL}, #{totalEquity,jdbcType=DECIMAL}, #{shareCount,jdbcType=DECIMAL},
#{marketTime,jdbcType=INTEGER}, #{stockPrice,jdbcType=DECIMAL}, #{marketValue,jdbcType=DECIMAL},
#{fundEarnings,jdbcType=DECIMAL})
</insert>
<insert id="insertSelective" parameterType="com.sztzjy.fund_investment.entity.ProfitManagement">
insert into profit_management
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="flowId != null">
flow_id,
</if>
<if test="investmentAmount != null">
investment_amount,
</if>
<if test="shareRatio != null">
share_ratio,
</if>
<if test="totalEquity != null">
total_equity,
</if>
<if test="shareCount != null">
share_count,
</if>
<if test="marketTime != null">
market_time,
</if>
<if test="stockPrice != null">
stock_price,
</if>
<if test="marketValue != null">
market_value,
</if>
<if test="fundEarnings != null">
fund_earnings,
</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="investmentAmount != null">
#{investmentAmount,jdbcType=DECIMAL},
</if>
<if test="shareRatio != null">
#{shareRatio,jdbcType=DECIMAL},
</if>
<if test="totalEquity != null">
#{totalEquity,jdbcType=DECIMAL},
</if>
<if test="shareCount != null">
#{shareCount,jdbcType=DECIMAL},
</if>
<if test="marketTime != null">
#{marketTime,jdbcType=INTEGER},
</if>
<if test="stockPrice != null">
#{stockPrice,jdbcType=DECIMAL},
</if>
<if test="marketValue != null">
#{marketValue,jdbcType=DECIMAL},
</if>
<if test="fundEarnings != null">
#{fundEarnings,jdbcType=DECIMAL},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.sztzjy.fund_investment.entity.ProfitManagementExample" resultType="java.lang.Long">
select count(*) from profit_management
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update profit_management
<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.investmentAmount != null">
investment_amount = #{record.investmentAmount,jdbcType=DECIMAL},
</if>
<if test="record.shareRatio != null">
share_ratio = #{record.shareRatio,jdbcType=DECIMAL},
</if>
<if test="record.totalEquity != null">
total_equity = #{record.totalEquity,jdbcType=DECIMAL},
</if>
<if test="record.shareCount != null">
share_count = #{record.shareCount,jdbcType=DECIMAL},
</if>
<if test="record.marketTime != null">
market_time = #{record.marketTime,jdbcType=INTEGER},
</if>
<if test="record.stockPrice != null">
stock_price = #{record.stockPrice,jdbcType=DECIMAL},
</if>
<if test="record.marketValue != null">
market_value = #{record.marketValue,jdbcType=DECIMAL},
</if>
<if test="record.fundEarnings != null">
fund_earnings = #{record.fundEarnings,jdbcType=DECIMAL},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update profit_management
set id = #{record.id,jdbcType=VARCHAR},
flow_id = #{record.flowId,jdbcType=VARCHAR},
investment_amount = #{record.investmentAmount,jdbcType=DECIMAL},
share_ratio = #{record.shareRatio,jdbcType=DECIMAL},
total_equity = #{record.totalEquity,jdbcType=DECIMAL},
share_count = #{record.shareCount,jdbcType=DECIMAL},
market_time = #{record.marketTime,jdbcType=INTEGER},
stock_price = #{record.stockPrice,jdbcType=DECIMAL},
market_value = #{record.marketValue,jdbcType=DECIMAL},
fund_earnings = #{record.fundEarnings,jdbcType=DECIMAL}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.fund_investment.entity.ProfitManagement">
update profit_management
<set>
<if test="flowId != null">
flow_id = #{flowId,jdbcType=VARCHAR},
</if>
<if test="investmentAmount != null">
investment_amount = #{investmentAmount,jdbcType=DECIMAL},
</if>
<if test="shareRatio != null">
share_ratio = #{shareRatio,jdbcType=DECIMAL},
</if>
<if test="totalEquity != null">
total_equity = #{totalEquity,jdbcType=DECIMAL},
</if>
<if test="shareCount != null">
share_count = #{shareCount,jdbcType=DECIMAL},
</if>
<if test="marketTime != null">
market_time = #{marketTime,jdbcType=INTEGER},
</if>
<if test="stockPrice != null">
stock_price = #{stockPrice,jdbcType=DECIMAL},
</if>
<if test="marketValue != null">
market_value = #{marketValue,jdbcType=DECIMAL},
</if>
<if test="fundEarnings != null">
fund_earnings = #{fundEarnings,jdbcType=DECIMAL},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.sztzjy.fund_investment.entity.ProfitManagement">
update profit_management
set flow_id = #{flowId,jdbcType=VARCHAR},
investment_amount = #{investmentAmount,jdbcType=DECIMAL},
share_ratio = #{shareRatio,jdbcType=DECIMAL},
total_equity = #{totalEquity,jdbcType=DECIMAL},
share_count = #{shareCount,jdbcType=DECIMAL},
market_time = #{marketTime,jdbcType=INTEGER},
stock_price = #{stockPrice,jdbcType=DECIMAL},
market_value = #{marketValue,jdbcType=DECIMAL},
fund_earnings = #{fundEarnings,jdbcType=DECIMAL}
where id = #{id,jdbcType=VARCHAR}
</update>
<resultMap id="BaseResultMap" type="com.sztzjy.fund_investment.entity.ProfitManagement">
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="flow_id" jdbcType="VARCHAR" property="flowId" />
<result column="investment_amount" jdbcType="DECIMAL" property="investmentAmount" />
<result column="share_ratio" jdbcType="DECIMAL" property="shareRatio" />
<result column="total_equity" jdbcType="DECIMAL" property="totalEquity" />
<result column="share_count" jdbcType="DECIMAL" property="shareCount" />
<result column="market_time" jdbcType="INTEGER" property="marketTime" />
<result column="stock_price" jdbcType="DECIMAL" property="stockPrice" />
<result column="market_value" jdbcType="DECIMAL" property="marketValue" />
<result column="fund_earnings" jdbcType="DECIMAL" property="fundEarnings" />
</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, investment_amount, share_ratio, total_equity, share_count, market_time,
stock_price, market_value, fund_earnings
</sql>
<select id="selectByExample" parameterType="com.sztzjy.fund_investment.entity.ProfitManagementExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from profit_management
<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_management
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from profit_management
where id = #{id,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="com.sztzjy.fund_investment.entity.ProfitManagementExample">
delete from profit_management
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.sztzjy.fund_investment.entity.ProfitManagement">
insert into profit_management (id, flow_id, investment_amount,
share_ratio, total_equity, share_count,
market_time, stock_price, market_value,
fund_earnings)
values (#{id,jdbcType=VARCHAR}, #{flowId,jdbcType=VARCHAR}, #{investmentAmount,jdbcType=DECIMAL},
#{shareRatio,jdbcType=DECIMAL}, #{totalEquity,jdbcType=DECIMAL}, #{shareCount,jdbcType=DECIMAL},
#{marketTime,jdbcType=INTEGER}, #{stockPrice,jdbcType=DECIMAL}, #{marketValue,jdbcType=DECIMAL},
#{fundEarnings,jdbcType=DECIMAL})
</insert>
<insert id="insertSelective" parameterType="com.sztzjy.fund_investment.entity.ProfitManagement">
insert into profit_management
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="flowId != null">
flow_id,
</if>
<if test="investmentAmount != null">
investment_amount,
</if>
<if test="shareRatio != null">
share_ratio,
</if>
<if test="totalEquity != null">
total_equity,
</if>
<if test="shareCount != null">
share_count,
</if>
<if test="marketTime != null">
market_time,
</if>
<if test="stockPrice != null">
stock_price,
</if>
<if test="marketValue != null">
market_value,
</if>
<if test="fundEarnings != null">
fund_earnings,
</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="investmentAmount != null">
#{investmentAmount,jdbcType=DECIMAL},
</if>
<if test="shareRatio != null">
#{shareRatio,jdbcType=DECIMAL},
</if>
<if test="totalEquity != null">
#{totalEquity,jdbcType=DECIMAL},
</if>
<if test="shareCount != null">
#{shareCount,jdbcType=DECIMAL},
</if>
<if test="marketTime != null">
#{marketTime,jdbcType=INTEGER},
</if>
<if test="stockPrice != null">
#{stockPrice,jdbcType=DECIMAL},
</if>
<if test="marketValue != null">
#{marketValue,jdbcType=DECIMAL},
</if>
<if test="fundEarnings != null">
#{fundEarnings,jdbcType=DECIMAL},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.sztzjy.fund_investment.entity.ProfitManagementExample" resultType="java.lang.Long">
select count(*) from profit_management
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update profit_management
<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.investmentAmount != null">
investment_amount = #{record.investmentAmount,jdbcType=DECIMAL},
</if>
<if test="record.shareRatio != null">
share_ratio = #{record.shareRatio,jdbcType=DECIMAL},
</if>
<if test="record.totalEquity != null">
total_equity = #{record.totalEquity,jdbcType=DECIMAL},
</if>
<if test="record.shareCount != null">
share_count = #{record.shareCount,jdbcType=DECIMAL},
</if>
<if test="record.marketTime != null">
market_time = #{record.marketTime,jdbcType=INTEGER},
</if>
<if test="record.stockPrice != null">
stock_price = #{record.stockPrice,jdbcType=DECIMAL},
</if>
<if test="record.marketValue != null">
market_value = #{record.marketValue,jdbcType=DECIMAL},
</if>
<if test="record.fundEarnings != null">
fund_earnings = #{record.fundEarnings,jdbcType=DECIMAL},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update profit_management
set id = #{record.id,jdbcType=VARCHAR},
flow_id = #{record.flowId,jdbcType=VARCHAR},
investment_amount = #{record.investmentAmount,jdbcType=DECIMAL},
share_ratio = #{record.shareRatio,jdbcType=DECIMAL},
total_equity = #{record.totalEquity,jdbcType=DECIMAL},
share_count = #{record.shareCount,jdbcType=DECIMAL},
market_time = #{record.marketTime,jdbcType=INTEGER},
stock_price = #{record.stockPrice,jdbcType=DECIMAL},
market_value = #{record.marketValue,jdbcType=DECIMAL},
fund_earnings = #{record.fundEarnings,jdbcType=DECIMAL}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.fund_investment.entity.ProfitManagement">
update profit_management
<set>
<if test="flowId != null">
flow_id = #{flowId,jdbcType=VARCHAR},
</if>
<if test="investmentAmount != null">
investment_amount = #{investmentAmount,jdbcType=DECIMAL},
</if>
<if test="shareRatio != null">
share_ratio = #{shareRatio,jdbcType=DECIMAL},
</if>
<if test="totalEquity != null">
total_equity = #{totalEquity,jdbcType=DECIMAL},
</if>
<if test="shareCount != null">
share_count = #{shareCount,jdbcType=DECIMAL},
</if>
<if test="marketTime != null">
market_time = #{marketTime,jdbcType=INTEGER},
</if>
<if test="stockPrice != null">
stock_price = #{stockPrice,jdbcType=DECIMAL},
</if>
<if test="marketValue != null">
market_value = #{marketValue,jdbcType=DECIMAL},
</if>
<if test="fundEarnings != null">
fund_earnings = #{fundEarnings,jdbcType=DECIMAL},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.sztzjy.fund_investment.entity.ProfitManagement">
update profit_management
set flow_id = #{flowId,jdbcType=VARCHAR},
investment_amount = #{investmentAmount,jdbcType=DECIMAL},
share_ratio = #{shareRatio,jdbcType=DECIMAL},
total_equity = #{totalEquity,jdbcType=DECIMAL},
share_count = #{shareCount,jdbcType=DECIMAL},
market_time = #{marketTime,jdbcType=INTEGER},
stock_price = #{stockPrice,jdbcType=DECIMAL},
market_value = #{marketValue,jdbcType=DECIMAL},
fund_earnings = #{fundEarnings,jdbcType=DECIMAL}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>
Loading…
Cancel
Save