From d717607320ec906670f665dd2fbc39a0209899df Mon Sep 17 00:00:00 2001 From: yz <3614508250@qq.com> Date: Tue, 5 Dec 2023 17:28:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=9B=B8=E5=AF=B9=E4=BC=B0?= =?UTF-8?q?=E5=80=BC=E6=B3=95=E6=89=80=E6=9C=89=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ProjectDueDiligence.java | 21 +- .../controller/ProjectValuation.java | 55 +- .../entity/EduProjectValuationAnswer.java | 55 ++ .../EduProjectValuationAnswerExample.java | 470 ++++++++++++++ .../entity/ProfitManagement.java | 2 +- .../EduProjectValuationAnswerMapper.java | 32 + .../mapper/ProfitManagementMapper.java | 4 +- .../ISysProjectValuationAnswerSerivce.java | 7 + .../service/ISysProjectValuationService.java | 7 + .../SysProjectValuationAnswerSerivceImpl.java | 30 + .../SysProjectValuationServiceImpl.java | 129 ++++ .../EduProjectValuationAnswerMapper.xml | 196 ++++++ .../mappers/ProfitManagementMapper.xml | 574 ++++++++++++++++++ 13 files changed, 1571 insertions(+), 11 deletions(-) create mode 100644 src/main/java/com/sztzjy/fund_investment/entity/EduProjectValuationAnswer.java create mode 100644 src/main/java/com/sztzjy/fund_investment/entity/EduProjectValuationAnswerExample.java create mode 100644 src/main/java/com/sztzjy/fund_investment/mapper/EduProjectValuationAnswerMapper.java create mode 100644 src/main/java/com/sztzjy/fund_investment/service/ISysProjectValuationAnswerSerivce.java create mode 100644 src/main/java/com/sztzjy/fund_investment/service/serviceImpl/SysProjectValuationAnswerSerivceImpl.java create mode 100644 src/main/resources/mappers/EduProjectValuationAnswerMapper.xml diff --git a/src/main/java/com/sztzjy/fund_investment/controller/ProjectDueDiligence.java b/src/main/java/com/sztzjy/fund_investment/controller/ProjectDueDiligence.java index a80981f..43e17d7 100644 --- a/src/main/java/com/sztzjy/fund_investment/controller/ProjectDueDiligence.java +++ b/src/main/java/com/sztzjy/fund_investment/controller/ProjectDueDiligence.java @@ -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> selectProFinancialIndexDetailList(@ApiParam("节点id的集合List") @RequestParam List proFinancialIndexIdList, + public ResultEntity> selectProFinancialIndexDetailList(@ApiParam("节点id的集合List") @RequestBody List 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> selectProFinancialStatementDetailList(@ApiParam("节点id的集合List") @RequestParam List proFinancialStatementIdList, + public ResultEntity> selectProFinancialStatementDetailList(@ApiParam("节点id的集合List") @RequestBody List 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(); diff --git a/src/main/java/com/sztzjy/fund_investment/controller/ProjectValuation.java b/src/main/java/com/sztzjy/fund_investment/controller/ProjectValuation.java index dbfb4fa..92b4404 100644 --- a/src/main/java/com/sztzjy/fund_investment/controller/ProjectValuation.java +++ b/src/main/java/com/sztzjy/fund_investment/controller/ProjectValuation.java @@ -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> getPB(@ApiParam("流程ID") @RequestParam String flowId) { List projectValuationList=projectValuationService.getPB(flowId); @@ -41,11 +45,58 @@ public class ProjectValuation { } @GetMapping("getPS") - @ApiOperation("相对估值法-PE市盈率法") + @ApiOperation("相对估值法-PS市盈率法") @AnonymousAccess public ResultEntity> getPS(@ApiParam("流程ID") @RequestParam String flowId) { List projectValuationList=projectValuationService.getPS(flowId); return new ResultEntity(HttpStatus.OK, "相对估值法-PS市盈率法,展示成功", projectValuationList); } + @GetMapping("getValuePerShare") + @ApiOperation("相对估值法-PE/PB/PS市盈率法-每股价值") + @AnonymousAccess + public ResultEntity> 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市盈率法)"); + } + + + } diff --git a/src/main/java/com/sztzjy/fund_investment/entity/EduProjectValuationAnswer.java b/src/main/java/com/sztzjy/fund_investment/entity/EduProjectValuationAnswer.java new file mode 100644 index 0000000..7a90c6f --- /dev/null +++ b/src/main/java/com/sztzjy/fund_investment/entity/EduProjectValuationAnswer.java @@ -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; + } +} \ No newline at end of file diff --git a/src/main/java/com/sztzjy/fund_investment/entity/EduProjectValuationAnswerExample.java b/src/main/java/com/sztzjy/fund_investment/entity/EduProjectValuationAnswerExample.java new file mode 100644 index 0000000..699d1b7 --- /dev/null +++ b/src/main/java/com/sztzjy/fund_investment/entity/EduProjectValuationAnswerExample.java @@ -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 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 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 criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List 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 values) { + addCriterion("answer_id in", values, "answerId"); + return (Criteria) this; + } + + public Criteria andAnswerIdNotIn(List 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 values) { + addCriterion("flow_id in", values, "flowId"); + return (Criteria) this; + } + + public Criteria andFlowIdNotIn(List 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 values) { + addCriterion("method in", values, "method"); + return (Criteria) this; + } + + public Criteria andMethodNotIn(List 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 values) { + addCriterion("value_per_share in", values, "valuePerShare"); + return (Criteria) this; + } + + public Criteria andValuePerShareNotIn(List 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); + } + } +} \ No newline at end of file diff --git a/src/main/java/com/sztzjy/fund_investment/entity/ProfitManagement.java b/src/main/java/com/sztzjy/fund_investment/entity/ProfitManagement.java index c7a3a4a..a754cd9 100644 --- a/src/main/java/com/sztzjy/fund_investment/entity/ProfitManagement.java +++ b/src/main/java/com/sztzjy/fund_investment/entity/ProfitManagement.java @@ -27,7 +27,7 @@ public class ProfitManagement { @ApiModelProperty("持股数量") private BigDecimal shareCount; - @ApiModelProperty("上市时间/数据库存的是以日为单位的数字/一个月为30") + @ApiModelProperty("上市时间") private Integer marketTime; @ApiModelProperty("股票价格") diff --git a/src/main/java/com/sztzjy/fund_investment/mapper/EduProjectValuationAnswerMapper.java b/src/main/java/com/sztzjy/fund_investment/mapper/EduProjectValuationAnswerMapper.java new file mode 100644 index 0000000..6547ff3 --- /dev/null +++ b/src/main/java/com/sztzjy/fund_investment/mapper/EduProjectValuationAnswerMapper.java @@ -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 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); +} \ No newline at end of file diff --git a/src/main/java/com/sztzjy/fund_investment/mapper/ProfitManagementMapper.java b/src/main/java/com/sztzjy/fund_investment/mapper/ProfitManagementMapper.java index ca387f5..ebb75a8 100644 --- a/src/main/java/com/sztzjy/fund_investment/mapper/ProfitManagementMapper.java +++ b/src/main/java/com/sztzjy/fund_investment/mapper/ProfitManagementMapper.java @@ -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); diff --git a/src/main/java/com/sztzjy/fund_investment/service/ISysProjectValuationAnswerSerivce.java b/src/main/java/com/sztzjy/fund_investment/service/ISysProjectValuationAnswerSerivce.java new file mode 100644 index 0000000..b78a010 --- /dev/null +++ b/src/main/java/com/sztzjy/fund_investment/service/ISysProjectValuationAnswerSerivce.java @@ -0,0 +1,7 @@ +package com.sztzjy.fund_investment.service; + +import java.math.BigDecimal; + +public interface ISysProjectValuationAnswerSerivce { + BigDecimal selectByFlowIdAndMethod(String flowId, String method); +} diff --git a/src/main/java/com/sztzjy/fund_investment/service/ISysProjectValuationService.java b/src/main/java/com/sztzjy/fund_investment/service/ISysProjectValuationService.java index da68545..51eb60a 100644 --- a/src/main/java/com/sztzjy/fund_investment/service/ISysProjectValuationService.java +++ b/src/main/java/com/sztzjy/fund_investment/service/ISysProjectValuationService.java @@ -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 getPE(String flowId); List getPB(String flowId); List getPS(String flowId); + + Boolean updatePE(String flowId, BigDecimal valuePerShare); + + Boolean updatePB(String flowId, BigDecimal valuePerShare); + + Boolean updatePS(String flowId, BigDecimal valuePerShare); } diff --git a/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/SysProjectValuationAnswerSerivceImpl.java b/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/SysProjectValuationAnswerSerivceImpl.java new file mode 100644 index 0000000..ba1f1d9 --- /dev/null +++ b/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/SysProjectValuationAnswerSerivceImpl.java @@ -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 eduProjectValuationAnswers = answerMapper.selectByExample(example); + if(eduProjectValuationAnswers.size()==0){ + return BigDecimal.ZERO; + } + BigDecimal valuePerShare = answerMapper.selectByExample(example).get(0).getValuePerShare(); + return valuePerShare; + } +} diff --git a/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/SysProjectValuationServiceImpl.java b/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/SysProjectValuationServiceImpl.java index c73eb27..44f72b5 100644 --- a/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/SysProjectValuationServiceImpl.java +++ b/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/SysProjectValuationServiceImpl.java @@ -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 getPE(String flowId) { @@ -46,4 +55,124 @@ public class SysProjectValuationServiceImpl implements ISysProjectValuationServi List 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 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 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 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; + } } diff --git a/src/main/resources/mappers/EduProjectValuationAnswerMapper.xml b/src/main/resources/mappers/EduProjectValuationAnswerMapper.xml new file mode 100644 index 0000000..c188156 --- /dev/null +++ b/src/main/resources/mappers/EduProjectValuationAnswerMapper.xml @@ -0,0 +1,196 @@ + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + answer_id, flow_id, method, value_per_share + + + + + delete from edu_project_valuation_answer + where answer_id = #{answerId,jdbcType=VARCHAR} + + + delete from edu_project_valuation_answer + + + + + + 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 into edu_project_valuation_answer + + + answer_id, + + + flow_id, + + + method, + + + value_per_share, + + + + + #{answerId,jdbcType=VARCHAR}, + + + #{flowId,jdbcType=VARCHAR}, + + + #{method,jdbcType=VARCHAR}, + + + #{valuePerShare,jdbcType=DECIMAL}, + + + + + + update edu_project_valuation_answer + + + answer_id = #{record.answerId,jdbcType=VARCHAR}, + + + flow_id = #{record.flowId,jdbcType=VARCHAR}, + + + method = #{record.method,jdbcType=VARCHAR}, + + + value_per_share = #{record.valuePerShare,jdbcType=DECIMAL}, + + + + + + + + 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} + + + + + + update edu_project_valuation_answer + + + flow_id = #{flowId,jdbcType=VARCHAR}, + + + method = #{method,jdbcType=VARCHAR}, + + + value_per_share = #{valuePerShare,jdbcType=DECIMAL}, + + + where answer_id = #{answerId,jdbcType=VARCHAR} + + + 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} + + \ No newline at end of file diff --git a/src/main/resources/mappers/ProfitManagementMapper.xml b/src/main/resources/mappers/ProfitManagementMapper.xml index 416c986..ffd2d2c 100644 --- a/src/main/resources/mappers/ProfitManagementMapper.xml +++ b/src/main/resources/mappers/ProfitManagementMapper.xml @@ -288,4 +288,578 @@ fund_earnings = #{fundEarnings,jdbcType=DECIMAL} where id = #{id,jdbcType=VARCHAR} + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, flow_id, investment_amount, share_ratio, total_equity, share_count, market_time, + stock_price, market_value, fund_earnings + + + + + delete from profit_management + where id = #{id,jdbcType=VARCHAR} + + + delete from profit_management + + + + + + 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 into profit_management + + + id, + + + flow_id, + + + investment_amount, + + + share_ratio, + + + total_equity, + + + share_count, + + + market_time, + + + stock_price, + + + market_value, + + + fund_earnings, + + + + + #{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}, + + + + + + update profit_management + + + 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}, + + + + + + + + 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} + + + + + + update profit_management + + + 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 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} + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, flow_id, investment_amount, share_ratio, total_equity, share_count, market_time, + stock_price, market_value, fund_earnings + + + + + delete from profit_management + where id = #{id,jdbcType=VARCHAR} + + + delete from profit_management + + + + + + 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 into profit_management + + + id, + + + flow_id, + + + investment_amount, + + + share_ratio, + + + total_equity, + + + share_count, + + + market_time, + + + stock_price, + + + market_value, + + + fund_earnings, + + + + + #{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}, + + + + + + update profit_management + + + 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}, + + + + + + + + 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} + + + + + + update profit_management + + + 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 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} + \ No newline at end of file