From 6a73e7b1493bc224b6032627c8a09301f2e4efa0 Mon Sep 17 00:00:00 2001 From: xiaoCJ <406612557@qq.com> Date: Sun, 28 Apr 2024 14:49:30 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E7=94=9F=E6=88=90=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E6=96=87=E4=BB=B6=E5=92=8Cmapper=20xml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tea/TeaGradeManageController.java | 169 +++-- .../entity/TeaAndStudentExamExample.java | 70 ++ .../entity/tea_dto/TeaExamManageCountDto.java | 2 +- .../entity/tea_dto/TeaExamManageDto.java | 3 + .../mapper/StuUserMapper.java | 10 +- .../mapper/SysCaseQuestionStepMapper.java | 6 + .../mapper/SysObjectiveQuestionMapper.java | 3 + .../mapper/TeaAndStudentExamMapper.java | 7 +- .../mapper/TeaExamManageMapper.java | 11 + .../service/stu/impl/StuIndexServiceImpl.java | 6 +- .../tea/impl/TeaExamManageServiceImpl.java | 3 +- .../mapper/SysCaseQuestionStepMapper.xml | 606 +++++++++--------- .../mapper/SysObjectiveQuestionMapper.xml | 9 + .../mapper/TeaAndStudentExamMapper.xml | 32 +- 14 files changed, 570 insertions(+), 367 deletions(-) diff --git a/src/main/java/com/sztzjy/financial_bigdata/controller/tea/TeaGradeManageController.java b/src/main/java/com/sztzjy/financial_bigdata/controller/tea/TeaGradeManageController.java index 33fe60a..8e41ca5 100644 --- a/src/main/java/com/sztzjy/financial_bigdata/controller/tea/TeaGradeManageController.java +++ b/src/main/java/com/sztzjy/financial_bigdata/controller/tea/TeaGradeManageController.java @@ -65,54 +65,12 @@ public class TeaGradeManageController { private SysWeightMapper sysWeightMapper; @Autowired private StuTheoryExamMapper stuTheoryExamMapper; - -// @AnonymousAccess -// @PostMapping("/getExamInfo") -// @ApiOperation("考试模式--页面展示(学生端实战考核复用)") -// public ResultEntity> getExamInfo(@RequestParam Integer index, -// @RequestParam Integer size, -// @ApiParam("ManyAnswer为考试时间,JudgeAnswer为发布人") @RequestParam String schoolId) { -// -// List teaExamManages = teaExamManageMapper.selectBySchoolId(schoolId); -// ListteaExamManageCountDtos =new AstList(); -// for (TeaExamManage teaExamManage : teaExamManages) { -// List nameList = new ArrayList<>(); -// TeaExamManageCountDto copyexamManageWithBLOBs = new TeaExamManageCountDto(); -// int num = 0; -// //获取班级和考试人数 -// String classId = teaAndStudentExamMapper.selectByExamId(teaExamManage.getExamManageId()); -// String[] split = classId.split(","); -// for (String s : split) { -// StuClass stuClass = stuClassMapper.selectByPrimaryKey(s); -// String className = stuClass.getClassName(); -// nameList.add(className); -// int count = userMapper.selectNumByClass(s); -// num = num + count; -// } -// copyexamManageWithBLOBs.setExamClass(nameList); -// copyexamManageWithBLOBs.setExamNum(num); -// BeanUtils.copyProperties(teaExamManage, copyexamManageWithBLOBs); -// Date now = new Date(); // 当前日期 -// Date endTime = teaExamManage.getEndTime(); // 从 teaExamManage 对象中获取的日期 -// Date startTime = teaExamManage.getStartTime(); -// -// if (now.compareTo(endTime) > 0) { -// copyexamManageWithBLOBs.setExamStatus("已结束"); -// } else if (now.compareTo(startTime) < 0) { -// copyexamManageWithBLOBs.setExamStatus("未开始"); -// } else { -// copyexamManageWithBLOBs.setExamStatus("进行中"); -// } -// String concatenatedTimeString = startTime + " -- " + endTime; -// copyexamManageWithBLOBs.setExamTime(concatenatedTimeString); //考试时间 -// String userId = teaExamManage.getUserId(); -// StuUser stuUser = userMapper.selectByPrimaryKey(userId); -// copyexamManageWithBLOBs.setName(stuUser.getName()); //发布人 -// teaExamManageCountDtos.add(copyexamManageWithBLOBs); -// } -// PageUtil.pageHelper(teaExamManageCountDtos, index, size); -// return new ResultEntity<>(new PageInfo<>(teaExamManageCountDtos)); -// } + @Autowired + private SysCaseQuestionMapper sysCaseQuestionMapper; + @Autowired + private SysCaseQuestionStepMapper sysCaseQuestionStepMapper; + @Autowired + private SysObjectiveQuestionMapper sysObjectiveQuestionMapper; @AnonymousAccess @@ -124,34 +82,80 @@ public class TeaGradeManageController { List teaExamManages = teaExamManageMapper.selectBySchoolId(schoolId); List teaExamManageCountDtos = new ArrayList<>(); + Map userMap = new HashMap<>(); - // 批量查询班级信息 - List examIds = new ArrayList<>(); + List userIds = new ArrayList<>(); for (TeaExamManage teaExamManage : teaExamManages) { - examIds.add(teaExamManage.getExamManageId()); + String userId = teaExamManage.getUserId(); + userIds.add(userId); } + //存储用户信息 + List stuUsers = userMapper.selectByPrimaryKeys(userIds); + for (StuUser stuUser : stuUsers) { + userMap.put(stuUser.getUserid(), stuUser); + } + + for (TeaExamManage teaExamManage : teaExamManages) { + TeaExamManageCountDto copyexamManageWithBLOBs = new TeaExamManageCountDto(); + + //获取班级和考试人数 + TeaAndStudentExam teaAndStudentExam = teaAndStudentExamMapper.selectByExamMangeId(teaExamManage.getExamManageId()); + + String classId = teaAndStudentExam.getClassId(); + String[] split = classId.split(","); + List ids = new ArrayList<>(Arrays.asList(split)); + int num = userMapper.selectNumByClass(ids); + copyexamManageWithBLOBs.setExamClass(teaAndStudentExam.getClassName()); + copyexamManageWithBLOBs.setExamNum(num); + BeanUtils.copyProperties(teaExamManage, copyexamManageWithBLOBs); + Date now = new Date(); // 当前日期 + Date endTime = teaExamManage.getEndTime(); // 从 teaExamManage 对象中获取的日期 + Date startTime = teaExamManage.getStartTime(); + + if (now.compareTo(endTime) > 0) { + copyexamManageWithBLOBs.setExamStatus("已结束"); + } else if (now.compareTo(startTime) < 0) { + copyexamManageWithBLOBs.setExamStatus("未开始"); + } else { + copyexamManageWithBLOBs.setExamStatus("进行中"); + } + String concatenatedTimeString = startTime + " -- " + endTime; + copyexamManageWithBLOBs.setExamTime(concatenatedTimeString); //考试时间 + String userId = teaExamManage.getUserId(); + StuUser stuUser = userMap.get(userId); + copyexamManageWithBLOBs.setName(stuUser.getName()); //发布人 + teaExamManageCountDtos.add(copyexamManageWithBLOBs); + } PageInfo pageInfo = PageUtil.pageHelper(teaExamManageCountDtos, index, size); - return new ResultEntity>(pageInfo); + return new ResultEntity<>(pageInfo); } @AnonymousAccess @PostMapping("/getExamInfoAndRank") @ApiOperation("考试模式--成绩排名和成绩情况展示") //TODO 图片可能需要一个接口去取 - public ResultEntity getExamInfoAndRank(@RequestParam Integer index, - @RequestParam Integer size, - @RequestParam String schoolId, - @ApiParam("学号或姓名搜索框") @RequestParam(required = false) String keyWord, - @RequestParam(required = false) String classId, - @RequestParam(required = false) String examManageId) { + public ResultEntity> getExamInfoAndRank(@RequestParam Integer index, + @RequestParam Integer size, + @RequestParam String schoolId, + @ApiParam("学号或姓名搜索框") @RequestParam(required = false) String keyWord, + @RequestParam(required = false) String classId, + @RequestParam(required = false) String examManageId) { List list = getTeaExamAndUserDtos(schoolId, keyWord, classId, examManageId); list.sort(new TeaGradeManageServiceImpl.StuUserDtoComparator()); //比较器按得分排序 PageInfo pageInfo = PageUtil.pageHelper(list, index, size); return new ResultEntity<>(pageInfo); } + @AnonymousAccess + @PostMapping("/getExamNameAndId") + @ApiOperation("考试模式--考试名称下拉框") //TODO 图片可能需要一个接口去取 + public ResultEntity>> getExamNameAndId(@RequestParam String schoolId) { + List> list = teaExamManageMapper.selectNameAndIdBySchoolId(schoolId); + return new ResultEntity<>(list); + } + @GetMapping("/exportExam") @ApiOperation("考试模式--页面单个考试导出") @@ -210,12 +214,55 @@ public class TeaGradeManageController { } @AnonymousAccess - @PostMapping("/getGradeReport") - @ApiOperation("考试模式--成绩报告接口") //TODO 待写 成绩报告接口 需要计算题目的正确率,暂时没想好 - public void getGradeReport() { + @PostMapping("/getGradeReportCase") + @ApiOperation("考试模式--成绩报告案例题questionOriginal所属章节,contentOriginal为考核点数量") //TODO 案例题正确率字段暂无 + public ResultEntity> getGradeReportCase(@RequestParam Integer index, + @RequestParam Integer size, + @RequestParam String examManageId) { + TeaExamManageWithBLOBs teaExamManageWithBLOBs = teaExamManageMapper.selectByPrimaryKey(examManageId); + String caseIdList = teaExamManageWithBLOBs.getCaseIdlist(); + List list = Arrays.asList(caseIdList.split(",")); + PageHelper.startPage(index, size); + List resultList = sysCaseQuestionStepMapper.getGradeReportCase(list); + PageInfo pageInfo = new PageInfo(resultList); + return new ResultEntity(pageInfo); + } + + + @AnonymousAccess + @PostMapping("/getGradeReportObjective") + @ApiOperation("考试模式--成绩报告客观题") //TODO 客观题正确率字段暂无 + public ResultEntity> getGradeReportObjective(@RequestParam Integer index, + @RequestParam Integer size, + @RequestParam String examManageId) { + TeaExamManageWithBLOBs teaExamManageWithBLOBs = teaExamManageMapper.selectByPrimaryKey(examManageId); + if (teaExamManageWithBLOBs == null) { + return null; + } + List list = new ArrayList(); + if (StringUtils.isNotBlank(teaExamManageWithBLOBs.getSingleIdlist())) { + String singleIdList = teaExamManageWithBLOBs.getSingleIdlist(); + String[] split = singleIdList.split(","); + list.addAll(Arrays.asList(split)); + } + if (StringUtils.isNotBlank(teaExamManageWithBLOBs.getManyIdlist())) { + String manyIdList = teaExamManageWithBLOBs.getManyIdlist(); + String[] split = manyIdList.split(","); + list.addAll(Arrays.asList(split)); + } + if (StringUtils.isNotBlank(teaExamManageWithBLOBs.getJudgeIdlist())) { + String judgeIdList = teaExamManageWithBLOBs.getJudgeIdlist(); + String[] split = judgeIdList.split(","); + list.addAll(Arrays.asList(split)); + } + PageHelper.startPage(index, size); + List resultList = sysObjectiveQuestionMapper.getGradeReportObjective(list); + PageInfo pageInfo = new PageInfo(resultList); + return new ResultEntity(pageInfo); } + @AnonymousAccess @GetMapping("/exportRank") @ApiOperation("考试模式--成绩排名页面导出") diff --git a/src/main/java/com/sztzjy/financial_bigdata/entity/TeaAndStudentExamExample.java b/src/main/java/com/sztzjy/financial_bigdata/entity/TeaAndStudentExamExample.java index ad2239d..8713bc0 100644 --- a/src/main/java/com/sztzjy/financial_bigdata/entity/TeaAndStudentExamExample.java +++ b/src/main/java/com/sztzjy/financial_bigdata/entity/TeaAndStudentExamExample.java @@ -313,6 +313,76 @@ public class TeaAndStudentExamExample { addCriterion("class_id not between", value1, value2, "classId"); return (Criteria) this; } + + public Criteria andClassNameIsNull() { + addCriterion("class_name is null"); + return (Criteria) this; + } + + public Criteria andClassNameIsNotNull() { + addCriterion("class_name is not null"); + return (Criteria) this; + } + + public Criteria andClassNameEqualTo(String value) { + addCriterion("class_name =", value, "className"); + return (Criteria) this; + } + + public Criteria andClassNameNotEqualTo(String value) { + addCriterion("class_name <>", value, "className"); + return (Criteria) this; + } + + public Criteria andClassNameGreaterThan(String value) { + addCriterion("class_name >", value, "className"); + return (Criteria) this; + } + + public Criteria andClassNameGreaterThanOrEqualTo(String value) { + addCriterion("class_name >=", value, "className"); + return (Criteria) this; + } + + public Criteria andClassNameLessThan(String value) { + addCriterion("class_name <", value, "className"); + return (Criteria) this; + } + + public Criteria andClassNameLessThanOrEqualTo(String value) { + addCriterion("class_name <=", value, "className"); + return (Criteria) this; + } + + public Criteria andClassNameLike(String value) { + addCriterion("class_name like", value, "className"); + return (Criteria) this; + } + + public Criteria andClassNameNotLike(String value) { + addCriterion("class_name not like", value, "className"); + return (Criteria) this; + } + + public Criteria andClassNameIn(List values) { + addCriterion("class_name in", values, "className"); + return (Criteria) this; + } + + public Criteria andClassNameNotIn(List values) { + addCriterion("class_name not in", values, "className"); + return (Criteria) this; + } + + public Criteria andClassNameBetween(String value1, String value2) { + addCriterion("class_name between", value1, value2, "className"); + return (Criteria) this; + } + + public Criteria andClassNameNotBetween(String value1, String value2) { + addCriterion("class_name not between", value1, value2, "className"); + return (Criteria) this; + } } public static class Criteria extends GeneratedCriteria { diff --git a/src/main/java/com/sztzjy/financial_bigdata/entity/tea_dto/TeaExamManageCountDto.java b/src/main/java/com/sztzjy/financial_bigdata/entity/tea_dto/TeaExamManageCountDto.java index 21cc89c..7c887e0 100644 --- a/src/main/java/com/sztzjy/financial_bigdata/entity/tea_dto/TeaExamManageCountDto.java +++ b/src/main/java/com/sztzjy/financial_bigdata/entity/tea_dto/TeaExamManageCountDto.java @@ -47,5 +47,5 @@ public class TeaExamManageCountDto { private int examNum; @ApiModelProperty("考试班级") - private List examClass; + private String examClass; } diff --git a/src/main/java/com/sztzjy/financial_bigdata/entity/tea_dto/TeaExamManageDto.java b/src/main/java/com/sztzjy/financial_bigdata/entity/tea_dto/TeaExamManageDto.java index 34e0fc5..74659cb 100644 --- a/src/main/java/com/sztzjy/financial_bigdata/entity/tea_dto/TeaExamManageDto.java +++ b/src/main/java/com/sztzjy/financial_bigdata/entity/tea_dto/TeaExamManageDto.java @@ -39,6 +39,9 @@ public class TeaExamManageDto { @ApiModelProperty("班级id") private String classId; + @ApiModelProperty("班级名字") + private String className; + @ApiModelProperty("LOGO地址") private String logoAddress; diff --git a/src/main/java/com/sztzjy/financial_bigdata/mapper/StuUserMapper.java b/src/main/java/com/sztzjy/financial_bigdata/mapper/StuUserMapper.java index d530319..c11675f 100644 --- a/src/main/java/com/sztzjy/financial_bigdata/mapper/StuUserMapper.java +++ b/src/main/java/com/sztzjy/financial_bigdata/mapper/StuUserMapper.java @@ -54,6 +54,14 @@ public interface StuUserMapper { +")") int selectNumByClass(@Param("classIdList") List classIdList); +// @Select("select count(*) from stu_userinfo where class_id = #{s}") +// int selectNumByClass(@Param("s") String s); - List selectNumByClasss(List classIdList); + @Select("") + List selectByPrimaryKeys(@Param("userIds")List userIds); } \ No newline at end of file diff --git a/src/main/java/com/sztzjy/financial_bigdata/mapper/SysCaseQuestionStepMapper.java b/src/main/java/com/sztzjy/financial_bigdata/mapper/SysCaseQuestionStepMapper.java index abe108d..9ecf132 100644 --- a/src/main/java/com/sztzjy/financial_bigdata/mapper/SysCaseQuestionStepMapper.java +++ b/src/main/java/com/sztzjy/financial_bigdata/mapper/SysCaseQuestionStepMapper.java @@ -1,11 +1,14 @@ package com.sztzjy.financial_bigdata.mapper; +import com.sztzjy.financial_bigdata.entity.SysCaseQuestion; import com.sztzjy.financial_bigdata.entity.SysCaseQuestionStep; import com.sztzjy.financial_bigdata.entity.SysCaseQuestionStepExample; import java.util.List; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; + @Mapper public interface SysCaseQuestionStepMapper { long countByExample(SysCaseQuestionStepExample example); @@ -29,4 +32,7 @@ public interface SysCaseQuestionStepMapper { int updateByPrimaryKeySelective(SysCaseQuestionStep record); int updateByPrimaryKey(SysCaseQuestionStep record); + + List getGradeReportCase(@Param("list") List list); + } \ No newline at end of file diff --git a/src/main/java/com/sztzjy/financial_bigdata/mapper/SysObjectiveQuestionMapper.java b/src/main/java/com/sztzjy/financial_bigdata/mapper/SysObjectiveQuestionMapper.java index e5b69b7..ea3d56b 100644 --- a/src/main/java/com/sztzjy/financial_bigdata/mapper/SysObjectiveQuestionMapper.java +++ b/src/main/java/com/sztzjy/financial_bigdata/mapper/SysObjectiveQuestionMapper.java @@ -1,5 +1,6 @@ package com.sztzjy.financial_bigdata.mapper; +import com.sztzjy.financial_bigdata.entity.SysCaseQuestion; import com.sztzjy.financial_bigdata.entity.SysObjectiveQuestion; import com.sztzjy.financial_bigdata.entity.SysObjectiveQuestionExample; import java.util.List; @@ -47,4 +48,6 @@ public interface SysObjectiveQuestionMapper { List selectRandomObjectiveMany(); List selectRandomObjectiveJudge(); + + List getGradeReportObjective(@Param("list") List list); } \ No newline at end of file diff --git a/src/main/java/com/sztzjy/financial_bigdata/mapper/TeaAndStudentExamMapper.java b/src/main/java/com/sztzjy/financial_bigdata/mapper/TeaAndStudentExamMapper.java index 58818fc..ebef1a5 100644 --- a/src/main/java/com/sztzjy/financial_bigdata/mapper/TeaAndStudentExamMapper.java +++ b/src/main/java/com/sztzjy/financial_bigdata/mapper/TeaAndStudentExamMapper.java @@ -2,12 +2,12 @@ package com.sztzjy.financial_bigdata.mapper; import com.sztzjy.financial_bigdata.entity.TeaAndStudentExam; import com.sztzjy.financial_bigdata.entity.TeaAndStudentExamExample; +import java.util.List; + import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; -import java.util.List; - @Mapper public interface TeaAndStudentExamMapper { long countByExample(TeaAndStudentExamExample example); @@ -32,6 +32,5 @@ public interface TeaAndStudentExamMapper { int updateByPrimaryKey(TeaAndStudentExam record); -// @Select("select class_id from tea_and_student_exam where exam_manage_id =#{examManageId}") -// String selectByExamId(@Param("examManageId") String examManageId); + TeaAndStudentExam selectByExamMangeId(@Param("examManageId") String examManageId); } \ No newline at end of file diff --git a/src/main/java/com/sztzjy/financial_bigdata/mapper/TeaExamManageMapper.java b/src/main/java/com/sztzjy/financial_bigdata/mapper/TeaExamManageMapper.java index 2da98ff..1f889cf 100644 --- a/src/main/java/com/sztzjy/financial_bigdata/mapper/TeaExamManageMapper.java +++ b/src/main/java/com/sztzjy/financial_bigdata/mapper/TeaExamManageMapper.java @@ -3,7 +3,10 @@ package com.sztzjy.financial_bigdata.mapper; import com.sztzjy.financial_bigdata.entity.TeaExamManage; import com.sztzjy.financial_bigdata.entity.TeaExamManageExample; import com.sztzjy.financial_bigdata.entity.TeaExamManageWithBLOBs; + +import java.math.BigDecimal; import java.util.List; +import java.util.Map; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -46,4 +49,12 @@ public interface TeaExamManageMapper { List selectBySchoolId(@Param("schoolId")String schoolId); + + @Select("select exam_name,exam_manage_id from tea_exam_manage where school_id =#{schoolId}") + List> selectNameAndIdBySchoolId(@Param("schoolId")String schoolId); + + @Select("select sse.total_score,sum(tam.case_score+tam.single_score+tam.many_score+tam.judge_score) " + + "FROM tea_exam_manage tam JOIN stu_student_exam sse ON tam.exam_manage_id = sse.exam_manage_id" + + " GROUP BY sse.total_score ORDER BY MAX(tam.end_time) limit 1") + Map getLastEaxmScore(); } \ No newline at end of file diff --git a/src/main/java/com/sztzjy/financial_bigdata/service/stu/impl/StuIndexServiceImpl.java b/src/main/java/com/sztzjy/financial_bigdata/service/stu/impl/StuIndexServiceImpl.java index 061f12c..bbdf3fe 100644 --- a/src/main/java/com/sztzjy/financial_bigdata/service/stu/impl/StuIndexServiceImpl.java +++ b/src/main/java/com/sztzjy/financial_bigdata/service/stu/impl/StuIndexServiceImpl.java @@ -9,6 +9,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; +import java.util.Map; /** * @Author xcj @@ -66,13 +67,14 @@ public class StuIndexServiceImpl implements StuIndexService { int examSize = stuStudentExamWithBLOBs.size(); //参与考核次数 stuTheoryIndexInfoDto.setTaskNum(examSize); - //TODO 最近一次考核正确率 + +// MapteaExamManageMapper.getLastEaxmScore();//拿到最近考试的得分和 老师设置的题目总分 // TODO 最近一次考核正确率 int lastRank = studentExamMapper.selectLastExamRank(userId); // 最近一次考核排名 stuTheoryIndexInfoDto.setLastTaskRank(lastRank); - //TODO 正确率最低的考核案例 + //TODO 正确率最低的考核案例 案例题正确率字段暂无 //理论考试数据 StuTheoryIndexInfoDto theoryIndexInfoDto = stuTheoryRecordMapper.selectTheoryInfo(userId); diff --git a/src/main/java/com/sztzjy/financial_bigdata/service/tea/impl/TeaExamManageServiceImpl.java b/src/main/java/com/sztzjy/financial_bigdata/service/tea/impl/TeaExamManageServiceImpl.java index 02fef40..6fc8b0f 100644 --- a/src/main/java/com/sztzjy/financial_bigdata/service/tea/impl/TeaExamManageServiceImpl.java +++ b/src/main/java/com/sztzjy/financial_bigdata/service/tea/impl/TeaExamManageServiceImpl.java @@ -54,7 +54,7 @@ public class TeaExamManageServiceImpl implements ITeaExamManageService { if (teaExamManagedto.getEndTime() == null || teaExamManagedto.getStartTime() == null) { return new ResultEntity<>(HttpStatus.BAD_REQUEST, "请输入考试时间!"); } - if (StringUtils.isBlank(teaExamManagedto.getClassId())) { + if (StringUtils.isBlank(teaExamManagedto.getClassId())||StringUtils.isBlank(teaExamManagedto.getClassName())) { return new ResultEntity<>(HttpStatus.BAD_REQUEST, "请选择考试班级!"); } if (teaExamManageWithBLOBs.getCaseWeight() == null || teaExamManageWithBLOBs.getObjectiveWeight() == null) { @@ -65,6 +65,7 @@ public class TeaExamManageServiceImpl implements ITeaExamManageService { TeaAndStudentExam teaAndStudentExam = new TeaAndStudentExam(); teaAndStudentExam.setExamManageId(examManageId); teaAndStudentExam.setClassId(teaExamManagedto.getClassId()); + teaAndStudentExam.setClassName(teaExamManagedto.getClassName()); teaAndStudentExam.setId(IdUtil.randomUUID()); teaAndStudentExamMapper.insert(teaAndStudentExam); teaExamManageWithBLOBs.setExamManageId(examManageId); diff --git a/src/main/resources/mapper/SysCaseQuestionStepMapper.xml b/src/main/resources/mapper/SysCaseQuestionStepMapper.xml index 39e38d0..2e43686 100644 --- a/src/main/resources/mapper/SysCaseQuestionStepMapper.xml +++ b/src/main/resources/mapper/SysCaseQuestionStepMapper.xml @@ -1,307 +1,333 @@ - - - - - - - - - - - - - - - - - - - - - - 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} + + + + + + - - - - - - - case_step_id, case_id, title, content, question, answer, content_original, question_original, + + + + case_step_id + , case_id, title, content, question, answer, content_original, question_original, answer_original, sort, score - - - - - delete from sys_case_question_step - where case_step_id = #{caseStepId,jdbcType=VARCHAR} - - - delete from sys_case_question_step - - - - - - insert into sys_case_question_step (case_step_id, case_id, title, - content, question, answer, - content_original, question_original, answer_original, - sort, score) - values (#{caseStepId,jdbcType=VARCHAR}, #{caseId,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR}, - #{content,jdbcType=VARCHAR}, #{question,jdbcType=VARCHAR}, #{answer,jdbcType=VARCHAR}, - #{contentOriginal,jdbcType=VARCHAR}, #{questionOriginal,jdbcType=VARCHAR}, #{answerOriginal,jdbcType=VARCHAR}, - #{sort,jdbcType=INTEGER}, #{score,jdbcType=DECIMAL}) - - - insert into sys_case_question_step - - - case_step_id, - - - case_id, - - - title, - - - content, - - - question, - - - answer, - - - content_original, - - - question_original, - - - answer_original, - - - sort, - - - score, - - - - - #{caseStepId,jdbcType=VARCHAR}, - - - #{caseId,jdbcType=VARCHAR}, - - - #{title,jdbcType=VARCHAR}, - - - #{content,jdbcType=VARCHAR}, - - - #{question,jdbcType=VARCHAR}, - - - #{answer,jdbcType=VARCHAR}, - - - #{contentOriginal,jdbcType=VARCHAR}, - - - #{questionOriginal,jdbcType=VARCHAR}, - - - #{answerOriginal,jdbcType=VARCHAR}, - - - #{sort,jdbcType=INTEGER}, - - - #{score,jdbcType=DECIMAL}, - - - - - - update sys_case_question_step - - - case_step_id = #{record.caseStepId,jdbcType=VARCHAR}, - - + + + + + delete + from sys_case_question_step + where case_step_id = #{caseStepId,jdbcType=VARCHAR} + + + delete from sys_case_question_step + + + + + + insert into sys_case_question_step (case_step_id, case_id, title, + content, question, answer, + content_original, question_original, answer_original, + sort, score) + values (#{caseStepId,jdbcType=VARCHAR}, #{caseId,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR}, + #{content,jdbcType=VARCHAR}, #{question,jdbcType=VARCHAR}, #{answer,jdbcType=VARCHAR}, + #{contentOriginal,jdbcType=VARCHAR}, #{questionOriginal,jdbcType=VARCHAR}, + #{answerOriginal,jdbcType=VARCHAR}, + #{sort,jdbcType=INTEGER}, #{score,jdbcType=DECIMAL}) + + + insert into sys_case_question_step + + + case_step_id, + + + case_id, + + + title, + + + content, + + + question, + + + answer, + + + content_original, + + + question_original, + + + answer_original, + + + sort, + + + score, + + + + + #{caseStepId,jdbcType=VARCHAR}, + + + #{caseId,jdbcType=VARCHAR}, + + + #{title,jdbcType=VARCHAR}, + + + #{content,jdbcType=VARCHAR}, + + + #{question,jdbcType=VARCHAR}, + + + #{answer,jdbcType=VARCHAR}, + + + #{contentOriginal,jdbcType=VARCHAR}, + + + #{questionOriginal,jdbcType=VARCHAR}, + + + #{answerOriginal,jdbcType=VARCHAR}, + + + #{sort,jdbcType=INTEGER}, + + + #{score,jdbcType=DECIMAL}, + + + + + + update sys_case_question_step + + + case_step_id = #{record.caseStepId,jdbcType=VARCHAR}, + + + case_id = #{record.caseId,jdbcType=VARCHAR}, + + + title = #{record.title,jdbcType=VARCHAR}, + + + content = #{record.content,jdbcType=VARCHAR}, + + + question = #{record.question,jdbcType=VARCHAR}, + + + answer = #{record.answer,jdbcType=VARCHAR}, + + + content_original = #{record.contentOriginal,jdbcType=VARCHAR}, + + + question_original = #{record.questionOriginal,jdbcType=VARCHAR}, + + + answer_original = #{record.answerOriginal,jdbcType=VARCHAR}, + + + sort = #{record.sort,jdbcType=INTEGER}, + + + score = #{record.score,jdbcType=DECIMAL}, + + + + + + + + update sys_case_question_step + set case_step_id = #{record.caseStepId,jdbcType=VARCHAR}, case_id = #{record.caseId,jdbcType=VARCHAR}, - - title = #{record.title,jdbcType=VARCHAR}, - - content = #{record.content,jdbcType=VARCHAR}, - - question = #{record.question,jdbcType=VARCHAR}, - - answer = #{record.answer,jdbcType=VARCHAR}, - - content_original = #{record.contentOriginal,jdbcType=VARCHAR}, - - question_original = #{record.questionOriginal,jdbcType=VARCHAR}, - - answer_original = #{record.answerOriginal,jdbcType=VARCHAR}, - - sort = #{record.sort,jdbcType=INTEGER}, - - - score = #{record.score,jdbcType=DECIMAL}, - - - - - - - - update sys_case_question_step - set case_step_id = #{record.caseStepId,jdbcType=VARCHAR}, - case_id = #{record.caseId,jdbcType=VARCHAR}, - title = #{record.title,jdbcType=VARCHAR}, - content = #{record.content,jdbcType=VARCHAR}, - question = #{record.question,jdbcType=VARCHAR}, - answer = #{record.answer,jdbcType=VARCHAR}, - content_original = #{record.contentOriginal,jdbcType=VARCHAR}, - question_original = #{record.questionOriginal,jdbcType=VARCHAR}, - answer_original = #{record.answerOriginal,jdbcType=VARCHAR}, - sort = #{record.sort,jdbcType=INTEGER}, - score = #{record.score,jdbcType=DECIMAL} - - - - - - update sys_case_question_step - - - case_id = #{caseId,jdbcType=VARCHAR}, - - - title = #{title,jdbcType=VARCHAR}, - - - content = #{content,jdbcType=VARCHAR}, - - - question = #{question,jdbcType=VARCHAR}, - - - answer = #{answer,jdbcType=VARCHAR}, - - - content_original = #{contentOriginal,jdbcType=VARCHAR}, - - - question_original = #{questionOriginal,jdbcType=VARCHAR}, - - - answer_original = #{answerOriginal,jdbcType=VARCHAR}, - - - sort = #{sort,jdbcType=INTEGER}, - - - score = #{score,jdbcType=DECIMAL}, - - - where case_step_id = #{caseStepId,jdbcType=VARCHAR} - - - update sys_case_question_step - set case_id = #{caseId,jdbcType=VARCHAR}, - title = #{title,jdbcType=VARCHAR}, - content = #{content,jdbcType=VARCHAR}, - question = #{question,jdbcType=VARCHAR}, - answer = #{answer,jdbcType=VARCHAR}, - content_original = #{contentOriginal,jdbcType=VARCHAR}, - question_original = #{questionOriginal,jdbcType=VARCHAR}, - answer_original = #{answerOriginal,jdbcType=VARCHAR}, - sort = #{sort,jdbcType=INTEGER}, - score = #{score,jdbcType=DECIMAL} - where case_step_id = #{caseStepId,jdbcType=VARCHAR} - + score = #{record.score,jdbcType=DECIMAL} + + + + + + update sys_case_question_step + + + case_id = #{caseId,jdbcType=VARCHAR}, + + + title = #{title,jdbcType=VARCHAR}, + + + content = #{content,jdbcType=VARCHAR}, + + + question = #{question,jdbcType=VARCHAR}, + + + answer = #{answer,jdbcType=VARCHAR}, + + + content_original = #{contentOriginal,jdbcType=VARCHAR}, + + + question_original = #{questionOriginal,jdbcType=VARCHAR}, + + + answer_original = #{answerOriginal,jdbcType=VARCHAR}, + + + sort = #{sort,jdbcType=INTEGER}, + + + score = #{score,jdbcType=DECIMAL}, + + + where case_step_id = #{caseStepId,jdbcType=VARCHAR} + + + update sys_case_question_step + set case_id = #{caseId,jdbcType=VARCHAR}, + title = #{title,jdbcType=VARCHAR}, + content = #{content,jdbcType=VARCHAR}, + question = #{question,jdbcType=VARCHAR}, + answer = #{answer,jdbcType=VARCHAR}, + content_original = #{contentOriginal,jdbcType=VARCHAR}, + question_original = #{questionOriginal,jdbcType=VARCHAR}, + answer_original = #{answerOriginal,jdbcType=VARCHAR}, + sort = #{sort,jdbcType=INTEGER}, + score = #{score,jdbcType=DECIMAL} + where case_step_id = #{caseStepId,jdbcType=VARCHAR} + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/SysObjectiveQuestionMapper.xml b/src/main/resources/mapper/SysObjectiveQuestionMapper.xml index c359327..fc9e429 100644 --- a/src/main/resources/mapper/SysObjectiveQuestionMapper.xml +++ b/src/main/resources/mapper/SysObjectiveQuestionMapper.xml @@ -450,4 +450,13 @@ + + \ No newline at end of file diff --git a/src/main/resources/mapper/TeaAndStudentExamMapper.xml b/src/main/resources/mapper/TeaAndStudentExamMapper.xml index 0c72183..a11b69f 100644 --- a/src/main/resources/mapper/TeaAndStudentExamMapper.xml +++ b/src/main/resources/mapper/TeaAndStudentExamMapper.xml @@ -5,6 +5,7 @@ + @@ -65,7 +66,7 @@ - id, exam_manage_id, class_id + id, exam_manage_id, class_id, class_name @@ -146,6 +153,9 @@ class_id = #{record.classId,jdbcType=VARCHAR}, + + class_name = #{record.className,jdbcType=VARCHAR}, + @@ -155,7 +165,8 @@ update tea_and_student_exam set id = #{record.id,jdbcType=VARCHAR}, exam_manage_id = #{record.examManageId,jdbcType=VARCHAR}, - class_id = #{record.classId,jdbcType=VARCHAR} + class_id = #{record.classId,jdbcType=VARCHAR}, + class_name = #{record.className,jdbcType=VARCHAR} @@ -169,13 +180,20 @@ class_id = #{classId,jdbcType=VARCHAR}, + + class_name = #{className,jdbcType=VARCHAR}, + where id = #{id,jdbcType=VARCHAR} update tea_and_student_exam set exam_manage_id = #{examManageId,jdbcType=VARCHAR}, - class_id = #{classId,jdbcType=VARCHAR} + class_id = #{classId,jdbcType=VARCHAR}, + class_name = #{className,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR} + \ No newline at end of file