修改实务认知得分和智能评分规则

master
xiaoCJ 9 months ago
parent cf5c7adaf3
commit d50a87a0ea

@ -35,4 +35,7 @@ public interface TrainingReportMapper {
int updateByPrimaryKeyWithBLOBs(TrainingReport record); int updateByPrimaryKeyWithBLOBs(TrainingReport record);
int updateByPrimaryKey(TrainingReport record); int updateByPrimaryKey(TrainingReport record);
void updateByList(@Param("finalReportList") List<TrainingReport> finalReportList);
} }

@ -23,6 +23,7 @@ import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode; import java.math.RoundingMode;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
/** /**
* @Author xcj * @Author xcj
@ -273,6 +274,7 @@ public class ClassScoreServiceImpl implements ClassScoreService {
} }
} }
// /* 智能评分 // /* 智能评分
// * @author xcj // * @author xcj
// * @Date 2023/11/28 // * @Date 2023/11/28
@ -283,13 +285,35 @@ public class ClassScoreServiceImpl implements ClassScoreService {
// PerformanceScoreExample performanceScoreExample = new PerformanceScoreExample(); // PerformanceScoreExample performanceScoreExample = new PerformanceScoreExample();
// performanceScoreExample.createCriteria().andSchoolIdEqualTo(schoolId); // performanceScoreExample.createCriteria().andSchoolIdEqualTo(schoolId);
// List<PerformanceScore> performanceScores = performanceScoreMapper.selectByExample(performanceScoreExample); // List<PerformanceScore> performanceScores = performanceScoreMapper.selectByExample(performanceScoreExample);
// List<String> list = new ArrayList(); // if (performanceScores.isEmpty()) {
// return new ResultEntity<>(HttpStatus.BAD_REQUEST, "未找到可用的数据!");
// }
//
// Map<String, PerformanceScore> performanceScoreMap = new HashMap<>();
// for (PerformanceScore performanceScore : performanceScores) {
// performanceScoreMap.put(performanceScore.getFlowId(), performanceScore);
// }
// List<String> flows = new ArrayList<>();
// Map<String, FoundProject> foundProjectMap = new HashMap<>();
//
// //拿到所有flowId
// for (PerformanceScore performanceScore : performanceScores) {
// flows.add(performanceScore.getFlowId());
// }
//
// //查出所有对象给下面循环使用
// FoundProjectExample example = new FoundProjectExample();
// example.createCriteria().andFlowIdIn(flows);
// List<FoundProject> foundProjects = foundProjectMapper.selectByExample(example);
// for (FoundProject foundProject : foundProjects) {
// foundProjectMap.put(foundProject.getFlowId(), foundProject);
// }
//
// //
// if (!performanceScores.isEmpty()) { // if (!performanceScores.isEmpty()) {
// for (PerformanceScore performanceScore : performanceScores) { // for (PerformanceScore performanceScore : performanceScores) {
// String flowId = performanceScore.getFlowId(); // String flowId = performanceScore.getFlowId();
// list.add(flowId); // FoundProject foundProject = foundProjectMap.get(flowId);
// FoundProject foundProject = foundProjectMapper.selectByPrimaryKey(flowId);
// if (foundProject == null) { // if (foundProject == null) {
// continue; // continue;
// } // }
@ -378,21 +402,30 @@ public class ClassScoreServiceImpl implements ClassScoreService {
// } // }
// } // }
// } // }
// for (String flowIdByList : list) { //
// TrainingReportExample trainingReportExample = new TrainingReportExample(); // TrainingReportExample trainingReportExample = new TrainingReportExample();
// trainingReportExample.createCriteria().andSchoolIdEqualTo(schoolId).andFlowIdEqualTo(flowIdByList).andStepEqualTo("投资报告"); // trainingReportExample.createCriteria().andSchoolIdEqualTo(schoolId).andFlowIdIn(flows).andStepEqualTo("投资报告");
// PerformanceScore scoreByFlowId = performanceScoreService.getByFlowId(flowIdByList);
// List<TrainingReport> trainingReports = trainingReportMapper.selectByExampleWithBLOBs(trainingReportExample); // List<TrainingReport> trainingReports = trainingReportMapper.selectByExampleWithBLOBs(trainingReportExample);
// if (trainingReports.isEmpty()) { // Map<String, TrainingReport> trainingReportMap = new HashMap<>();
// for (TrainingReport trainingReport : trainingReports) {
// trainingReportMap.put(trainingReport.getFlowId(), trainingReport);
// }
//
// List<TrainingReport> finalReportList = new ArrayList<>();
//
// //更新报告分数
// for (String flowIdByList : flows) {
// PerformanceScore performanceScore = performanceScoreMap.get(flowIdByList);
// TrainingReport trainingReport = trainingReportMap.get(flowIdByList);
// if (performanceScore == null || trainingReport == null) {
// continue; // continue;
// } // }
// TrainingReport trainingReport = trainingReports.get(0); // if (performanceScore.getExperienceScore() == null && StringUtils.isBlank(trainingReport.getExperience())) {
// if (scoreByFlowId.getExperienceScore() == null && StringUtils.isBlank(trainingReport.getExperience())) {
// performanceScoreService.updateScore("experienceScore", 0, flowIdByList); // performanceScoreService.updateScore("experienceScore", 0, flowIdByList);
// trainingReport.setExperienceScore(BigDecimal.ZERO); // trainingReport.setExperienceScore(BigDecimal.ZERO);
// } // }
// //实训心得 // //实训心得
// if (scoreByFlowId.getExperienceScore() == null && StringUtils.isNotBlank(trainingReport.getExperience())) { // if (performanceScore.getExperienceScore() == null && StringUtils.isNotBlank(trainingReport.getExperience())) {
// String experience = trainingReport.getExperience(); // String experience = trainingReport.getExperience();
// if (experience.length() < 100) { // if (experience.length() < 100) {
// performanceScoreService.updateScore("experienceScore", 1, flowIdByList); // performanceScoreService.updateScore("experienceScore", 1, flowIdByList);
@ -406,7 +439,7 @@ public class ClassScoreServiceImpl implements ClassScoreService {
// } // }
// } // }
// //实验报告,未上传 0 分 上传得两分 // //实验报告,未上传 0 分 上传得两分
// if (scoreByFlowId.getInvestmentReportScore() == null) { // if (performanceScore.getInvestmentReportScore() == null) {
// if (trainingReport.getUrl() == null && trainingReport.getReportName() == null) { // if (trainingReport.getUrl() == null && trainingReport.getReportName() == null) {
// performanceScoreService.updateScore("investmentReportScore", 0, flowIdByList);//todo 需要修改 // performanceScoreService.updateScore("investmentReportScore", 0, flowIdByList);//todo 需要修改
// trainingReport.setReportScore(BigDecimal.ZERO); // trainingReport.setReportScore(BigDecimal.ZERO);
@ -415,11 +448,21 @@ public class ClassScoreServiceImpl implements ClassScoreService {
// trainingReport.setReportScore(BigDecimal.valueOf(2)); // trainingReport.setReportScore(BigDecimal.valueOf(2));
// } // }
// } // }
// trainingReportMapper.updateByPrimaryKey(trainingReport); // finalReportList.add(trainingReport);
// } // }
// trainingReportMapper.updateByList(finalReportList);
// return new ResultEntity<>(HttpStatus.OK); // return new ResultEntity<>(HttpStatus.OK);
// } // }
// return new ResultEntity<>(HttpStatus.NOT_FOUND); // return new ResultEntity<>(HttpStatus.NOT_FOUND);
// }
//
//
// public static void main(String[] args) {
// String projectValuationAbsolute = "12312,./,/@#$好好好好好好好好好好好好好好好好AFGGGS好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好";
// projectValuationAbsolute = projectValuationAbsolute.replaceAll("[^\\u4E00-\\u9FA5]", "");
// System.out.println(projectValuationAbsolute);
// int length = projectValuationAbsolute.length();
// System.out.println(length);
// } // }
@ -429,185 +472,116 @@ public class ClassScoreServiceImpl implements ClassScoreService {
*/ */
@Override @Override
public ResultEntity<HttpStatus> autoScore(String schoolId) { public ResultEntity<HttpStatus> autoScore(String schoolId) {
//根据flowId查出所有页面的结论报告 // 根据schoolId查出所有页面的结论报告
PerformanceScoreExample performanceScoreExample = new PerformanceScoreExample(); PerformanceScoreExample performanceScoreExample = new PerformanceScoreExample();
performanceScoreExample.createCriteria().andSchoolIdEqualTo(schoolId); performanceScoreExample.createCriteria().andSchoolIdEqualTo(schoolId);
List<PerformanceScore> performanceScores = performanceScoreMapper.selectByExample(performanceScoreExample); List<PerformanceScore> performanceScores = performanceScoreMapper.selectByExample(performanceScoreExample);
List<String> list = new ArrayList(); if (performanceScores.isEmpty()) {
for (PerformanceScore performanceScore : performanceScores) { return new ResultEntity<>(HttpStatus.NOT_FOUND);
String flowId = performanceScore.getFlowId();
list.add(flowId);
} }
FoundProjectExample example = new FoundProjectExample(); // 获取所有的flowId
example.createCriteria().andFlowIdIn(list); List<String> flowIds = performanceScores.stream()
List<FoundProject> foundProjects = foundProjectMapper.selectByExample(example); .map(PerformanceScore::getFlowId)
.collect(Collectors.toList());
Map<String, FoundProject> map = new HashMap<>(); // 根据flowId查询FoundProject
for (FoundProject foundProject : foundProjects) { FoundProjectExample foundProjectExample = new FoundProjectExample();
map.put(foundProject.getFlowId(), foundProject); foundProjectExample.createCriteria().andFlowIdIn(flowIds);
} List<FoundProject> foundProjects = foundProjectMapper.selectByExample(foundProjectExample);
// 构建FoundProject的Map方便后续根据flowId查找
Map<String, FoundProject> foundProjectMap = foundProjects.stream()
.collect(Collectors.toMap(FoundProject::getFlowId, foundProject -> foundProject));
// 一次性从数据库中查询所有符合条件的 TrainingReport
TrainingReportExample trainingReportExample = new TrainingReportExample();
trainingReportExample.createCriteria().andSchoolIdEqualTo(schoolId).andFlowIdIn(flowIds).andStepEqualTo("投资报告");
List<TrainingReport> allTrainingReports = trainingReportMapper.selectByExampleWithBLOBs(trainingReportExample);
// 构建一个以 flowId 为 key 的 TrainingReport 的 Map方便后续根据 flowId 查找对应的 TrainingReport
Map<String, TrainingReport> trainingReportMap = allTrainingReports.stream()
.collect(Collectors.toMap(TrainingReport::getFlowId, trainingReport -> trainingReport));
if (!performanceScores.isEmpty()) { // 构建一个以 flowId 为 key 的 PerformanceScore 的 Map
Map<String, PerformanceScore> performanceScoreMap = performanceScores.stream()
.collect(Collectors.toMap(PerformanceScore::getFlowId, performanceScore -> performanceScore));
// 遍历每一个PerformanceScore进行处理
for (PerformanceScore performanceScore : performanceScores) { for (PerformanceScore performanceScore : performanceScores) {
String flowId = performanceScore.getFlowId(); String flowId = performanceScore.getFlowId();
FoundProject foundProject = map.get(flowId); FoundProject foundProject = foundProjectMap.get(flowId);
if (foundProject == null) {
continue;
}
String serviceDueDiligence = "";
String financialDueDiligence = "";
String projectValuationRelative = "";
String projectValuationAbsolute = "";
String foundProjectConclusion = "";
if (StringUtils.isBlank(foundProject.getFoundProjectConclusion())) {
performanceScoreService.updateScore("projectSearchReportScore", 0, flowId);
} else {
foundProjectConclusion = foundProject.getFoundProjectConclusion(); // 寻找项目结论
}
if (StringUtils.isBlank(foundProject.getServiceDueDiligence())) {
performanceScoreService.updateScore("projectDueDiligenceBusinessReportScore", 0, flowId);
} else {
serviceDueDiligence = foundProject.getServiceDueDiligence(); // 业务尽调结论
}
if (StringUtils.isBlank(foundProject.getFinancialDueDiligence())) {
performanceScoreService.updateScore("projectDueDiligenceFinanceReportScore", 0, flowId);
} else {
financialDueDiligence = foundProject.getFinancialDueDiligence(); //财务尽调结论
}
if (StringUtils.isBlank(foundProject.getProjectValuationRelative())) {
performanceScoreService.updateScore("projectValuationRelativeScore", 0, flowId);
} else {
projectValuationRelative = foundProject.getProjectValuationRelative();//相对估值结论得分
}
if (StringUtils.isBlank(foundProject.getProjectValuationAbsolute())) {
performanceScoreService.updateScore("projectValuationAbsoluteScore", 0, flowId);
} else {
projectValuationAbsolute = foundProject.getProjectValuationAbsolute();//绝对估值结论得分
}
foundProjectConclusion = foundProjectConclusion.replaceAll("[^\\u4E00-\\u9FA5]", "");
serviceDueDiligence = serviceDueDiligence.replaceAll("[^\\u4E00-\\u9FA5]", "");
financialDueDiligence = financialDueDiligence.replaceAll("[^\\u4E00-\\u9FA5]", "");
projectValuationRelative = projectValuationRelative.replaceAll("[^\\u4E00-\\u9FA5]", "");
projectValuationAbsolute = projectValuationAbsolute.replaceAll("[^\\u4E00-\\u9FA5]", "");
PerformanceScoreExample performanceScoreExample2 = new PerformanceScoreExample();
performanceScoreExample2.createCriteria().andSchoolIdEqualTo(schoolId).andFlowIdEqualTo(flowId);
// 寻找项目结论
if (performanceScore.getProjectSearchReportScore() == null) {
if (foundProjectConclusion.length() >= 30) {
// 字符串长度超过30
performanceScoreService.updateScore("projectSearchReportScore", 2, flowId);
} else {
//未超过30结论报告是必填项到这里就给1分没有0
performanceScoreService.updateScore("projectSearchReportScore", 1, flowId);
}
}
// 业务尽调结论
if (performanceScore.getProjectDueDiligenceBusinessReportScore() == null) {
if (serviceDueDiligence.length() >= 30) { if (foundProject != null) {
performanceScoreService.updateScore("projectDueDiligenceBusinessReportScore", 2, flowId); handleFoundProject(performanceScore, foundProject);
} else {
performanceScoreService.updateScore("projectDueDiligenceBusinessReportScore", 1, flowId);
}
} }
//财务尽调结论
if (performanceScore.getProjectDueDiligenceFinanceReportScore() == null) {
if (financialDueDiligence.length() >= 30) { TrainingReport trainingReport = trainingReportMap.get(flowId);
performanceScoreService.updateScore("projectDueDiligenceFinanceReportScore", 2, flowId); if (trainingReport != null) {
} else { handleTrainingReport(performanceScore, trainingReport);
performanceScoreService.updateScore("projectDueDiligenceFinanceReportScore", 1, flowId);
} }
} }
//项目相对估值结论
if (performanceScore.getProjectValuationRelativeScore() == null) {
if (projectValuationRelative.length() >= 30) { // 批量更新所有的TrainingReport
performanceScoreService.updateScore("projectValuationRelativeScore", 2, flowId); trainingReportMapper.updateByList(allTrainingReports);
} else { return new ResultEntity<>(HttpStatus.OK,"评分成功!");
performanceScoreService.updateScore("projectValuationRelativeScore", 1, flowId);
}
} }
//项目绝对估值结论
if (performanceScore.getProjectValuationAbsoluteScore() == null) {
if (projectValuationAbsolute.length() >= 30) { private void handleFoundProject(PerformanceScore performanceScore, FoundProject foundProject) {
performanceScoreService.updateScore("projectValuationAbsoluteScore", 2, flowId); String flowId = performanceScore.getFlowId();
} else { updateScore(performanceScore, "projectSearchReportScore", foundProject.getFoundProjectConclusion(), 30, flowId);
performanceScoreService.updateScore("projectValuationAbsoluteScore", 1, flowId); updateScore(performanceScore, "projectDueDiligenceBusinessReportScore", foundProject.getServiceDueDiligence(), 30, flowId);
} updateScore(performanceScore, "projectDueDiligenceFinanceReportScore", foundProject.getFinancialDueDiligence(), 30, flowId);
} updateScore(performanceScore, "projectValuationRelativeScore", foundProject.getProjectValuationRelative(), 30, flowId);
updateScore(performanceScore, "projectValuationAbsoluteScore", foundProject.getProjectValuationAbsolute(), 30, flowId);
} }
// 一次性从数据库中查询所有符合条件的 TrainingReport private void handleTrainingReport(PerformanceScore performanceScore, TrainingReport trainingReport) {
TrainingReportExample trainingReportExample = new TrainingReportExample(); String flowId = performanceScore.getFlowId();
trainingReportExample.createCriteria().andSchoolIdEqualTo(schoolId).andFlowIdIn(list).andStepEqualTo("投资报告");
List<TrainingReport> allTrainingReports = trainingReportMapper.selectByExampleWithBLOBs(trainingReportExample);
// 构建一个以 flowId 为 key 的 TrainingReport 的 Map方便后续根据 flowId 查找对应的 TrainingReport
Map<String, TrainingReport> trainingReportMap = new HashMap<>();
for (TrainingReport trainingReport : allTrainingReports) {
trainingReportMap.put(trainingReport.getFlowId(), trainingReport);
}
Map<String, PerformanceScore> performanceScoreMap = new HashMap<>(); if (performanceScore.getExperienceScore() == null) {
// 循环外执行一次查询并存储结果 if (StringUtils.isBlank(trainingReport.getExperience())) {
for (String flowIdByList : list) { performanceScoreService.updateScore("experienceScore", 0, flowId);
PerformanceScore scoreByFlowId = performanceScoreService.getByFlowId(flowIdByList);
performanceScoreMap.put(flowIdByList, scoreByFlowId);
}
// 遍历 list根据内存中的数据处理流程
for (String flowIdByList : list) {
TrainingReport trainingReport = trainingReportMap.get(flowIdByList);
if (trainingReport == null) {
continue;
}
PerformanceScore scoreByFlowId = performanceScoreMap.get(flowIdByList);
if (scoreByFlowId.getExperienceScore() == null && StringUtils.isBlank(trainingReport.getExperience())) {
performanceScoreService.updateScore("experienceScore", 0, flowIdByList);
trainingReport.setExperienceScore(BigDecimal.ZERO); trainingReport.setExperienceScore(BigDecimal.ZERO);
}
//实训心得
if (scoreByFlowId.getExperienceScore() == null && StringUtils.isNotBlank(trainingReport.getExperience())) {
String experience = trainingReport.getExperience();
if (experience.length() < 100) {
performanceScoreService.updateScore("experienceScore", 1, flowIdByList);
trainingReport.setExperienceScore(BigDecimal.ONE);
} else if (experience.length() < 300) {
performanceScoreService.updateScore("experienceScore", 2, flowIdByList);
trainingReport.setExperienceScore(BigDecimal.valueOf(2));
} else { } else {
performanceScoreService.updateScore("experienceScore", 3, flowIdByList); String experience = trainingReport.getExperience();
trainingReport.setExperienceScore(BigDecimal.valueOf(3)); int score = calculateScoreByLength(experience.length(), 100, 300);
performanceScoreService.updateScore("experienceScore", score, flowId);
trainingReport.setExperienceScore(BigDecimal.valueOf(score));
} }
} }
//实验报告,未上传 0 分 上传得两分
if (scoreByFlowId.getInvestmentReportScore() == null) { if (performanceScore.getInvestmentReportScore() == null) {
if (trainingReport.getUrl() == null && trainingReport.getReportName() == null) { if (StringUtils.isBlank(trainingReport.getUrl()) && StringUtils.isBlank(trainingReport.getReportName())) {
performanceScoreService.updateScore("investmentReportScore", 0, flowIdByList);//todo 需要修改 performanceScoreService.updateScore("investmentReportScore", 0, flowId);
trainingReport.setReportScore(BigDecimal.ZERO); trainingReport.setReportScore(BigDecimal.ZERO);
} else if (!(trainingReport.getUrl().isEmpty()) && !(trainingReport.getReportName().isEmpty())) { } else {
performanceScoreService.updateScore("investmentReportScore", 2, flowIdByList);//todo 需要修改 performanceScoreService.updateScore("investmentReportScore", 2, flowId);
trainingReport.setReportScore(BigDecimal.valueOf(2)); trainingReport.setReportScore(BigDecimal.valueOf(2));
} }
} }
trainingReportMapper.updateByPrimaryKey(trainingReport);
} }
return new ResultEntity<>(HttpStatus.OK);
private void updateScore(PerformanceScore performanceScore, String scoreField, String fieldValue, int threshold, String flowId) {
if (performanceScore.get(scoreField) == null) {
if (StringUtils.isBlank(fieldValue)) {
performanceScoreService.updateScore(scoreField, 0, flowId);
} else {
int score = fieldValue.length() >= threshold ? 2 : 1;
performanceScoreService.updateScore(scoreField, score, flowId);
}
} }
return new ResultEntity<>(HttpStatus.NOT_FOUND);
} }
private int calculateScoreByLength(int length, int level1, int level2) {
public static void main(String[] args) { if (length < level1) {
String projectValuationAbsolute = "12312,./,/@#$好好好好好好好好好好好好好好好好AFGGGS好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好"; return 1;
projectValuationAbsolute = projectValuationAbsolute.replaceAll("[^\\u4E00-\\u9FA5]", ""); } else if (length < level2) {
System.out.println(projectValuationAbsolute); return 2;
int length = projectValuationAbsolute.length(); } else {
System.out.println(length); return 3;
}
} }

@ -2,7 +2,7 @@ spring:
datasource: datasource:
druid: druid:
db-type: mysql db-type: mysql
url: jdbc:mysql://${DB_HOST:118.31.7.2}:${DB_PORT:3306}/${DB_NAME:fund_investment}?useSSL=false&serverTimezone=GMT%2B8&allowPublicKeyRetrieval=true url: jdbc:mysql://${DB_HOST:118.31.7.2}:${DB_PORT:3306}/${DB_NAME:fund_investment}?useSSL=false&serverTimezone=GMT%2B8&allowPublicKeyRetrieval=true&allowMultiQueries=true
username: ${DB_USER:root} username: ${DB_USER:root}
password: ${DB_PWD:sztzjy2017} password: ${DB_PWD:sztzjy2017}
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver

@ -34,7 +34,8 @@
</when> </when>
<when test="criterion.listValue"> <when test="criterion.listValue">
and ${criterion.condition} and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> <foreach close=")" collection="criterion.value" item="listItem" open="("
separator=",">
#{listItem} #{listItem}
</foreach> </foreach>
</when> </when>
@ -63,7 +64,8 @@
</when> </when>
<when test="criterion.listValue"> <when test="criterion.listValue">
and ${criterion.condition} and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> <foreach close=")" collection="criterion.value" item="listItem" open="("
separator=",">
#{listItem} #{listItem}
</foreach> </foreach>
</when> </when>
@ -75,13 +77,15 @@
</where> </where>
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, flow_id, school_id, url, report_name, step, report_score, experience_score, uploadTime, id
, flow_id, school_id, url, report_name, step, report_score, experience_score, uploadTime,
version version
</sql> </sql>
<sql id="Blob_Column_List"> <sql id="Blob_Column_List">
experience experience
</sql> </sql>
<select id="selectByExampleWithBLOBs" parameterType="com.sztzjy.fund_investment.entity.TrainingReportExample" resultMap="ResultMapWithBLOBs"> <select id="selectByExampleWithBLOBs" parameterType="com.sztzjy.fund_investment.entity.TrainingReportExample"
resultMap="ResultMapWithBLOBs">
select select
<if test="distinct"> <if test="distinct">
distinct distinct
@ -97,7 +101,8 @@
order by ${orderByClause} order by ${orderByClause}
</if> </if>
</select> </select>
<select id="selectByExample" parameterType="com.sztzjy.fund_investment.entity.TrainingReportExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="com.sztzjy.fund_investment.entity.TrainingReportExample"
resultMap="BaseResultMap">
select select
<if test="distinct"> <if test="distinct">
distinct distinct
@ -120,7 +125,8 @@
where id = #{id,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR}
</select> </select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String"> <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from training_report delete
from training_report
where id = #{id,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR}
</delete> </delete>
<delete id="deleteByExample" parameterType="com.sztzjy.fund_investment.entity.TrainingReportExample"> <delete id="deleteByExample" parameterType="com.sztzjy.fund_investment.entity.TrainingReportExample">
@ -212,7 +218,8 @@
</if> </if>
</trim> </trim>
</insert> </insert>
<select id="countByExample" parameterType="com.sztzjy.fund_investment.entity.TrainingReportExample" resultType="java.lang.Long"> <select id="countByExample" parameterType="com.sztzjy.fund_investment.entity.TrainingReportExample"
resultType="java.lang.Long">
select count(*) from training_report select count(*) from training_report
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Example_Where_Clause"/> <include refid="Example_Where_Clause"/>
@ -355,4 +362,15 @@
version = #{version,jdbcType=VARCHAR} version = #{version,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR}
</update> </update>
<update id="updateByList" parameterType="java.util.List">
<foreach collection="finalReportList" item="item" separator=";">
UPDATE training_report
set
report_score = #{item.reportScore,jdbcType=DECIMAL},
experience_score = #{item.experienceScore,jdbcType=DECIMAL}
WHERE id = #{item.id,jdbcType=VARCHAR}
</foreach>
</update>
</mapper> </mapper>
Loading…
Cancel
Save