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<PageInfo<TeaExamManageCountDto>> getExamInfo(@RequestParam Integer index, -// @RequestParam Integer size, -// @ApiParam("ManyAnswer为考试时间,JudgeAnswer为发布人") @RequestParam String schoolId) { -// -// List<TeaExamManage> teaExamManages = teaExamManageMapper.selectBySchoolId(schoolId); -// List<TeaExamManageCountDto>teaExamManageCountDtos =new AstList(); -// for (TeaExamManage teaExamManage : teaExamManages) { -// List<String> 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<TeaExamManage> teaExamManages = teaExamManageMapper.selectBySchoolId(schoolId); List<TeaExamManageCountDto> teaExamManageCountDtos = new ArrayList<>(); + Map<String, StuUser> userMap = new HashMap<>(); - // 批量查询班级信息 - List<String> examIds = new ArrayList<>(); + List<String> userIds = new ArrayList<>(); for (TeaExamManage teaExamManage : teaExamManages) { - examIds.add(teaExamManage.getExamManageId()); + String userId = teaExamManage.getUserId(); + userIds.add(userId); } + //存储用户信息 + List<StuUser> 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<String> 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<TeaExamManageCountDto>>(pageInfo); + return new ResultEntity<>(pageInfo); } @AnonymousAccess @PostMapping("/getExamInfoAndRank") @ApiOperation("考试模式--成绩排名和成绩情况展示") //TODO 图片可能需要一个接口去取 - public ResultEntity<PageInfo> 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<PageInfo<TeaExamAndUserDto>> 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<TeaExamAndUserDto> list = getTeaExamAndUserDtos(schoolId, keyWord, classId, examManageId); list.sort(new TeaGradeManageServiceImpl.StuUserDtoComparator()); //比较器按得分排序 PageInfo<TeaExamAndUserDto> pageInfo = PageUtil.pageHelper(list, index, size); return new ResultEntity<>(pageInfo); } + @AnonymousAccess + @PostMapping("/getExamNameAndId") + @ApiOperation("考试模式--考试名称下拉框") //TODO 图片可能需要一个接口去取 + public ResultEntity<List<Map<String, String>>> getExamNameAndId(@RequestParam String schoolId) { + List<Map<String, String>> 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<PageInfo<SysCaseQuestion>> getGradeReportCase(@RequestParam Integer index, + @RequestParam Integer size, + @RequestParam String examManageId) { + TeaExamManageWithBLOBs teaExamManageWithBLOBs = teaExamManageMapper.selectByPrimaryKey(examManageId); + String caseIdList = teaExamManageWithBLOBs.getCaseIdlist(); + List<String> list = Arrays.asList(caseIdList.split(",")); + PageHelper.startPage(index, size); + List<SysCaseQuestion> resultList = sysCaseQuestionStepMapper.getGradeReportCase(list); + PageInfo pageInfo = new PageInfo(resultList); + return new ResultEntity(pageInfo); + } + + + @AnonymousAccess + @PostMapping("/getGradeReportObjective") + @ApiOperation("考试模式--成绩报告客观题") //TODO 客观题正确率字段暂无 + public ResultEntity<PageInfo<SysCaseQuestion>> getGradeReportObjective(@RequestParam Integer index, + @RequestParam Integer size, + @RequestParam String examManageId) { + TeaExamManageWithBLOBs teaExamManageWithBLOBs = teaExamManageMapper.selectByPrimaryKey(examManageId); + if (teaExamManageWithBLOBs == null) { + return null; + } + List<String> 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<SysCaseQuestion> 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<String> values) { + addCriterion("class_name in", values, "className"); + return (Criteria) this; + } + + public Criteria andClassNameNotIn(List<String> 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<String> 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 { +")</script>") int selectNumByClass(@Param("classIdList") List<String> classIdList); +// @Select("select count(*) from stu_userinfo where class_id = #{s}") +// int selectNumByClass(@Param("s") String s); - List<Integer> selectNumByClasss(List<String> classIdList); + @Select("<script>" + + "select userid,name FROM stu_userinfo WHERE userid IN(" + +"<foreach collection='userIds' separator=',' item='id'>" + + "#{id} " + + "</foreach> " + +")</script>") + List<StuUser> selectByPrimaryKeys(@Param("userIds")List<String> 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<SysCaseQuestion> getGradeReportCase(@Param("list") List<String> 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<SysObjectiveQuestion> selectRandomObjectiveMany(); List<SysObjectiveQuestion> selectRandomObjectiveJudge(); + + List<SysCaseQuestion> getGradeReportObjective(@Param("list") List<String> 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<TeaExamManage> selectBySchoolId(@Param("schoolId")String schoolId); + + @Select("select exam_name,exam_manage_id from tea_exam_manage where school_id =#{schoolId}") + List<Map<String, String>> 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<BigDecimal,BigDecimal> 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 最近一次考核正确率 + +// Map<BD>teaExamManageMapper.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 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.sztzjy.financial_bigdata.mapper.SysCaseQuestionStepMapper"> - <resultMap id="BaseResultMap" type="com.sztzjy.financial_bigdata.entity.SysCaseQuestionStep"> - <id column="case_step_id" jdbcType="VARCHAR" property="caseStepId" /> - <result column="case_id" jdbcType="VARCHAR" property="caseId" /> - <result column="title" jdbcType="VARCHAR" property="title" /> - <result column="content" jdbcType="VARCHAR" property="content" /> - <result column="question" jdbcType="VARCHAR" property="question" /> - <result column="answer" jdbcType="VARCHAR" property="answer" /> - <result column="content_original" jdbcType="VARCHAR" property="contentOriginal" /> - <result column="question_original" jdbcType="VARCHAR" property="questionOriginal" /> - <result column="answer_original" jdbcType="VARCHAR" property="answerOriginal" /> - <result column="sort" jdbcType="INTEGER" property="sort" /> - <result column="score" jdbcType="DECIMAL" property="score" /> - </resultMap> - <sql id="Example_Where_Clause"> - <where> - <foreach collection="oredCriteria" item="criteria" separator="or"> - <if test="criteria.valid"> - <trim prefix="(" prefixOverrides="and" suffix=")"> - <foreach collection="criteria.criteria" item="criterion"> - <choose> - <when test="criterion.noValue"> - and ${criterion.condition} - </when> - <when test="criterion.singleValue"> - and ${criterion.condition} #{criterion.value} - </when> - <when test="criterion.betweenValue"> - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - </when> - <when test="criterion.listValue"> - and ${criterion.condition} - <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> - #{listItem} - </foreach> - </when> - </choose> + <resultMap id="BaseResultMap" type="com.sztzjy.financial_bigdata.entity.SysCaseQuestionStep"> + <id column="case_step_id" jdbcType="VARCHAR" property="caseStepId"/> + <result column="case_id" jdbcType="VARCHAR" property="caseId"/> + <result column="title" jdbcType="VARCHAR" property="title"/> + <result column="content" jdbcType="VARCHAR" property="content"/> + <result column="question" jdbcType="VARCHAR" property="question"/> + <result column="answer" jdbcType="VARCHAR" property="answer"/> + <result column="content_original" jdbcType="VARCHAR" property="contentOriginal"/> + <result column="question_original" jdbcType="VARCHAR" property="questionOriginal"/> + <result column="answer_original" jdbcType="VARCHAR" property="answerOriginal"/> + <result column="sort" jdbcType="INTEGER" property="sort"/> + <result column="score" jdbcType="DECIMAL" property="score"/> + </resultMap> + <sql id="Example_Where_Clause"> + <where> + <foreach collection="oredCriteria" item="criteria" separator="or"> + <if test="criteria.valid"> + <trim prefix="(" prefixOverrides="and" suffix=")"> + <foreach collection="criteria.criteria" item="criterion"> + <choose> + <when test="criterion.noValue"> + and ${criterion.condition} + </when> + <when test="criterion.singleValue"> + and ${criterion.condition} #{criterion.value} + </when> + <when test="criterion.betweenValue"> + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + </when> + <when test="criterion.listValue"> + and ${criterion.condition} + <foreach close=")" collection="criterion.value" item="listItem" open="(" + separator=","> + #{listItem} + </foreach> + </when> + </choose> + </foreach> + </trim> + </if> </foreach> - </trim> - </if> - </foreach> - </where> - </sql> - <sql id="Update_By_Example_Where_Clause"> - <where> - <foreach collection="example.oredCriteria" item="criteria" separator="or"> - <if test="criteria.valid"> - <trim prefix="(" prefixOverrides="and" suffix=")"> - <foreach collection="criteria.criteria" item="criterion"> - <choose> - <when test="criterion.noValue"> - and ${criterion.condition} - </when> - <when test="criterion.singleValue"> - and ${criterion.condition} #{criterion.value} - </when> - <when test="criterion.betweenValue"> - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - </when> - <when test="criterion.listValue"> - and ${criterion.condition} - <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> - #{listItem} - </foreach> - </when> - </choose> + </where> + </sql> + <sql id="Update_By_Example_Where_Clause"> + <where> + <foreach collection="example.oredCriteria" item="criteria" separator="or"> + <if test="criteria.valid"> + <trim prefix="(" prefixOverrides="and" suffix=")"> + <foreach collection="criteria.criteria" item="criterion"> + <choose> + <when test="criterion.noValue"> + and ${criterion.condition} + </when> + <when test="criterion.singleValue"> + and ${criterion.condition} #{criterion.value} + </when> + <when test="criterion.betweenValue"> + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + </when> + <when test="criterion.listValue"> + and ${criterion.condition} + <foreach close=")" collection="criterion.value" item="listItem" open="(" + separator=","> + #{listItem} + </foreach> + </when> + </choose> + </foreach> + </trim> + </if> </foreach> - </trim> - </if> - </foreach> - </where> - </sql> - <sql id="Base_Column_List"> - case_step_id, case_id, title, content, question, answer, content_original, question_original, + </where> + </sql> + <sql id="Base_Column_List"> + case_step_id + , case_id, title, content, question, answer, content_original, question_original, answer_original, sort, score - </sql> - <select id="selectByExample" parameterType="com.sztzjy.financial_bigdata.entity.SysCaseQuestionStepExample" resultMap="BaseResultMap"> - select - <if test="distinct"> - distinct - </if> - <include refid="Base_Column_List" /> - from sys_case_question_step - <if test="_parameter != null"> - <include refid="Example_Where_Clause" /> - </if> - <if test="orderByClause != null"> - order by ${orderByClause} - </if> - </select> - <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap"> - select - <include refid="Base_Column_List" /> - from sys_case_question_step - where case_step_id = #{caseStepId,jdbcType=VARCHAR} - </select> - <delete id="deleteByPrimaryKey" parameterType="java.lang.String"> - delete from sys_case_question_step - where case_step_id = #{caseStepId,jdbcType=VARCHAR} - </delete> - <delete id="deleteByExample" parameterType="com.sztzjy.financial_bigdata.entity.SysCaseQuestionStepExample"> - delete from sys_case_question_step - <if test="_parameter != null"> - <include refid="Example_Where_Clause" /> - </if> - </delete> - <insert id="insert" parameterType="com.sztzjy.financial_bigdata.entity.SysCaseQuestionStep"> - 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> - <insert id="insertSelective" parameterType="com.sztzjy.financial_bigdata.entity.SysCaseQuestionStep"> - insert into sys_case_question_step - <trim prefix="(" suffix=")" suffixOverrides=","> - <if test="caseStepId != null"> - case_step_id, - </if> - <if test="caseId != null"> - case_id, - </if> - <if test="title != null"> - title, - </if> - <if test="content != null"> - content, - </if> - <if test="question != null"> - question, - </if> - <if test="answer != null"> - answer, - </if> - <if test="contentOriginal != null"> - content_original, - </if> - <if test="questionOriginal != null"> - question_original, - </if> - <if test="answerOriginal != null"> - answer_original, - </if> - <if test="sort != null"> - sort, - </if> - <if test="score != null"> - score, - </if> - </trim> - <trim prefix="values (" suffix=")" suffixOverrides=","> - <if test="caseStepId != null"> - #{caseStepId,jdbcType=VARCHAR}, - </if> - <if test="caseId != null"> - #{caseId,jdbcType=VARCHAR}, - </if> - <if test="title != null"> - #{title,jdbcType=VARCHAR}, - </if> - <if test="content != null"> - #{content,jdbcType=VARCHAR}, - </if> - <if test="question != null"> - #{question,jdbcType=VARCHAR}, - </if> - <if test="answer != null"> - #{answer,jdbcType=VARCHAR}, - </if> - <if test="contentOriginal != null"> - #{contentOriginal,jdbcType=VARCHAR}, - </if> - <if test="questionOriginal != null"> - #{questionOriginal,jdbcType=VARCHAR}, - </if> - <if test="answerOriginal != null"> - #{answerOriginal,jdbcType=VARCHAR}, - </if> - <if test="sort != null"> - #{sort,jdbcType=INTEGER}, - </if> - <if test="score != null"> - #{score,jdbcType=DECIMAL}, - </if> - </trim> - </insert> - <select id="countByExample" parameterType="com.sztzjy.financial_bigdata.entity.SysCaseQuestionStepExample" resultType="java.lang.Long"> - select count(*) from sys_case_question_step - <if test="_parameter != null"> - <include refid="Example_Where_Clause" /> - </if> - </select> - <update id="updateByExampleSelective" parameterType="map"> - update sys_case_question_step - <set> - <if test="record.caseStepId != null"> - case_step_id = #{record.caseStepId,jdbcType=VARCHAR}, - </if> - <if test="record.caseId != null"> + </sql> + <select id="selectByExample" parameterType="com.sztzjy.financial_bigdata.entity.SysCaseQuestionStepExample" + resultMap="BaseResultMap"> + select + <if test="distinct"> + distinct + </if> + <include refid="Base_Column_List"/> + from sys_case_question_step + <if test="_parameter != null"> + <include refid="Example_Where_Clause"/> + </if> + <if test="orderByClause != null"> + order by ${orderByClause} + </if> + </select> + <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap"> + select + <include refid="Base_Column_List"/> + from sys_case_question_step + where case_step_id = #{caseStepId,jdbcType=VARCHAR} + </select> + <delete id="deleteByPrimaryKey" parameterType="java.lang.String"> + delete + from sys_case_question_step + where case_step_id = #{caseStepId,jdbcType=VARCHAR} + </delete> + <delete id="deleteByExample" parameterType="com.sztzjy.financial_bigdata.entity.SysCaseQuestionStepExample"> + delete from sys_case_question_step + <if test="_parameter != null"> + <include refid="Example_Where_Clause"/> + </if> + </delete> + <insert id="insert" parameterType="com.sztzjy.financial_bigdata.entity.SysCaseQuestionStep"> + 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> + <insert id="insertSelective" parameterType="com.sztzjy.financial_bigdata.entity.SysCaseQuestionStep"> + insert into sys_case_question_step + <trim prefix="(" suffix=")" suffixOverrides=","> + <if test="caseStepId != null"> + case_step_id, + </if> + <if test="caseId != null"> + case_id, + </if> + <if test="title != null"> + title, + </if> + <if test="content != null"> + content, + </if> + <if test="question != null"> + question, + </if> + <if test="answer != null"> + answer, + </if> + <if test="contentOriginal != null"> + content_original, + </if> + <if test="questionOriginal != null"> + question_original, + </if> + <if test="answerOriginal != null"> + answer_original, + </if> + <if test="sort != null"> + sort, + </if> + <if test="score != null"> + score, + </if> + </trim> + <trim prefix="values (" suffix=")" suffixOverrides=","> + <if test="caseStepId != null"> + #{caseStepId,jdbcType=VARCHAR}, + </if> + <if test="caseId != null"> + #{caseId,jdbcType=VARCHAR}, + </if> + <if test="title != null"> + #{title,jdbcType=VARCHAR}, + </if> + <if test="content != null"> + #{content,jdbcType=VARCHAR}, + </if> + <if test="question != null"> + #{question,jdbcType=VARCHAR}, + </if> + <if test="answer != null"> + #{answer,jdbcType=VARCHAR}, + </if> + <if test="contentOriginal != null"> + #{contentOriginal,jdbcType=VARCHAR}, + </if> + <if test="questionOriginal != null"> + #{questionOriginal,jdbcType=VARCHAR}, + </if> + <if test="answerOriginal != null"> + #{answerOriginal,jdbcType=VARCHAR}, + </if> + <if test="sort != null"> + #{sort,jdbcType=INTEGER}, + </if> + <if test="score != null"> + #{score,jdbcType=DECIMAL}, + </if> + </trim> + </insert> + <select id="countByExample" parameterType="com.sztzjy.financial_bigdata.entity.SysCaseQuestionStepExample" + resultType="java.lang.Long"> + select count(*) from sys_case_question_step + <if test="_parameter != null"> + <include refid="Example_Where_Clause"/> + </if> + </select> + <update id="updateByExampleSelective" parameterType="map"> + update sys_case_question_step + <set> + <if test="record.caseStepId != null"> + case_step_id = #{record.caseStepId,jdbcType=VARCHAR}, + </if> + <if test="record.caseId != null"> + case_id = #{record.caseId,jdbcType=VARCHAR}, + </if> + <if test="record.title != null"> + title = #{record.title,jdbcType=VARCHAR}, + </if> + <if test="record.content != null"> + content = #{record.content,jdbcType=VARCHAR}, + </if> + <if test="record.question != null"> + question = #{record.question,jdbcType=VARCHAR}, + </if> + <if test="record.answer != null"> + answer = #{record.answer,jdbcType=VARCHAR}, + </if> + <if test="record.contentOriginal != null"> + content_original = #{record.contentOriginal,jdbcType=VARCHAR}, + </if> + <if test="record.questionOriginal != null"> + question_original = #{record.questionOriginal,jdbcType=VARCHAR}, + </if> + <if test="record.answerOriginal != null"> + answer_original = #{record.answerOriginal,jdbcType=VARCHAR}, + </if> + <if test="record.sort != null"> + sort = #{record.sort,jdbcType=INTEGER}, + </if> + <if test="record.score != null"> + score = #{record.score,jdbcType=DECIMAL}, + </if> + </set> + <if test="_parameter != null"> + <include refid="Update_By_Example_Where_Clause"/> + </if> + </update> + <update id="updateByExample" parameterType="map"> + update sys_case_question_step + set case_step_id = #{record.caseStepId,jdbcType=VARCHAR}, case_id = #{record.caseId,jdbcType=VARCHAR}, - </if> - <if test="record.title != null"> title = #{record.title,jdbcType=VARCHAR}, - </if> - <if test="record.content != null"> content = #{record.content,jdbcType=VARCHAR}, - </if> - <if test="record.question != null"> question = #{record.question,jdbcType=VARCHAR}, - </if> - <if test="record.answer != null"> answer = #{record.answer,jdbcType=VARCHAR}, - </if> - <if test="record.contentOriginal != null"> content_original = #{record.contentOriginal,jdbcType=VARCHAR}, - </if> - <if test="record.questionOriginal != null"> question_original = #{record.questionOriginal,jdbcType=VARCHAR}, - </if> - <if test="record.answerOriginal != null"> answer_original = #{record.answerOriginal,jdbcType=VARCHAR}, - </if> - <if test="record.sort != null"> sort = #{record.sort,jdbcType=INTEGER}, - </if> - <if test="record.score != null"> - score = #{record.score,jdbcType=DECIMAL}, - </if> - </set> - <if test="_parameter != null"> - <include refid="Update_By_Example_Where_Clause" /> - </if> - </update> - <update id="updateByExample" parameterType="map"> - 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} - <if test="_parameter != null"> - <include refid="Update_By_Example_Where_Clause" /> - </if> - </update> - <update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.financial_bigdata.entity.SysCaseQuestionStep"> - update sys_case_question_step - <set> - <if test="caseId != null"> - case_id = #{caseId,jdbcType=VARCHAR}, - </if> - <if test="title != null"> - title = #{title,jdbcType=VARCHAR}, - </if> - <if test="content != null"> - content = #{content,jdbcType=VARCHAR}, - </if> - <if test="question != null"> - question = #{question,jdbcType=VARCHAR}, - </if> - <if test="answer != null"> - answer = #{answer,jdbcType=VARCHAR}, - </if> - <if test="contentOriginal != null"> - content_original = #{contentOriginal,jdbcType=VARCHAR}, - </if> - <if test="questionOriginal != null"> - question_original = #{questionOriginal,jdbcType=VARCHAR}, - </if> - <if test="answerOriginal != null"> - answer_original = #{answerOriginal,jdbcType=VARCHAR}, - </if> - <if test="sort != null"> - sort = #{sort,jdbcType=INTEGER}, - </if> - <if test="score != null"> - score = #{score,jdbcType=DECIMAL}, - </if> - </set> - where case_step_id = #{caseStepId,jdbcType=VARCHAR} - </update> - <update id="updateByPrimaryKey" parameterType="com.sztzjy.financial_bigdata.entity.SysCaseQuestionStep"> - 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} - </update> + score = #{record.score,jdbcType=DECIMAL} + <if test="_parameter != null"> + <include refid="Update_By_Example_Where_Clause"/> + </if> + </update> + <update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.financial_bigdata.entity.SysCaseQuestionStep"> + update sys_case_question_step + <set> + <if test="caseId != null"> + case_id = #{caseId,jdbcType=VARCHAR}, + </if> + <if test="title != null"> + title = #{title,jdbcType=VARCHAR}, + </if> + <if test="content != null"> + content = #{content,jdbcType=VARCHAR}, + </if> + <if test="question != null"> + question = #{question,jdbcType=VARCHAR}, + </if> + <if test="answer != null"> + answer = #{answer,jdbcType=VARCHAR}, + </if> + <if test="contentOriginal != null"> + content_original = #{contentOriginal,jdbcType=VARCHAR}, + </if> + <if test="questionOriginal != null"> + question_original = #{questionOriginal,jdbcType=VARCHAR}, + </if> + <if test="answerOriginal != null"> + answer_original = #{answerOriginal,jdbcType=VARCHAR}, + </if> + <if test="sort != null"> + sort = #{sort,jdbcType=INTEGER}, + </if> + <if test="score != null"> + score = #{score,jdbcType=DECIMAL}, + </if> + </set> + where case_step_id = #{caseStepId,jdbcType=VARCHAR} + </update> + <update id="updateByPrimaryKey" parameterType="com.sztzjy.financial_bigdata.entity.SysCaseQuestionStep"> + 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} + </update> + + <resultMap id="DtoMap" type="com.sztzjy.financial_bigdata.entity.SysCaseQuestionStep"> + <result column="title" jdbcType="VARCHAR" property="title"/> + <result column="chapter_name" jdbcType="VARCHAR" property="questionOriginal"/> + <result column="step_count" jdbcType="VARCHAR" property="contentOriginal"/> + <result column="content" jdbcType="VARCHAR" property="questionOriginal"/> + <result column="answer_original" jdbcType="VARCHAR" property="answerOriginal"/> + </resultMap> + <select id="getGradeReportCase" parameterType="java.util.List" resultMap="DtoMap"> + SELECT s2.title, s3.chapter_name, COUNT(*) AS step_count + FROM sys_case_question_step s1 + JOIN sys_case_question s2 ON s1.case_id = s2.case_id + JOIN sys_course_chapter s3 ON s2.chapter_id = s3.chapter_id + WHERE s2.case_id IN + <foreach collection="list" separator="," item="id" open="(" close=")"> + #{id} + </foreach> + GROUP BY s2.title, s3.chapter_name + </select> </mapper> \ 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 @@ </select> + <select id="getGradeReportObjective" parameterType="java.util.List" resultMap="BaseResultMap"> + SELECT content, chapter_name,answer,`type` + from sys_objective_question + WHERE objective_id IN + <foreach collection="list" separator="," item="id" open="(" close=")"> + #{id} + </foreach> + </select> + </mapper> \ 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 @@ <id column="id" jdbcType="VARCHAR" property="id" /> <result column="exam_manage_id" jdbcType="VARCHAR" property="examManageId" /> <result column="class_id" jdbcType="VARCHAR" property="classId" /> + <result column="class_name" jdbcType="VARCHAR" property="className" /> </resultMap> <sql id="Example_Where_Clause"> <where> @@ -65,7 +66,7 @@ </where> </sql> <sql id="Base_Column_List"> - id, exam_manage_id, class_id + id, exam_manage_id, class_id, class_name </sql> <select id="selectByExample" parameterType="com.sztzjy.financial_bigdata.entity.TeaAndStudentExamExample" resultMap="BaseResultMap"> select @@ -98,10 +99,10 @@ </if> </delete> <insert id="insert" parameterType="com.sztzjy.financial_bigdata.entity.TeaAndStudentExam"> - insert into tea_and_student_exam (id, exam_manage_id, class_id - ) - values (#{id,jdbcType=VARCHAR}, #{examManageId,jdbcType=VARCHAR}, #{classId,jdbcType=VARCHAR} - ) + insert into tea_and_student_exam (id, exam_manage_id, class_id, + class_name) + values (#{id,jdbcType=VARCHAR}, #{examManageId,jdbcType=VARCHAR}, #{classId,jdbcType=VARCHAR}, + #{className,jdbcType=VARCHAR}) </insert> <insert id="insertSelective" parameterType="com.sztzjy.financial_bigdata.entity.TeaAndStudentExam"> insert into tea_and_student_exam @@ -115,6 +116,9 @@ <if test="classId != null"> class_id, </if> + <if test="className != null"> + class_name, + </if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> <if test="id != null"> @@ -126,6 +130,9 @@ <if test="classId != null"> #{classId,jdbcType=VARCHAR}, </if> + <if test="className != null"> + #{className,jdbcType=VARCHAR}, + </if> </trim> </insert> <select id="countByExample" parameterType="com.sztzjy.financial_bigdata.entity.TeaAndStudentExamExample" resultType="java.lang.Long"> @@ -146,6 +153,9 @@ <if test="record.classId != null"> class_id = #{record.classId,jdbcType=VARCHAR}, </if> + <if test="record.className != null"> + class_name = #{record.className,jdbcType=VARCHAR}, + </if> </set> <if test="_parameter != null"> <include refid="Update_By_Example_Where_Clause" /> @@ -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} <if test="_parameter != null"> <include refid="Update_By_Example_Where_Clause" /> </if> @@ -169,13 +180,20 @@ <if test="classId != null"> class_id = #{classId,jdbcType=VARCHAR}, </if> + <if test="className != null"> + class_name = #{className,jdbcType=VARCHAR}, + </if> </set> where id = #{id,jdbcType=VARCHAR} </update> <update id="updateByPrimaryKey" parameterType="com.sztzjy.financial_bigdata.entity.TeaAndStudentExam"> 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} </update> + <select id="selectByExamMangeId" parameterType="java.lang.String" resultMap="BaseResultMap"> + select class_name,class_id from tea_and_student_exam where exam_manage_id = #{examManageId} + </select> </mapper> \ No newline at end of file