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 150d6cf..f312f5e 100644 --- a/src/main/java/com/sztzjy/resource_center/controller/CaseController.java +++ b/src/main/java/com/sztzjy/resource_center/controller/CaseController.java @@ -75,11 +75,14 @@ public class CaseController { sysTopicAndCourse.setTopicType("1"); sysTopicAndCourse.setTopicId(uuid); sysTopicAndCourse.setOneId(sysCaseQuestion.getOneId()); + sysTopicAndCourse.setOneName(sysCaseQuestion.getOneName()); if (StringUtils.isNotBlank(sysCaseQuestion.getTwoId())) { sysTopicAndCourse.setTwoId(sysCaseQuestion.getTwoId()); + sysTopicAndCourse.setTwoName(sysCaseQuestion.getTwoName()); } if (StringUtils.isNotBlank(sysCaseQuestion.getThreeId())) { sysTopicAndCourse.setThreeId(sysCaseQuestion.getThreeId()); + sysTopicAndCourse.setThreeName(sysCaseQuestion.getThreeName()); } topicAndCourseMapper.insert(sysTopicAndCourse); return new ResultEntity<>(HttpStatus.OK, "新增成功!"); @@ -87,7 +90,7 @@ public class CaseController { @AnonymousAccess - @ApiOperation("案例题页面查询") + @ApiOperation("案例题页面查询/无重复") @PostMapping("selectCaseByConditions") public ResultEntity> selectCaseByConditions(@RequestParam Integer index, @RequestParam Integer size, @@ -99,6 +102,18 @@ public class CaseController { return new ResultEntity>(pageInfo); } + @AnonymousAccess + @ApiOperation("案例题页面查询/有重复") + @PostMapping("selectCaseByConditionsByBind") + public ResultEntity> selectCaseByConditions(@RequestParam Integer index, + @RequestParam Integer size, + @RequestParam(required = false) String title) { + PageHelper.startPage(index, size); + List list = caseQuestionMapper.selectCaseByConditionsByBind(title); + PageInfo pageInfo = new PageInfo(list); + return new ResultEntity>(pageInfo); + } + @AnonymousAccess @ApiOperation("案例题详细内容展示") @PostMapping("selectCaseByConditionsByID") diff --git a/src/main/java/com/sztzjy/resource_center/controller/CourseConfigController.java b/src/main/java/com/sztzjy/resource_center/controller/CourseConfigController.java index 9394add..5fb1e65 100644 --- a/src/main/java/com/sztzjy/resource_center/controller/CourseConfigController.java +++ b/src/main/java/com/sztzjy/resource_center/controller/CourseConfigController.java @@ -121,9 +121,9 @@ public class CourseConfigController { @AnonymousAccess @ApiOperation("课程配置/资源列表展示,无重复") @PostMapping("selectResourceByIDAndSource") - public ResultEntity> selectResource(@ApiParam("课程ID") @RequestParam String oneID, - @ApiParam("章ID") @RequestParam String twoID, - @ApiParam("节ID") @RequestParam String threeID, + public ResultEntity> selectResource(@ApiParam("课程ID") @RequestParam(required = false) String oneID, + @ApiParam("章ID") @RequestParam(required = false) String twoID, + @ApiParam("节ID") @RequestParam(required = false) String threeID, @RequestParam(required = false) String source, //子系统调用时传 @RequestParam Integer index, @RequestParam Integer size) { diff --git a/src/main/java/com/sztzjy/resource_center/controller/TopicResourceController.java b/src/main/java/com/sztzjy/resource_center/controller/TopicResourceController.java index a477257..2bfe3f9 100644 --- a/src/main/java/com/sztzjy/resource_center/controller/TopicResourceController.java +++ b/src/main/java/com/sztzjy/resource_center/controller/TopicResourceController.java @@ -159,9 +159,9 @@ public class TopicResourceController { @PostMapping("selectTopicByConditions") //todo 关于老师删除的题库如何查询 private ResultEntity> selectTopicByConditions(@RequestParam Integer index, @RequestParam Integer size, - @RequestParam String oneID, - @RequestParam String twoID, - @RequestParam String threeID, + @RequestParam (required = false)String oneID, + @RequestParam (required = false)String twoID, + @RequestParam (required = false)String threeID, @RequestParam(required = false) String type, @ApiParam("题干") @RequestParam(required = false) String content) { PageHelper.startPage(index, size); 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 4fc864b..7f58ff0 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,16 +1,109 @@ 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.*; +import com.sztzjy.resource_center.mapper.SysCaseQuestionMapper; +import com.sztzjy.resource_center.mapper.SysCaseQuestionStepMapper; +import com.sztzjy.resource_center.mapper.SysOneCatalogMapper; +import com.sztzjy.resource_center.mapper.SysTopicAndCourseMapper; +import com.sztzjy.resource_center.util.ResultEntity; import io.swagger.annotations.Api; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.*; + +import java.util.Date; +import java.util.List; @RestController @Api(tags = "课程方面API") @RequestMapping("api/sys/CaseApi") public class CaseApi { + @Autowired + private SysCaseQuestionStepMapper caseQuestionStepMapper; + @Autowired + private SysCaseQuestionMapper caseQuestionMapper; + @Autowired + private SysTopicAndCourseMapper topicAndCourseMapper; + @Autowired + private SysOneCatalogMapper sysOneCatalogMapper; + + //案例题新增 SysCaseQuestion + @AnonymousAccess + @ApiOperation("案例题新增") + @PostMapping("insertCase") + public ResultEntity insertCase(@ApiParam("目前二级三级ID可以为空,来源和题型要传,上架状态传true") @RequestBody SysCaseQuestion sysCaseQuestion) { + if (("3").equals(sysCaseQuestion.getType())) { + return new ResultEntity<>(HttpStatus.BAD_REQUEST, "题型错误!"); + } + if (StringUtils.isBlank(sysCaseQuestion.getOneId())) { //todo 目前二级三级ID可以为空 + return new ResultEntity<>(HttpStatus.BAD_REQUEST, "课程不能为空!"); + } + if (StringUtils.isBlank(sysCaseQuestion.getContent()) || StringUtils.isBlank(sysCaseQuestion.getTitle())) { + return new ResultEntity<>(HttpStatus.BAD_REQUEST, "题目内容不能为空!"); + } + if (StringUtils.isBlank(sysCaseQuestion.getSource())) { + return new ResultEntity<>(HttpStatus.BAD_REQUEST, "题目来源不能为空!"); + } + String title = sysCaseQuestion.getTitle(); + SysCaseQuestionExample example = new SysCaseQuestionExample(); + example.createCriteria().andTitleEqualTo(title); + List sysCaseQuestions = caseQuestionMapper.selectByExample(example); + if (!sysCaseQuestions.isEmpty()) { + return new ResultEntity<>(HttpStatus.BAD_REQUEST, "案例名称不能重复!"); + } + + String uuid = IdUtil.randomUUID(); + sysCaseQuestion.setCaseId(uuid); + sysCaseQuestion.setCreateTime(new Date()); + sysCaseQuestion.setUnmountStatus(false); + caseQuestionMapper.insert(sysCaseQuestion); + //新增绑定关系 + SysTopicAndCourse sysTopicAndCourse = new SysTopicAndCourse(); + sysTopicAndCourse.setId(IdUtil.randomUUID()); + sysTopicAndCourse.setTopicType("1"); + sysTopicAndCourse.setTopicId(uuid); + SysOneCatalog sysOneCatalogs = getSysOneCatalogs(sysCaseQuestion.getOneId()); //name放在ID传过来 + String oneId = sysOneCatalogs.getOneId(); + sysTopicAndCourse.setOneId(oneId); + if (StringUtils.isNotBlank(sysCaseQuestion.getTwoId())) { + sysTopicAndCourse.setTwoId(sysCaseQuestion.getTwoId()); + } + if (StringUtils.isNotBlank(sysCaseQuestion.getThreeId())) { + sysTopicAndCourse.setThreeId(sysCaseQuestion.getThreeId()); + } + topicAndCourseMapper.insert(sysTopicAndCourse); + return new ResultEntity<>(HttpStatus.OK, "新增成功!"); + } + + private SysOneCatalog getSysOneCatalogs(String systemOwner) { + SysOneCatalogExample example = new SysOneCatalogExample(); + example.createCriteria().andOneNameEqualTo(systemOwner); + List sysOneCatalogs = sysOneCatalogMapper.selectByExample(example); + return sysOneCatalogs.get(0); + } + //案例题列表查询 schoolId keyword index size systemOwner + @AnonymousAccess + @ApiOperation("案例题页面查询") + @PostMapping("selectCaseByConditions") + public ResultEntity> selectCaseByConditions(@RequestParam Integer index, + @RequestParam Integer size, + @RequestParam(required = false) String title, + @RequestParam(required = false) String oneId) { + PageHelper.startPage(index, size); + List list = caseQuestionMapper.selectCaseByConditions(title, oneId); + PageInfo pageInfo = new PageInfo(list); + return new ResultEntity>(pageInfo); + } //案例题详情查询 caseId //案例题删除 caseId //案例题编辑 SysCaseQuestion diff --git a/src/main/java/com/sztzjy/resource_center/mapper/SysCaseQuestionMapper.java b/src/main/java/com/sztzjy/resource_center/mapper/SysCaseQuestionMapper.java index 8dbacb1..1e00d3f 100644 --- a/src/main/java/com/sztzjy/resource_center/mapper/SysCaseQuestionMapper.java +++ b/src/main/java/com/sztzjy/resource_center/mapper/SysCaseQuestionMapper.java @@ -37,4 +37,6 @@ public interface SysCaseQuestionMapper { int updateByPrimaryKey(SysCaseQuestion record); List selectCaseByConditions(@Param("title")String title, @Param("oneId")String oneId); + + List selectCaseByConditionsByBind(@Param("title")String title); } \ No newline at end of file diff --git a/src/main/resources/mapper/SysCaseQuestionMapper.xml b/src/main/resources/mapper/SysCaseQuestionMapper.xml index b05b162..6e23d2a 100644 --- a/src/main/resources/mapper/SysCaseQuestionMapper.xml +++ b/src/main/resources/mapper/SysCaseQuestionMapper.xml @@ -1,444 +1,466 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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_id, title, resource_data, source, type, one_id, one_name, two_id, two_name, + + + + case_id + , title, resource_data, source, type, one_id, one_name, two_id, two_name, three_id, three_name, unmount_status, create_time, update_time - - - content - - - - - - delete from sys_case_questions - where case_id = #{caseId,jdbcType=VARCHAR} - - - delete from sys_case_questions - - - - - - insert into sys_case_questions (case_id, title, resource_data, - source, type, one_id, - one_name, two_id, two_name, - three_id, three_name, unmount_status, - create_time, update_time, content - ) - values (#{caseId,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR}, #{resourceData,jdbcType=VARCHAR}, - #{source,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{oneId,jdbcType=VARCHAR}, - #{oneName,jdbcType=VARCHAR}, #{twoId,jdbcType=VARCHAR}, #{twoName,jdbcType=VARCHAR}, - #{threeId,jdbcType=VARCHAR}, #{threeName,jdbcType=VARCHAR}, #{unmountStatus,jdbcType=BIT}, - #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{content,jdbcType=LONGVARCHAR} - ) - - - insert into sys_case_questions - - - case_id, - - - title, - - - resource_data, - - - source, - - - type, - - - one_id, - - - one_name, - - - two_id, - - - two_name, - - - three_id, - - - three_name, - - - unmount_status, - - - create_time, - - - update_time, - - - content, - - - - - #{caseId,jdbcType=VARCHAR}, - - - #{title,jdbcType=VARCHAR}, - - - #{resourceData,jdbcType=VARCHAR}, - - - #{source,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{oneId,jdbcType=VARCHAR}, - - - #{oneName,jdbcType=VARCHAR}, - - - #{twoId,jdbcType=VARCHAR}, - - - #{twoName,jdbcType=VARCHAR}, - - - #{threeId,jdbcType=VARCHAR}, - - - #{threeName,jdbcType=VARCHAR}, - - - #{unmountStatus,jdbcType=BIT}, - - - #{createTime,jdbcType=TIMESTAMP}, - - - #{updateTime,jdbcType=TIMESTAMP}, - - - #{content,jdbcType=LONGVARCHAR}, - - - - - - update sys_case_questions - - - case_id = #{record.caseId,jdbcType=VARCHAR}, - - + + + content + + + + + + delete + from sys_case_questions + where case_id = #{caseId,jdbcType=VARCHAR} + + + delete from sys_case_questions + + + + + + insert into sys_case_questions (case_id, title, resource_data, + source, type, one_id, + one_name, two_id, two_name, + three_id, three_name, unmount_status, + create_time, update_time, content) + values (#{caseId,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR}, #{resourceData,jdbcType=VARCHAR}, + #{source,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{oneId,jdbcType=VARCHAR}, + #{oneName,jdbcType=VARCHAR}, #{twoId,jdbcType=VARCHAR}, #{twoName,jdbcType=VARCHAR}, + #{threeId,jdbcType=VARCHAR}, #{threeName,jdbcType=VARCHAR}, #{unmountStatus,jdbcType=BIT}, + #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{content,jdbcType=LONGVARCHAR}) + + + insert into sys_case_questions + + + case_id, + + + title, + + + resource_data, + + + source, + + + type, + + + one_id, + + + one_name, + + + two_id, + + + two_name, + + + three_id, + + + three_name, + + + unmount_status, + + + create_time, + + + update_time, + + + content, + + + + + #{caseId,jdbcType=VARCHAR}, + + + #{title,jdbcType=VARCHAR}, + + + #{resourceData,jdbcType=VARCHAR}, + + + #{source,jdbcType=VARCHAR}, + + + #{type,jdbcType=VARCHAR}, + + + #{oneId,jdbcType=VARCHAR}, + + + #{oneName,jdbcType=VARCHAR}, + + + #{twoId,jdbcType=VARCHAR}, + + + #{twoName,jdbcType=VARCHAR}, + + + #{threeId,jdbcType=VARCHAR}, + + + #{threeName,jdbcType=VARCHAR}, + + + #{unmountStatus,jdbcType=BIT}, + + + #{createTime,jdbcType=TIMESTAMP}, + + + #{updateTime,jdbcType=TIMESTAMP}, + + + #{content,jdbcType=LONGVARCHAR}, + + + + + + update sys_case_questions + + + case_id = #{record.caseId,jdbcType=VARCHAR}, + + + title = #{record.title,jdbcType=VARCHAR}, + + + resource_data = #{record.resourceData,jdbcType=VARCHAR}, + + + source = #{record.source,jdbcType=VARCHAR}, + + + type = #{record.type,jdbcType=VARCHAR}, + + + one_id = #{record.oneId,jdbcType=VARCHAR}, + + + one_name = #{record.oneName,jdbcType=VARCHAR}, + + + two_id = #{record.twoId,jdbcType=VARCHAR}, + + + two_name = #{record.twoName,jdbcType=VARCHAR}, + + + three_id = #{record.threeId,jdbcType=VARCHAR}, + + + three_name = #{record.threeName,jdbcType=VARCHAR}, + + + unmount_status = #{record.unmountStatus,jdbcType=BIT}, + + + create_time = #{record.createTime,jdbcType=TIMESTAMP}, + + + update_time = #{record.updateTime,jdbcType=TIMESTAMP}, + + + content = #{record.content,jdbcType=LONGVARCHAR}, + + + + + + + + update sys_case_questions + set case_id = #{record.caseId,jdbcType=VARCHAR}, title = #{record.title,jdbcType=VARCHAR}, - - resource_data = #{record.resourceData,jdbcType=VARCHAR}, - - source = #{record.source,jdbcType=VARCHAR}, - - type = #{record.type,jdbcType=VARCHAR}, - - one_id = #{record.oneId,jdbcType=VARCHAR}, - - one_name = #{record.oneName,jdbcType=VARCHAR}, - - two_id = #{record.twoId,jdbcType=VARCHAR}, - - two_name = #{record.twoName,jdbcType=VARCHAR}, - - three_id = #{record.threeId,jdbcType=VARCHAR}, - - three_name = #{record.threeName,jdbcType=VARCHAR}, - - unmount_status = #{record.unmountStatus,jdbcType=BIT}, - - create_time = #{record.createTime,jdbcType=TIMESTAMP}, - - update_time = #{record.updateTime,jdbcType=TIMESTAMP}, - - - content = #{record.content,jdbcType=LONGVARCHAR}, - - - - - - - - update sys_case_questions - set case_id = #{record.caseId,jdbcType=VARCHAR}, - title = #{record.title,jdbcType=VARCHAR}, - resource_data = #{record.resourceData,jdbcType=VARCHAR}, - source = #{record.source,jdbcType=VARCHAR}, - type = #{record.type,jdbcType=VARCHAR}, - one_id = #{record.oneId,jdbcType=VARCHAR}, - one_name = #{record.oneName,jdbcType=VARCHAR}, - two_id = #{record.twoId,jdbcType=VARCHAR}, - two_name = #{record.twoName,jdbcType=VARCHAR}, - three_id = #{record.threeId,jdbcType=VARCHAR}, - three_name = #{record.threeName,jdbcType=VARCHAR}, - unmount_status = #{record.unmountStatus,jdbcType=BIT}, - create_time = #{record.createTime,jdbcType=TIMESTAMP}, - update_time = #{record.updateTime,jdbcType=TIMESTAMP}, - content = #{record.content,jdbcType=LONGVARCHAR} - - - - - - update sys_case_questions - set case_id = #{record.caseId,jdbcType=VARCHAR}, - title = #{record.title,jdbcType=VARCHAR}, - resource_data = #{record.resourceData,jdbcType=VARCHAR}, - source = #{record.source,jdbcType=VARCHAR}, - type = #{record.type,jdbcType=VARCHAR}, - one_id = #{record.oneId,jdbcType=VARCHAR}, - one_name = #{record.oneName,jdbcType=VARCHAR}, - two_id = #{record.twoId,jdbcType=VARCHAR}, - two_name = #{record.twoName,jdbcType=VARCHAR}, - three_id = #{record.threeId,jdbcType=VARCHAR}, - three_name = #{record.threeName,jdbcType=VARCHAR}, - unmount_status = #{record.unmountStatus,jdbcType=BIT}, - create_time = #{record.createTime,jdbcType=TIMESTAMP}, - update_time = #{record.updateTime,jdbcType=TIMESTAMP} - - - - - - update sys_case_questions - - - title = #{title,jdbcType=VARCHAR}, - - - resource_data = #{resourceData,jdbcType=VARCHAR}, - - - source = #{source,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - one_id = #{oneId,jdbcType=VARCHAR}, - - - one_name = #{oneName,jdbcType=VARCHAR}, - - - two_id = #{twoId,jdbcType=VARCHAR}, - - - two_name = #{twoName,jdbcType=VARCHAR}, - - - three_id = #{threeId,jdbcType=VARCHAR}, - - - three_name = #{threeName,jdbcType=VARCHAR}, - - - unmount_status = #{unmountStatus,jdbcType=BIT}, - - - create_time = #{createTime,jdbcType=TIMESTAMP}, - - - update_time = #{updateTime,jdbcType=TIMESTAMP}, - - - content = #{content,jdbcType=LONGVARCHAR}, - - - where case_id = #{caseId,jdbcType=VARCHAR} - - - update sys_case_questions - set title = #{title,jdbcType=VARCHAR}, - resource_data = #{resourceData,jdbcType=VARCHAR}, - source = #{source,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - one_id = #{oneId,jdbcType=VARCHAR}, - one_name = #{oneName,jdbcType=VARCHAR}, - two_id = #{twoId,jdbcType=VARCHAR}, - two_name = #{twoName,jdbcType=VARCHAR}, - three_id = #{threeId,jdbcType=VARCHAR}, - three_name = #{threeName,jdbcType=VARCHAR}, - unmount_status = #{unmountStatus,jdbcType=BIT}, - create_time = #{createTime,jdbcType=TIMESTAMP}, - update_time = #{updateTime,jdbcType=TIMESTAMP}, - content = #{content,jdbcType=LONGVARCHAR} - where case_id = #{caseId,jdbcType=VARCHAR} - - - update sys_case_questions - set title = #{title,jdbcType=VARCHAR}, - resource_data = #{resourceData,jdbcType=VARCHAR}, - source = #{source,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - one_id = #{oneId,jdbcType=VARCHAR}, - one_name = #{oneName,jdbcType=VARCHAR}, - two_id = #{twoId,jdbcType=VARCHAR}, - two_name = #{twoName,jdbcType=VARCHAR}, - three_id = #{threeId,jdbcType=VARCHAR}, - three_name = #{threeName,jdbcType=VARCHAR}, - unmount_status = #{unmountStatus,jdbcType=BIT}, - create_time = #{createTime,jdbcType=TIMESTAMP}, - update_time = #{updateTime,jdbcType=TIMESTAMP} - where case_id = #{caseId,jdbcType=VARCHAR} - + content = #{record.content,jdbcType=LONGVARCHAR} + + + + + + update sys_case_questions + set case_id = #{record.caseId,jdbcType=VARCHAR}, + title = #{record.title,jdbcType=VARCHAR}, + resource_data = #{record.resourceData,jdbcType=VARCHAR}, + source = #{record.source,jdbcType=VARCHAR}, + type = #{record.type,jdbcType=VARCHAR}, + one_id = #{record.oneId,jdbcType=VARCHAR}, + one_name = #{record.oneName,jdbcType=VARCHAR}, + two_id = #{record.twoId,jdbcType=VARCHAR}, + two_name = #{record.twoName,jdbcType=VARCHAR}, + three_id = #{record.threeId,jdbcType=VARCHAR}, + three_name = #{record.threeName,jdbcType=VARCHAR}, + unmount_status = #{record.unmountStatus,jdbcType=BIT}, + create_time = #{record.createTime,jdbcType=TIMESTAMP}, + update_time = #{record.updateTime,jdbcType=TIMESTAMP} + + + + + + update sys_case_questions + + + title = #{title,jdbcType=VARCHAR}, + + + resource_data = #{resourceData,jdbcType=VARCHAR}, + + + source = #{source,jdbcType=VARCHAR}, + + + type = #{type,jdbcType=VARCHAR}, + + + one_id = #{oneId,jdbcType=VARCHAR}, + + + one_name = #{oneName,jdbcType=VARCHAR}, + + + two_id = #{twoId,jdbcType=VARCHAR}, + + + two_name = #{twoName,jdbcType=VARCHAR}, + + + three_id = #{threeId,jdbcType=VARCHAR}, + + + three_name = #{threeName,jdbcType=VARCHAR}, + + + unmount_status = #{unmountStatus,jdbcType=BIT}, + + + create_time = #{createTime,jdbcType=TIMESTAMP}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + content = #{content,jdbcType=LONGVARCHAR}, + + + where case_id = #{caseId,jdbcType=VARCHAR} + + + update sys_case_questions + set title = #{title,jdbcType=VARCHAR}, + resource_data = #{resourceData,jdbcType=VARCHAR}, + source = #{source,jdbcType=VARCHAR}, + type = #{type,jdbcType=VARCHAR}, + one_id = #{oneId,jdbcType=VARCHAR}, + one_name = #{oneName,jdbcType=VARCHAR}, + two_id = #{twoId,jdbcType=VARCHAR}, + two_name = #{twoName,jdbcType=VARCHAR}, + three_id = #{threeId,jdbcType=VARCHAR}, + three_name = #{threeName,jdbcType=VARCHAR}, + unmount_status = #{unmountStatus,jdbcType=BIT}, + create_time = #{createTime,jdbcType=TIMESTAMP}, + update_time = #{updateTime,jdbcType=TIMESTAMP}, + content = #{content,jdbcType=LONGVARCHAR} + where case_id = #{caseId,jdbcType=VARCHAR} + + + update sys_case_questions + set title = #{title,jdbcType=VARCHAR}, + resource_data = #{resourceData,jdbcType=VARCHAR}, + source = #{source,jdbcType=VARCHAR}, + type = #{type,jdbcType=VARCHAR}, + one_id = #{oneId,jdbcType=VARCHAR}, + one_name = #{oneName,jdbcType=VARCHAR}, + two_id = #{twoId,jdbcType=VARCHAR}, + two_name = #{twoName,jdbcType=VARCHAR}, + three_id = #{threeId,jdbcType=VARCHAR}, + three_name = #{threeName,jdbcType=VARCHAR}, + unmount_status = #{unmountStatus,jdbcType=BIT}, + create_time = #{createTime,jdbcType=TIMESTAMP}, + update_time = #{updateTime,jdbcType=TIMESTAMP} + where case_id = #{caseId,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 504cd24..c4b0f6f 100644 --- a/src/main/resources/mapper/SysObjectiveQuestionsMapper.xml +++ b/src/main/resources/mapper/SysObjectiveQuestionsMapper.xml @@ -403,15 +403,15 @@ left JOIN sys_topic_and_course st on sb.objective_id = st.topic_id - - - - - - - - - + + st.one_id = #{oneID} + + + and st.two_id = #{twoID} + + + and st.three_id = #{threeID} + and sb.type = #{type} diff --git a/src/main/resources/mapper/SysResourceMapper.xml b/src/main/resources/mapper/SysResourceMapper.xml index 7286adf..69d886b 100644 --- a/src/main/resources/mapper/SysResourceMapper.xml +++ b/src/main/resources/mapper/SysResourceMapper.xml @@ -406,9 +406,15 @@ sys_resource_and_course sc on sr.resource_id =sc.resource_id - sc.one_id = #{oneId} - and sc.two_id = #{twoId} - and sc.three_id = #{threeId} + + sc.one_id = #{oneId} + + + and sc.two_id = #{twoId} + + + and sc.three_id = #{threeId} + order by sr.create_time