From 69589a20d62e8786fc4d64ac21fbfa86f4bb3e25 Mon Sep 17 00:00:00 2001 From: "rong.liu" Date: Fri, 26 Feb 2021 10:16:24 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AD=A6=E7=94=9F?= =?UTF-8?q?=E7=AB=AF=E8=99=9A=E6=8B=9F=E5=AE=9E=E9=AA=8C=E6=95=99=E5=AD=A6?= =?UTF-8?q?=E5=AE=9E=E9=AA=8C=E5=88=97=E8=A1=A8=E5=8F=8A=E5=AE=9E=E9=AA=8C?= =?UTF-8?q?=E6=8A=A5=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ClassTeachingController.java | 103 +-- .../controller/ProjectRecordController.java | 2 +- .../com/msdw/tms/dao/ProjectRecordDao.java | 15 +- .../tms/entity/resp/GetByUserRecordResp.java | 89 ++ .../tms/service/ProjectRecordService.java | 16 +- .../impl/ExperimentalReportServiceImpl.java | 29 +- .../impl/ProjectRecordServiceImpl.java | 22 +- .../mapper/tms/AchievementManagementDao.xml | 774 ++++++++++-------- .../mapper/tms/ExperimentalReportDao.xml | 148 ++-- .../resources/mapper/tms/ProjectRecordDao.xml | 188 +++-- 10 files changed, 771 insertions(+), 615 deletions(-) create mode 100644 src/main/java/com/msdw/tms/entity/resp/GetByUserRecordResp.java diff --git a/src/main/java/com/msdw/tms/controller/ClassTeachingController.java b/src/main/java/com/msdw/tms/controller/ClassTeachingController.java index 64d7282..35218c9 100644 --- a/src/main/java/com/msdw/tms/controller/ClassTeachingController.java +++ b/src/main/java/com/msdw/tms/controller/ClassTeachingController.java @@ -32,6 +32,7 @@ public class ClassTeachingController implements ClassTeachingApi { /** * 用户端查看班级实验列表 + * * @param page * @param size * @param month @@ -43,58 +44,61 @@ public class ClassTeachingController implements ClassTeachingApi { */ @Override @GetMapping("userRecord") - public R queryTestRecord(@RequestParam Integer page, @RequestParam Integer size, Integer month,String startTime,String endTime, - String condition, @RequestParam Integer status,@RequestParam Integer schoolId){ + public R queryTestRecord(@RequestParam Integer page, @RequestParam Integer size, Integer month, String startTime, String endTime, + String condition, @RequestParam Integer status, @RequestParam Integer schoolId) { ProjectRecordVo recordVo = new ProjectRecordVo(); - if (status==1||status==2||status==3) {//限定实验状态 - recordVo.setStatus(status); - }else{//不限定实验状态 - recordVo.setStatus(null); - } - if(!StringUtils.isEmpty(condition)){ - recordVo.setCondition(condition); + if (status == 1 || status == 2 || status == 3) {//限定实验状态 + recordVo.setStatus(status); + } else {//不限定实验状态 + recordVo.setStatus(null); + } + if (!StringUtils.isEmpty(condition)) { + recordVo.setCondition(condition); + } + if (!StringUtils.isEmpty(month)) { + recordVo.setMonth(month); + } else { + recordVo.setMonth(null); + if (!StringUtils.isEmpty(startTime)) { + recordVo.setStartTime(startTime); } - if(!StringUtils.isEmpty(month)) { - recordVo.setMonth(month); - }else { - recordVo.setMonth(null); - if(!StringUtils.isEmpty(startTime)) { - recordVo.setStartTime(startTime); - }if(!StringUtils.isEmpty(endTime)) { - recordVo.setEndTime(endTime); - } + if (!StringUtils.isEmpty(endTime)) { + recordVo.setEndTime(endTime); } - recordVo.setSchoolId(schoolId); - PageUtils page1 = classTeachingService.queryClassRecord(page,size,recordVo); - return R.ok().put("page", page1); + } + recordVo.setSchoolId(schoolId); + PageUtils page1 = classTeachingService.queryClassRecord(page, size, recordVo); + return R.ok().put("page", page1); } /** * 校验是否需要输入邀请码 + * * @param userId * @param projectId * @return */ @Override @GetMapping("/checkInvitationCode") - public R check(@RequestParam Integer userId,@RequestParam("id") Integer projectId){ - List o = experimentalStudentService.queryIsCode(userId,projectId); - if (o.size()>0){ + public R check(@RequestParam Integer userId, @RequestParam("id") Integer projectId) { + List o = experimentalStudentService.queryIsCode(userId, projectId); + if (o.size() > 0) { return R.ok(); - }else{ - return R.error(200,"false"); + } else { + return R.error(200, "false"); } } /** * 通过邀请码进入实验 + * * @param * @return */ @Override @Transactional @PostMapping("/joinPractice") - public R joinPractice(@RequestBody ExperimentalTeachingEntity entity1){ + public R joinPractice(@RequestBody ExperimentalTeachingEntity entity1) { //获取参数 Integer projectId = entity1.getProjectId(); Integer id = entity1.getId(); @@ -106,58 +110,61 @@ public class ClassTeachingController implements ClassTeachingApi { // Integer ICode = experimentalStudentService.queryIsCode(userId);//获取iscode信息, //if (isCode==0) - if (invitationCode!=null){ - entity.setId(id); + if (invitationCode != null) { + entity.setId(id); // entity.setProjectId(projectId); - ExperimentalTeachingEntity result= classTeachingService.queryInvitationcode(entity);//邀请码唯一 - Integer code = result.getInvitationCode(); - if (invitationCode.equals(code)==true){ - ExperimentalStudentEntity student = studentEntity.setUserId(userId).setProjectId(id); - experimentalStudentService.saveCode(student); - return R.ok(); - }else{ - return R.error("邀请码错误,验证失败!!!"); - } - }else{ - return R.error(400,"邀请码格式错误!!!"); + ExperimentalTeachingEntity result = classTeachingService.queryInvitationcode(entity);//邀请码唯一 + Integer code = result.getInvitationCode(); + if (invitationCode.equals(code) == true) { + ExperimentalStudentEntity student = studentEntity.setUserId(userId).setProjectId(id); + experimentalStudentService.saveCode(student); + return R.ok(); + } else { + return R.error("邀请码错误,验证失败!!!"); } + } else { + return R.error(400, "邀请码格式错误!!!"); } + } /** * 查看虚拟仿真课程列表信息 + * * @param page * @param size * @return */ @Override @GetMapping("/simulationPlayList") - public R querySimulationPlayList(@RequestParam Integer page,@RequestParam Integer size){ - PageUtils page1 = classTeachingService.querySimulationPlayList(page,size); - return R.ok().put("data",page1); + public R querySimulationPlayList(@RequestParam Integer page, @RequestParam Integer size) { + PageUtils page1 = classTeachingService.querySimulationPlayList(page, size); + return R.ok().put("data", page1); } /** - * 学生查看实验报告 + * 学生查看实验报告(教学) + * * @param * @return */ @Override @GetMapping("/queryExperimentalReport") - public R queryExperimentalReport(@RequestParam Integer studentId,@RequestParam Integer projectId,@RequestParam Integer recordId,@RequestParam Integer reportId){ + public R queryExperimentalReport(@RequestParam Integer studentId, @RequestParam Integer projectId, @RequestParam Integer recordId, @RequestParam Integer reportId) { ExperimentalReportVo entity = new ExperimentalReportVo(); - R result = experimentalReportService.queryReport(studentId,projectId,recordId,reportId); + R result = experimentalReportService.queryReport(studentId, projectId, recordId, reportId); return result; } /** - * 学生查看虚拟实验报告 + * 学生查看虚拟实验报告(虚仿) + * * @param * @return */ @Override @GetMapping("/queryVirtualReport") - public R queryVirtualReport(@RequestParam Integer recordId){ + public R queryVirtualReport(@RequestParam Integer recordId) { R result = experimentalReportService.queryVirtualReport(recordId); return result; } diff --git a/src/main/java/com/msdw/tms/controller/ProjectRecordController.java b/src/main/java/com/msdw/tms/controller/ProjectRecordController.java index 0235cb4..e69def5 100644 --- a/src/main/java/com/msdw/tms/controller/ProjectRecordController.java +++ b/src/main/java/com/msdw/tms/controller/ProjectRecordController.java @@ -64,7 +64,7 @@ public class ProjectRecordController implements ProjectRcordControllerApi { @Override @GetMapping("/user/record") public R queryUserRecord(@RequestParam Integer page,@RequestParam Integer size,@RequestParam Integer userId,@RequestParam Integer projectPermissions){ - PageUtils page1 = projectRecordService.queryPage(page,size,userId,projectPermissions); + PageUtils page1 = projectRecordService.queryPage(page,size,userId); return R.ok().put("data", page1); } diff --git a/src/main/java/com/msdw/tms/dao/ProjectRecordDao.java b/src/main/java/com/msdw/tms/dao/ProjectRecordDao.java index e1f10c7..7b5f19f 100644 --- a/src/main/java/com/msdw/tms/dao/ProjectRecordDao.java +++ b/src/main/java/com/msdw/tms/dao/ProjectRecordDao.java @@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.msdw.tms.entity.ExperimentalProjectEntity; import com.msdw.tms.entity.ExperimentalReportEntity; import com.msdw.tms.entity.ProjectRecordEntity; +import com.msdw.tms.entity.resp.GetByUserRecordResp; import com.msdw.tms.entity.vo.ProjectRecordExportVo; import com.msdw.tms.entity.vo.ProjectRecordVo; import com.msdw.tms.entity.vo.RecordVo; @@ -15,26 +16,24 @@ import org.apache.ibatis.annotations.Param; import java.util.List; /** - * - * - * @author - * @email + * @author + * @email * @date 2020-08-19 16:07:02 */ @Mapper public interface ProjectRecordDao extends BaseMapper { - IPage getByUserRecord(Page page,@Param("pro") ProjectRecordEntity projectRecordEntity,Integer projectPermissions); + IPage getByUserRecord(Page page, @Param("userId") Integer userId); - IPage getByUserExperimentRecord(Page page,@Param("pro") ProjectRecordEntity projectRecordEntity); + IPage getByUserExperimentRecord(Page page, @Param("pro") ProjectRecordEntity projectRecordEntity); List getByUserRecordImport(ProjectRecordEntity projectRecordEntity); - ProjectRecordVo getByUserScore(@Param("userid") Integer userId,@Param("isdel") Integer isdel); + ProjectRecordVo getByUserScore(@Param("userid") Integer userId, @Param("isdel") Integer isdel); ProjectRecordVo queryScore(@Param("userId") Integer userId); - IPage getBySchoolRecord(Page page,@Param("pro") ProjectRecordVo projectRecord); + IPage getBySchoolRecord(Page page, @Param("pro") ProjectRecordVo projectRecord); boolean updateUserRecord(ProjectRecordEntity projectRecord); diff --git a/src/main/java/com/msdw/tms/entity/resp/GetByUserRecordResp.java b/src/main/java/com/msdw/tms/entity/resp/GetByUserRecordResp.java new file mode 100644 index 0000000..5155336 --- /dev/null +++ b/src/main/java/com/msdw/tms/entity/resp/GetByUserRecordResp.java @@ -0,0 +1,89 @@ +package com.msdw.tms.entity.resp; + +import lombok.Data; + +/** + * @ProjectName: tms + * @Package: com.msdw.tms.entity.resp + * @ClassName: GetByUserRecordResp + * @Description: java类作用描述 + * @Author: Maureen.Rong + * @CreateDate: 2021/2/25 15:26 + * @UpdateDate: 2021/2/25 15:26 + * @Version: 1.0 + */ + +public class GetByUserRecordResp { + private String projectName; + private Integer recordId; + private Integer score; + private Integer codeId; + private String startingTime; + private String submitTime; + private Integer timeSum; + private Integer userId; + + public String getProjectName() { + return projectName; + } + + public void setProjectName(String projectName) { + this.projectName = projectName; + } + + public Integer getRecordId() { + return recordId; + } + + public void setRecordId(Integer recordId) { + this.recordId = recordId; + } + + public Integer getScore() { + return score; + } + + public void setScore(Integer score) { + this.score = score; + } + + public Integer getCodeId() { + return codeId; + } + + public void setCodeId(Integer codeId) { + this.codeId = codeId; + } + + public String getStartingTime() { + return startingTime; + } + + public void setStartingTime(String startingTime) { + this.startingTime = startingTime; + } + + public String getSubmitTime() { + return submitTime; + } + + public void setSubmitTime(String submitTime) { + this.submitTime = submitTime; + } + + public Integer getTimeSum() { + return timeSum; + } + + public void setTimeSum(Integer timeSum) { + this.timeSum = timeSum; + } + + public Integer getUserId() { + return userId; + } + + public void setUserId(Integer userId) { + this.userId = userId; + } +} diff --git a/src/main/java/com/msdw/tms/service/ProjectRecordService.java b/src/main/java/com/msdw/tms/service/ProjectRecordService.java index 74edc2a..6f258a3 100644 --- a/src/main/java/com/msdw/tms/service/ProjectRecordService.java +++ b/src/main/java/com/msdw/tms/service/ProjectRecordService.java @@ -11,27 +11,25 @@ import java.util.HashMap; import java.util.List; /** - * - * - * @author - * @email + * @author + * @email * @date 2020-08-19 16:07:02 */ public interface ProjectRecordService extends IService { - PageUtils queryPage(Integer page,Integer size,Integer userId,Integer projectPermissions); + PageUtils queryPage(Integer page, Integer size, Integer userId); - PageUtils queryExperimentPage(Integer page,Integer size,Integer userid); + PageUtils queryExperimentPage(Integer page, Integer size, Integer userid); ProjectRecordVo queryUserScore(Integer userId); ProjectRecordVo queryScore(Integer userId); - void exportProjectRecord(HttpServletResponse response, Integer userId)throws Exception; + void exportProjectRecord(HttpServletResponse response, Integer userId) throws Exception; - void exportExperimentProjectRecord(HttpServletResponse response, Integer userId)throws Exception; + void exportExperimentProjectRecord(HttpServletResponse response, Integer userId) throws Exception; - PageUtils querySchoolRecord(Integer page,Integer size,ProjectRecordVo projectRecord); + PageUtils querySchoolRecord(Integer page, Integer size, ProjectRecordVo projectRecord); boolean updateUserRecord(ProjectRecordEntity projectRecord); diff --git a/src/main/java/com/msdw/tms/service/impl/ExperimentalReportServiceImpl.java b/src/main/java/com/msdw/tms/service/impl/ExperimentalReportServiceImpl.java index b419d62..0b08a7c 100644 --- a/src/main/java/com/msdw/tms/service/impl/ExperimentalReportServiceImpl.java +++ b/src/main/java/com/msdw/tms/service/impl/ExperimentalReportServiceImpl.java @@ -15,7 +15,7 @@ import java.util.HashMap; import java.util.List; @Service -public class ExperimentalReportServiceImpl extends ServiceImpl implements ExperimentalReportService { +public class ExperimentalReportServiceImpl extends ServiceImpl implements ExperimentalReportService { @Autowired private ExperimentalReportDao reportDao; @@ -24,36 +24,37 @@ public class ExperimentalReportServiceImpl extends ServiceImpl map = new HashMap<>(); - map.put("report",result); - if(systemId==1|systemId==4|systemId==5){ + map.put("report", result); + if (systemId == 1 | systemId == 4 | systemId == 5) { List data = achievementManagementDao.queryPythonTest(recordId); - map.put("data",data); - return R.ok().put("data",map); + map.put("data", data); + return R.ok().put("data", map); } - return R.ok().put("data",map); + return R.ok().put("data", map); } + //虚拟实验 @Override public R queryVirtualReport(Integer recordId) { ExperimentalReportVo result = reportDao.queryVirtualReport(recordId); - Integer systemId =reportDao.querySystemId(recordId); + Integer systemId = reportDao.querySystemId(recordId); //python实验 - if(systemId==1|systemId==4|systemId==5){ + if (systemId == 1 | systemId == 4 | systemId == 5) { List data = achievementManagementDao.queryPythonTest(recordId); HashMap map = new HashMap<>(); - map.put("data",data); - map.put("report",result); - return R.ok().put("data",map); + map.put("data", data); + map.put("report", result); + return R.ok().put("data", map); } - return R.ok().put("data",result); + return R.ok().put("data", result); } } diff --git a/src/main/java/com/msdw/tms/service/impl/ProjectRecordServiceImpl.java b/src/main/java/com/msdw/tms/service/impl/ProjectRecordServiceImpl.java index 020f208..85a1c44 100644 --- a/src/main/java/com/msdw/tms/service/impl/ProjectRecordServiceImpl.java +++ b/src/main/java/com/msdw/tms/service/impl/ProjectRecordServiceImpl.java @@ -12,6 +12,7 @@ import com.msdw.tms.entity.ExperimentalReportEntity; import com.msdw.tms.entity.ProjectRecordEntity; import com.msdw.tms.entity.request.ExperimentProjectRecordImportRequest; import com.msdw.tms.entity.request.ProjectRecordImportRequest; +import com.msdw.tms.entity.resp.GetByUserRecordResp; import com.msdw.tms.entity.vo.ProjectRecordExportVo; import com.msdw.tms.entity.vo.ProjectRecordVo; import com.msdw.tms.service.ProjectRecordService; @@ -37,14 +38,15 @@ public class ProjectRecordServiceImpl extends ServiceImpl page1 = new Page<>(page, size); - IPage projectRecordVos = this.baseMapper.getByUserRecord(page1,projectRecord,projectPermissions); + IPage projectRecordVos = this.baseMapper.getByUserRecord(page1, userId); PageUtils questionsPage = new PageUtils(projectRecordVos); @@ -59,7 +61,7 @@ public class ProjectRecordServiceImpl extends ServiceImpl page1 = new Page<>(page, size); - IPage projectRecordVos = this.baseMapper.getByUserExperimentRecord(page1,projectRecord); + IPage projectRecordVos = this.baseMapper.getByUserExperimentRecord(page1, projectRecord); PageUtils questionsPage = new PageUtils(projectRecordVos); @@ -70,9 +72,9 @@ public class ProjectRecordServiceImpl extends ServiceImpl - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + SELECT her.*, pm.projectName, s.workNumber + FROM hr_experimental_report her, + hr_project_management pm, + student s + WHERE her.reportId = #{reportId} + and her.studentId = #{studentId} + and her.projectId = pm.projectId + and her.studentId = s.userId - + - - - - - INSERT INTO hr_experimental_report( projectId, content, principle, step, analysis, summarize, improvement, - commentId, studentId, period,laboratory,className,steps1,steps2,steps3,steps4,steps5,steps6,steps7,steps8,steps9,steps10,timeConsuming,startTime,creationTime,purpose,teacherName) - VALUES - (#{projectId},#{content}, #{principle}, #{step}, #{analysis}, #{summarize}, #{improvement}, #{commentId}, #{studentId}, - #{period}, #{laboratory},#{className},#{steps1},#{steps2},#{steps3},#{steps4},#{steps5},#{steps6},#{steps7},#{steps8},#{steps9},#{steps10},#{timeConsuming},#{startTime},#{creationTime},#{purpose},#{teacherName}) + + + + + INSERT INTO hr_experimental_report(projectId, content, principle, step, analysis, summarize, improvement, + commentId, studentId, period, laboratory, className, steps1, steps2, steps3, + steps4, steps5, steps6, steps7, steps8, steps9, steps10, timeConsuming, + startTime, creationTime, purpose, teacherName) + VALUES (#{projectId}, #{content}, #{principle}, #{step}, #{analysis}, #{summarize}, #{improvement}, + #{commentId}, #{studentId}, + #{period}, #{laboratory}, #{className}, #{steps1}, #{steps2}, #{steps3}, #{steps4}, #{steps5}, + #{steps6}, #{steps7}, #{steps8}, #{steps9}, #{steps10}, #{timeConsuming}, #{startTime}, #{creationTime}, + #{purpose}, #{teacherName}) - - UPDATE tms_project_record tpr,hr_experimental_report tcr SET tpr.isdel = 1 , tcr.isdel = 1 WHERE tpr.recordId = tcr.eventId AND tcr.reportId = #{reportId} + + UPDATE tms_project_record tpr,hr_experimental_report tcr + SET tpr.isdel = 1, tcr.isdel = 1 + WHERE tpr.recordId = tcr.eventId AND tcr.reportId = #{reportId} + + + UPDATE tms_experimental_report + SET `comment` = #{comment} + WHERE reportId = #{reportId} - - UPDATE tms_experimental_report SET `comment` = #{comment} WHERE reportId = #{reportId} - - -UPDATE tms_experimental_report SET isSignature = #{isSignature} , signatureId = #{signatureId}, `comment` = #{comment} WHERE reportId = #{reportId} - - + SELECT ter.reportId, + IFNULL(ter.`comment`, (SELECT `comment` FROM tms_comment WHERE id = commentId)) AS comment, + ter.projectId, + ter.principle, + ter.content, + ter.step, + ter.`data`, + ter.analysis, + ter.conclusion, + ter.summarize, + ter.improvement, + ter.commentId, + ter.studentId, + ter.teacherName, + ter.period, + ter.laboratory, + ter.eventId, + ter.isSignature, + ter.signatureId, + ter.isdel, + hpm.projectName, + hpm.systemId, + ts.signature_name AS signatureName, + ts.signature_url AS signatureUrl, + tc.`level` + FROM tms_experimental_report ter + LEFT JOIN tms_signature ts ON signatureId = ts.id + LEFT JOIN tms_comment tc ON commentId = tc.id + LEFT JOIN tms_project_record AS tpr ON tpr.recordId = ter.eventId + LEFT JOIN hr_project_management AS hpm ON hpm.projectId = tpr.projectId + WHERE reportId = #{reportId} + + + + + - + + + + + + - SELECT - u.userName, - sch.schoolName, - s.workNumber, - tpr.score, - tpr.submitTime, - tpr.recordId, - tcr.reportId - FROM - hr_project_management hpm, - hr_user_info u, - student s, - tms_project_record tpr, - tms_experimental_report tcr, - school sch - WHERE - hpm.projectId = tpr.projectId - AND tpr.userId = u.userId - AND u.userId = s.userId - AND sch.schoolId = u.schoolId - AND tcr.eventId = tpr.recordId - AND tpr.isdel = 0 - AND tcr.isdel = 0 - AND u.isdel = 0 - - AND recordId IN ( - - #{recordId} - - ) - - GROUP BY - tcr.reportId - ORDER BY tpr.submitTime DESC - - - - - - - - + AND hjp.isdel = 0 + AND hec.recordId = #{recordId} + GROUP BY hec.codeId + + SELECT hpm.creationTime,hpm.projectId,hpm.projectName,hpm.projectPermissions,hpm.systemId,(SELECT count(*) FROM + hr_experimental_report her where hpm.projectId = her.projectId ) as number + FROM hr_project_management hpm WHERE systemId = #{systemId} + AND hpm.isdel = 0 + AND hpm.projectPermissions = + #{projectPermissions} + + and hpm.projectName like concat('%',#{searchContant},'%') + + and hpm.creationTime between + #{endTime} and #{startTime} + + and DATE_SUB(CURDATE(), INTERVAL #{month} month ) <= + date(hpm.creationTime) + + ORDER BY hpm.creationTime DESC + - + - + - + - + \ No newline at end of file diff --git a/src/main/resources/mapper/tms/ExperimentalReportDao.xml b/src/main/resources/mapper/tms/ExperimentalReportDao.xml index 6052511..7f087d8 100644 --- a/src/main/resources/mapper/tms/ExperimentalReportDao.xml +++ b/src/main/resources/mapper/tms/ExperimentalReportDao.xml @@ -1,85 +1,75 @@ - - - - - - - + + + + + + + + + - - \ No newline at end of file diff --git a/src/main/resources/mapper/tms/ProjectRecordDao.xml b/src/main/resources/mapper/tms/ProjectRecordDao.xml index 3fa668a..5cedac0 100644 --- a/src/main/resources/mapper/tms/ProjectRecordDao.xml +++ b/src/main/resources/mapper/tms/ProjectRecordDao.xml @@ -14,16 +14,16 @@ - + -INSERT INTO tms_project_record ( userId, projectId, score, startingTime, endTime, timeSum, submitTime ) -VALUES - (#{userid}, #{projectid}, #{score}, #{startingtime}, now(), #{timeSum}, now()) + INSERT INTO tms_project_record (userId, projectId, score, startingTime, endTime, timeSum, submitTime) + VALUES (#{userid}, #{projectid}, #{score}, #{startingtime}, now(), #{timeSum}, now()) - + SELECT projectName, + c.recordId, + r.score, + c.codeId, + r.startingTime, + r.submitTime, + r.timeSum, + c.userId + FROM hr_experiment_code c + INNER JOIN hr_project_management t ON t.projectId = c.projectId + INNER JOIN tms_project_record r ON r.recordId = c.recordId + WHERE c.userId = #{userId} + and r.isdel = 0 + ORDER BY c.codeId DESC - + SELECT tet.id, + ter.reportId, + tpr.recordId, + tpr.projectId, + projectName, + score, + timeSum, + startingTime as startTime, + endTime, + recordState, + tet.experimental_class_name as experimentalClassName + FROM tms_project_record tpr + LEFT JOIN hr_project_management tp ON tpr.projectId = tp.projectId + LEFT JOIN tms_experimental_teaching tet ON tet.project_id = tpr.projectId + LEFT JOIN tms_experimental_report ter ON ter.projectId = tet.id + WHERE tpr.userId = #{pro.userid} + AND tpr.isdel = #{pro.isdel} + AND tp.projectPermissions !=0 AND ter.eventId = tpr.recordId ORDER BY - tpr.submitTime DESC + tpr.submitTime DESC - + SELECT tpr.projectId, + projectName, + score, + timeSum, + startingTime as startTime, + endTime, + recordState, + tet.experimental_class_name + FROM tms_project_record tpr + LEFT JOIN hr_project_management tp ON tpr.projectId = tp.projectId + LEFT JOIN tms_experimental_teaching tet ON tpr.projectId = tet.project_id + WHERE tpr.userId = #{userid} + AND tpr.isdel = #{isdel} + AND tpr.projectId = tet.project_id + AND tp.projectPermissions != 0 ORDER BY - tpr.submitTime DESC + tpr.submitTime DESC - + update tms_project_record set isdel = #{isdel} ,recordstate = #{recordstate} @@ -184,6 +188,8 @@ VALUES - UPDATE tms_project_record SET score = #{score} WHERE recordId = #{recordid} + UPDATE tms_project_record + SET score = #{score} + WHERE recordId = #{recordid} \ No newline at end of file From d4b8ec26361dde4d740b6d22b39d7ef33210fdf1 Mon Sep 17 00:00:00 2001 From: "rong.liu" Date: Fri, 26 Feb 2021 11:54:16 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tms/service/impl/ExperimentalReportServiceImpl.java | 9 +++++++++ src/main/resources/mapper/tms/ProjectRecordDao.xml | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/msdw/tms/service/impl/ExperimentalReportServiceImpl.java b/src/main/java/com/msdw/tms/service/impl/ExperimentalReportServiceImpl.java index 0b08a7c..80ced2d 100644 --- a/src/main/java/com/msdw/tms/service/impl/ExperimentalReportServiceImpl.java +++ b/src/main/java/com/msdw/tms/service/impl/ExperimentalReportServiceImpl.java @@ -23,6 +23,15 @@ public class ExperimentalReportServiceImpl extends ServiceImpl