From ac777fd62e7e2efec344251c7ac79ae2c56e164d Mon Sep 17 00:00:00 2001 From: xiaoCJ <406612557@qq.com> Date: Thu, 18 Jul 2024 18:40:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=B8=89=E6=96=B9=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=EF=BC=8C=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/CaseController.java | 29 +- .../controller/api/CaseApi.java | 61 +- .../controller/api/CourseApi.java | 13 + .../controller/api/ObjectiveApi.java | 33 +- .../new_module/admin/AdminDataController.java | 1 - .../new_module/stu/StuCaseController.java | 2 +- .../mapper/SysCaseQuestionStepMapper.java | 4 + .../mapper/SysObjectiveQuestionsMapper.java | 8 + .../mapper/SysThreeCatalogMapper.java | 17 +- .../resource_center/util/CompressUtil.java | 2 +- .../mapper/SysCaseQuestionStepMapper.xml | 756 +++++++++--------- .../mapper/SysObjectiveQuestionsMapper.xml | 22 + 12 files changed, 551 insertions(+), 397 deletions(-) diff --git a/src/main/java/com/sztzjy/resource_center/controller/CaseController.java b/src/main/java/com/sztzjy/resource_center/controller/CaseController.java index dda8739..555df45 100644 --- a/src/main/java/com/sztzjy/resource_center/controller/CaseController.java +++ b/src/main/java/com/sztzjy/resource_center/controller/CaseController.java @@ -18,10 +18,8 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.*; -import javax.servlet.http.HttpServletResponse; import java.util.Date; import java.util.List; -import java.util.Map; import java.util.UUID; /** @@ -60,7 +58,7 @@ public class CaseController { } String title = sysCaseQuestion.getTitle(); SysCaseQuestionExample example = new SysCaseQuestionExample(); - example.createCriteria().andTitleEqualTo(title); + example.createCriteria().andTitleEqualTo(title).andUnmountStatusEqualTo(false).andOneIdEqualTo(sysCaseQuestion.getOneId()); List sysCaseQuestions = caseQuestionMapper.selectByExample(example); if (!sysCaseQuestions.isEmpty()) { return new ResultEntity<>(HttpStatus.BAD_REQUEST, "案例名称不能重复!"); @@ -131,13 +129,21 @@ public class CaseController { @PostMapping("updateCase") public ResultEntity updateCase(@RequestBody SysCaseQuestion sysCaseQuestion, @ApiParam("谁调的请求,传管理员/学校ID") @RequestParam String source) { - List sysTopicAndCourses = getSysTopicAndCourses(sysCaseQuestion.getCaseId()); + List sysTopicAndCourses = getSysTopicAndCourses(sysCaseQuestion.getCaseId(), sysCaseQuestion.getOneId()); if (!sysTopicAndCourses.isEmpty()) { return new ResultEntity<>(HttpStatus.BAD_REQUEST, "该案例题正在被使用!"); } else { //todo 管理员任意修改,老师只能改自己的 if ("管理员".equals(source) || source.equals(sysCaseQuestion.getSource())) { - caseQuestionMapper.updateByPrimaryKey(sysCaseQuestion); + if (!sysTopicAndCourses.isEmpty()) { + SysTopicAndCourse sysTopicAndCourse = sysTopicAndCourses.get(0); + sysTopicAndCourse.setTwoId(sysCaseQuestion.getTwoId()); + sysTopicAndCourse.setThreeId(sysCaseQuestion.getThreeId()); + sysTopicAndCourse.setTwoName(sysCaseQuestion.getTwoName()); + sysTopicAndCourse.setThreeName(sysCaseQuestion.getThreeName()); + topicAndCourseMapper.updateByPrimaryKeySelective(sysTopicAndCourse); + } + caseQuestionMapper.updateByPrimaryKeySelective(sysCaseQuestion); return new ResultEntity<>(HttpStatus.OK, "编辑成功!"); } else { return new ResultEntity<>(HttpStatus.BAD_REQUEST, "权限不足!"); @@ -152,25 +158,24 @@ public class CaseController { @PostMapping("deleteCase") public ResultEntity deleteCase(@RequestBody SysCaseQuestion sysCaseQuestion, @ApiParam("哪个用的掉的请求,传管理员/学校ID") @RequestParam String source) { - List sysTopicAndCourses = getSysTopicAndCourses(sysCaseQuestion.getCaseId()); + List sysTopicAndCourses = getSysTopicAndCourses(sysCaseQuestion.getCaseId(), sysCaseQuestion.getOneId()); if (!sysTopicAndCourses.isEmpty()) { return new ResultEntity<>(HttpStatus.BAD_REQUEST, "无法删除!该案例题正在被使用!"); } else { //todo 管理员任意删除 老师只能删除自己上传的 if ("管理员".equals(source) || source.equals(sysCaseQuestion.getSource())) { - SysCaseQuestion dataSysCaseQuestion = caseQuestionMapper.selectByPrimaryKey(sysCaseQuestion.getCaseId()); - dataSysCaseQuestion.setUnmountStatus(true); - caseQuestionMapper.updateByPrimaryKey(dataSysCaseQuestion); - return new ResultEntity<>(HttpStatus.OK, "编辑成功!"); + topicAndCourseMapper.deleteByPrimaryKey(sysTopicAndCourses.get(0).getId()); + caseQuestionMapper.deleteByPrimaryKey(sysCaseQuestion.getCaseId()); + return new ResultEntity<>(HttpStatus.OK, "删除成功!"); } else { return new ResultEntity<>(HttpStatus.BAD_REQUEST, "权限不足!"); } } } - private List getSysTopicAndCourses(String caseId) { + private List getSysTopicAndCourses(String caseId, String oneId) { SysTopicAndCourseExample example = new SysTopicAndCourseExample(); - example.createCriteria().andTopicIdEqualTo(caseId).andTopicTypeEqualTo("1"); + example.createCriteria().andTopicIdEqualTo(caseId).andOneIdEqualTo(oneId).andTopicTypeEqualTo("1"); List sysTopicAndCourses = topicAndCourseMapper.selectByExample(example); return sysTopicAndCourses; } diff --git a/src/main/java/com/sztzjy/resource_center/controller/api/CaseApi.java b/src/main/java/com/sztzjy/resource_center/controller/api/CaseApi.java index 4e521ba..7ffda6d 100644 --- a/src/main/java/com/sztzjy/resource_center/controller/api/CaseApi.java +++ b/src/main/java/com/sztzjy/resource_center/controller/api/CaseApi.java @@ -1,7 +1,6 @@ package com.sztzjy.resource_center.controller.api; import cn.hutool.core.util.IdUtil; -import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.sztzjy.resource_center.annotation.AnonymousAccess; import com.sztzjy.resource_center.entity.*; @@ -41,6 +40,7 @@ public class CaseApi { @ApiOperation("案例题新增") @PostMapping("insertCase") public Boolean insertCase(@ApiParam("目前二级三级ID可以为空,来源和题型要传,上架状态传true") @RequestBody SysCaseQuestion sysCaseQuestion) { + SysOneCatalog sysOneCatalogs1 = getSysOneCatalogs(sysCaseQuestion.getOneName()); if (("3").equals(sysCaseQuestion.getType())) { return false; } @@ -55,7 +55,7 @@ public class CaseApi { } String title = sysCaseQuestion.getTitle(); SysCaseQuestionExample example = new SysCaseQuestionExample(); - example.createCriteria().andTitleEqualTo(title); + example.createCriteria().andTitleEqualTo(title).andUnmountStatusEqualTo(false).andOneIdEqualTo(sysOneCatalogs1.getOneId()); List sysCaseQuestions = caseQuestionMapper.selectByExample(example); if (!sysCaseQuestions.isEmpty()) { return false; @@ -124,11 +124,15 @@ public class CaseApi { @AnonymousAccess @ApiOperation("案例题删除") //逻辑删除 @PostMapping("caseDelete") - public Boolean deleteCase(@RequestParam String caseId) { + public Boolean deleteCase(@RequestParam String caseId, @RequestParam String systemOwner) { + SysOneCatalog sysOneCatalogs = getSysOneCatalogs(systemOwner); + List sysTopicAndCourses = getSysTopicAndCourses(caseId, sysOneCatalogs.getOneId()); SysCaseQuestion sysCaseQuestion = caseQuestionMapper.selectByPrimaryKey(caseId); String source = sysCaseQuestion.getSource(); - //todo 管理员任意删除 老师只能删除自己上传的 if (!"管理员".equals(source)) { + if (!sysTopicAndCourses.isEmpty()) { + topicAndCourseMapper.deleteByPrimaryKey(sysTopicAndCourses.get(0).getId()); + } SysCaseQuestion dataSysCaseQuestion = caseQuestionMapper.selectByPrimaryKey(sysCaseQuestion.getCaseId()); dataSysCaseQuestion.setUnmountStatus(true); caseQuestionMapper.updateByPrimaryKey(dataSysCaseQuestion); @@ -139,6 +143,14 @@ public class CaseApi { } + private List getSysTopicAndCourses(String caseId, String oneId) { + SysTopicAndCourseExample example = new SysTopicAndCourseExample(); + example.createCriteria().andTopicIdEqualTo(caseId).andOneIdEqualTo(oneId).andTopicTypeEqualTo("1"); + List sysTopicAndCourses = topicAndCourseMapper.selectByExample(example); + return sysTopicAndCourses; + } + + private List getSysTopicAndCourses(String caseId) { SysTopicAndCourseExample example = new SysTopicAndCourseExample(); example.createCriteria().andTopicIdEqualTo(caseId).andTopicTypeEqualTo("1"); @@ -152,11 +164,26 @@ public class CaseApi { @ApiOperation("案例题编辑") @PostMapping("updateCase") public Boolean updateCase(@RequestBody SysCaseQuestion sysCaseQuestion) { - List sysTopicAndCourses = getSysTopicAndCourses(sysCaseQuestion.getCaseId()); - if (sysTopicAndCourses.isEmpty()) { + SysOneCatalog sysOneCatalogs = getSysOneCatalogs(sysCaseQuestion.getOneName()); + SysCaseQuestion sysCaseQuestion1 = caseQuestionMapper.selectByPrimaryKey(sysCaseQuestion.getCaseId()); + if (sysCaseQuestion1 == null) { + return false; + } + if (!sysCaseQuestion.getSource().equals(sysCaseQuestion1.getSource())) { //老师不能修改管理员上传的,不同直接返回 return false; } else { - caseQuestionMapper.updateByPrimaryKey(sysCaseQuestion); + SysTopicAndCourseExample example = new SysTopicAndCourseExample(); + example.createCriteria().andOneIdEqualTo(sysOneCatalogs.getOneId()) + .andTopicIdEqualTo(sysCaseQuestion.getCaseId()) + .andTopicTypeEqualTo("1"); + List sysTopicAndCourses = topicAndCourseMapper.selectByExample(example); + if (!sysTopicAndCourses.isEmpty()) { + SysTopicAndCourse sysTopicAndCourse = sysTopicAndCourses.get(0); + sysTopicAndCourse.setTwoId(sysCaseQuestion.getTwoId()); + sysTopicAndCourse.setTwoName(sysCaseQuestion.getTwoName()); + topicAndCourseMapper.updateByPrimaryKeySelective(sysTopicAndCourse); + } + caseQuestionMapper.updateByPrimaryKeySelective(sysCaseQuestion); return true; } } @@ -204,10 +231,10 @@ public class CaseApi { @PostMapping("updateCaseStep") public Boolean updateCaseStep(@RequestBody SysCaseQuestionStepWithBLOBs caseQuestionStepWithBLOBs) { List sysTopicAndCourses = getSysTopicAndCourses(caseQuestionStepWithBLOBs.getCaseId()); - if (!sysTopicAndCourses.isEmpty()) { + if (sysTopicAndCourses.isEmpty()) { return false; } else { - caseQuestionStepMapper.updateByPrimaryKey(caseQuestionStepWithBLOBs); + caseQuestionStepMapper.updateByPrimaryKeySelective(caseQuestionStepWithBLOBs); return true; } } @@ -217,8 +244,8 @@ public class CaseApi { @ApiOperation("案例题步骤删除") @PostMapping("deleteCaseStep") public Boolean deleteCaseStep(@RequestParam String caseStepId) { - List sysTopicAndCourses = getSysTopicAndCourses(caseStepId); - if (!sysTopicAndCourses.isEmpty()) { + SysCaseQuestionStepWithBLOBs sysCaseQuestionStepWithBLOBs = caseQuestionStepMapper.selectByPrimaryKey(caseStepId); + if (sysCaseQuestionStepWithBLOBs == null) { return false; } else { caseQuestionStepMapper.deleteByPrimaryKey(caseStepId); @@ -286,4 +313,16 @@ public class CaseApi { return caseQuestionMapper.selectByExampleWithBLOBs(sysCaseQuestionExample); } + + //单独接口 + //*考试模式--成绩报告案例题question0riginal所属章节,contentOriginal为考核点数量,Sort为序号 + @PostMapping("getGradeReportCase") + @ApiOperation("考试模式/成绩报告/案例题") + public List getGradeReportCase(@RequestParam List caseIdList, + @RequestParam String schoolId, + @RequestParam String systemOwner) { + SysOneCatalog sysOneCatalogs = getSysOneCatalogs(systemOwner); + String oneId = sysOneCatalogs.getOneId(); + return caseQuestionStepMapper.getGradeReportCase(caseIdList, schoolId, oneId); + } } diff --git a/src/main/java/com/sztzjy/resource_center/controller/api/CourseApi.java b/src/main/java/com/sztzjy/resource_center/controller/api/CourseApi.java index 5a33789..eca3040 100644 --- a/src/main/java/com/sztzjy/resource_center/controller/api/CourseApi.java +++ b/src/main/java/com/sztzjy/resource_center/controller/api/CourseApi.java @@ -15,6 +15,7 @@ import org.springframework.web.bind.annotation.*; import java.util.ArrayList; import java.util.Date; import java.util.List; +import java.util.Map; @RestController @Api(tags = "课程方面API") @@ -206,4 +207,16 @@ public class CourseApi { } + /** + * 查询章节名称集合 + */ + @AnonymousAccess + @ApiOperation("查询章节名称集合") + @PostMapping("selectNameByCourseID") + public List selectNameByCourseID(@RequestParam String schoolId, + @RequestParam String systemOwner) { + SysOneCatalog sysOneCatalogs = getSysOneCatalogs(systemOwner); + String oneId = sysOneCatalogs.getOneId(); + return threeCatalogMapper.selectNameByCourseID(schoolId,oneId); + } } diff --git a/src/main/java/com/sztzjy/resource_center/controller/api/ObjectiveApi.java b/src/main/java/com/sztzjy/resource_center/controller/api/ObjectiveApi.java index 7751e2a..e216880 100644 --- a/src/main/java/com/sztzjy/resource_center/controller/api/ObjectiveApi.java +++ b/src/main/java/com/sztzjy/resource_center/controller/api/ObjectiveApi.java @@ -9,6 +9,7 @@ import com.sztzjy.resource_center.entity.dto.SysObjectiveQuestionsDto; import com.sztzjy.resource_center.mapper.SysObjectiveQuestionsMapper; import com.sztzjy.resource_center.mapper.SysOneCatalogMapper; import com.sztzjy.resource_center.mapper.SysTopicAndCourseMapper; +import com.sztzjy.resource_center.util.PageUtil; import com.sztzjy.resource_center.util.file.IFileUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -160,7 +161,7 @@ public class ObjectiveApi { * return:PageInfo */ @AnonymousAccess - @ApiOperation("课程配置/题目条件查询") + @ApiOperation("客观题列表查看") @PostMapping("selectObjectiveList") //todo 关于老师删除的题库如何查询 private PageInfo selectObjectiveList(@RequestParam Integer index, @RequestParam Integer size, @@ -168,10 +169,12 @@ public class ObjectiveApi { @RequestParam(required = false) String chapterId, @RequestParam(required = false) String type, @RequestParam String schoolId, - @ApiParam("题干") @RequestParam(required = false) String content) { - PageHelper.startPage(index, size); - List list = sysObjectiveQuestionMapper.getTopicByConfig(null, courseId, chapterId, type, schoolId, content); - PageInfo pageInfo = new PageInfo(list); + @ApiParam("题干") @RequestParam(required = false) String content, + @RequestParam String systemOwner) { + SysOneCatalog sysOneCatalogs = getSysOneCatalogs(systemOwner); + String oneId = sysOneCatalogs.getOneId(); + List list = sysObjectiveQuestionMapper.getTopicByConfig(oneId, courseId, chapterId, type, schoolId, content); + PageInfo pageInfo = PageUtil.pageHelper(list, index, size); return (pageInfo); } @@ -526,4 +529,24 @@ public class ObjectiveApi { List sysObjectiveQuestions = sysObjectiveQuestionMapper.selectByExample(example1); return sysObjectiveQuestions.size(); } + + + //*获取所选客观题数量及分数 + @AnonymousAccess + @ApiOperation("获取所选客观题数量及分数") + @PostMapping("getChooseObjCountAndSorce") + private Map getChooseObjCountAndSorce(@RequestParam List objectIdList) { + return sysObjectiveQuestionMapper.getChooseObjCountAndSorce(objectIdList); + } + + + // *根据客观题类型査询客观题 + @AnonymousAccess + @ApiOperation("获取所选客观题数量及分数") + @PostMapping("selectObjByType") + private List selectObjByType(@RequestParam String type, + @RequestParam String schoolId, + @RequestParam String systemOwner) { + return sysObjectiveQuestionMapper.selectObjByType(type, schoolId); + } } diff --git a/src/main/java/com/sztzjy/resource_center/controller/new_module/admin/AdminDataController.java b/src/main/java/com/sztzjy/resource_center/controller/new_module/admin/AdminDataController.java index 7bb00dd..798306d 100644 --- a/src/main/java/com/sztzjy/resource_center/controller/new_module/admin/AdminDataController.java +++ b/src/main/java/com/sztzjy/resource_center/controller/new_module/admin/AdminDataController.java @@ -16,7 +16,6 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import org.apache.commons.lang3.StringUtils; -import org.apache.ibatis.annotations.Param; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.transaction.annotation.Transactional; diff --git a/src/main/java/com/sztzjy/resource_center/controller/new_module/stu/StuCaseController.java b/src/main/java/com/sztzjy/resource_center/controller/new_module/stu/StuCaseController.java index bd6a7b9..2a6e46f 100644 --- a/src/main/java/com/sztzjy/resource_center/controller/new_module/stu/StuCaseController.java +++ b/src/main/java/com/sztzjy/resource_center/controller/new_module/stu/StuCaseController.java @@ -87,7 +87,7 @@ public class StuCaseController { * * @param ids */ - @GetMapping("/downloadZIP") + @PostMapping("/downloadZIP") @ApiOperation("数据文件打包下载") @AnonymousAccess public void download(@RequestBody List ids, HttpServletResponse response) { diff --git a/src/main/java/com/sztzjy/resource_center/mapper/SysCaseQuestionStepMapper.java b/src/main/java/com/sztzjy/resource_center/mapper/SysCaseQuestionStepMapper.java index 4aa178c..e7204bb 100644 --- a/src/main/java/com/sztzjy/resource_center/mapper/SysCaseQuestionStepMapper.java +++ b/src/main/java/com/sztzjy/resource_center/mapper/SysCaseQuestionStepMapper.java @@ -36,4 +36,8 @@ public interface SysCaseQuestionStepMapper { int updateByPrimaryKeyWithBLOBs(SysCaseQuestionStepWithBLOBs record); int updateByPrimaryKey(SysCaseQuestionStep record); + + List getGradeReportCase(@Param("list") List caseIdList, + @Param("schoolId") String schoolId, + @Param("oneId") String oneId); } \ No newline at end of file diff --git a/src/main/java/com/sztzjy/resource_center/mapper/SysObjectiveQuestionsMapper.java b/src/main/java/com/sztzjy/resource_center/mapper/SysObjectiveQuestionsMapper.java index d04f3b0..a60edea 100644 --- a/src/main/java/com/sztzjy/resource_center/mapper/SysObjectiveQuestionsMapper.java +++ b/src/main/java/com/sztzjy/resource_center/mapper/SysObjectiveQuestionsMapper.java @@ -5,8 +5,11 @@ import com.sztzjy.resource_center.entity.SysObjectiveQuestionsExample; import com.sztzjy.resource_center.entity.dto.SysObjectiveQuestionsDto; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; +import java.math.BigDecimal; import java.util.List; +import java.util.Map; @Mapper public interface SysObjectiveQuestionsMapper { @@ -49,4 +52,9 @@ public interface SysObjectiveQuestionsMapper { ); void batchDelete(@Param("list") List ids); + + + Map getChooseObjCountAndSorce(@Param("list") List objectIdList); + + List selectObjByType(@Param("type") String type,@Param("schoolId") String schoolId); } \ No newline at end of file diff --git a/src/main/java/com/sztzjy/resource_center/mapper/SysThreeCatalogMapper.java b/src/main/java/com/sztzjy/resource_center/mapper/SysThreeCatalogMapper.java index ac1c2cd..3f1358e 100644 --- a/src/main/java/com/sztzjy/resource_center/mapper/SysThreeCatalogMapper.java +++ b/src/main/java/com/sztzjy/resource_center/mapper/SysThreeCatalogMapper.java @@ -2,12 +2,13 @@ package com.sztzjy.resource_center.mapper; import com.sztzjy.resource_center.entity.SysThreeCatalog; import com.sztzjy.resource_center.entity.SysThreeCatalogExample; -import java.util.List; -import java.util.Map; - import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; + +import java.util.List; +import java.util.Map; + @Mapper public interface SysThreeCatalogMapper { long countByExample(SysThreeCatalogExample example); @@ -33,10 +34,18 @@ public interface SysThreeCatalogMapper { int updateByPrimaryKey(SysThreeCatalog record); @Select("select three_id,three_name from sys_three_catalog where ont_id = #{oneId} and two_id =#{twoId} order by sort ASC") - List> getAllThreeCatalogList(@Param("oneId")String oneId, @Param("twoId")String twoId); + List> getAllThreeCatalogList(@Param("oneId") String oneId, @Param("twoId") String twoId); void updateByBatch(@Param("sysThreeCatalogs") List sysThreeCatalogs); @Select("select count(*) from sys_three_catalog where ont_id = #{oneId}") Integer countByOneId(@Param("oneId") String oneId); + + @Select("SELECT three_name FROM sys_three_catalog s \n" + + " join sys_two_catalog st\n" + + "ON st.two_id = s.two_id \n" + + "AND s.ont_id = #{oneId}\n" + + "where s.creator in ('管理员',#{source})") + List selectNameByCourseID(@Param("oneId") String oneId, + @Param("source") String source); } \ No newline at end of file diff --git a/src/main/java/com/sztzjy/resource_center/util/CompressUtil.java b/src/main/java/com/sztzjy/resource_center/util/CompressUtil.java index 6623f34..40ba6f6 100644 --- a/src/main/java/com/sztzjy/resource_center/util/CompressUtil.java +++ b/src/main/java/com/sztzjy/resource_center/util/CompressUtil.java @@ -36,7 +36,7 @@ public class CompressUtil { ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(zipFile)); for (int i = 0; i < filePaths.size(); i++) { String relativeName = filePaths.get(i).get("name"); - String relativePath = filePath+filePaths.get(i).get("file_url")+"/"+relativeName; + String relativePath = filePath+filePaths.get(i).get("file_url"); if (StringUtils.isEmpty(relativePath)) { continue; } diff --git a/src/main/resources/mapper/SysCaseQuestionStepMapper.xml b/src/main/resources/mapper/SysCaseQuestionStepMapper.xml index bd76320..601126f 100644 --- a/src/main/resources/mapper/SysCaseQuestionStepMapper.xml +++ b/src/main/resources/mapper/SysCaseQuestionStepMapper.xml @@ -1,380 +1,412 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - 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, sort, score - - - title, content, question, answer, practice_answer, content_original, question_original, + + + + case_step_id + , case_id, sort, score + + + title + , content, question, answer, practice_answer, content_original, question_original, answer_original, practice_answer_original - - - - - - delete from sys_case_question_steps - where case_step_id = #{caseStepId,jdbcType=VARCHAR} - - - delete from sys_case_question_steps - - - - - - insert into sys_case_question_steps (case_step_id, case_id, sort, - score, title, content, - question, answer, practice_answer, - content_original, question_original, - answer_original, practice_answer_original - ) - values (#{caseStepId,jdbcType=VARCHAR}, #{caseId,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER}, - #{score,jdbcType=DECIMAL}, #{title,jdbcType=LONGVARCHAR}, #{content,jdbcType=LONGVARCHAR}, - #{question,jdbcType=LONGVARCHAR}, #{answer,jdbcType=LONGVARCHAR}, #{practiceAnswer,jdbcType=LONGVARCHAR}, - #{contentOriginal,jdbcType=LONGVARCHAR}, #{questionOriginal,jdbcType=LONGVARCHAR}, - #{answerOriginal,jdbcType=LONGVARCHAR}, #{practiceAnswerOriginal,jdbcType=LONGVARCHAR} - ) - - - insert into sys_case_question_steps - - - case_step_id, - - - case_id, - - - sort, - - - score, - - - title, - - - content, - - - question, - - - answer, - - - practice_answer, - - - content_original, - - - question_original, - - - answer_original, - - - practice_answer_original, - - - - - #{caseStepId,jdbcType=VARCHAR}, - - - #{caseId,jdbcType=VARCHAR}, - - - #{sort,jdbcType=INTEGER}, - - - #{score,jdbcType=DECIMAL}, - - - #{title,jdbcType=LONGVARCHAR}, - - - #{content,jdbcType=LONGVARCHAR}, - - - #{question,jdbcType=LONGVARCHAR}, - - - #{answer,jdbcType=LONGVARCHAR}, - - - #{practiceAnswer,jdbcType=LONGVARCHAR}, - - - #{contentOriginal,jdbcType=LONGVARCHAR}, - - - #{questionOriginal,jdbcType=LONGVARCHAR}, - - - #{answerOriginal,jdbcType=LONGVARCHAR}, - - - #{practiceAnswerOriginal,jdbcType=LONGVARCHAR}, - - - - - - update sys_case_question_steps - - - case_step_id = #{record.caseStepId,jdbcType=VARCHAR}, - - + + + + + + delete + from sys_case_question_steps + where case_step_id = #{caseStepId,jdbcType=VARCHAR} + + + delete from sys_case_question_steps + + + + + + insert into sys_case_question_steps (case_step_id, case_id, sort, + score, title, content, + question, answer, practice_answer, + content_original, question_original, + answer_original, practice_answer_original) + values (#{caseStepId,jdbcType=VARCHAR}, #{caseId,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER}, + #{score,jdbcType=DECIMAL}, #{title,jdbcType=LONGVARCHAR}, #{content,jdbcType=LONGVARCHAR}, + #{question,jdbcType=LONGVARCHAR}, #{answer,jdbcType=LONGVARCHAR}, + #{practiceAnswer,jdbcType=LONGVARCHAR}, + #{contentOriginal,jdbcType=LONGVARCHAR}, #{questionOriginal,jdbcType=LONGVARCHAR}, + #{answerOriginal,jdbcType=LONGVARCHAR}, #{practiceAnswerOriginal,jdbcType=LONGVARCHAR}) + + + insert into sys_case_question_steps + + + case_step_id, + + + case_id, + + + sort, + + + score, + + + title, + + + content, + + + question, + + + answer, + + + practice_answer, + + + content_original, + + + question_original, + + + answer_original, + + + practice_answer_original, + + + + + #{caseStepId,jdbcType=VARCHAR}, + + + #{caseId,jdbcType=VARCHAR}, + + + #{sort,jdbcType=INTEGER}, + + + #{score,jdbcType=DECIMAL}, + + + #{title,jdbcType=LONGVARCHAR}, + + + #{content,jdbcType=LONGVARCHAR}, + + + #{question,jdbcType=LONGVARCHAR}, + + + #{answer,jdbcType=LONGVARCHAR}, + + + #{practiceAnswer,jdbcType=LONGVARCHAR}, + + + #{contentOriginal,jdbcType=LONGVARCHAR}, + + + #{questionOriginal,jdbcType=LONGVARCHAR}, + + + #{answerOriginal,jdbcType=LONGVARCHAR}, + + + #{practiceAnswerOriginal,jdbcType=LONGVARCHAR}, + + + + + + update sys_case_question_steps + + + case_step_id = #{record.caseStepId,jdbcType=VARCHAR}, + + + case_id = #{record.caseId,jdbcType=VARCHAR}, + + + sort = #{record.sort,jdbcType=INTEGER}, + + + score = #{record.score,jdbcType=DECIMAL}, + + + title = #{record.title,jdbcType=LONGVARCHAR}, + + + content = #{record.content,jdbcType=LONGVARCHAR}, + + + question = #{record.question,jdbcType=LONGVARCHAR}, + + + answer = #{record.answer,jdbcType=LONGVARCHAR}, + + + practice_answer = #{record.practiceAnswer,jdbcType=LONGVARCHAR}, + + + content_original = #{record.contentOriginal,jdbcType=LONGVARCHAR}, + + + question_original = #{record.questionOriginal,jdbcType=LONGVARCHAR}, + + + answer_original = #{record.answerOriginal,jdbcType=LONGVARCHAR}, + + + practice_answer_original = #{record.practiceAnswerOriginal,jdbcType=LONGVARCHAR}, + + + + + + + + update sys_case_question_steps + set case_step_id = #{record.caseStepId,jdbcType=VARCHAR}, case_id = #{record.caseId,jdbcType=VARCHAR}, - - sort = #{record.sort,jdbcType=INTEGER}, - - score = #{record.score,jdbcType=DECIMAL}, - - title = #{record.title,jdbcType=LONGVARCHAR}, - - content = #{record.content,jdbcType=LONGVARCHAR}, - - question = #{record.question,jdbcType=LONGVARCHAR}, - - answer = #{record.answer,jdbcType=LONGVARCHAR}, - - practice_answer = #{record.practiceAnswer,jdbcType=LONGVARCHAR}, - - content_original = #{record.contentOriginal,jdbcType=LONGVARCHAR}, - - question_original = #{record.questionOriginal,jdbcType=LONGVARCHAR}, - - answer_original = #{record.answerOriginal,jdbcType=LONGVARCHAR}, - - - practice_answer_original = #{record.practiceAnswerOriginal,jdbcType=LONGVARCHAR}, - - - - - - - - update sys_case_question_steps - set case_step_id = #{record.caseStepId,jdbcType=VARCHAR}, - case_id = #{record.caseId,jdbcType=VARCHAR}, - sort = #{record.sort,jdbcType=INTEGER}, - score = #{record.score,jdbcType=DECIMAL}, - title = #{record.title,jdbcType=LONGVARCHAR}, - content = #{record.content,jdbcType=LONGVARCHAR}, - question = #{record.question,jdbcType=LONGVARCHAR}, - answer = #{record.answer,jdbcType=LONGVARCHAR}, - practice_answer = #{record.practiceAnswer,jdbcType=LONGVARCHAR}, - content_original = #{record.contentOriginal,jdbcType=LONGVARCHAR}, - question_original = #{record.questionOriginal,jdbcType=LONGVARCHAR}, - answer_original = #{record.answerOriginal,jdbcType=LONGVARCHAR}, - practice_answer_original = #{record.practiceAnswerOriginal,jdbcType=LONGVARCHAR} - - - - - - update sys_case_question_steps - set case_step_id = #{record.caseStepId,jdbcType=VARCHAR}, - case_id = #{record.caseId,jdbcType=VARCHAR}, - sort = #{record.sort,jdbcType=INTEGER}, - score = #{record.score,jdbcType=DECIMAL} - - - - - - update sys_case_question_steps - - - case_id = #{caseId,jdbcType=VARCHAR}, - - - sort = #{sort,jdbcType=INTEGER}, - - - score = #{score,jdbcType=DECIMAL}, - - - title = #{title,jdbcType=LONGVARCHAR}, - - - content = #{content,jdbcType=LONGVARCHAR}, - - - question = #{question,jdbcType=LONGVARCHAR}, - - - answer = #{answer,jdbcType=LONGVARCHAR}, - - - practice_answer = #{practiceAnswer,jdbcType=LONGVARCHAR}, - - - content_original = #{contentOriginal,jdbcType=LONGVARCHAR}, - - - question_original = #{questionOriginal,jdbcType=LONGVARCHAR}, - - - answer_original = #{answerOriginal,jdbcType=LONGVARCHAR}, - - - practice_answer_original = #{practiceAnswerOriginal,jdbcType=LONGVARCHAR}, - - - where case_step_id = #{caseStepId,jdbcType=VARCHAR} - - - update sys_case_question_steps - set case_id = #{caseId,jdbcType=VARCHAR}, - sort = #{sort,jdbcType=INTEGER}, - score = #{score,jdbcType=DECIMAL}, - title = #{title,jdbcType=LONGVARCHAR}, - content = #{content,jdbcType=LONGVARCHAR}, - question = #{question,jdbcType=LONGVARCHAR}, - answer = #{answer,jdbcType=LONGVARCHAR}, - practice_answer = #{practiceAnswer,jdbcType=LONGVARCHAR}, - content_original = #{contentOriginal,jdbcType=LONGVARCHAR}, - question_original = #{questionOriginal,jdbcType=LONGVARCHAR}, - answer_original = #{answerOriginal,jdbcType=LONGVARCHAR}, - practice_answer_original = #{practiceAnswerOriginal,jdbcType=LONGVARCHAR} - where case_step_id = #{caseStepId,jdbcType=VARCHAR} - - - update sys_case_question_steps - set case_id = #{caseId,jdbcType=VARCHAR}, - sort = #{sort,jdbcType=INTEGER}, - score = #{score,jdbcType=DECIMAL} - where case_step_id = #{caseStepId,jdbcType=VARCHAR} - + practice_answer_original = #{record.practiceAnswerOriginal,jdbcType=LONGVARCHAR} + + + + + + update sys_case_question_steps + set case_step_id = #{record.caseStepId,jdbcType=VARCHAR}, + case_id = #{record.caseId,jdbcType=VARCHAR}, + sort = #{record.sort,jdbcType=INTEGER}, + score = #{record.score,jdbcType=DECIMAL} + + + + + + update sys_case_question_steps + + + case_id = #{caseId,jdbcType=VARCHAR}, + + + sort = #{sort,jdbcType=INTEGER}, + + + score = #{score,jdbcType=DECIMAL}, + + + title = #{title,jdbcType=LONGVARCHAR}, + + + content = #{content,jdbcType=LONGVARCHAR}, + + + question = #{question,jdbcType=LONGVARCHAR}, + + + answer = #{answer,jdbcType=LONGVARCHAR}, + + + practice_answer = #{practiceAnswer,jdbcType=LONGVARCHAR}, + + + content_original = #{contentOriginal,jdbcType=LONGVARCHAR}, + + + question_original = #{questionOriginal,jdbcType=LONGVARCHAR}, + + + answer_original = #{answerOriginal,jdbcType=LONGVARCHAR}, + + + practice_answer_original = #{practiceAnswerOriginal,jdbcType=LONGVARCHAR}, + + + where case_step_id = #{caseStepId,jdbcType=VARCHAR} + + + update sys_case_question_steps + set case_id = #{caseId,jdbcType=VARCHAR}, + sort = #{sort,jdbcType=INTEGER}, + score = #{score,jdbcType=DECIMAL}, + title = #{title,jdbcType=LONGVARCHAR}, + content = #{content,jdbcType=LONGVARCHAR}, + question = #{question,jdbcType=LONGVARCHAR}, + answer = #{answer,jdbcType=LONGVARCHAR}, + practice_answer = #{practiceAnswer,jdbcType=LONGVARCHAR}, + content_original = #{contentOriginal,jdbcType=LONGVARCHAR}, + question_original = #{questionOriginal,jdbcType=LONGVARCHAR}, + answer_original = #{answerOriginal,jdbcType=LONGVARCHAR}, + practice_answer_original = #{practiceAnswerOriginal,jdbcType=LONGVARCHAR} + where case_step_id = #{caseStepId,jdbcType=VARCHAR} + + + update sys_case_question_steps + set case_id = #{caseId,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/SysObjectiveQuestionsMapper.xml b/src/main/resources/mapper/SysObjectiveQuestionsMapper.xml index 9191ae8..426ff5c 100644 --- a/src/main/resources/mapper/SysObjectiveQuestionsMapper.xml +++ b/src/main/resources/mapper/SysObjectiveQuestionsMapper.xml @@ -449,6 +449,7 @@ and sb.source in (#{schoolId},'管理员') + and sb.is_delete = FALSE order by sb.create_time @@ -475,4 +476,25 @@ #{id} + + + + + + \ No newline at end of file