diff --git a/src/main/java/com/sztzjy/fund_investment/controller/FoundProjectController.java b/src/main/java/com/sztzjy/fund_investment/controller/FoundProjectController.java index 77412d8..2ee1435 100644 --- a/src/main/java/com/sztzjy/fund_investment/controller/FoundProjectController.java +++ b/src/main/java/com/sztzjy/fund_investment/controller/FoundProjectController.java @@ -24,7 +24,7 @@ import java.nio.file.Paths; @RestController -@RequestMapping("/foundProjectController") +@RequestMapping("/stu/foundProjectController") @Api(tags = "学生端--寻找项目") public class FoundProjectController { @Autowired diff --git a/src/main/java/com/sztzjy/fund_investment/controller/FundraisingController.java b/src/main/java/com/sztzjy/fund_investment/controller/FundraisingController.java index 0fcac87..d37c06c 100644 --- a/src/main/java/com/sztzjy/fund_investment/controller/FundraisingController.java +++ b/src/main/java/com/sztzjy/fund_investment/controller/FundraisingController.java @@ -1,6 +1,5 @@ package com.sztzjy.fund_investment.controller; -import com.sztzjy.fund_investment.annotation.AnonymousAccess; import com.sztzjy.fund_investment.entity.Fundraising; import com.sztzjy.fund_investment.mapper.FundraisingMapper; import com.sztzjy.fund_investment.service.ISysFundraisingService; @@ -19,7 +18,7 @@ import java.math.BigDecimal; import java.util.UUID; @RestController -@RequestMapping("/fundraisingController") +@RequestMapping("/stu/fundraisingController") @Api(tags = "学生端--资金募资") public class FundraisingController { @Autowired @@ -27,7 +26,6 @@ public class FundraisingController { @Autowired FundraisingMapper fundraisingMapper; - @AnonymousAccess @GetMapping("getFundraising") @ApiOperation("资金募资回显") public ResultEntity getFundraising(@ApiParam("流程id") @RequestParam String flowId) { @@ -35,7 +33,6 @@ public class FundraisingController { return new ResultEntity(HttpStatus.OK,"资金募资回显成功",fundraising); } - @AnonymousAccess @GetMapping("insertFundraising") @ApiOperation("新增基金募资") public ResultEntity insertFundraising(@ApiParam("流程id") @RequestParam String flowId, diff --git a/src/main/java/com/sztzjy/fund_investment/controller/InvestmentReportController.java b/src/main/java/com/sztzjy/fund_investment/controller/InvestmentReportController.java new file mode 100644 index 0000000..179d5cc --- /dev/null +++ b/src/main/java/com/sztzjy/fund_investment/controller/InvestmentReportController.java @@ -0,0 +1,100 @@ +package com.sztzjy.fund_investment.controller; + +import com.sztzjy.fund_investment.annotation.AnonymousAccess; +import com.sztzjy.fund_investment.entity.ExitTime; +import com.sztzjy.fund_investment.entity.ProfitManagement; +import com.sztzjy.fund_investment.entity.ProfitManagementExample; +import com.sztzjy.fund_investment.entity.TrainingReport; +import com.sztzjy.fund_investment.mapper.ExitTimeMapper; +import com.sztzjy.fund_investment.mapper.ProfitManagementMapper; +import com.sztzjy.fund_investment.service.InvestmentReportService; +import com.sztzjy.fund_investment.util.ResultEntity; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.*; + + +@RestController +@RequestMapping("/stu/report") +@Api(tags = "学生端--投资报告") +public class InvestmentReportController { + @Autowired + private InvestmentReportService investmentReportService; + @Autowired + private ExitTimeMapper exitTimeMapper; + @Autowired + ProfitManagementMapper profitManagementMapper; + + @AnonymousAccess + @GetMapping("getProjectPoolList") + @ApiOperation("股权投资收益率") + public ResultEntity<Map<Integer, BigDecimal>> getFundraising(@RequestParam String flowId) { + ProfitManagementExample profitManagementExample = new ProfitManagementExample(); + profitManagementExample.createCriteria().andFlowIdEqualTo(flowId); + profitManagementExample.setOrderByClause("market_time ASC"); + List<ProfitManagement> profitManagementList = profitManagementMapper.selectByExample(profitManagementExample); + Map<Integer, BigDecimal> map = new LinkedHashMap<>(); + for (ProfitManagement profitManagement : profitManagementList) { + if (profitManagement.getFundEarnings() != null && profitManagement.getFundEarnings().compareTo(BigDecimal.ZERO) != 0 + && profitManagement.getInvestmentAmount() != null && profitManagement.getInvestmentAmount().compareTo(BigDecimal.ZERO) != 0) { + BigDecimal fundEarnings = profitManagement.getFundEarnings(); // 基金收益 + BigDecimal investmentAmount = profitManagement.getInvestmentAmount(); // 投资金额 + + // 基金收益/投资金额=投资收益率 + BigDecimal bigDecimal = fundEarnings.divide(investmentAmount,6,RoundingMode.HALF_UP); + map.put(profitManagement.getMarketTime(), bigDecimal); + } + } + return new ResultEntity<Map<Integer, BigDecimal>>(map); + } + + + @AnonymousAccess + @GetMapping("getExitData") + @ApiOperation("左侧退出时数据") + public ResultEntity<ExitTime> getExitData(@RequestParam String flowId) { + return new ResultEntity<ExitTime>(exitTimeMapper.selectByPrimaryKey(flowId)); + } + + + @AnonymousAccess + @PostMapping("commitExperience") + @ApiOperation("提交心得") + public ResultEntity<String> commitExperience(@ApiParam("传三个ID、experience、uploadTime") @RequestBody TrainingReport trainingReport) { + return investmentReportService.commitExperience(trainingReport); + } + + @AnonymousAccess + @PostMapping("getExperience") + @ApiOperation("心得回显") + public ResultEntity<String> getExperience(@RequestBody String flowId) { + List<TrainingReport> trainingReports = investmentReportService.getTrainingReports(flowId); + if (trainingReports.isEmpty()) { + return null; + } + TrainingReport trainingReport = trainingReports.get(0); + if (StringUtils.isBlank(trainingReport.getExperience())) { + return null; + } + return new ResultEntity<>(trainingReport.getExperience()); + } + + @AnonymousAccess + @PostMapping("uploadReport") + @ApiOperation("上传报告") + public ResultEntity<String> uploadReport(@RequestParam("file") @RequestPart(name = "file") MultipartFile file, + @ApiParam("文件名称") @RequestParam String fileName, + @RequestParam String flowId, + @RequestParam String schoolId) { + return investmentReportService.uploadReport(file, fileName, flowId, schoolId); + } + +} diff --git a/src/main/java/com/sztzjy/fund_investment/controller/ProfitManagementController.java b/src/main/java/com/sztzjy/fund_investment/controller/ProfitManagementController.java index b00a83d..4a23810 100644 --- a/src/main/java/com/sztzjy/fund_investment/controller/ProfitManagementController.java +++ b/src/main/java/com/sztzjy/fund_investment/controller/ProfitManagementController.java @@ -20,7 +20,7 @@ import java.util.List; * @Date 2023/11/23 */ @RestController -@RequestMapping("/profitManagement") +@RequestMapping("/stu/profitManagement") @Api(tags = "学生端--收益管理相关接口") public class ProfitManagementController { @Autowired @@ -42,11 +42,12 @@ public class ProfitManagementController { @ApiOperation("退出时机弹窗") @AnonymousAccess - @GetMapping("/getExitTime") + @GetMapping("/getExitTime") //todo 基金收益 / 投资金额 = 退出时收益率 public ResultEntity<String> getExitTime(@RequestParam String flowId) { return null; } + @ApiOperation("显示股票相关信息弹窗") @AnonymousAccess @GetMapping("/getStockInfo") @@ -54,6 +55,7 @@ public class ProfitManagementController { return null; } + @ApiOperation("判断市值和基金收益对错") @AnonymousAccess @GetMapping("/getRightMarketValueAndFundEarnings") 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 b49b7f9..b540f94 100644 --- a/src/main/java/com/sztzjy/fund_investment/controller/ProjectDueDiligence.java +++ b/src/main/java/com/sztzjy/fund_investment/controller/ProjectDueDiligence.java @@ -15,7 +15,7 @@ import org.springframework.web.bind.annotation.*; import java.util.List; @RestController -@RequestMapping("/projectDueDiligenceController") +@RequestMapping("/stu/projectDueDiligenceController") @Api(tags = "学生端--项目尽调") public class ProjectDueDiligence { @Autowired diff --git a/src/main/java/com/sztzjy/fund_investment/controller/TopicController.java b/src/main/java/com/sztzjy/fund_investment/controller/TopicController.java index 5740bbb..0b391cc 100644 --- a/src/main/java/com/sztzjy/fund_investment/controller/TopicController.java +++ b/src/main/java/com/sztzjy/fund_investment/controller/TopicController.java @@ -21,12 +21,13 @@ import java.math.BigDecimal; import java.util.Date; import java.util.List; + /** * @Author xcj * @Date 2023/11/14 */ @RestController -@RequestMapping("/topics") +@RequestMapping("/stu/topics") @Api(tags = "学生端--答题视频相关接口") public class TopicController { @Autowired diff --git a/src/main/java/com/sztzjy/fund_investment/controller/tea/ClassScoreController.java b/src/main/java/com/sztzjy/fund_investment/controller/tea/ClassScoreController.java index 24d84f9..d5c8569 100644 --- a/src/main/java/com/sztzjy/fund_investment/controller/tea/ClassScoreController.java +++ b/src/main/java/com/sztzjy/fund_investment/controller/tea/ClassScoreController.java @@ -99,7 +99,7 @@ public class ClassScoreController { @AnonymousAccess @GetMapping("/getStuTrainingScore") - @ApiOperation("成绩详情/实训成绩/展示") + @ApiOperation("成绩详情&投资报告/实训成绩展示") public ResultEntity<PerformanceTrainingScoreDto> getStuTrainingScore(@ApiParam("页面返回的得分ID") @RequestParam String performanceScoreId) { return new ResultEntity<>(classScoreService.getStuTrainingScore(performanceScoreId)); } diff --git a/src/main/java/com/sztzjy/fund_investment/controller/tea/TeaTopicManageController.java b/src/main/java/com/sztzjy/fund_investment/controller/tea/TeaTopicManageController.java index 52b7064..a4a744f 100644 --- a/src/main/java/com/sztzjy/fund_investment/controller/tea/TeaTopicManageController.java +++ b/src/main/java/com/sztzjy/fund_investment/controller/tea/TeaTopicManageController.java @@ -12,6 +12,7 @@ import com.sztzjy.fund_investment.util.ResultEntity; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.*; @@ -34,9 +35,10 @@ public class TeaTopicManageController { @AnonymousAccess - @GetMapping("/insertTopics") + @PostMapping("/insertTopics") @ApiOperation("试题管理/新增试题") - public ResultEntity<String> insertTopics(@ApiParam("topicId给字符串uuid,analysis,userAnswer,选项CDE允许为空,其他必填,source固定为【自增】,module值同导入功能模块") + public ResultEntity<String> insertTopics(@ApiParam("topicId给字符串uuid,analysis,userAnswer,选项CDE允许为空,其他必填," + + "source固定为【自增】,module值同导入功能模块,判断答案为A/B,多选为A,B,C英文逗号隔开") @RequestBody TopicsWithBLOBs topics) { return teaTopicManageService.insertTopics(topics); } @@ -91,8 +93,8 @@ public class TeaTopicManageController { public ResultEntity<String> deleteByTopicId(@ApiParam("展示接口中的id字段") @RequestParam String questionId, @ApiParam("回复内容") String content) { QuestionAnswerWithBLOBs questionAnswerWithBLOBs = questionAnswerMapper.selectByPrimaryKey(questionId); - if (questionAnswerWithBLOBs == null) { - return new ResultEntity(HttpStatus.INTERNAL_SERVER_ERROR, "数据不存在!"); + if (StringUtils.isBlank(content)){ + return new ResultEntity(HttpStatus.BAD_REQUEST, "请输入回复内容!"); } questionAnswerWithBLOBs.setReplyContent(content); questionAnswerMapper.updateByPrimaryKey(questionAnswerWithBLOBs); @@ -102,7 +104,7 @@ public class TeaTopicManageController { @AnonymousAccess @GetMapping("/getQuestionById") - @ApiOperation("互动答疑/回复问题") + @ApiOperation("互动答疑/获取单挑互动数据") public ResultEntity<QuestionAnswerWithBLOBs> getQuestionById(@ApiParam("展示接口中的id字段") @RequestParam String questionId) { return new ResultEntity<QuestionAnswerWithBLOBs>(questionAnswerMapper.selectByPrimaryKey(questionId)); } diff --git a/src/main/java/com/sztzjy/fund_investment/entity/ExitTime.java b/src/main/java/com/sztzjy/fund_investment/entity/ExitTime.java new file mode 100644 index 0000000..d7635db --- /dev/null +++ b/src/main/java/com/sztzjy/fund_investment/entity/ExitTime.java @@ -0,0 +1,131 @@ +package com.sztzjy.fund_investment.entity; + +import java.math.BigDecimal; + +import io.swagger.annotations.ApiModelProperty; +/** + * + * @author xcj + * exit_time + */ +public class ExitTime { + private String flowId; + + @ApiModelProperty("投资项目") + private String porjectName; + + @ApiModelProperty("投资金额") + private BigDecimal investmentAmount; + + @ApiModelProperty("持股比例") + private BigDecimal shareRatio; + + @ApiModelProperty("总股本") + private BigDecimal totalEquity; + + @ApiModelProperty("持股数量") + private BigDecimal shareCount; + + @ApiModelProperty("退出时市值") + private BigDecimal exitMarketValue; + + @ApiModelProperty("退出时收益率") + private BigDecimal exitYield; + + @ApiModelProperty("退出时基金收益") + private BigDecimal exitFundEarnings; + + @ApiModelProperty("退出时机") + private String exitTiming; + + @ApiModelProperty("退出股价") + private BigDecimal exitStockPrice; + + public String getFlowId() { + return flowId; + } + + public void setFlowId(String flowId) { + this.flowId = flowId == null ? null : flowId.trim(); + } + + public String getPorjectName() { + return porjectName; + } + + public void setPorjectName(String porjectName) { + this.porjectName = porjectName == null ? null : porjectName.trim(); + } + + public BigDecimal getInvestmentAmount() { + return investmentAmount; + } + + public void setInvestmentAmount(BigDecimal investmentAmount) { + this.investmentAmount = investmentAmount; + } + + public BigDecimal getShareRatio() { + return shareRatio; + } + + public void setShareRatio(BigDecimal shareRatio) { + this.shareRatio = shareRatio; + } + + public BigDecimal getTotalEquity() { + return totalEquity; + } + + public void setTotalEquity(BigDecimal totalEquity) { + this.totalEquity = totalEquity; + } + + public BigDecimal getShareCount() { + return shareCount; + } + + public void setShareCount(BigDecimal shareCount) { + this.shareCount = shareCount; + } + + public BigDecimal getExitMarketValue() { + return exitMarketValue; + } + + public void setExitMarketValue(BigDecimal exitMarketValue) { + this.exitMarketValue = exitMarketValue; + } + + public BigDecimal getExitYield() { + return exitYield; + } + + public void setExitYield(BigDecimal exitYield) { + this.exitYield = exitYield; + } + + public BigDecimal getExitFundEarnings() { + return exitFundEarnings; + } + + public void setExitFundEarnings(BigDecimal exitFundEarnings) { + this.exitFundEarnings = exitFundEarnings; + } + + public String getExitTiming() { + return exitTiming; + } + + public void setExitTiming(String exitTiming) { + this.exitTiming = exitTiming == null ? null : exitTiming.trim(); + } + + public BigDecimal getExitStockPrice() { + return exitStockPrice; + } + + public void setExitStockPrice(BigDecimal exitStockPrice) { + this.exitStockPrice = exitStockPrice; + } +} \ No newline at end of file diff --git a/src/main/java/com/sztzjy/fund_investment/entity/ExitTimeExample.java b/src/main/java/com/sztzjy/fund_investment/entity/ExitTimeExample.java new file mode 100644 index 0000000..7f6432a --- /dev/null +++ b/src/main/java/com/sztzjy/fund_investment/entity/ExitTimeExample.java @@ -0,0 +1,890 @@ +package com.sztzjy.fund_investment.entity; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +public class ExitTimeExample { + protected String orderByClause; + + protected boolean distinct; + + protected List<Criteria> oredCriteria; + + public ExitTimeExample() { + 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 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 andPorjectNameIsNull() { + addCriterion("porject_name is null"); + return (Criteria) this; + } + + public Criteria andPorjectNameIsNotNull() { + addCriterion("porject_name is not null"); + return (Criteria) this; + } + + public Criteria andPorjectNameEqualTo(String value) { + addCriterion("porject_name =", value, "porjectName"); + return (Criteria) this; + } + + public Criteria andPorjectNameNotEqualTo(String value) { + addCriterion("porject_name <>", value, "porjectName"); + return (Criteria) this; + } + + public Criteria andPorjectNameGreaterThan(String value) { + addCriterion("porject_name >", value, "porjectName"); + return (Criteria) this; + } + + public Criteria andPorjectNameGreaterThanOrEqualTo(String value) { + addCriterion("porject_name >=", value, "porjectName"); + return (Criteria) this; + } + + public Criteria andPorjectNameLessThan(String value) { + addCriterion("porject_name <", value, "porjectName"); + return (Criteria) this; + } + + public Criteria andPorjectNameLessThanOrEqualTo(String value) { + addCriterion("porject_name <=", value, "porjectName"); + return (Criteria) this; + } + + public Criteria andPorjectNameLike(String value) { + addCriterion("porject_name like", value, "porjectName"); + return (Criteria) this; + } + + public Criteria andPorjectNameNotLike(String value) { + addCriterion("porject_name not like", value, "porjectName"); + return (Criteria) this; + } + + public Criteria andPorjectNameIn(List<String> values) { + addCriterion("porject_name in", values, "porjectName"); + return (Criteria) this; + } + + public Criteria andPorjectNameNotIn(List<String> values) { + addCriterion("porject_name not in", values, "porjectName"); + return (Criteria) this; + } + + public Criteria andPorjectNameBetween(String value1, String value2) { + addCriterion("porject_name between", value1, value2, "porjectName"); + return (Criteria) this; + } + + public Criteria andPorjectNameNotBetween(String value1, String value2) { + addCriterion("porject_name not between", value1, value2, "porjectName"); + return (Criteria) this; + } + + public Criteria andInvestmentAmountIsNull() { + addCriterion("investment_amount is null"); + return (Criteria) this; + } + + public Criteria andInvestmentAmountIsNotNull() { + addCriterion("investment_amount is not null"); + return (Criteria) this; + } + + public Criteria andInvestmentAmountEqualTo(BigDecimal value) { + addCriterion("investment_amount =", value, "investmentAmount"); + return (Criteria) this; + } + + public Criteria andInvestmentAmountNotEqualTo(BigDecimal value) { + addCriterion("investment_amount <>", value, "investmentAmount"); + return (Criteria) this; + } + + public Criteria andInvestmentAmountGreaterThan(BigDecimal value) { + addCriterion("investment_amount >", value, "investmentAmount"); + return (Criteria) this; + } + + public Criteria andInvestmentAmountGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("investment_amount >=", value, "investmentAmount"); + return (Criteria) this; + } + + public Criteria andInvestmentAmountLessThan(BigDecimal value) { + addCriterion("investment_amount <", value, "investmentAmount"); + return (Criteria) this; + } + + public Criteria andInvestmentAmountLessThanOrEqualTo(BigDecimal value) { + addCriterion("investment_amount <=", value, "investmentAmount"); + return (Criteria) this; + } + + public Criteria andInvestmentAmountIn(List<BigDecimal> values) { + addCriterion("investment_amount in", values, "investmentAmount"); + return (Criteria) this; + } + + public Criteria andInvestmentAmountNotIn(List<BigDecimal> values) { + addCriterion("investment_amount not in", values, "investmentAmount"); + return (Criteria) this; + } + + public Criteria andInvestmentAmountBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("investment_amount between", value1, value2, "investmentAmount"); + return (Criteria) this; + } + + public Criteria andInvestmentAmountNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("investment_amount not between", value1, value2, "investmentAmount"); + return (Criteria) this; + } + + public Criteria andShareRatioIsNull() { + addCriterion("share_ratio is null"); + return (Criteria) this; + } + + public Criteria andShareRatioIsNotNull() { + addCriterion("share_ratio is not null"); + return (Criteria) this; + } + + public Criteria andShareRatioEqualTo(BigDecimal value) { + addCriterion("share_ratio =", value, "shareRatio"); + return (Criteria) this; + } + + public Criteria andShareRatioNotEqualTo(BigDecimal value) { + addCriterion("share_ratio <>", value, "shareRatio"); + return (Criteria) this; + } + + public Criteria andShareRatioGreaterThan(BigDecimal value) { + addCriterion("share_ratio >", value, "shareRatio"); + return (Criteria) this; + } + + public Criteria andShareRatioGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("share_ratio >=", value, "shareRatio"); + return (Criteria) this; + } + + public Criteria andShareRatioLessThan(BigDecimal value) { + addCriterion("share_ratio <", value, "shareRatio"); + return (Criteria) this; + } + + public Criteria andShareRatioLessThanOrEqualTo(BigDecimal value) { + addCriterion("share_ratio <=", value, "shareRatio"); + return (Criteria) this; + } + + public Criteria andShareRatioIn(List<BigDecimal> values) { + addCriterion("share_ratio in", values, "shareRatio"); + return (Criteria) this; + } + + public Criteria andShareRatioNotIn(List<BigDecimal> values) { + addCriterion("share_ratio not in", values, "shareRatio"); + return (Criteria) this; + } + + public Criteria andShareRatioBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("share_ratio between", value1, value2, "shareRatio"); + return (Criteria) this; + } + + public Criteria andShareRatioNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("share_ratio not between", value1, value2, "shareRatio"); + return (Criteria) this; + } + + public Criteria andTotalEquityIsNull() { + addCriterion("total_equity is null"); + return (Criteria) this; + } + + public Criteria andTotalEquityIsNotNull() { + addCriterion("total_equity is not null"); + return (Criteria) this; + } + + public Criteria andTotalEquityEqualTo(BigDecimal value) { + addCriterion("total_equity =", value, "totalEquity"); + return (Criteria) this; + } + + public Criteria andTotalEquityNotEqualTo(BigDecimal value) { + addCriterion("total_equity <>", value, "totalEquity"); + return (Criteria) this; + } + + public Criteria andTotalEquityGreaterThan(BigDecimal value) { + addCriterion("total_equity >", value, "totalEquity"); + return (Criteria) this; + } + + public Criteria andTotalEquityGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("total_equity >=", value, "totalEquity"); + return (Criteria) this; + } + + public Criteria andTotalEquityLessThan(BigDecimal value) { + addCriterion("total_equity <", value, "totalEquity"); + return (Criteria) this; + } + + public Criteria andTotalEquityLessThanOrEqualTo(BigDecimal value) { + addCriterion("total_equity <=", value, "totalEquity"); + return (Criteria) this; + } + + public Criteria andTotalEquityIn(List<BigDecimal> values) { + addCriterion("total_equity in", values, "totalEquity"); + return (Criteria) this; + } + + public Criteria andTotalEquityNotIn(List<BigDecimal> values) { + addCriterion("total_equity not in", values, "totalEquity"); + return (Criteria) this; + } + + public Criteria andTotalEquityBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("total_equity between", value1, value2, "totalEquity"); + return (Criteria) this; + } + + public Criteria andTotalEquityNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("total_equity not between", value1, value2, "totalEquity"); + return (Criteria) this; + } + + public Criteria andShareCountIsNull() { + addCriterion("share_count is null"); + return (Criteria) this; + } + + public Criteria andShareCountIsNotNull() { + addCriterion("share_count is not null"); + return (Criteria) this; + } + + public Criteria andShareCountEqualTo(BigDecimal value) { + addCriterion("share_count =", value, "shareCount"); + return (Criteria) this; + } + + public Criteria andShareCountNotEqualTo(BigDecimal value) { + addCriterion("share_count <>", value, "shareCount"); + return (Criteria) this; + } + + public Criteria andShareCountGreaterThan(BigDecimal value) { + addCriterion("share_count >", value, "shareCount"); + return (Criteria) this; + } + + public Criteria andShareCountGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("share_count >=", value, "shareCount"); + return (Criteria) this; + } + + public Criteria andShareCountLessThan(BigDecimal value) { + addCriterion("share_count <", value, "shareCount"); + return (Criteria) this; + } + + public Criteria andShareCountLessThanOrEqualTo(BigDecimal value) { + addCriterion("share_count <=", value, "shareCount"); + return (Criteria) this; + } + + public Criteria andShareCountIn(List<BigDecimal> values) { + addCriterion("share_count in", values, "shareCount"); + return (Criteria) this; + } + + public Criteria andShareCountNotIn(List<BigDecimal> values) { + addCriterion("share_count not in", values, "shareCount"); + return (Criteria) this; + } + + public Criteria andShareCountBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("share_count between", value1, value2, "shareCount"); + return (Criteria) this; + } + + public Criteria andShareCountNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("share_count not between", value1, value2, "shareCount"); + return (Criteria) this; + } + + public Criteria andExitMarketValueIsNull() { + addCriterion("exit_market_value is null"); + return (Criteria) this; + } + + public Criteria andExitMarketValueIsNotNull() { + addCriterion("exit_market_value is not null"); + return (Criteria) this; + } + + public Criteria andExitMarketValueEqualTo(BigDecimal value) { + addCriterion("exit_market_value =", value, "exitMarketValue"); + return (Criteria) this; + } + + public Criteria andExitMarketValueNotEqualTo(BigDecimal value) { + addCriterion("exit_market_value <>", value, "exitMarketValue"); + return (Criteria) this; + } + + public Criteria andExitMarketValueGreaterThan(BigDecimal value) { + addCriterion("exit_market_value >", value, "exitMarketValue"); + return (Criteria) this; + } + + public Criteria andExitMarketValueGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("exit_market_value >=", value, "exitMarketValue"); + return (Criteria) this; + } + + public Criteria andExitMarketValueLessThan(BigDecimal value) { + addCriterion("exit_market_value <", value, "exitMarketValue"); + return (Criteria) this; + } + + public Criteria andExitMarketValueLessThanOrEqualTo(BigDecimal value) { + addCriterion("exit_market_value <=", value, "exitMarketValue"); + return (Criteria) this; + } + + public Criteria andExitMarketValueIn(List<BigDecimal> values) { + addCriterion("exit_market_value in", values, "exitMarketValue"); + return (Criteria) this; + } + + public Criteria andExitMarketValueNotIn(List<BigDecimal> values) { + addCriterion("exit_market_value not in", values, "exitMarketValue"); + return (Criteria) this; + } + + public Criteria andExitMarketValueBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("exit_market_value between", value1, value2, "exitMarketValue"); + return (Criteria) this; + } + + public Criteria andExitMarketValueNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("exit_market_value not between", value1, value2, "exitMarketValue"); + return (Criteria) this; + } + + public Criteria andExitYieldIsNull() { + addCriterion("exit_yield is null"); + return (Criteria) this; + } + + public Criteria andExitYieldIsNotNull() { + addCriterion("exit_yield is not null"); + return (Criteria) this; + } + + public Criteria andExitYieldEqualTo(BigDecimal value) { + addCriterion("exit_yield =", value, "exitYield"); + return (Criteria) this; + } + + public Criteria andExitYieldNotEqualTo(BigDecimal value) { + addCriterion("exit_yield <>", value, "exitYield"); + return (Criteria) this; + } + + public Criteria andExitYieldGreaterThan(BigDecimal value) { + addCriterion("exit_yield >", value, "exitYield"); + return (Criteria) this; + } + + public Criteria andExitYieldGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("exit_yield >=", value, "exitYield"); + return (Criteria) this; + } + + public Criteria andExitYieldLessThan(BigDecimal value) { + addCriterion("exit_yield <", value, "exitYield"); + return (Criteria) this; + } + + public Criteria andExitYieldLessThanOrEqualTo(BigDecimal value) { + addCriterion("exit_yield <=", value, "exitYield"); + return (Criteria) this; + } + + public Criteria andExitYieldIn(List<BigDecimal> values) { + addCriterion("exit_yield in", values, "exitYield"); + return (Criteria) this; + } + + public Criteria andExitYieldNotIn(List<BigDecimal> values) { + addCriterion("exit_yield not in", values, "exitYield"); + return (Criteria) this; + } + + public Criteria andExitYieldBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("exit_yield between", value1, value2, "exitYield"); + return (Criteria) this; + } + + public Criteria andExitYieldNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("exit_yield not between", value1, value2, "exitYield"); + return (Criteria) this; + } + + public Criteria andExitFundEarningsIsNull() { + addCriterion("exit_fund_earnings is null"); + return (Criteria) this; + } + + public Criteria andExitFundEarningsIsNotNull() { + addCriterion("exit_fund_earnings is not null"); + return (Criteria) this; + } + + public Criteria andExitFundEarningsEqualTo(BigDecimal value) { + addCriterion("exit_fund_earnings =", value, "exitFundEarnings"); + return (Criteria) this; + } + + public Criteria andExitFundEarningsNotEqualTo(BigDecimal value) { + addCriterion("exit_fund_earnings <>", value, "exitFundEarnings"); + return (Criteria) this; + } + + public Criteria andExitFundEarningsGreaterThan(BigDecimal value) { + addCriterion("exit_fund_earnings >", value, "exitFundEarnings"); + return (Criteria) this; + } + + public Criteria andExitFundEarningsGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("exit_fund_earnings >=", value, "exitFundEarnings"); + return (Criteria) this; + } + + public Criteria andExitFundEarningsLessThan(BigDecimal value) { + addCriterion("exit_fund_earnings <", value, "exitFundEarnings"); + return (Criteria) this; + } + + public Criteria andExitFundEarningsLessThanOrEqualTo(BigDecimal value) { + addCriterion("exit_fund_earnings <=", value, "exitFundEarnings"); + return (Criteria) this; + } + + public Criteria andExitFundEarningsIn(List<BigDecimal> values) { + addCriterion("exit_fund_earnings in", values, "exitFundEarnings"); + return (Criteria) this; + } + + public Criteria andExitFundEarningsNotIn(List<BigDecimal> values) { + addCriterion("exit_fund_earnings not in", values, "exitFundEarnings"); + return (Criteria) this; + } + + public Criteria andExitFundEarningsBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("exit_fund_earnings between", value1, value2, "exitFundEarnings"); + return (Criteria) this; + } + + public Criteria andExitFundEarningsNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("exit_fund_earnings not between", value1, value2, "exitFundEarnings"); + return (Criteria) this; + } + + public Criteria andExitTimingIsNull() { + addCriterion("exit_timing is null"); + return (Criteria) this; + } + + public Criteria andExitTimingIsNotNull() { + addCriterion("exit_timing is not null"); + return (Criteria) this; + } + + public Criteria andExitTimingEqualTo(String value) { + addCriterion("exit_timing =", value, "exitTiming"); + return (Criteria) this; + } + + public Criteria andExitTimingNotEqualTo(String value) { + addCriterion("exit_timing <>", value, "exitTiming"); + return (Criteria) this; + } + + public Criteria andExitTimingGreaterThan(String value) { + addCriterion("exit_timing >", value, "exitTiming"); + return (Criteria) this; + } + + public Criteria andExitTimingGreaterThanOrEqualTo(String value) { + addCriterion("exit_timing >=", value, "exitTiming"); + return (Criteria) this; + } + + public Criteria andExitTimingLessThan(String value) { + addCriterion("exit_timing <", value, "exitTiming"); + return (Criteria) this; + } + + public Criteria andExitTimingLessThanOrEqualTo(String value) { + addCriterion("exit_timing <=", value, "exitTiming"); + return (Criteria) this; + } + + public Criteria andExitTimingLike(String value) { + addCriterion("exit_timing like", value, "exitTiming"); + return (Criteria) this; + } + + public Criteria andExitTimingNotLike(String value) { + addCriterion("exit_timing not like", value, "exitTiming"); + return (Criteria) this; + } + + public Criteria andExitTimingIn(List<String> values) { + addCriterion("exit_timing in", values, "exitTiming"); + return (Criteria) this; + } + + public Criteria andExitTimingNotIn(List<String> values) { + addCriterion("exit_timing not in", values, "exitTiming"); + return (Criteria) this; + } + + public Criteria andExitTimingBetween(String value1, String value2) { + addCriterion("exit_timing between", value1, value2, "exitTiming"); + return (Criteria) this; + } + + public Criteria andExitTimingNotBetween(String value1, String value2) { + addCriterion("exit_timing not between", value1, value2, "exitTiming"); + return (Criteria) this; + } + + public Criteria andExitStockPriceIsNull() { + addCriterion("exit_stock_price is null"); + return (Criteria) this; + } + + public Criteria andExitStockPriceIsNotNull() { + addCriterion("exit_stock_price is not null"); + return (Criteria) this; + } + + public Criteria andExitStockPriceEqualTo(BigDecimal value) { + addCriterion("exit_stock_price =", value, "exitStockPrice"); + return (Criteria) this; + } + + public Criteria andExitStockPriceNotEqualTo(BigDecimal value) { + addCriterion("exit_stock_price <>", value, "exitStockPrice"); + return (Criteria) this; + } + + public Criteria andExitStockPriceGreaterThan(BigDecimal value) { + addCriterion("exit_stock_price >", value, "exitStockPrice"); + return (Criteria) this; + } + + public Criteria andExitStockPriceGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("exit_stock_price >=", value, "exitStockPrice"); + return (Criteria) this; + } + + public Criteria andExitStockPriceLessThan(BigDecimal value) { + addCriterion("exit_stock_price <", value, "exitStockPrice"); + return (Criteria) this; + } + + public Criteria andExitStockPriceLessThanOrEqualTo(BigDecimal value) { + addCriterion("exit_stock_price <=", value, "exitStockPrice"); + return (Criteria) this; + } + + public Criteria andExitStockPriceIn(List<BigDecimal> values) { + addCriterion("exit_stock_price in", values, "exitStockPrice"); + return (Criteria) this; + } + + public Criteria andExitStockPriceNotIn(List<BigDecimal> values) { + addCriterion("exit_stock_price not in", values, "exitStockPrice"); + return (Criteria) this; + } + + public Criteria andExitStockPriceBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("exit_stock_price between", value1, value2, "exitStockPrice"); + return (Criteria) this; + } + + public Criteria andExitStockPriceNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("exit_stock_price not between", value1, value2, "exitStockPrice"); + 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 b9d3312..c7a3a4a 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("上市时间") + @ApiModelProperty("上市时间/数据库存的是以日为单位的数字/一个月为30") private Integer marketTime; @ApiModelProperty("股票价格") @@ -39,12 +39,6 @@ public class ProfitManagement { @ApiModelProperty("基金收益") private BigDecimal fundEarnings; - @ApiModelProperty("退出时机") - private String exitTiming; - - @ApiModelProperty("退出股价") - private BigDecimal exitStockPrice; - public String getId() { return id; } @@ -124,20 +118,4 @@ public class ProfitManagement { public void setFundEarnings(BigDecimal fundEarnings) { this.fundEarnings = fundEarnings; } - - public String getExitTiming() { - return exitTiming; - } - - public void setExitTiming(String exitTiming) { - this.exitTiming = exitTiming == null ? null : exitTiming.trim(); - } - - public BigDecimal getExitStockPrice() { - return exitStockPrice; - } - - public void setExitStockPrice(BigDecimal exitStockPrice) { - this.exitStockPrice = exitStockPrice; - } } \ No newline at end of file diff --git a/src/main/java/com/sztzjy/fund_investment/entity/ProfitManagementExample.java b/src/main/java/com/sztzjy/fund_investment/entity/ProfitManagementExample.java index 1cdd975..bd142c8 100644 --- a/src/main/java/com/sztzjy/fund_investment/entity/ProfitManagementExample.java +++ b/src/main/java/com/sztzjy/fund_investment/entity/ProfitManagementExample.java @@ -724,136 +724,6 @@ public class ProfitManagementExample { addCriterion("fund_earnings not between", value1, value2, "fundEarnings"); return (Criteria) this; } - - public Criteria andExitTimingIsNull() { - addCriterion("exit_timing is null"); - return (Criteria) this; - } - - public Criteria andExitTimingIsNotNull() { - addCriterion("exit_timing is not null"); - return (Criteria) this; - } - - public Criteria andExitTimingEqualTo(String value) { - addCriterion("exit_timing =", value, "exitTiming"); - return (Criteria) this; - } - - public Criteria andExitTimingNotEqualTo(String value) { - addCriterion("exit_timing <>", value, "exitTiming"); - return (Criteria) this; - } - - public Criteria andExitTimingGreaterThan(String value) { - addCriterion("exit_timing >", value, "exitTiming"); - return (Criteria) this; - } - - public Criteria andExitTimingGreaterThanOrEqualTo(String value) { - addCriterion("exit_timing >=", value, "exitTiming"); - return (Criteria) this; - } - - public Criteria andExitTimingLessThan(String value) { - addCriterion("exit_timing <", value, "exitTiming"); - return (Criteria) this; - } - - public Criteria andExitTimingLessThanOrEqualTo(String value) { - addCriterion("exit_timing <=", value, "exitTiming"); - return (Criteria) this; - } - - public Criteria andExitTimingLike(String value) { - addCriterion("exit_timing like", value, "exitTiming"); - return (Criteria) this; - } - - public Criteria andExitTimingNotLike(String value) { - addCriterion("exit_timing not like", value, "exitTiming"); - return (Criteria) this; - } - - public Criteria andExitTimingIn(List<String> values) { - addCriterion("exit_timing in", values, "exitTiming"); - return (Criteria) this; - } - - public Criteria andExitTimingNotIn(List<String> values) { - addCriterion("exit_timing not in", values, "exitTiming"); - return (Criteria) this; - } - - public Criteria andExitTimingBetween(String value1, String value2) { - addCriterion("exit_timing between", value1, value2, "exitTiming"); - return (Criteria) this; - } - - public Criteria andExitTimingNotBetween(String value1, String value2) { - addCriterion("exit_timing not between", value1, value2, "exitTiming"); - return (Criteria) this; - } - - public Criteria andExitStockPriceIsNull() { - addCriterion("exit_stock_price is null"); - return (Criteria) this; - } - - public Criteria andExitStockPriceIsNotNull() { - addCriterion("exit_stock_price is not null"); - return (Criteria) this; - } - - public Criteria andExitStockPriceEqualTo(BigDecimal value) { - addCriterion("exit_stock_price =", value, "exitStockPrice"); - return (Criteria) this; - } - - public Criteria andExitStockPriceNotEqualTo(BigDecimal value) { - addCriterion("exit_stock_price <>", value, "exitStockPrice"); - return (Criteria) this; - } - - public Criteria andExitStockPriceGreaterThan(BigDecimal value) { - addCriterion("exit_stock_price >", value, "exitStockPrice"); - return (Criteria) this; - } - - public Criteria andExitStockPriceGreaterThanOrEqualTo(BigDecimal value) { - addCriterion("exit_stock_price >=", value, "exitStockPrice"); - return (Criteria) this; - } - - public Criteria andExitStockPriceLessThan(BigDecimal value) { - addCriterion("exit_stock_price <", value, "exitStockPrice"); - return (Criteria) this; - } - - public Criteria andExitStockPriceLessThanOrEqualTo(BigDecimal value) { - addCriterion("exit_stock_price <=", value, "exitStockPrice"); - return (Criteria) this; - } - - public Criteria andExitStockPriceIn(List<BigDecimal> values) { - addCriterion("exit_stock_price in", values, "exitStockPrice"); - return (Criteria) this; - } - - public Criteria andExitStockPriceNotIn(List<BigDecimal> values) { - addCriterion("exit_stock_price not in", values, "exitStockPrice"); - return (Criteria) this; - } - - public Criteria andExitStockPriceBetween(BigDecimal value1, BigDecimal value2) { - addCriterion("exit_stock_price between", value1, value2, "exitStockPrice"); - return (Criteria) this; - } - - public Criteria andExitStockPriceNotBetween(BigDecimal value1, BigDecimal value2) { - addCriterion("exit_stock_price not between", value1, value2, "exitStockPrice"); - return (Criteria) this; - } } public static class Criteria extends GeneratedCriteria { diff --git a/src/main/java/com/sztzjy/fund_investment/entity/TrainingReport.java b/src/main/java/com/sztzjy/fund_investment/entity/TrainingReport.java index 81ac897..b03cea0 100644 --- a/src/main/java/com/sztzjy/fund_investment/entity/TrainingReport.java +++ b/src/main/java/com/sztzjy/fund_investment/entity/TrainingReport.java @@ -3,7 +3,10 @@ package com.sztzjy.fund_investment.entity; import java.math.BigDecimal; import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModelProperty; +import org.springframework.format.annotation.DateTimeFormat; + /** * * @author xcj @@ -33,6 +36,8 @@ public class TrainingReport { @ApiModelProperty("心得分数") private BigDecimal experienceScore; + @DateTimeFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") @ApiModelProperty("上传时间") private Date uploadtime; diff --git a/src/main/java/com/sztzjy/fund_investment/mapper/ExitTimeMapper.java b/src/main/java/com/sztzjy/fund_investment/mapper/ExitTimeMapper.java new file mode 100644 index 0000000..a15e062 --- /dev/null +++ b/src/main/java/com/sztzjy/fund_investment/mapper/ExitTimeMapper.java @@ -0,0 +1,32 @@ +package com.sztzjy.fund_investment.mapper; + +import com.sztzjy.fund_investment.entity.ExitTime; +import com.sztzjy.fund_investment.entity.ExitTimeExample; +import java.util.List; + +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +@Mapper +public interface ExitTimeMapper { + long countByExample(ExitTimeExample example); + + int deleteByExample(ExitTimeExample example); + + int deleteByPrimaryKey(String flowId); + + int insert(ExitTime record); + + int insertSelective(ExitTime record); + + List<ExitTime> selectByExample(ExitTimeExample example); + + ExitTime selectByPrimaryKey(String flowId); + + int updateByExampleSelective(@Param("record") ExitTime record, @Param("example") ExitTimeExample example); + + int updateByExample(@Param("record") ExitTime record, @Param("example") ExitTimeExample example); + + int updateByPrimaryKeySelective(ExitTime record); + + int updateByPrimaryKey(ExitTime 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 e1a8013..ca387f5 100644 --- a/src/main/java/com/sztzjy/fund_investment/mapper/ProfitManagementMapper.java +++ b/src/main/java/com/sztzjy/fund_investment/mapper/ProfitManagementMapper.java @@ -2,10 +2,10 @@ 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; - -import java.util.List; @Mapper public interface ProfitManagementMapper { long countByExample(ProfitManagementExample example); diff --git a/src/main/java/com/sztzjy/fund_investment/mapper/TopicsMapper.java b/src/main/java/com/sztzjy/fund_investment/mapper/TopicsMapper.java index 6a97993..e04699e 100644 --- a/src/main/java/com/sztzjy/fund_investment/mapper/TopicsMapper.java +++ b/src/main/java/com/sztzjy/fund_investment/mapper/TopicsMapper.java @@ -3,10 +3,12 @@ package com.sztzjy.fund_investment.mapper; import com.sztzjy.fund_investment.entity.Topics; import com.sztzjy.fund_investment.entity.TopicsExample; import com.sztzjy.fund_investment.entity.TopicsWithBLOBs; + import java.util.List; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; + @Mapper public interface TopicsMapper { long countByExample(TopicsExample example); @@ -38,4 +40,6 @@ public interface TopicsMapper { int updateByPrimaryKey(Topics record); void insertBatch(List<Topics> list); + + List<TopicsWithBLOBs> getTopicsByCondition(@Param("schoolId") String schoolId, @Param("module") String module, @Param("topicContent") String topicContent); } \ No newline at end of file diff --git a/src/main/java/com/sztzjy/fund_investment/service/InvestmentReportService.java b/src/main/java/com/sztzjy/fund_investment/service/InvestmentReportService.java new file mode 100644 index 0000000..24eb249 --- /dev/null +++ b/src/main/java/com/sztzjy/fund_investment/service/InvestmentReportService.java @@ -0,0 +1,19 @@ +package com.sztzjy.fund_investment.service; + +import com.sztzjy.fund_investment.entity.TrainingReport; +import com.sztzjy.fund_investment.util.ResultEntity; +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; + +/** + * @Author xcj + * @Date 2023/12/4 + */ +public interface InvestmentReportService { + ResultEntity<String> uploadReport(MultipartFile file, String fileName, String flowId, String schoolId); + + List<TrainingReport> getTrainingReports(String flowId); + + ResultEntity<String> commitExperience(TrainingReport trainingReport); +} diff --git a/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/InvestmentReportServiceImpl.java b/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/InvestmentReportServiceImpl.java new file mode 100644 index 0000000..ec95c81 --- /dev/null +++ b/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/InvestmentReportServiceImpl.java @@ -0,0 +1,109 @@ +package com.sztzjy.fund_investment.service.serviceImpl; + +import com.sztzjy.fund_investment.entity.TrainingReport; +import com.sztzjy.fund_investment.entity.TrainingReportExample; +import com.sztzjy.fund_investment.mapper.TrainingReportMapper; +import com.sztzjy.fund_investment.service.InvestmentReportService; +import com.sztzjy.fund_investment.util.ResultEntity; +import com.sztzjy.fund_investment.util.file.IFileUtil; +import org.apache.commons.lang3.StringUtils; +import org.apache.xmlbeans.impl.xb.xsdschema.Public; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.stereotype.Service; +import org.springframework.web.multipart.MultipartFile; + +import java.util.Date; +import java.util.List; +import java.util.UUID; + +/** + * @Author xcj + * @Date 2023/12/4 + */ +@Service +public class InvestmentReportServiceImpl implements InvestmentReportService { + @Autowired + private IFileUtil fileUtil; + @Autowired + TrainingReportMapper trainingReportMapper; + + + /**报告提交 + * @author xcj + * @Date 2023/12/4 + */ + @Override + public ResultEntity<String> uploadReport(MultipartFile file, String fileName, String flowId, String schoolId) { + String filePath = fileUtil.upload(file); + String originalFilename = file.getOriginalFilename(); + String fileExtension = originalFilename.substring(originalFilename.lastIndexOf(".")).toLowerCase(); + if (!fileExtension.equals(".pdf") && !fileExtension.equals(".doc") && !fileExtension.equals(".docx")) { + return new ResultEntity<>(HttpStatus.BAD_REQUEST, "文件必须为word或pdf!"); + } + List<TrainingReport> trainingReports = getTrainingReports(flowId); + + //只允许提交一次,判断是否只提交了心得没提交报告 + if (!trainingReports.isEmpty()) { + TrainingReport trainingReport = trainingReports.get(0); + if (StringUtils.isNotBlank(trainingReport.getReportName())) { + return new ResultEntity<>(HttpStatus.BAD_REQUEST, "不允许重复提交!"); + } else { + trainingReport.setUrl(filePath); + trainingReport.setReportName(fileName); + trainingReport.setUploadtime(new Date()); + trainingReport.setStep("投资报告"); + trainingReportMapper.updateByPrimaryKey(trainingReport); + return new ResultEntity<>(HttpStatus.OK, "报告上传成功!"); + } + } else { //没上传报告没提交心得的情况 + TrainingReport trainingReport = new TrainingReport(); + trainingReport.setId(UUID.randomUUID().toString()); + trainingReport.setFlowId(flowId); + trainingReport.setSchoolId(schoolId); + trainingReport.setUrl(filePath); + trainingReport.setReportName(fileName); + trainingReport.setUploadtime(new Date()); + trainingReport.setStep("投资报告"); + trainingReportMapper.insert(trainingReport); + return new ResultEntity<>(HttpStatus.OK, "报告上传成功!"); + } + } + + + @Override + public List<TrainingReport> getTrainingReports(String flowId) { + TrainingReportExample trainingReportExample = new TrainingReportExample(); + trainingReportExample.createCriteria().andFlowIdEqualTo(flowId); + return trainingReportMapper.selectByExample(trainingReportExample); + } + + + /* 提交心得 + * @author xcj + * @Date 2023/12/4 + */ + @Override + public ResultEntity<String> commitExperience(TrainingReport trainingReport) { + if (StringUtils.isBlank(trainingReport.getExperience())) { + return new ResultEntity<>(HttpStatus.BAD_REQUEST, "请先填写心得再提交!"); + } + if (StringUtils.isBlank(trainingReport.getId()) || StringUtils.isBlank(trainingReport.getFlowId()) || StringUtils.isBlank(trainingReport.getSchoolId())) { + return new ResultEntity<>(HttpStatus.BAD_REQUEST, "提交失败!缺少所需的ID!"); + } + List<TrainingReport> trainingReports = getTrainingReports(trainingReport.getFlowId()); + if (!trainingReports.isEmpty()) { + TrainingReport dataTrainingReport = trainingReports.get(0); + if (StringUtils.isNotBlank(dataTrainingReport.getExperience())){ + return new ResultEntity<>(HttpStatus.BAD_REQUEST, "不允许重复提交!"); + }else { //提交了报告没提交心得 + trainingReport.setExperience(trainingReport.getExperience()); + trainingReport.setUploadtime(new Date()); + trainingReportMapper.updateByPrimaryKey(trainingReport); + } + } else { //为空新增 + trainingReportMapper.insert(trainingReport); + } + return new ResultEntity<>(HttpStatus.OK, "提交成功!"); + } +} diff --git a/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/tea/TeaTopicManageServiceImpl.java b/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/tea/TeaTopicManageServiceImpl.java index 05dc3fb..17c77db 100644 --- a/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/tea/TeaTopicManageServiceImpl.java +++ b/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/tea/TeaTopicManageServiceImpl.java @@ -1,6 +1,5 @@ package com.sztzjy.fund_investment.service.serviceImpl.tea; -import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.sztzjy.fund_investment.entity.*; import com.sztzjy.fund_investment.entity.dto.QuestionAnswerDto; @@ -18,6 +17,7 @@ import org.springframework.http.HttpStatus; import org.springframework.stereotype.Service; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; /** @@ -26,7 +26,6 @@ import java.util.List; */ @Service public class TeaTopicManageServiceImpl implements TeaTopicManageService { - @Autowired private TopicsMapper topicsMapper; @Autowired @@ -39,18 +38,37 @@ public class TeaTopicManageServiceImpl implements TeaTopicManageService { @Override public ResultEntity<String> insertTopics(TopicsWithBLOBs topics) { - if (StringUtils.isNotBlank(topics.getTopicContent())) { + if (StringUtils.isBlank(topics.getTopicContent())) { return new ResultEntity<>(HttpStatus.BAD_REQUEST, "题干不能为空!"); } - if (StringUtils.isNotBlank(topics.getChoicesa()) || StringUtils.isNotBlank(topics.getChoicesb())) { + if (StringUtils.isBlank(topics.getChoicesa()) || StringUtils.isBlank(topics.getChoicesb().trim())) { return new ResultEntity<>(HttpStatus.BAD_REQUEST, "选项不能为空!"); } - if (StringUtils.isNotBlank(topics.getTopicType())) { + if (StringUtils.isBlank(topics.getTopicType())) { return new ResultEntity<>(HttpStatus.BAD_REQUEST, "题型不能为空!"); } - if (StringUtils.isNotBlank(topics.getAnswer())) { + if (StringUtils.isBlank(topics.getAnswer())) { return new ResultEntity<>(HttpStatus.BAD_REQUEST, "答案不能为空!"); } + if (topics.getTopicType().equals("判断题")) { + if (!topics.getAnswer().equals("A") && !topics.getAnswer().equals("B")) { + return new ResultEntity<>(HttpStatus.BAD_REQUEST, "判断题答案必须为A或者B!"); + } + } + if (topics.getTopicType().equals("单选题")) { + if (!topics.getAnswer().matches("[ABCDE]")) { + return new ResultEntity<>(HttpStatus.BAD_REQUEST, "单选题答案必须为ABCDE中的一个!"); + } + } + if (topics.getTopicType().equals("多选题")) { + if (!topics.getAnswer().matches("^[A-E](,[A-E]){1,}$")) { + return new ResultEntity<>(HttpStatus.BAD_REQUEST, "多选题答案格式不正确!答案应为大写字母A到E,用英文逗号隔开,并至少选择两个选项。"); + } + List<String> list = Arrays.asList(topics.getChoicesa(), topics.getChoicesb(), topics.getChoicesc()); + if (list.stream().anyMatch(StringUtils::isBlank)) { + return new ResultEntity<>(HttpStatus.BAD_REQUEST, "多选题最少需要A,B,C三个选项!"); + } + } if (topics.getScore() == null || topics.getScore() == 0) { return new ResultEntity<>(HttpStatus.BAD_REQUEST, "分值不能为空!"); } @@ -65,20 +83,15 @@ public class TeaTopicManageServiceImpl implements TeaTopicManageService { */ @Override public PageInfo<TopicsWithBLOBs> getTopicsBySchoolId(Integer index, Integer size, String schoolId, String module, String topicContent) { - PageHelper.startPage(index, size); - TopicsExample topicsExample = new TopicsExample(); - TopicsExample.Criteria criteria = topicsExample.createCriteria(); - criteria.andSchoolIdEqualTo(schoolId).andModuleEqualTo(module); - if (!("").equals(topicContent) && topicContent != null) { - topicContent = "%" + topicContent + "%"; - criteria.andTopicIdEqualTo(topicContent); - } - List<TopicsWithBLOBs> topicsWithBLOBs = topicsMapper.selectByExampleWithBLOBs(topicsExample); - return new PageInfo<>(topicsWithBLOBs); + List<TopicsWithBLOBs> topics = topicsMapper.getTopicsByCondition(schoolId, module, topicContent); + PageInfo pageInfo = PageUtil.pageHelper(topics, index, size); + return pageInfo; } - /** 互动答疑查询展示 + /** + * 互动答疑查询展示 + * * @author xcj * @Date 2023/12/1 */ @@ -91,10 +104,10 @@ public class TeaTopicManageServiceImpl implements TeaTopicManageService { UserTableExample.Criteria criteria = userTableExample.createCriteria(); UserTableExample.Criteria or = userTableExample.createCriteria(); criteria.andSchoolIdEqualTo(schoolId); - if (StringUtils.isNotBlank(className)){ + if (StringUtils.isNotBlank(className)) { criteria.andClassNameEqualTo(className); } - if (StringUtils.isNotBlank(keyWord)){ + if (StringUtils.isNotBlank(keyWord)) { criteria.andStudentIdEqualTo(keyWord); or.andNameEqualTo(keyWord); } diff --git a/src/main/resources/generatorConfig.xml b/src/main/resources/generatorConfig.xml index 237e5bc..949468c 100644 --- a/src/main/resources/generatorConfig.xml +++ b/src/main/resources/generatorConfig.xml @@ -46,9 +46,10 @@ <!-- <table tableName="performance_score" domainObjectName="PerformanceScore" />--> <!-- <table tableName="tea_class_score" domainObjectName="TeaClassScore" />--> <!-- <table tableName="profit_distribution" domainObjectName="ProfitDistribution" />--> -<!-- <table tableName="profit_management" domainObjectName="ProfitManagement" />--> -<!-- <table tableName="question_answer" domainObjectName="QuestionAnswer" />--> - <table tableName="sys_topics" domainObjectName="Topics" /> + <table tableName="profit_management" domainObjectName="ProfitManagement" /> +<!-- <table tableName="exit_time" domainObjectName="ExitTime" />--> + <!-- <table tableName="question_answer" domainObjectName="QuestionAnswer" />--> +<!-- <table tableName="sys_topics" domainObjectName="Topics" />--> <!-- <table tableName="topic_record" domainObjectName="TopicRecord" />--> <!-- <table tableName="found_project" domainObjectName="FoundProject" />--> <!-- <table tableName="training_report" domainObjectName="TrainingReport" />--> diff --git a/src/main/resources/mappers/ExitTimeMapper.xml b/src/main/resources/mappers/ExitTimeMapper.xml new file mode 100644 index 0000000..97c275b --- /dev/null +++ b/src/main/resources/mappers/ExitTimeMapper.xml @@ -0,0 +1,306 @@ +<?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.ExitTimeMapper"> + <resultMap id="BaseResultMap" type="com.sztzjy.fund_investment.entity.ExitTime"> + <id column="flow_id" jdbcType="VARCHAR" property="flowId" /> + <result column="porject_name" jdbcType="VARCHAR" property="porjectName" /> + <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="exit_market_value" jdbcType="DECIMAL" property="exitMarketValue" /> + <result column="exit_yield" jdbcType="DECIMAL" property="exitYield" /> + <result column="exit_fund_earnings" jdbcType="DECIMAL" property="exitFundEarnings" /> + <result column="exit_timing" jdbcType="VARCHAR" property="exitTiming" /> + <result column="exit_stock_price" jdbcType="DECIMAL" property="exitStockPrice" /> + </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"> + flow_id, porject_name, investment_amount, share_ratio, total_equity, share_count, + exit_market_value, exit_yield, exit_fund_earnings, exit_timing, exit_stock_price + </sql> + <select id="selectByExample" parameterType="com.sztzjy.fund_investment.entity.ExitTimeExample" resultMap="BaseResultMap"> + select + <if test="distinct"> + distinct + </if> + <include refid="Base_Column_List" /> + from exit_time + <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 exit_time + where flow_id = #{flowId,jdbcType=VARCHAR} + </select> + <delete id="deleteByPrimaryKey" parameterType="java.lang.String"> + delete from exit_time + where flow_id = #{flowId,jdbcType=VARCHAR} + </delete> + <delete id="deleteByExample" parameterType="com.sztzjy.fund_investment.entity.ExitTimeExample"> + delete from exit_time + <if test="_parameter != null"> + <include refid="Example_Where_Clause" /> + </if> + </delete> + <insert id="insert" parameterType="com.sztzjy.fund_investment.entity.ExitTime"> + insert into exit_time (flow_id, porject_name, investment_amount, + share_ratio, total_equity, share_count, + exit_market_value, exit_yield, exit_fund_earnings, + exit_timing, exit_stock_price) + values (#{flowId,jdbcType=VARCHAR}, #{porjectName,jdbcType=VARCHAR}, #{investmentAmount,jdbcType=DECIMAL}, + #{shareRatio,jdbcType=DECIMAL}, #{totalEquity,jdbcType=DECIMAL}, #{shareCount,jdbcType=DECIMAL}, + #{exitMarketValue,jdbcType=DECIMAL}, #{exitYield,jdbcType=DECIMAL}, #{exitFundEarnings,jdbcType=DECIMAL}, + #{exitTiming,jdbcType=VARCHAR}, #{exitStockPrice,jdbcType=DECIMAL}) + </insert> + <insert id="insertSelective" parameterType="com.sztzjy.fund_investment.entity.ExitTime"> + insert into exit_time + <trim prefix="(" suffix=")" suffixOverrides=","> + <if test="flowId != null"> + flow_id, + </if> + <if test="porjectName != null"> + porject_name, + </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="exitMarketValue != null"> + exit_market_value, + </if> + <if test="exitYield != null"> + exit_yield, + </if> + <if test="exitFundEarnings != null"> + exit_fund_earnings, + </if> + <if test="exitTiming != null"> + exit_timing, + </if> + <if test="exitStockPrice != null"> + exit_stock_price, + </if> + </trim> + <trim prefix="values (" suffix=")" suffixOverrides=","> + <if test="flowId != null"> + #{flowId,jdbcType=VARCHAR}, + </if> + <if test="porjectName != null"> + #{porjectName,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="exitMarketValue != null"> + #{exitMarketValue,jdbcType=DECIMAL}, + </if> + <if test="exitYield != null"> + #{exitYield,jdbcType=DECIMAL}, + </if> + <if test="exitFundEarnings != null"> + #{exitFundEarnings,jdbcType=DECIMAL}, + </if> + <if test="exitTiming != null"> + #{exitTiming,jdbcType=VARCHAR}, + </if> + <if test="exitStockPrice != null"> + #{exitStockPrice,jdbcType=DECIMAL}, + </if> + </trim> + </insert> + <select id="countByExample" parameterType="com.sztzjy.fund_investment.entity.ExitTimeExample" resultType="java.lang.Long"> + select count(*) from exit_time + <if test="_parameter != null"> + <include refid="Example_Where_Clause" /> + </if> + </select> + <update id="updateByExampleSelective" parameterType="map"> + update exit_time + <set> + <if test="record.flowId != null"> + flow_id = #{record.flowId,jdbcType=VARCHAR}, + </if> + <if test="record.porjectName != null"> + porject_name = #{record.porjectName,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.exitMarketValue != null"> + exit_market_value = #{record.exitMarketValue,jdbcType=DECIMAL}, + </if> + <if test="record.exitYield != null"> + exit_yield = #{record.exitYield,jdbcType=DECIMAL}, + </if> + <if test="record.exitFundEarnings != null"> + exit_fund_earnings = #{record.exitFundEarnings,jdbcType=DECIMAL}, + </if> + <if test="record.exitTiming != null"> + exit_timing = #{record.exitTiming,jdbcType=VARCHAR}, + </if> + <if test="record.exitStockPrice != null"> + exit_stock_price = #{record.exitStockPrice,jdbcType=DECIMAL}, + </if> + </set> + <if test="_parameter != null"> + <include refid="Update_By_Example_Where_Clause" /> + </if> + </update> + <update id="updateByExample" parameterType="map"> + update exit_time + set flow_id = #{record.flowId,jdbcType=VARCHAR}, + porject_name = #{record.porjectName,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}, + exit_market_value = #{record.exitMarketValue,jdbcType=DECIMAL}, + exit_yield = #{record.exitYield,jdbcType=DECIMAL}, + exit_fund_earnings = #{record.exitFundEarnings,jdbcType=DECIMAL}, + exit_timing = #{record.exitTiming,jdbcType=VARCHAR}, + exit_stock_price = #{record.exitStockPrice,jdbcType=DECIMAL} + <if test="_parameter != null"> + <include refid="Update_By_Example_Where_Clause" /> + </if> + </update> + <update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.fund_investment.entity.ExitTime"> + update exit_time + <set> + <if test="porjectName != null"> + porject_name = #{porjectName,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="exitMarketValue != null"> + exit_market_value = #{exitMarketValue,jdbcType=DECIMAL}, + </if> + <if test="exitYield != null"> + exit_yield = #{exitYield,jdbcType=DECIMAL}, + </if> + <if test="exitFundEarnings != null"> + exit_fund_earnings = #{exitFundEarnings,jdbcType=DECIMAL}, + </if> + <if test="exitTiming != null"> + exit_timing = #{exitTiming,jdbcType=VARCHAR}, + </if> + <if test="exitStockPrice != null"> + exit_stock_price = #{exitStockPrice,jdbcType=DECIMAL}, + </if> + </set> + where flow_id = #{flowId,jdbcType=VARCHAR} + </update> + <update id="updateByPrimaryKey" parameterType="com.sztzjy.fund_investment.entity.ExitTime"> + update exit_time + set porject_name = #{porjectName,jdbcType=VARCHAR}, + investment_amount = #{investmentAmount,jdbcType=DECIMAL}, + share_ratio = #{shareRatio,jdbcType=DECIMAL}, + total_equity = #{totalEquity,jdbcType=DECIMAL}, + share_count = #{shareCount,jdbcType=DECIMAL}, + exit_market_value = #{exitMarketValue,jdbcType=DECIMAL}, + exit_yield = #{exitYield,jdbcType=DECIMAL}, + exit_fund_earnings = #{exitFundEarnings,jdbcType=DECIMAL}, + exit_timing = #{exitTiming,jdbcType=VARCHAR}, + exit_stock_price = #{exitStockPrice,jdbcType=DECIMAL} + where flow_id = #{flowId,jdbcType=VARCHAR} + </update> +</mapper> \ No newline at end of file diff --git a/src/main/resources/mappers/ProfitManagementMapper.xml b/src/main/resources/mappers/ProfitManagementMapper.xml index 6ef44bd..416c986 100644 --- a/src/main/resources/mappers/ProfitManagementMapper.xml +++ b/src/main/resources/mappers/ProfitManagementMapper.xml @@ -12,8 +12,6 @@ <result column="stock_price" jdbcType="DECIMAL" property="stockPrice" /> <result column="market_value" jdbcType="DECIMAL" property="marketValue" /> <result column="fund_earnings" jdbcType="DECIMAL" property="fundEarnings" /> - <result column="exit_timing" jdbcType="VARCHAR" property="exitTiming" /> - <result column="exit_stock_price" jdbcType="DECIMAL" property="exitStockPrice" /> </resultMap> <sql id="Example_Where_Clause"> <where> @@ -75,7 +73,7 @@ </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, exit_timing, exit_stock_price + stock_price, market_value, fund_earnings </sql> <select id="selectByExample" parameterType="com.sztzjy.fund_investment.entity.ProfitManagementExample" resultMap="BaseResultMap"> select @@ -111,13 +109,11 @@ insert into profit_management (id, flow_id, investment_amount, share_ratio, total_equity, share_count, market_time, stock_price, market_value, - fund_earnings, exit_timing, exit_stock_price - ) + 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}, #{exitTiming,jdbcType=VARCHAR}, #{exitStockPrice,jdbcType=DECIMAL} - ) + #{fundEarnings,jdbcType=DECIMAL}) </insert> <insert id="insertSelective" parameterType="com.sztzjy.fund_investment.entity.ProfitManagement"> insert into profit_management @@ -152,12 +148,6 @@ <if test="fundEarnings != null"> fund_earnings, </if> - <if test="exitTiming != null"> - exit_timing, - </if> - <if test="exitStockPrice != null"> - exit_stock_price, - </if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> <if test="id != null"> @@ -190,12 +180,6 @@ <if test="fundEarnings != null"> #{fundEarnings,jdbcType=DECIMAL}, </if> - <if test="exitTiming != null"> - #{exitTiming,jdbcType=VARCHAR}, - </if> - <if test="exitStockPrice != null"> - #{exitStockPrice,jdbcType=DECIMAL}, - </if> </trim> </insert> <select id="countByExample" parameterType="com.sztzjy.fund_investment.entity.ProfitManagementExample" resultType="java.lang.Long"> @@ -237,12 +221,6 @@ <if test="record.fundEarnings != null"> fund_earnings = #{record.fundEarnings,jdbcType=DECIMAL}, </if> - <if test="record.exitTiming != null"> - exit_timing = #{record.exitTiming,jdbcType=VARCHAR}, - </if> - <if test="record.exitStockPrice != null"> - exit_stock_price = #{record.exitStockPrice,jdbcType=DECIMAL}, - </if> </set> <if test="_parameter != null"> <include refid="Update_By_Example_Where_Clause" /> @@ -259,9 +237,7 @@ market_time = #{record.marketTime,jdbcType=INTEGER}, stock_price = #{record.stockPrice,jdbcType=DECIMAL}, market_value = #{record.marketValue,jdbcType=DECIMAL}, - fund_earnings = #{record.fundEarnings,jdbcType=DECIMAL}, - exit_timing = #{record.exitTiming,jdbcType=VARCHAR}, - exit_stock_price = #{record.exitStockPrice,jdbcType=DECIMAL} + fund_earnings = #{record.fundEarnings,jdbcType=DECIMAL} <if test="_parameter != null"> <include refid="Update_By_Example_Where_Clause" /> </if> @@ -296,12 +272,6 @@ <if test="fundEarnings != null"> fund_earnings = #{fundEarnings,jdbcType=DECIMAL}, </if> - <if test="exitTiming != null"> - exit_timing = #{exitTiming,jdbcType=VARCHAR}, - </if> - <if test="exitStockPrice != null"> - exit_stock_price = #{exitStockPrice,jdbcType=DECIMAL}, - </if> </set> where id = #{id,jdbcType=VARCHAR} </update> @@ -315,9 +285,7 @@ market_time = #{marketTime,jdbcType=INTEGER}, stock_price = #{stockPrice,jdbcType=DECIMAL}, market_value = #{marketValue,jdbcType=DECIMAL}, - fund_earnings = #{fundEarnings,jdbcType=DECIMAL}, - exit_timing = #{exitTiming,jdbcType=VARCHAR}, - exit_stock_price = #{exitStockPrice,jdbcType=DECIMAL} + fund_earnings = #{fundEarnings,jdbcType=DECIMAL} where id = #{id,jdbcType=VARCHAR} </update> </mapper> \ No newline at end of file diff --git a/src/main/resources/mappers/TopicsMapper.xml b/src/main/resources/mappers/TopicsMapper.xml index c6a1651..567aa6e 100644 --- a/src/main/resources/mappers/TopicsMapper.xml +++ b/src/main/resources/mappers/TopicsMapper.xml @@ -1,439 +1,469 @@ <?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.TopicsMapper"> - <resultMap id="BaseResultMap" type="com.sztzjy.fund_investment.entity.Topics"> - <id column="topic_id" jdbcType="VARCHAR" property="topicId" /> - <result column="choicesA" jdbcType="VARCHAR" property="choicesa" /> - <result column="choicesB" jdbcType="VARCHAR" property="choicesb" /> - <result column="choicesC" jdbcType="VARCHAR" property="choicesc" /> - <result column="choicesD" jdbcType="VARCHAR" property="choicesd" /> - <result column="choicesE" jdbcType="VARCHAR" property="choicese" /> - <result column="topic_type" jdbcType="VARCHAR" property="topicType" /> - <result column="source" jdbcType="VARCHAR" property="source" /> - <result column="module" jdbcType="VARCHAR" property="module" /> - <result column="answer" jdbcType="VARCHAR" property="answer" /> - <result column="user_answer" jdbcType="VARCHAR" property="userAnswer" /> - <result column="score" jdbcType="INTEGER" property="score" /> - <result column="school_id" jdbcType="VARCHAR" property="schoolId" /> - </resultMap> - <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.sztzjy.fund_investment.entity.TopicsWithBLOBs"> - <result column="topic_content" jdbcType="LONGVARCHAR" property="topicContent" /> - <result column="analysis" jdbcType="LONGVARCHAR" property="analysis" /> - </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> + <resultMap id="BaseResultMap" type="com.sztzjy.fund_investment.entity.Topics"> + <id column="topic_id" jdbcType="VARCHAR" property="topicId"/> + <result column="choicesA" jdbcType="VARCHAR" property="choicesa"/> + <result column="choicesB" jdbcType="VARCHAR" property="choicesb"/> + <result column="choicesC" jdbcType="VARCHAR" property="choicesc"/> + <result column="choicesD" jdbcType="VARCHAR" property="choicesd"/> + <result column="choicesE" jdbcType="VARCHAR" property="choicese"/> + <result column="topic_type" jdbcType="VARCHAR" property="topicType"/> + <result column="source" jdbcType="VARCHAR" property="source"/> + <result column="module" jdbcType="VARCHAR" property="module"/> + <result column="answer" jdbcType="VARCHAR" property="answer"/> + <result column="user_answer" jdbcType="VARCHAR" property="userAnswer"/> + <result column="score" jdbcType="INTEGER" property="score"/> + <result column="school_id" jdbcType="VARCHAR" property="schoolId"/> + </resultMap> + <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.sztzjy.fund_investment.entity.TopicsWithBLOBs"> + <result column="topic_content" jdbcType="LONGVARCHAR" property="topicContent"/> + <result column="analysis" jdbcType="LONGVARCHAR" property="analysis"/> + </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> - </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> + </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> - </trim> - </if> - </foreach> - </where> - </sql> - <sql id="Base_Column_List"> - topic_id, choicesA, choicesB, choicesC, choicesD, choicesE, topic_type, source, module, + </where> + </sql> + <sql id="Base_Column_List"> + topic_id + , choicesA, choicesB, choicesC, choicesD, choicesE, topic_type, source, module, answer, user_answer, score, school_id - </sql> - <sql id="Blob_Column_List"> - topic_content, analysis - </sql> - <select id="selectByExampleWithBLOBs" parameterType="com.sztzjy.fund_investment.entity.TopicsExample" resultMap="ResultMapWithBLOBs"> - select - <if test="distinct"> - distinct - </if> - <include refid="Base_Column_List" /> - , - <include refid="Blob_Column_List" /> - from sys_topics - <if test="_parameter != null"> - <include refid="Example_Where_Clause" /> - </if> - <if test="orderByClause != null"> - order by ${orderByClause} - </if> - </select> - <select id="selectByExample" parameterType="com.sztzjy.fund_investment.entity.TopicsExample" resultMap="BaseResultMap"> - select - <if test="distinct"> - distinct - </if> - <include refid="Base_Column_List" /> - from sys_topics - <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="ResultMapWithBLOBs"> - select - <include refid="Base_Column_List" /> - , - <include refid="Blob_Column_List" /> - from sys_topics - where topic_id = #{topicId,jdbcType=VARCHAR} - </select> - <delete id="deleteByPrimaryKey" parameterType="java.lang.String"> - delete from sys_topics - where topic_id = #{topicId,jdbcType=VARCHAR} - </delete> - <delete id="deleteByExample" parameterType="com.sztzjy.fund_investment.entity.TopicsExample"> - delete from sys_topics - <if test="_parameter != null"> - <include refid="Example_Where_Clause" /> - </if> - </delete> - <insert id="insert" parameterType="com.sztzjy.fund_investment.entity.TopicsWithBLOBs"> - insert into sys_topics (topic_id, choicesA, choicesB, - choicesC, choicesD, choicesE, - topic_type, source, module, - answer, user_answer, score, - school_id, topic_content, analysis - ) - values (#{topicId,jdbcType=VARCHAR}, #{choicesa,jdbcType=VARCHAR}, #{choicesb,jdbcType=VARCHAR}, - #{choicesc,jdbcType=VARCHAR}, #{choicesd,jdbcType=VARCHAR}, #{choicese,jdbcType=VARCHAR}, - #{topicType,jdbcType=VARCHAR}, #{source,jdbcType=VARCHAR}, #{module,jdbcType=VARCHAR}, - #{answer,jdbcType=VARCHAR}, #{userAnswer,jdbcType=VARCHAR}, #{score,jdbcType=INTEGER}, - #{schoolId,jdbcType=VARCHAR}, #{topicContent,jdbcType=LONGVARCHAR}, #{analysis,jdbcType=LONGVARCHAR} - ) - </insert> - <insert id="insertSelective" parameterType="com.sztzjy.fund_investment.entity.TopicsWithBLOBs"> - insert into sys_topics - <trim prefix="(" suffix=")" suffixOverrides=","> - <if test="topicId != null"> - topic_id, - </if> - <if test="choicesa != null"> - choicesA, - </if> - <if test="choicesb != null"> - choicesB, - </if> - <if test="choicesc != null"> - choicesC, - </if> - <if test="choicesd != null"> - choicesD, - </if> - <if test="choicese != null"> - choicesE, - </if> - <if test="topicType != null"> - topic_type, - </if> - <if test="source != null"> - source, - </if> - <if test="module != null"> - module, - </if> - <if test="answer != null"> - answer, - </if> - <if test="userAnswer != null"> - user_answer, - </if> - <if test="score != null"> - score, - </if> - <if test="schoolId != null"> - school_id, - </if> - <if test="topicContent != null"> - topic_content, - </if> - <if test="analysis != null"> - analysis, - </if> - </trim> - <trim prefix="values (" suffix=")" suffixOverrides=","> - <if test="topicId != null"> - #{topicId,jdbcType=VARCHAR}, - </if> - <if test="choicesa != null"> - #{choicesa,jdbcType=VARCHAR}, - </if> - <if test="choicesb != null"> - #{choicesb,jdbcType=VARCHAR}, - </if> - <if test="choicesc != null"> - #{choicesc,jdbcType=VARCHAR}, - </if> - <if test="choicesd != null"> - #{choicesd,jdbcType=VARCHAR}, - </if> - <if test="choicese != null"> - #{choicese,jdbcType=VARCHAR}, - </if> - <if test="topicType != null"> - #{topicType,jdbcType=VARCHAR}, - </if> - <if test="source != null"> - #{source,jdbcType=VARCHAR}, - </if> - <if test="module != null"> - #{module,jdbcType=VARCHAR}, - </if> - <if test="answer != null"> - #{answer,jdbcType=VARCHAR}, - </if> - <if test="userAnswer != null"> - #{userAnswer,jdbcType=VARCHAR}, - </if> - <if test="score != null"> - #{score,jdbcType=INTEGER}, - </if> - <if test="schoolId != null"> - #{schoolId,jdbcType=VARCHAR}, - </if> - <if test="topicContent != null"> - #{topicContent,jdbcType=LONGVARCHAR}, - </if> - <if test="analysis != null"> - #{analysis,jdbcType=LONGVARCHAR}, - </if> - </trim> - </insert> + </sql> + <sql id="Blob_Column_List"> + topic_content + , analysis + </sql> + + + <select id="getTopicsByCondition" parameterType="java.lang.String" resultMap="ResultMapWithBLOBs"> + select + <include refid="Base_Column_List"/> + , + <include refid="Blob_Column_List"/> + from sys_topics + <where> + <if test="schoolId != null"> + AND school_id in (#{schoolId},'999') + </if> + <if test="module != null"> + AND module = #{module} + </if> + <if test="topicContent != null"> + AND topic_content LIKE CONCAT('%', #{topicContent}, '%') + </if> + </where> + </select> + + + + <select id="selectByExampleWithBLOBs" parameterType="com.sztzjy.fund_investment.entity.TopicsExample" + resultMap="ResultMapWithBLOBs"> + select + <if test="distinct"> + distinct + </if> + <include refid="Base_Column_List"/> + , + <include refid="Blob_Column_List"/> + from sys_topics + <if test="_parameter != null"> + <include refid="Example_Where_Clause"/> + </if> + <if test="orderByClause != null"> + order by ${orderByClause} + </if> + </select> + <select id="selectByExample" parameterType="com.sztzjy.fund_investment.entity.TopicsExample" + resultMap="BaseResultMap"> + select + <if test="distinct"> + distinct + </if> + <include refid="Base_Column_List"/> + from sys_topics + <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="ResultMapWithBLOBs"> + select + <include refid="Base_Column_List"/> + , + <include refid="Blob_Column_List"/> + from sys_topics + where topic_id = #{topicId,jdbcType=VARCHAR} + </select> + <delete id="deleteByPrimaryKey" parameterType="java.lang.String"> + delete + from sys_topics + where topic_id = #{topicId,jdbcType=VARCHAR} + </delete> + <delete id="deleteByExample" parameterType="com.sztzjy.fund_investment.entity.TopicsExample"> + delete from sys_topics + <if test="_parameter != null"> + <include refid="Example_Where_Clause"/> + </if> + </delete> + <insert id="insert" parameterType="com.sztzjy.fund_investment.entity.TopicsWithBLOBs"> + insert into sys_topics (topic_id, choicesA, choicesB, + choicesC, choicesD, choicesE, + topic_type, source, module, + answer, user_answer, score, + school_id, topic_content, analysis) + values (#{topicId,jdbcType=VARCHAR}, #{choicesa,jdbcType=VARCHAR}, #{choicesb,jdbcType=VARCHAR}, + #{choicesc,jdbcType=VARCHAR}, #{choicesd,jdbcType=VARCHAR}, #{choicese,jdbcType=VARCHAR}, + #{topicType,jdbcType=VARCHAR}, #{source,jdbcType=VARCHAR}, #{module,jdbcType=VARCHAR}, + #{answer,jdbcType=VARCHAR}, #{userAnswer,jdbcType=VARCHAR}, #{score,jdbcType=INTEGER}, + #{schoolId,jdbcType=VARCHAR}, #{topicContent,jdbcType=LONGVARCHAR}, #{analysis,jdbcType=LONGVARCHAR}) + </insert> + <insert id="insertSelective" parameterType="com.sztzjy.fund_investment.entity.TopicsWithBLOBs"> + insert into sys_topics + <trim prefix="(" suffix=")" suffixOverrides=","> + <if test="topicId != null"> + topic_id, + </if> + <if test="choicesa != null"> + choicesA, + </if> + <if test="choicesb != null"> + choicesB, + </if> + <if test="choicesc != null"> + choicesC, + </if> + <if test="choicesd != null"> + choicesD, + </if> + <if test="choicese != null"> + choicesE, + </if> + <if test="topicType != null"> + topic_type, + </if> + <if test="source != null"> + source, + </if> + <if test="module != null"> + module, + </if> + <if test="answer != null"> + answer, + </if> + <if test="userAnswer != null"> + user_answer, + </if> + <if test="score != null"> + score, + </if> + <if test="schoolId != null"> + school_id, + </if> + <if test="topicContent != null"> + topic_content, + </if> + <if test="analysis != null"> + analysis, + </if> + </trim> + <trim prefix="values (" suffix=")" suffixOverrides=","> + <if test="topicId != null"> + #{topicId,jdbcType=VARCHAR}, + </if> + <if test="choicesa != null"> + #{choicesa,jdbcType=VARCHAR}, + </if> + <if test="choicesb != null"> + #{choicesb,jdbcType=VARCHAR}, + </if> + <if test="choicesc != null"> + #{choicesc,jdbcType=VARCHAR}, + </if> + <if test="choicesd != null"> + #{choicesd,jdbcType=VARCHAR}, + </if> + <if test="choicese != null"> + #{choicese,jdbcType=VARCHAR}, + </if> + <if test="topicType != null"> + #{topicType,jdbcType=VARCHAR}, + </if> + <if test="source != null"> + #{source,jdbcType=VARCHAR}, + </if> + <if test="module != null"> + #{module,jdbcType=VARCHAR}, + </if> + <if test="answer != null"> + #{answer,jdbcType=VARCHAR}, + </if> + <if test="userAnswer != null"> + #{userAnswer,jdbcType=VARCHAR}, + </if> + <if test="score != null"> + #{score,jdbcType=INTEGER}, + </if> + <if test="schoolId != null"> + #{schoolId,jdbcType=VARCHAR}, + </if> + <if test="topicContent != null"> + #{topicContent,jdbcType=LONGVARCHAR}, + </if> + <if test="analysis != null"> + #{analysis,jdbcType=LONGVARCHAR}, + </if> + </trim> + </insert> - <insert id="insertBatch" parameterType="java.util.List"> - INSERT INTO sys_topics (topic_id, topic_content, choicesA, choicesB, choicesC, choicesD, choicesE, topic_type, source, module, answer, score, analysis, school_id) - VALUES - <foreach collection="list" item="topic" separator=","> - (#{topic.topicId},#{topic.topicContent}, #{topic.choicesa}, #{topic.choicesb}, #{topic.choicesc}, - #{topic.choicesd}, #{topic.choicese}, #{topic.topicType}, #{topic.source}, - #{topic.module}, #{topic.answer}, #{topic.score}, #{topic.analysis}, #{topic.schoolId}) - </foreach> - </insert> + <insert id="insertBatch" parameterType="java.util.List"> + INSERT INTO sys_topics (topic_id, topic_content, choicesA, choicesB, choicesC, choicesD, choicesE, topic_type, + source, module, answer, score, analysis, school_id) + VALUES + <foreach collection="list" item="topic" separator=","> + (#{topic.topicId},#{topic.topicContent}, #{topic.choicesa}, #{topic.choicesb}, #{topic.choicesc}, + #{topic.choicesd}, #{topic.choicese}, #{topic.topicType}, #{topic.source}, + #{topic.module}, #{topic.answer}, #{topic.score}, #{topic.analysis}, #{topic.schoolId}) + </foreach> + </insert> - <select id="countByExample" parameterType="com.sztzjy.fund_investment.entity.TopicsExample" resultType="java.lang.Long"> - select count(*) from sys_topics - <if test="_parameter != null"> - <include refid="Example_Where_Clause" /> - </if> - </select> - <update id="updateByExampleSelective" parameterType="map"> - update sys_topics - <set> - <if test="record.topicId != null"> - topic_id = #{record.topicId,jdbcType=VARCHAR}, - </if> - <if test="record.choicesa != null"> + <select id="countByExample" parameterType="com.sztzjy.fund_investment.entity.TopicsExample" + resultType="java.lang.Long"> + select count(*) from sys_topics + <if test="_parameter != null"> + <include refid="Example_Where_Clause"/> + </if> + </select> + <update id="updateByExampleSelective" parameterType="map"> + update sys_topics + <set> + <if test="record.topicId != null"> + topic_id = #{record.topicId,jdbcType=VARCHAR}, + </if> + <if test="record.choicesa != null"> + choicesA = #{record.choicesa,jdbcType=VARCHAR}, + </if> + <if test="record.choicesb != null"> + choicesB = #{record.choicesb,jdbcType=VARCHAR}, + </if> + <if test="record.choicesc != null"> + choicesC = #{record.choicesc,jdbcType=VARCHAR}, + </if> + <if test="record.choicesd != null"> + choicesD = #{record.choicesd,jdbcType=VARCHAR}, + </if> + <if test="record.choicese != null"> + choicesE = #{record.choicese,jdbcType=VARCHAR}, + </if> + <if test="record.topicType != null"> + topic_type = #{record.topicType,jdbcType=VARCHAR}, + </if> + <if test="record.source != null"> + source = #{record.source,jdbcType=VARCHAR}, + </if> + <if test="record.module != null"> + module = #{record.module,jdbcType=VARCHAR}, + </if> + <if test="record.answer != null"> + answer = #{record.answer,jdbcType=VARCHAR}, + </if> + <if test="record.userAnswer != null"> + user_answer = #{record.userAnswer,jdbcType=VARCHAR}, + </if> + <if test="record.score != null"> + score = #{record.score,jdbcType=INTEGER}, + </if> + <if test="record.schoolId != null"> + school_id = #{record.schoolId,jdbcType=VARCHAR}, + </if> + <if test="record.topicContent != null"> + topic_content = #{record.topicContent,jdbcType=LONGVARCHAR}, + </if> + <if test="record.analysis != null"> + analysis = #{record.analysis,jdbcType=LONGVARCHAR}, + </if> + </set> + <if test="_parameter != null"> + <include refid="Update_By_Example_Where_Clause"/> + </if> + </update> + <update id="updateByExampleWithBLOBs" parameterType="map"> + update sys_topics + set topic_id = #{record.topicId,jdbcType=VARCHAR}, choicesA = #{record.choicesa,jdbcType=VARCHAR}, - </if> - <if test="record.choicesb != null"> choicesB = #{record.choicesb,jdbcType=VARCHAR}, - </if> - <if test="record.choicesc != null"> choicesC = #{record.choicesc,jdbcType=VARCHAR}, - </if> - <if test="record.choicesd != null"> choicesD = #{record.choicesd,jdbcType=VARCHAR}, - </if> - <if test="record.choicese != null"> choicesE = #{record.choicese,jdbcType=VARCHAR}, - </if> - <if test="record.topicType != null"> topic_type = #{record.topicType,jdbcType=VARCHAR}, - </if> - <if test="record.source != null"> source = #{record.source,jdbcType=VARCHAR}, - </if> - <if test="record.module != null"> module = #{record.module,jdbcType=VARCHAR}, - </if> - <if test="record.answer != null"> answer = #{record.answer,jdbcType=VARCHAR}, - </if> - <if test="record.userAnswer != null"> user_answer = #{record.userAnswer,jdbcType=VARCHAR}, - </if> - <if test="record.score != null"> score = #{record.score,jdbcType=INTEGER}, - </if> - <if test="record.schoolId != null"> school_id = #{record.schoolId,jdbcType=VARCHAR}, - </if> - <if test="record.topicContent != null"> topic_content = #{record.topicContent,jdbcType=LONGVARCHAR}, - </if> - <if test="record.analysis != null"> - analysis = #{record.analysis,jdbcType=LONGVARCHAR}, - </if> - </set> - <if test="_parameter != null"> - <include refid="Update_By_Example_Where_Clause" /> - </if> - </update> - <update id="updateByExampleWithBLOBs" parameterType="map"> - update sys_topics - set topic_id = #{record.topicId,jdbcType=VARCHAR}, - choicesA = #{record.choicesa,jdbcType=VARCHAR}, - choicesB = #{record.choicesb,jdbcType=VARCHAR}, - choicesC = #{record.choicesc,jdbcType=VARCHAR}, - choicesD = #{record.choicesd,jdbcType=VARCHAR}, - choicesE = #{record.choicese,jdbcType=VARCHAR}, - topic_type = #{record.topicType,jdbcType=VARCHAR}, - source = #{record.source,jdbcType=VARCHAR}, - module = #{record.module,jdbcType=VARCHAR}, - answer = #{record.answer,jdbcType=VARCHAR}, - user_answer = #{record.userAnswer,jdbcType=VARCHAR}, - score = #{record.score,jdbcType=INTEGER}, - school_id = #{record.schoolId,jdbcType=VARCHAR}, - topic_content = #{record.topicContent,jdbcType=LONGVARCHAR}, - analysis = #{record.analysis,jdbcType=LONGVARCHAR} - <if test="_parameter != null"> - <include refid="Update_By_Example_Where_Clause" /> - </if> - </update> - <update id="updateByExample" parameterType="map"> - update sys_topics - set topic_id = #{record.topicId,jdbcType=VARCHAR}, - choicesA = #{record.choicesa,jdbcType=VARCHAR}, - choicesB = #{record.choicesb,jdbcType=VARCHAR}, - choicesC = #{record.choicesc,jdbcType=VARCHAR}, - choicesD = #{record.choicesd,jdbcType=VARCHAR}, - choicesE = #{record.choicese,jdbcType=VARCHAR}, - topic_type = #{record.topicType,jdbcType=VARCHAR}, - source = #{record.source,jdbcType=VARCHAR}, - module = #{record.module,jdbcType=VARCHAR}, - answer = #{record.answer,jdbcType=VARCHAR}, - user_answer = #{record.userAnswer,jdbcType=VARCHAR}, - score = #{record.score,jdbcType=INTEGER}, - school_id = #{record.schoolId,jdbcType=VARCHAR} - <if test="_parameter != null"> - <include refid="Update_By_Example_Where_Clause" /> - </if> - </update> - <update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.fund_investment.entity.TopicsWithBLOBs"> - update sys_topics - <set> - <if test="choicesa != null"> - choicesA = #{choicesa,jdbcType=VARCHAR}, - </if> - <if test="choicesb != null"> - choicesB = #{choicesb,jdbcType=VARCHAR}, - </if> - <if test="choicesc != null"> - choicesC = #{choicesc,jdbcType=VARCHAR}, - </if> - <if test="choicesd != null"> - choicesD = #{choicesd,jdbcType=VARCHAR}, - </if> - <if test="choicese != null"> - choicesE = #{choicese,jdbcType=VARCHAR}, - </if> - <if test="topicType != null"> - topic_type = #{topicType,jdbcType=VARCHAR}, - </if> - <if test="source != null"> - source = #{source,jdbcType=VARCHAR}, - </if> - <if test="module != null"> - module = #{module,jdbcType=VARCHAR}, - </if> - <if test="answer != null"> - answer = #{answer,jdbcType=VARCHAR}, - </if> - <if test="userAnswer != null"> - user_answer = #{userAnswer,jdbcType=VARCHAR}, - </if> - <if test="score != null"> - score = #{score,jdbcType=INTEGER}, - </if> - <if test="schoolId != null"> - school_id = #{schoolId,jdbcType=VARCHAR}, - </if> - <if test="topicContent != null"> - topic_content = #{topicContent,jdbcType=LONGVARCHAR}, - </if> - <if test="analysis != null"> - analysis = #{analysis,jdbcType=LONGVARCHAR}, - </if> - </set> - where topic_id = #{topicId,jdbcType=VARCHAR} - </update> - <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.sztzjy.fund_investment.entity.TopicsWithBLOBs"> - update sys_topics - set choicesA = #{choicesa,jdbcType=VARCHAR}, - choicesB = #{choicesb,jdbcType=VARCHAR}, - choicesC = #{choicesc,jdbcType=VARCHAR}, - choicesD = #{choicesd,jdbcType=VARCHAR}, - choicesE = #{choicese,jdbcType=VARCHAR}, - topic_type = #{topicType,jdbcType=VARCHAR}, - source = #{source,jdbcType=VARCHAR}, - module = #{module,jdbcType=VARCHAR}, - answer = #{answer,jdbcType=VARCHAR}, - user_answer = #{userAnswer,jdbcType=VARCHAR}, - score = #{score,jdbcType=INTEGER}, - school_id = #{schoolId,jdbcType=VARCHAR}, - topic_content = #{topicContent,jdbcType=LONGVARCHAR}, - analysis = #{analysis,jdbcType=LONGVARCHAR} - where topic_id = #{topicId,jdbcType=VARCHAR} - </update> - <update id="updateByPrimaryKey" parameterType="com.sztzjy.fund_investment.entity.Topics"> - update sys_topics - set choicesA = #{choicesa,jdbcType=VARCHAR}, - choicesB = #{choicesb,jdbcType=VARCHAR}, - choicesC = #{choicesc,jdbcType=VARCHAR}, - choicesD = #{choicesd,jdbcType=VARCHAR}, - choicesE = #{choicese,jdbcType=VARCHAR}, - topic_type = #{topicType,jdbcType=VARCHAR}, - source = #{source,jdbcType=VARCHAR}, - module = #{module,jdbcType=VARCHAR}, - answer = #{answer,jdbcType=VARCHAR}, - user_answer = #{userAnswer,jdbcType=VARCHAR}, - score = #{score,jdbcType=INTEGER}, - school_id = #{schoolId,jdbcType=VARCHAR} - where topic_id = #{topicId,jdbcType=VARCHAR} - </update> + analysis = #{record.analysis,jdbcType=LONGVARCHAR} + <if test="_parameter != null"> + <include refid="Update_By_Example_Where_Clause"/> + </if> + </update> + <update id="updateByExample" parameterType="map"> + update sys_topics + set topic_id = #{record.topicId,jdbcType=VARCHAR}, + choicesA = #{record.choicesa,jdbcType=VARCHAR}, + choicesB = #{record.choicesb,jdbcType=VARCHAR}, + choicesC = #{record.choicesc,jdbcType=VARCHAR}, + choicesD = #{record.choicesd,jdbcType=VARCHAR}, + choicesE = #{record.choicese,jdbcType=VARCHAR}, + topic_type = #{record.topicType,jdbcType=VARCHAR}, + source = #{record.source,jdbcType=VARCHAR}, + module = #{record.module,jdbcType=VARCHAR}, + answer = #{record.answer,jdbcType=VARCHAR}, + user_answer = #{record.userAnswer,jdbcType=VARCHAR}, + score = #{record.score,jdbcType=INTEGER}, + school_id = #{record.schoolId,jdbcType=VARCHAR} + <if test="_parameter != null"> + <include refid="Update_By_Example_Where_Clause"/> + </if> + </update> + <update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.fund_investment.entity.TopicsWithBLOBs"> + update sys_topics + <set> + <if test="choicesa != null"> + choicesA = #{choicesa,jdbcType=VARCHAR}, + </if> + <if test="choicesb != null"> + choicesB = #{choicesb,jdbcType=VARCHAR}, + </if> + <if test="choicesc != null"> + choicesC = #{choicesc,jdbcType=VARCHAR}, + </if> + <if test="choicesd != null"> + choicesD = #{choicesd,jdbcType=VARCHAR}, + </if> + <if test="choicese != null"> + choicesE = #{choicese,jdbcType=VARCHAR}, + </if> + <if test="topicType != null"> + topic_type = #{topicType,jdbcType=VARCHAR}, + </if> + <if test="source != null"> + source = #{source,jdbcType=VARCHAR}, + </if> + <if test="module != null"> + module = #{module,jdbcType=VARCHAR}, + </if> + <if test="answer != null"> + answer = #{answer,jdbcType=VARCHAR}, + </if> + <if test="userAnswer != null"> + user_answer = #{userAnswer,jdbcType=VARCHAR}, + </if> + <if test="score != null"> + score = #{score,jdbcType=INTEGER}, + </if> + <if test="schoolId != null"> + school_id = #{schoolId,jdbcType=VARCHAR}, + </if> + <if test="topicContent != null"> + topic_content = #{topicContent,jdbcType=LONGVARCHAR}, + </if> + <if test="analysis != null"> + analysis = #{analysis,jdbcType=LONGVARCHAR}, + </if> + </set> + where topic_id = #{topicId,jdbcType=VARCHAR} + </update> + <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.sztzjy.fund_investment.entity.TopicsWithBLOBs"> + update sys_topics + set choicesA = #{choicesa,jdbcType=VARCHAR}, + choicesB = #{choicesb,jdbcType=VARCHAR}, + choicesC = #{choicesc,jdbcType=VARCHAR}, + choicesD = #{choicesd,jdbcType=VARCHAR}, + choicesE = #{choicese,jdbcType=VARCHAR}, + topic_type = #{topicType,jdbcType=VARCHAR}, + source = #{source,jdbcType=VARCHAR}, + module = #{module,jdbcType=VARCHAR}, + answer = #{answer,jdbcType=VARCHAR}, + user_answer = #{userAnswer,jdbcType=VARCHAR}, + score = #{score,jdbcType=INTEGER}, + school_id = #{schoolId,jdbcType=VARCHAR}, + topic_content = #{topicContent,jdbcType=LONGVARCHAR}, + analysis = #{analysis,jdbcType=LONGVARCHAR} + where topic_id = #{topicId,jdbcType=VARCHAR} + </update> + <update id="updateByPrimaryKey" parameterType="com.sztzjy.fund_investment.entity.Topics"> + update sys_topics + set choicesA = #{choicesa,jdbcType=VARCHAR}, + choicesB = #{choicesb,jdbcType=VARCHAR}, + choicesC = #{choicesc,jdbcType=VARCHAR}, + choicesD = #{choicesd,jdbcType=VARCHAR}, + choicesE = #{choicese,jdbcType=VARCHAR}, + topic_type = #{topicType,jdbcType=VARCHAR}, + source = #{source,jdbcType=VARCHAR}, + module = #{module,jdbcType=VARCHAR}, + answer = #{answer,jdbcType=VARCHAR}, + user_answer = #{userAnswer,jdbcType=VARCHAR}, + score = #{score,jdbcType=INTEGER}, + school_id = #{schoolId,jdbcType=VARCHAR} + where topic_id = #{topicId,jdbcType=VARCHAR} + </update> </mapper> \ No newline at end of file