From d50a87a0ea269753a11338c6a2656e5b457ce3ad Mon Sep 17 00:00:00 2001 From: xiaoCJ <406612557@qq.com> Date: Fri, 28 Jun 2024 16:47:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AE=9E=E5=8A=A1=E8=AE=A4?= =?UTF-8?q?=E7=9F=A5=E5=BE=97=E5=88=86=E5=92=8C=E6=99=BA=E8=83=BD=E8=AF=84?= =?UTF-8?q?=E5=88=86=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/TrainingReportMapper.java | 3 + .../tea/ClassScoreServiceImpl.java | 322 ++++---- src/main/resources/application-dev.yml | 2 +- .../mappers/TrainingReportMapper.xml | 702 +++++++++--------- 4 files changed, 512 insertions(+), 517 deletions(-) diff --git a/src/main/java/com/sztzjy/fund_investment/mapper/TrainingReportMapper.java b/src/main/java/com/sztzjy/fund_investment/mapper/TrainingReportMapper.java index 6f05c91..288021e 100644 --- a/src/main/java/com/sztzjy/fund_investment/mapper/TrainingReportMapper.java +++ b/src/main/java/com/sztzjy/fund_investment/mapper/TrainingReportMapper.java @@ -35,4 +35,7 @@ public interface TrainingReportMapper { int updateByPrimaryKeyWithBLOBs(TrainingReport record); int updateByPrimaryKey(TrainingReport record); + + + void updateByList(@Param("finalReportList") List finalReportList); } \ No newline at end of file diff --git a/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/tea/ClassScoreServiceImpl.java b/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/tea/ClassScoreServiceImpl.java index 497ac4e..d7a9d06 100644 --- a/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/tea/ClassScoreServiceImpl.java +++ b/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/tea/ClassScoreServiceImpl.java @@ -23,6 +23,7 @@ import javax.servlet.http.HttpServletResponse; import java.math.BigDecimal; import java.math.RoundingMode; import java.util.*; +import java.util.stream.Collectors; /** * @Author xcj @@ -273,6 +274,7 @@ public class ClassScoreServiceImpl implements ClassScoreService { } } + // /* 智能评分 // * @author xcj // * @Date 2023/11/28 @@ -283,13 +285,35 @@ public class ClassScoreServiceImpl implements ClassScoreService { // PerformanceScoreExample performanceScoreExample = new PerformanceScoreExample(); // performanceScoreExample.createCriteria().andSchoolIdEqualTo(schoolId); // List performanceScores = performanceScoreMapper.selectByExample(performanceScoreExample); -// List list = new ArrayList(); +// if (performanceScores.isEmpty()) { +// return new ResultEntity<>(HttpStatus.BAD_REQUEST, "未找到可用的数据!"); +// } +// +// Map performanceScoreMap = new HashMap<>(); +// for (PerformanceScore performanceScore : performanceScores) { +// performanceScoreMap.put(performanceScore.getFlowId(), performanceScore); +// } +// List flows = new ArrayList<>(); +// Map foundProjectMap = new HashMap<>(); +// +// //拿到所有flowId +// for (PerformanceScore performanceScore : performanceScores) { +// flows.add(performanceScore.getFlowId()); +// } +// +// //查出所有对象给下面循环使用 +// FoundProjectExample example = new FoundProjectExample(); +// example.createCriteria().andFlowIdIn(flows); +// List foundProjects = foundProjectMapper.selectByExample(example); +// for (FoundProject foundProject : foundProjects) { +// foundProjectMap.put(foundProject.getFlowId(), foundProject); +// } +// // // if (!performanceScores.isEmpty()) { // for (PerformanceScore performanceScore : performanceScores) { // String flowId = performanceScore.getFlowId(); -// list.add(flowId); -// FoundProject foundProject = foundProjectMapper.selectByPrimaryKey(flowId); +// FoundProject foundProject = foundProjectMap.get(flowId); // if (foundProject == null) { // continue; // } @@ -378,21 +402,30 @@ public class ClassScoreServiceImpl implements ClassScoreService { // } // } // } -// for (String flowIdByList : list) { -// TrainingReportExample trainingReportExample = new TrainingReportExample(); -// trainingReportExample.createCriteria().andSchoolIdEqualTo(schoolId).andFlowIdEqualTo(flowIdByList).andStepEqualTo("投资报告"); -// PerformanceScore scoreByFlowId = performanceScoreService.getByFlowId(flowIdByList); -// List trainingReports = trainingReportMapper.selectByExampleWithBLOBs(trainingReportExample); -// if (trainingReports.isEmpty()) { +// +// TrainingReportExample trainingReportExample = new TrainingReportExample(); +// trainingReportExample.createCriteria().andSchoolIdEqualTo(schoolId).andFlowIdIn(flows).andStepEqualTo("投资报告"); +// List trainingReports = trainingReportMapper.selectByExampleWithBLOBs(trainingReportExample); +// Map trainingReportMap = new HashMap<>(); +// for (TrainingReport trainingReport : trainingReports) { +// trainingReportMap.put(trainingReport.getFlowId(), trainingReport); +// } +// +// List finalReportList = new ArrayList<>(); +// +// //更新报告分数 +// for (String flowIdByList : flows) { +// PerformanceScore performanceScore = performanceScoreMap.get(flowIdByList); +// TrainingReport trainingReport = trainingReportMap.get(flowIdByList); +// if (performanceScore == null || trainingReport == null) { // continue; // } -// TrainingReport trainingReport = trainingReports.get(0); -// if (scoreByFlowId.getExperienceScore() == null && StringUtils.isBlank(trainingReport.getExperience())) { +// if (performanceScore.getExperienceScore() == null && StringUtils.isBlank(trainingReport.getExperience())) { // performanceScoreService.updateScore("experienceScore", 0, flowIdByList); // trainingReport.setExperienceScore(BigDecimal.ZERO); // } // //实训心得 -// if (scoreByFlowId.getExperienceScore() == null && StringUtils.isNotBlank(trainingReport.getExperience())) { +// if (performanceScore.getExperienceScore() == null && StringUtils.isNotBlank(trainingReport.getExperience())) { // String experience = trainingReport.getExperience(); // if (experience.length() < 100) { // performanceScoreService.updateScore("experienceScore", 1, flowIdByList); @@ -406,7 +439,7 @@ public class ClassScoreServiceImpl implements ClassScoreService { // } // } // //实验报告,未上传 0 分 上传得两分 -// if (scoreByFlowId.getInvestmentReportScore() == null) { +// if (performanceScore.getInvestmentReportScore() == null) { // if (trainingReport.getUrl() == null && trainingReport.getReportName() == null) { // performanceScoreService.updateScore("investmentReportScore", 0, flowIdByList);//todo 需要修改 // trainingReport.setReportScore(BigDecimal.ZERO); @@ -415,11 +448,21 @@ public class ClassScoreServiceImpl implements ClassScoreService { // trainingReport.setReportScore(BigDecimal.valueOf(2)); // } // } -// trainingReportMapper.updateByPrimaryKey(trainingReport); +// finalReportList.add(trainingReport); // } +// trainingReportMapper.updateByList(finalReportList); // return new ResultEntity<>(HttpStatus.OK); // } // 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 public ResultEntity autoScore(String schoolId) { - //根据flowId查出所有页面的结论报告 + // 根据schoolId查出所有页面的结论报告 PerformanceScoreExample performanceScoreExample = new PerformanceScoreExample(); performanceScoreExample.createCriteria().andSchoolIdEqualTo(schoolId); List performanceScores = performanceScoreMapper.selectByExample(performanceScoreExample); - List list = new ArrayList(); + if (performanceScores.isEmpty()) { + return new ResultEntity<>(HttpStatus.NOT_FOUND); + } + + // 获取所有的flowId + List flowIds = performanceScores.stream() + .map(PerformanceScore::getFlowId) + .collect(Collectors.toList()); + + // 根据flowId查询FoundProject + FoundProjectExample foundProjectExample = new FoundProjectExample(); + foundProjectExample.createCriteria().andFlowIdIn(flowIds); + List foundProjects = foundProjectMapper.selectByExample(foundProjectExample); + + // 构建FoundProject的Map,方便后续根据flowId查找 + Map foundProjectMap = foundProjects.stream() + .collect(Collectors.toMap(FoundProject::getFlowId, foundProject -> foundProject)); + + // 一次性从数据库中查询所有符合条件的 TrainingReport + TrainingReportExample trainingReportExample = new TrainingReportExample(); + trainingReportExample.createCriteria().andSchoolIdEqualTo(schoolId).andFlowIdIn(flowIds).andStepEqualTo("投资报告"); + List allTrainingReports = trainingReportMapper.selectByExampleWithBLOBs(trainingReportExample); + + // 构建一个以 flowId 为 key 的 TrainingReport 的 Map,方便后续根据 flowId 查找对应的 TrainingReport + Map trainingReportMap = allTrainingReports.stream() + .collect(Collectors.toMap(TrainingReport::getFlowId, trainingReport -> trainingReport)); + + // 构建一个以 flowId 为 key 的 PerformanceScore 的 Map + Map performanceScoreMap = performanceScores.stream() + .collect(Collectors.toMap(PerformanceScore::getFlowId, performanceScore -> performanceScore)); + + // 遍历每一个PerformanceScore进行处理 for (PerformanceScore performanceScore : performanceScores) { String flowId = performanceScore.getFlowId(); - list.add(flowId); - } + FoundProject foundProject = foundProjectMap.get(flowId); - FoundProjectExample example = new FoundProjectExample(); - example.createCriteria().andFlowIdIn(list); - List foundProjects = foundProjectMapper.selectByExample(example); + if (foundProject != null) { + handleFoundProject(performanceScore, foundProject); + } - Map map = new HashMap<>(); - for (FoundProject foundProject : foundProjects) { - map.put(foundProject.getFlowId(), foundProject); + TrainingReport trainingReport = trainingReportMap.get(flowId); + if (trainingReport != null) { + handleTrainingReport(performanceScore, trainingReport); + } } - if (!performanceScores.isEmpty()) { - for (PerformanceScore performanceScore : performanceScores) { - String flowId = performanceScore.getFlowId(); - FoundProject foundProject = map.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) { - performanceScoreService.updateScore("projectDueDiligenceBusinessReportScore", 2, flowId); - } else { - performanceScoreService.updateScore("projectDueDiligenceBusinessReportScore", 1, flowId); - } - } - //财务尽调结论 - if (performanceScore.getProjectDueDiligenceFinanceReportScore() == null) { - - if (financialDueDiligence.length() >= 30) { - performanceScoreService.updateScore("projectDueDiligenceFinanceReportScore", 2, flowId); - } else { - performanceScoreService.updateScore("projectDueDiligenceFinanceReportScore", 1, flowId); - } - } - //项目相对估值结论 - if (performanceScore.getProjectValuationRelativeScore() == null) { - - if (projectValuationRelative.length() >= 30) { - performanceScoreService.updateScore("projectValuationRelativeScore", 2, flowId); - } else { - performanceScoreService.updateScore("projectValuationRelativeScore", 1, flowId); - } - } - //项目绝对估值结论 - if (performanceScore.getProjectValuationAbsoluteScore() == null) { - - if (projectValuationAbsolute.length() >= 30) { - performanceScoreService.updateScore("projectValuationAbsoluteScore", 2, flowId); - } else { - performanceScoreService.updateScore("projectValuationAbsoluteScore", 1, flowId); - } - } - } + // 批量更新所有的TrainingReport + trainingReportMapper.updateByList(allTrainingReports); + return new ResultEntity<>(HttpStatus.OK,"评分成功!"); + } -// 一次性从数据库中查询所有符合条件的 TrainingReport - TrainingReportExample trainingReportExample = new TrainingReportExample(); - trainingReportExample.createCriteria().andSchoolIdEqualTo(schoolId).andFlowIdIn(list).andStepEqualTo("投资报告"); - List allTrainingReports = trainingReportMapper.selectByExampleWithBLOBs(trainingReportExample); + private void handleFoundProject(PerformanceScore performanceScore, FoundProject foundProject) { + String flowId = performanceScore.getFlowId(); + updateScore(performanceScore, "projectSearchReportScore", foundProject.getFoundProjectConclusion(), 30, 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); + } -// 构建一个以 flowId 为 key 的 TrainingReport 的 Map,方便后续根据 flowId 查找对应的 TrainingReport - Map trainingReportMap = new HashMap<>(); - for (TrainingReport trainingReport : allTrainingReports) { - trainingReportMap.put(trainingReport.getFlowId(), trainingReport); + private void handleTrainingReport(PerformanceScore performanceScore, TrainingReport trainingReport) { + String flowId = performanceScore.getFlowId(); + + if (performanceScore.getExperienceScore() == null) { + if (StringUtils.isBlank(trainingReport.getExperience())) { + performanceScoreService.updateScore("experienceScore", 0, flowId); + trainingReport.setExperienceScore(BigDecimal.ZERO); + } else { + String experience = trainingReport.getExperience(); + int score = calculateScoreByLength(experience.length(), 100, 300); + performanceScoreService.updateScore("experienceScore", score, flowId); + trainingReport.setExperienceScore(BigDecimal.valueOf(score)); } + } - Map performanceScoreMap = new HashMap<>(); -// 循环外执行一次查询并存储结果 - for (String flowIdByList : list) { - 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); - } - //实训心得 - 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 { - performanceScoreService.updateScore("experienceScore", 3, flowIdByList); - trainingReport.setExperienceScore(BigDecimal.valueOf(3)); - } - } - //实验报告,未上传 0 分 上传得两分 - if (scoreByFlowId.getInvestmentReportScore() == null) { - if (trainingReport.getUrl() == null && trainingReport.getReportName() == null) { - performanceScoreService.updateScore("investmentReportScore", 0, flowIdByList);//todo 需要修改 - trainingReport.setReportScore(BigDecimal.ZERO); - } else if (!(trainingReport.getUrl().isEmpty()) && !(trainingReport.getReportName().isEmpty())) { - performanceScoreService.updateScore("investmentReportScore", 2, flowIdByList);//todo 需要修改 - trainingReport.setReportScore(BigDecimal.valueOf(2)); - } - } - trainingReportMapper.updateByPrimaryKey(trainingReport); + if (performanceScore.getInvestmentReportScore() == null) { + if (StringUtils.isBlank(trainingReport.getUrl()) && StringUtils.isBlank(trainingReport.getReportName())) { + performanceScoreService.updateScore("investmentReportScore", 0, flowId); + trainingReport.setReportScore(BigDecimal.ZERO); + } else { + performanceScoreService.updateScore("investmentReportScore", 2, flowId); + trainingReport.setReportScore(BigDecimal.valueOf(2)); } - return new ResultEntity<>(HttpStatus.OK); } - return new ResultEntity<>(HttpStatus.NOT_FOUND); } + 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); + } + } + } - 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); + private int calculateScoreByLength(int length, int level1, int level2) { + if (length < level1) { + return 1; + } else if (length < level2) { + return 2; + } else { + return 3; + } } diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index f5c8bf5..47e9b85 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -2,7 +2,7 @@ spring: datasource: druid: 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} password: ${DB_PWD:sztzjy2017} driver-class-name: com.mysql.cj.jdbc.Driver diff --git a/src/main/resources/mappers/TrainingReportMapper.xml b/src/main/resources/mappers/TrainingReportMapper.xml index 2eecd21..5d60d0d 100644 --- a/src/main/resources/mappers/TrainingReportMapper.xml +++ b/src/main/resources/mappers/TrainingReportMapper.xml @@ -1,358 +1,376 @@ - - - - - - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + - - - - - - - id, flow_id, 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 - - - experience - - - - - - delete from training_report - where id = #{id,jdbcType=VARCHAR} - - - delete from training_report - - - - - - insert into training_report (id, flow_id, school_id, - url, report_name, step, - report_score, experience_score, uploadTime, - version, experience) - values (#{id,jdbcType=VARCHAR}, #{flowId,jdbcType=VARCHAR}, #{schoolId,jdbcType=VARCHAR}, - #{url,jdbcType=VARCHAR}, #{reportName,jdbcType=VARCHAR}, #{step,jdbcType=VARCHAR}, - #{reportScore,jdbcType=DECIMAL}, #{experienceScore,jdbcType=DECIMAL}, #{uploadtime,jdbcType=DATE}, - #{version,jdbcType=VARCHAR}, #{experience,jdbcType=LONGVARCHAR}) - - - insert into training_report - - - id, - - - flow_id, - - - school_id, - - - url, - - - report_name, - - - step, - - - report_score, - - - experience_score, - - - uploadTime, - - - version, - - - experience, - - - - - #{id,jdbcType=VARCHAR}, - - - #{flowId,jdbcType=VARCHAR}, - - - #{schoolId,jdbcType=VARCHAR}, - - - #{url,jdbcType=VARCHAR}, - - - #{reportName,jdbcType=VARCHAR}, - - - #{step,jdbcType=VARCHAR}, - - - #{reportScore,jdbcType=DECIMAL}, - - - #{experienceScore,jdbcType=DECIMAL}, - - - #{uploadtime,jdbcType=DATE}, - - - #{version,jdbcType=VARCHAR}, - - - #{experience,jdbcType=LONGVARCHAR}, - - - - - - update training_report - - - id = #{record.id,jdbcType=VARCHAR}, - - + + + experience + + + + + + delete + from training_report + where id = #{id,jdbcType=VARCHAR} + + + delete from training_report + + + + + + insert into training_report (id, flow_id, school_id, + url, report_name, step, + report_score, experience_score, uploadTime, + version, experience) + values (#{id,jdbcType=VARCHAR}, #{flowId,jdbcType=VARCHAR}, #{schoolId,jdbcType=VARCHAR}, + #{url,jdbcType=VARCHAR}, #{reportName,jdbcType=VARCHAR}, #{step,jdbcType=VARCHAR}, + #{reportScore,jdbcType=DECIMAL}, #{experienceScore,jdbcType=DECIMAL}, #{uploadtime,jdbcType=DATE}, + #{version,jdbcType=VARCHAR}, #{experience,jdbcType=LONGVARCHAR}) + + + insert into training_report + + + id, + + + flow_id, + + + school_id, + + + url, + + + report_name, + + + step, + + + report_score, + + + experience_score, + + + uploadTime, + + + version, + + + experience, + + + + + #{id,jdbcType=VARCHAR}, + + + #{flowId,jdbcType=VARCHAR}, + + + #{schoolId,jdbcType=VARCHAR}, + + + #{url,jdbcType=VARCHAR}, + + + #{reportName,jdbcType=VARCHAR}, + + + #{step,jdbcType=VARCHAR}, + + + #{reportScore,jdbcType=DECIMAL}, + + + #{experienceScore,jdbcType=DECIMAL}, + + + #{uploadtime,jdbcType=DATE}, + + + #{version,jdbcType=VARCHAR}, + + + #{experience,jdbcType=LONGVARCHAR}, + + + + + + update training_report + + + id = #{record.id,jdbcType=VARCHAR}, + + + flow_id = #{record.flowId,jdbcType=VARCHAR}, + + + school_id = #{record.schoolId,jdbcType=VARCHAR}, + + + url = #{record.url,jdbcType=VARCHAR}, + + + report_name = #{record.reportName,jdbcType=VARCHAR}, + + + step = #{record.step,jdbcType=VARCHAR}, + + + report_score = #{record.reportScore,jdbcType=DECIMAL}, + + + experience_score = #{record.experienceScore,jdbcType=DECIMAL}, + + + uploadTime = #{record.uploadtime,jdbcType=DATE}, + + + version = #{record.version,jdbcType=VARCHAR}, + + + experience = #{record.experience,jdbcType=LONGVARCHAR}, + + + + + + + + update training_report + set id = #{record.id,jdbcType=VARCHAR}, flow_id = #{record.flowId,jdbcType=VARCHAR}, - - school_id = #{record.schoolId,jdbcType=VARCHAR}, - - url = #{record.url,jdbcType=VARCHAR}, - - report_name = #{record.reportName,jdbcType=VARCHAR}, - - step = #{record.step,jdbcType=VARCHAR}, - - report_score = #{record.reportScore,jdbcType=DECIMAL}, - - experience_score = #{record.experienceScore,jdbcType=DECIMAL}, - - uploadTime = #{record.uploadtime,jdbcType=DATE}, - - version = #{record.version,jdbcType=VARCHAR}, - - - experience = #{record.experience,jdbcType=LONGVARCHAR}, - - - - - - - - update training_report - set id = #{record.id,jdbcType=VARCHAR}, - flow_id = #{record.flowId,jdbcType=VARCHAR}, - school_id = #{record.schoolId,jdbcType=VARCHAR}, - url = #{record.url,jdbcType=VARCHAR}, - report_name = #{record.reportName,jdbcType=VARCHAR}, - step = #{record.step,jdbcType=VARCHAR}, - report_score = #{record.reportScore,jdbcType=DECIMAL}, - experience_score = #{record.experienceScore,jdbcType=DECIMAL}, - uploadTime = #{record.uploadtime,jdbcType=DATE}, - version = #{record.version,jdbcType=VARCHAR}, - experience = #{record.experience,jdbcType=LONGVARCHAR} - - - - - - update training_report - set id = #{record.id,jdbcType=VARCHAR}, - flow_id = #{record.flowId,jdbcType=VARCHAR}, - school_id = #{record.schoolId,jdbcType=VARCHAR}, - url = #{record.url,jdbcType=VARCHAR}, - report_name = #{record.reportName,jdbcType=VARCHAR}, - step = #{record.step,jdbcType=VARCHAR}, - report_score = #{record.reportScore,jdbcType=DECIMAL}, - experience_score = #{record.experienceScore,jdbcType=DECIMAL}, - uploadTime = #{record.uploadtime,jdbcType=DATE}, - version = #{record.version,jdbcType=VARCHAR} - - - - - - update training_report - - - flow_id = #{flowId,jdbcType=VARCHAR}, - - - school_id = #{schoolId,jdbcType=VARCHAR}, - - - url = #{url,jdbcType=VARCHAR}, - - - report_name = #{reportName,jdbcType=VARCHAR}, - - - step = #{step,jdbcType=VARCHAR}, - - - report_score = #{reportScore,jdbcType=DECIMAL}, - - - experience_score = #{experienceScore,jdbcType=DECIMAL}, - - - uploadTime = #{uploadtime,jdbcType=DATE}, - - - version = #{version,jdbcType=VARCHAR}, - - - experience = #{experience,jdbcType=LONGVARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update training_report - set flow_id = #{flowId,jdbcType=VARCHAR}, - school_id = #{schoolId,jdbcType=VARCHAR}, - url = #{url,jdbcType=VARCHAR}, - report_name = #{reportName,jdbcType=VARCHAR}, - step = #{step,jdbcType=VARCHAR}, - report_score = #{reportScore,jdbcType=DECIMAL}, - experience_score = #{experienceScore,jdbcType=DECIMAL}, - uploadTime = #{uploadtime,jdbcType=DATE}, - version = #{version,jdbcType=VARCHAR}, - experience = #{experience,jdbcType=LONGVARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - update training_report - set flow_id = #{flowId,jdbcType=VARCHAR}, - school_id = #{schoolId,jdbcType=VARCHAR}, - url = #{url,jdbcType=VARCHAR}, - report_name = #{reportName,jdbcType=VARCHAR}, - step = #{step,jdbcType=VARCHAR}, - report_score = #{reportScore,jdbcType=DECIMAL}, - experience_score = #{experienceScore,jdbcType=DECIMAL}, - uploadTime = #{uploadtime,jdbcType=DATE}, - version = #{version,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - + experience = #{record.experience,jdbcType=LONGVARCHAR} + + + + + + update training_report + set id = #{record.id,jdbcType=VARCHAR}, + flow_id = #{record.flowId,jdbcType=VARCHAR}, + school_id = #{record.schoolId,jdbcType=VARCHAR}, + url = #{record.url,jdbcType=VARCHAR}, + report_name = #{record.reportName,jdbcType=VARCHAR}, + step = #{record.step,jdbcType=VARCHAR}, + report_score = #{record.reportScore,jdbcType=DECIMAL}, + experience_score = #{record.experienceScore,jdbcType=DECIMAL}, + uploadTime = #{record.uploadtime,jdbcType=DATE}, + version = #{record.version,jdbcType=VARCHAR} + + + + + + update training_report + + + flow_id = #{flowId,jdbcType=VARCHAR}, + + + school_id = #{schoolId,jdbcType=VARCHAR}, + + + url = #{url,jdbcType=VARCHAR}, + + + report_name = #{reportName,jdbcType=VARCHAR}, + + + step = #{step,jdbcType=VARCHAR}, + + + report_score = #{reportScore,jdbcType=DECIMAL}, + + + experience_score = #{experienceScore,jdbcType=DECIMAL}, + + + uploadTime = #{uploadtime,jdbcType=DATE}, + + + version = #{version,jdbcType=VARCHAR}, + + + experience = #{experience,jdbcType=LONGVARCHAR}, + + + where id = #{id,jdbcType=VARCHAR} + + + update training_report + set flow_id = #{flowId,jdbcType=VARCHAR}, + school_id = #{schoolId,jdbcType=VARCHAR}, + url = #{url,jdbcType=VARCHAR}, + report_name = #{reportName,jdbcType=VARCHAR}, + step = #{step,jdbcType=VARCHAR}, + report_score = #{reportScore,jdbcType=DECIMAL}, + experience_score = #{experienceScore,jdbcType=DECIMAL}, + uploadTime = #{uploadtime,jdbcType=DATE}, + version = #{version,jdbcType=VARCHAR}, + experience = #{experience,jdbcType=LONGVARCHAR} + where id = #{id,jdbcType=VARCHAR} + + + update training_report + set flow_id = #{flowId,jdbcType=VARCHAR}, + school_id = #{schoolId,jdbcType=VARCHAR}, + url = #{url,jdbcType=VARCHAR}, + report_name = #{reportName,jdbcType=VARCHAR}, + step = #{step,jdbcType=VARCHAR}, + report_score = #{reportScore,jdbcType=DECIMAL}, + experience_score = #{experienceScore,jdbcType=DECIMAL}, + uploadTime = #{uploadtime,jdbcType=DATE}, + version = #{version,jdbcType=VARCHAR} + where id = #{id,jdbcType=VARCHAR} + + + + + UPDATE training_report + set + report_score = #{item.reportScore,jdbcType=DECIMAL}, + experience_score = #{item.experienceScore,jdbcType=DECIMAL} + WHERE id = #{item.id,jdbcType=VARCHAR} + + + \ No newline at end of file