From dfcb513a1b3be15bb273e60a591570c06cb1de40 Mon Sep 17 00:00:00 2001 From: xiaoCJ <406612557@qq.com> Date: Sun, 14 Jul 2024 18:05:32 +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?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/CourseConfigController.java | 20 +- .../KnowledgeSummaryController.java | 17 +- .../controller/TopicResourceController.java | 6 +- .../controller/api/CaseApi.java | 74 +-- .../entity/SysCaseQuestionStepWithBLOBs.java | 22 + .../entity/SysTopicAndCourse.java | 3 + src/main/resources/generatorConfig.xml | 4 +- .../mapper/SysCaseQuestionStepMapper.xml | 47 +- .../mapper/SysResourceAndCourseMapper.xml | 7 +- .../resources/mapper/SysResourceMapper.xml | 10 +- .../mapper/SysTopicAndCourseMapper.xml | 563 +++++++++--------- 11 files changed, 430 insertions(+), 343 deletions(-) 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 5fb1e65..0caedeb 100644 --- a/src/main/java/com/sztzjy/resource_center/controller/CourseConfigController.java +++ b/src/main/java/com/sztzjy/resource_center/controller/CourseConfigController.java @@ -4,10 +4,12 @@ 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.SysCaseQuestionExample; import com.sztzjy.resource_center.entity.SysResource; import com.sztzjy.resource_center.entity.SysResourceAndCourse; import com.sztzjy.resource_center.entity.SysResourceAndCourseExample; import com.sztzjy.resource_center.entity.dto.SysResourceDto; +import com.sztzjy.resource_center.mapper.SysCaseQuestionMapper; import com.sztzjy.resource_center.mapper.SysResourceAndCourseMapper; import com.sztzjy.resource_center.mapper.SysResourceMapper; import com.sztzjy.resource_center.util.ResultEntity; @@ -38,6 +40,8 @@ public class CourseConfigController { @Autowired private SysResourceAndCourseMapper sysResourceAndCourseMapper; @Autowired + private SysCaseQuestionMapper sysCaseQuestionMapper; + @Autowired private IFileUtil fileUtil; @AnonymousAccess @@ -137,9 +141,21 @@ public class CourseConfigController { @AnonymousAccess @ApiOperation("课程配置删除资源") //只删除绑定关系 @PostMapping("deleteResource") - public ResultEntity deleteResource(@RequestParam String id) { + public ResultEntity deleteResource(@RequestParam String id, + @RequestParam(required = false) String oneId, + @RequestParam(required = false) String twoId, + @RequestParam(required = false) String threeId) { SysResourceAndCourseExample example = new SysResourceAndCourseExample(); - example.createCriteria().andResourceIdEqualTo(id); + SysResourceAndCourseExample.Criteria criteria = example.createCriteria().andResourceIdEqualTo(id); + if (StringUtils.isNotBlank(oneId)) { + criteria.andOneIdEqualTo(oneId); + } + if (StringUtils.isNotBlank(twoId)) { + criteria.andTwoIdEqualTo(twoId); + } + if (StringUtils.isNotBlank(threeId)) { + criteria.andThreeIdEqualTo(threeId); + } try { sysResourceAndCourseMapper.deleteByExample(example); } catch (Exception e) { diff --git a/src/main/java/com/sztzjy/resource_center/controller/KnowledgeSummaryController.java b/src/main/java/com/sztzjy/resource_center/controller/KnowledgeSummaryController.java index 1a3ca1d..b041b3b 100644 --- a/src/main/java/com/sztzjy/resource_center/controller/KnowledgeSummaryController.java +++ b/src/main/java/com/sztzjy/resource_center/controller/KnowledgeSummaryController.java @@ -89,9 +89,22 @@ public class KnowledgeSummaryController { @AnonymousAccess @ApiOperation("知识概要删除绑定关系") @PostMapping("deleteKnowledgeSummaryBind") - public ResultEntity deleteKnowledgeSummaryBind(@RequestParam String id) { + public ResultEntity deleteKnowledgeSummaryBind(@RequestParam String id, + @RequestParam(required = false) String oneId, + @RequestParam(required = false) String twoId, + @RequestParam(required = false) String threeId) { SysKnowledgeAndCourseExample example = new SysKnowledgeAndCourseExample(); - example.createCriteria().andKnowledgeSummaryIdEqualTo(id); + SysKnowledgeAndCourseExample.Criteria criteria = example.createCriteria(); + criteria.andKnowledgeSummaryIdEqualTo(id); + if (StringUtils.isNotBlank(oneId)) { + criteria.andOneIdEqualTo(oneId); + } + if (StringUtils.isNotBlank(twoId)) { + criteria.andTwoIdEqualTo(twoId); + } + if (StringUtils.isNotBlank(threeId)) { + criteria.andThreeIdEqualTo(threeId); + } List sysKnowledgeAndCourses = knowledgeAndCourseMapper.selectByExample(example); if (sysKnowledgeAndCourses == null || sysKnowledgeAndCourses.isEmpty()) { return new ResultEntity<>(HttpStatus.INTERNAL_SERVER_ERROR, "该知识概要暂无绑定关系!"); 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 2bfe3f9..18f2af9 100644 --- a/src/main/java/com/sztzjy/resource_center/controller/TopicResourceController.java +++ b/src/main/java/com/sztzjy/resource_center/controller/TopicResourceController.java @@ -69,12 +69,12 @@ public class TopicResourceController { if (StringUtils.isBlank(objectiveQuestion.getOneID())) { return new ResultEntity<>(HttpStatus.BAD_REQUEST, "所属课程不能为空!"); } - if (objectiveQuestion.getType().equals("1") || objectiveQuestion.getType().equals("2")) { + if (objectiveQuestion.getType().equals("1") || objectiveQuestion.getType().equals("0")) { if (StringUtils.isBlank(objectiveQuestion.getQuestionA()) || StringUtils.isBlank(objectiveQuestion.getQuestionB()) || StringUtils.isBlank(objectiveQuestion.getQuestionC()) || StringUtils.isBlank(objectiveQuestion.getQuestionD())) return new ResultEntity<>(HttpStatus.BAD_REQUEST, "选择题至少有四个选项!"); } - if (objectiveQuestion.getType().equals("1")) { + if (objectiveQuestion.getType().equals("2")) { if (StringUtils.isBlank(objectiveQuestion.getQuestionA()) || StringUtils.isBlank(objectiveQuestion.getQuestionB())) return new ResultEntity<>(HttpStatus.BAD_REQUEST, "判断题必须有两个选项!"); } @@ -140,7 +140,7 @@ public class TopicResourceController { try { sysTopicAndCourseMapper.batchInsert(list); } catch (Exception e) { - return new ResultEntity<>(HttpStatus.BAD_REQUEST, "删除失败,请联系管理员!"); + return new ResultEntity<>(HttpStatus.BAD_REQUEST, "导入失败,请联系管理员!"); } return new ResultEntity<>(HttpStatus.OK, "添加成功!"); } 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 b18c33a..5dd0ae2 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 @@ -9,13 +9,11 @@ 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 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; @@ -24,7 +22,7 @@ import java.util.UUID; @RestController @Api(tags = "课程方面API") -@RequestMapping("api/sys/CaseApi") +@RequestMapping("api/tea/CaseApi") public class CaseApi { @Autowired @@ -44,7 +42,7 @@ public class CaseApi { if (("3").equals(sysCaseQuestion.getType())) { return false; } - if (StringUtils.isBlank(sysCaseQuestion.getOneId())) { //todo 目前二级三级ID可以为空 + if (StringUtils.isBlank(sysCaseQuestion.getOneName())) { //todo 目前二级三级ID可以为空 return false; } if (StringUtils.isBlank(sysCaseQuestion.getContent()) || StringUtils.isBlank(sysCaseQuestion.getTitle())) { @@ -71,10 +69,10 @@ public class CaseApi { sysTopicAndCourse.setId(IdUtil.randomUUID()); sysTopicAndCourse.setTopicType("1"); sysTopicAndCourse.setTopicId(uuid); - SysOneCatalog sysOneCatalogs = getSysOneCatalogs(sysCaseQuestion.getOneId()); //name放在ID传过来 + SysOneCatalog sysOneCatalogs = getSysOneCatalogs(sysCaseQuestion.getOneName()); String oneId = sysOneCatalogs.getOneId(); sysTopicAndCourse.setOneId(oneId); - sysTopicAndCourse.setOneName(sysCaseQuestion.getOneId()); + sysTopicAndCourse.setOneName(sysCaseQuestion.getOneName()); if (StringUtils.isNotBlank(sysCaseQuestion.getTwoId())) { sysTopicAndCourse.setTwoId(sysCaseQuestion.getTwoId()); } @@ -95,53 +93,49 @@ public class CaseApi { //案例题列表查询 schoolId keyword index size systemOwner @AnonymousAccess @ApiOperation("案例题页面查询") - @PostMapping("selectCaseByConditions") - public ResultEntity> selectCaseByConditions(@RequestParam Integer index, - @RequestParam Integer size, - @RequestParam(required = false) String keyword, - @RequestParam(required = false) String systemOwner, - @RequestParam(required = false) String schoolId) { + @PostMapping("selectCaseList") + public PageInfo selectCaseByConditions(@RequestParam Integer index, + @RequestParam Integer size, + @RequestParam(required = false) String keyword, + @RequestParam(required = false) String systemOwner, + @RequestParam(required = false) String schoolId) { PageHelper.startPage(index, size); SysOneCatalog sysOneCatalogs = getSysOneCatalogs(systemOwner); String oneId = sysOneCatalogs.getOneId(); List list = caseQuestionMapper.selectCaseByConditions(keyword, oneId, schoolId); - PageInfo pageInfo = new PageInfo(list); - return new ResultEntity>(pageInfo); + PageInfo pageInfo = new PageInfo(list); + return pageInfo; } //案例题详情查询 caseId @AnonymousAccess @ApiOperation("案例题详细内容展示") - @PostMapping("selectCaseByConditionsByID") - public ResultEntity selectCaseByConditionsByID(@RequestParam String caseId) { - SysCaseQuestion sysCaseQuestion = caseQuestionMapper.selectByPrimaryKey(caseId); - return new ResultEntity(sysCaseQuestion); + @PostMapping("selectCaseDetails") + public SysCaseQuestion selectCaseByConditionsByID(@RequestParam String caseId) { + return caseQuestionMapper.selectByPrimaryKey(caseId); + } //案例题删除 caseId @AnonymousAccess @ApiOperation("案例题删除") //逻辑删除 - @PostMapping("deleteCase") + @PostMapping("caseDelete") public Boolean deleteCase(@RequestParam String caseId) { - List sysTopicAndCourses = getSysTopicAndCourses(caseId); - if (!sysTopicAndCourses.isEmpty()) { - return false; + SysCaseQuestion sysCaseQuestion = caseQuestionMapper.selectByPrimaryKey(caseId); + String source = sysCaseQuestion.getSource(); + //todo 管理员任意删除 老师只能删除自己上传的 + if (!"管理员".equals(source)) { + SysCaseQuestion dataSysCaseQuestion = caseQuestionMapper.selectByPrimaryKey(sysCaseQuestion.getCaseId()); + dataSysCaseQuestion.setUnmountStatus(true); + caseQuestionMapper.updateByPrimaryKey(dataSysCaseQuestion); + return true; } else { - SysCaseQuestion sysCaseQuestion = caseQuestionMapper.selectByPrimaryKey(caseId); - String source = sysCaseQuestion.getSource(); - //todo 管理员任意删除 老师只能删除自己上传的 - if (!"管理员".equals(source)) { - SysCaseQuestion dataSysCaseQuestion = caseQuestionMapper.selectByPrimaryKey(sysCaseQuestion.getCaseId()); - dataSysCaseQuestion.setUnmountStatus(true); - caseQuestionMapper.updateByPrimaryKey(dataSysCaseQuestion); - return true; - } else { - return false; - } + return false; } } + private List getSysTopicAndCourses(String caseId) { SysTopicAndCourseExample example = new SysTopicAndCourseExample(); example.createCriteria().andTopicIdEqualTo(caseId).andTopicTypeEqualTo("1"); @@ -168,20 +162,19 @@ public class CaseApi { //案例题步骤信息查询 caseId @AnonymousAccess @ApiOperation("案例步骤展示") - @PostMapping("selectCaseStep") - public ResultEntity> selectCaseStep(@ApiParam("案例题ID") @RequestParam String caseId) { + @PostMapping("selectCaseStepDetailByCaseId") + public List selectCaseStep(@ApiParam("案例题ID") @RequestParam String caseId) { SysCaseQuestionStepExample example = new SysCaseQuestionStepExample(); example.createCriteria().andCaseIdEqualTo(caseId); example.setOrderByClause("sort ASC"); - List stepList = caseQuestionStepMapper.selectByExampleWithBLOBs(example); - return new ResultEntity<>(stepList); + return caseQuestionStepMapper.selectByExampleWithBLOBs(example); } //案例题步骤新增 SysCaseQuestionStep @AnonymousAccess @ApiOperation("案例题添加步骤") - @PostMapping("insertCaseStepByCaseId") + @PostMapping("insertCaseStep") public Boolean insertCaseStepByCaseId(@RequestBody SysCaseQuestionStepWithBLOBs caseQuestionStep) { if (caseQuestionStep.getCaseId().isEmpty()) { return false; @@ -233,9 +226,8 @@ public class CaseApi { //案例题步骤内容查看 caseStepId @PostMapping("selectCaseStepDetails") @ApiOperation("案例题步骤内容查看") - public ResultEntity selectCaseStepDetails(@ApiParam("案例题步骤ID") @RequestParam String caseStepId) { - SysCaseQuestionStep sysCaseQuestionStep = caseQuestionStepMapper.selectByPrimaryKey(caseStepId); - return new ResultEntity<>(HttpStatus.OK, "案例题步骤内容查看成功", sysCaseQuestionStep); + public SysCaseQuestionStep selectCaseStepDetails(@ApiParam("案例题步骤ID") @RequestParam String caseStepId) { + return caseQuestionStepMapper.selectByPrimaryKey(caseStepId); } } diff --git a/src/main/java/com/sztzjy/resource_center/entity/SysCaseQuestionStepWithBLOBs.java b/src/main/java/com/sztzjy/resource_center/entity/SysCaseQuestionStepWithBLOBs.java index 8f23f0b..c171843 100644 --- a/src/main/java/com/sztzjy/resource_center/entity/SysCaseQuestionStepWithBLOBs.java +++ b/src/main/java/com/sztzjy/resource_center/entity/SysCaseQuestionStepWithBLOBs.java @@ -19,6 +19,9 @@ public class SysCaseQuestionStepWithBLOBs extends SysCaseQuestionStep { @ApiModelProperty("步骤答案") private String answer; + @ApiModelProperty("练习答案") + private String practiceAnswer; + @ApiModelProperty("内容原始数据") private String contentOriginal; @@ -28,6 +31,9 @@ public class SysCaseQuestionStepWithBLOBs extends SysCaseQuestionStep { @ApiModelProperty("答案原始数据") private String answerOriginal; + @ApiModelProperty("练习答案原始数据") + private String practiceAnswerOriginal; + public String getTitle() { return title; } @@ -60,6 +66,14 @@ public class SysCaseQuestionStepWithBLOBs extends SysCaseQuestionStep { this.answer = answer == null ? null : answer.trim(); } + public String getPracticeAnswer() { + return practiceAnswer; + } + + public void setPracticeAnswer(String practiceAnswer) { + this.practiceAnswer = practiceAnswer == null ? null : practiceAnswer.trim(); + } + public String getContentOriginal() { return contentOriginal; } @@ -83,4 +97,12 @@ public class SysCaseQuestionStepWithBLOBs extends SysCaseQuestionStep { public void setAnswerOriginal(String answerOriginal) { this.answerOriginal = answerOriginal == null ? null : answerOriginal.trim(); } + + public String getPracticeAnswerOriginal() { + return practiceAnswerOriginal; + } + + public void setPracticeAnswerOriginal(String practiceAnswerOriginal) { + this.practiceAnswerOriginal = practiceAnswerOriginal == null ? null : practiceAnswerOriginal.trim(); + } } \ No newline at end of file diff --git a/src/main/java/com/sztzjy/resource_center/entity/SysTopicAndCourse.java b/src/main/java/com/sztzjy/resource_center/entity/SysTopicAndCourse.java index 69f8855..afc7967 100644 --- a/src/main/java/com/sztzjy/resource_center/entity/SysTopicAndCourse.java +++ b/src/main/java/com/sztzjy/resource_center/entity/SysTopicAndCourse.java @@ -1,11 +1,14 @@ package com.sztzjy.resource_center.entity; import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + /** * * @author xcj * sys_topic_and_course */ +@Data public class SysTopicAndCourse { private String id; diff --git a/src/main/resources/generatorConfig.xml b/src/main/resources/generatorConfig.xml index 83e804b..c03ffed 100644 --- a/src/main/resources/generatorConfig.xml +++ b/src/main/resources/generatorConfig.xml @@ -41,13 +41,13 @@ - + -
+ diff --git a/src/main/resources/mapper/SysCaseQuestionStepMapper.xml b/src/main/resources/mapper/SysCaseQuestionStepMapper.xml index f7da321..bd76320 100644 --- a/src/main/resources/mapper/SysCaseQuestionStepMapper.xml +++ b/src/main/resources/mapper/SysCaseQuestionStepMapper.xml @@ -12,9 +12,11 @@ + + @@ -78,7 +80,8 @@ case_step_id, case_id, sort, score - title, content, question, answer, content_original, question_original, answer_original + title, content, question, answer, practice_answer, content_original, question_original, + answer_original, practice_answer_original @@ -246,6 +263,9 @@ answer = #{record.answer,jdbcType=LONGVARCHAR}, + + practice_answer = #{record.practiceAnswer,jdbcType=LONGVARCHAR}, + content_original = #{record.contentOriginal,jdbcType=LONGVARCHAR}, @@ -255,6 +275,9 @@ answer_original = #{record.answerOriginal,jdbcType=LONGVARCHAR}, + + practice_answer_original = #{record.practiceAnswerOriginal,jdbcType=LONGVARCHAR}, + @@ -270,9 +293,11 @@ 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} + answer_original = #{record.answerOriginal,jdbcType=LONGVARCHAR}, + practice_answer_original = #{record.practiceAnswerOriginal,jdbcType=LONGVARCHAR} @@ -311,6 +336,9 @@ answer = #{answer,jdbcType=LONGVARCHAR}, + + practice_answer = #{practiceAnswer,jdbcType=LONGVARCHAR}, + content_original = #{contentOriginal,jdbcType=LONGVARCHAR}, @@ -320,6 +348,9 @@ answer_original = #{answerOriginal,jdbcType=LONGVARCHAR}, + + practice_answer_original = #{practiceAnswerOriginal,jdbcType=LONGVARCHAR}, + where case_step_id = #{caseStepId,jdbcType=VARCHAR} @@ -332,9 +363,11 @@ 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} + answer_original = #{answerOriginal,jdbcType=LONGVARCHAR}, + practice_answer_original = #{practiceAnswerOriginal,jdbcType=LONGVARCHAR} where case_step_id = #{caseStepId,jdbcType=VARCHAR} diff --git a/src/main/resources/mapper/SysResourceAndCourseMapper.xml b/src/main/resources/mapper/SysResourceAndCourseMapper.xml index 35f00a7..9703e43 100644 --- a/src/main/resources/mapper/SysResourceAndCourseMapper.xml +++ b/src/main/resources/mapper/SysResourceAndCourseMapper.xml @@ -273,7 +273,7 @@ - INSERT INTO sys_resource_and_course (id, resource_id, one_id, two_id, three_id) + INSERT INTO sys_resource_and_course (id, resource_id, one_id, two_id, three_id,one_name,two_name,three_name) VALUES ( @@ -281,7 +281,10 @@ #{resourceAndCourse.resourceId}, #{resourceAndCourse.oneId}, #{resourceAndCourse.twoId}, - #{resourceAndCourse.threeId} + #{resourceAndCourse.threeId}, + #{resourceAndCourse.oneName}, + #{resourceAndCourse.twoName}, + #{resourceAndCourse.threeName} ) diff --git a/src/main/resources/mapper/SysResourceMapper.xml b/src/main/resources/mapper/SysResourceMapper.xml index 69d886b..c5b14ef 100644 --- a/src/main/resources/mapper/SysResourceMapper.xml +++ b/src/main/resources/mapper/SysResourceMapper.xml @@ -374,11 +374,11 @@ - + - + + select + + distinct + + + from sys_topic_and_course + + + + + order by ${orderByClause} + + + + + delete + from sys_topic_and_course + where id = #{id,jdbcType=VARCHAR} + + + delete from sys_topic_and_course + + - - - - - id, topic_id, one_id, one_name, two_id, two_name, three_id, three_name, topic_type - - - - - delete from sys_topic_and_course - where id = #{id,jdbcType=VARCHAR} - - - delete from sys_topic_and_course - - - - - - insert into sys_topic_and_course (id, topic_id, one_id, - one_name, two_id, two_name, - three_id, three_name, topic_type - ) - values (#{id,jdbcType=VARCHAR}, #{topicId,jdbcType=VARCHAR}, #{oneId,jdbcType=VARCHAR}, - #{oneName,jdbcType=VARCHAR}, #{twoId,jdbcType=VARCHAR}, #{twoName,jdbcType=VARCHAR}, - #{threeId,jdbcType=VARCHAR}, #{threeName,jdbcType=VARCHAR}, #{topicType,jdbcType=VARCHAR} - ) - - - insert into sys_topic_and_course - - - id, - - - topic_id, - - - one_id, - - - one_name, - - - two_id, - - - two_name, - - - three_id, - - - three_name, - - - topic_type, - - - - - #{id,jdbcType=VARCHAR}, - - - #{topicId,jdbcType=VARCHAR}, - - - #{oneId,jdbcType=VARCHAR}, - - - #{oneName,jdbcType=VARCHAR}, - - - #{twoId,jdbcType=VARCHAR}, - - - #{twoName,jdbcType=VARCHAR}, - - - #{threeId,jdbcType=VARCHAR}, - - - #{threeName,jdbcType=VARCHAR}, - - - #{topicType,jdbcType=VARCHAR}, - - - - - - update sys_topic_and_course - - - id = #{record.id,jdbcType=VARCHAR}, - - + + + insert into sys_topic_and_course (id, topic_id, one_id, + one_name, two_id, two_name, + three_id, three_name, topic_type) + values (#{id,jdbcType=VARCHAR}, #{topicId,jdbcType=VARCHAR}, #{oneId,jdbcType=VARCHAR}, + #{oneName,jdbcType=VARCHAR}, #{twoId,jdbcType=VARCHAR}, #{twoName,jdbcType=VARCHAR}, + #{threeId,jdbcType=VARCHAR}, #{threeName,jdbcType=VARCHAR}, #{topicType,jdbcType=VARCHAR}) + + + insert into sys_topic_and_course + + + id, + + + topic_id, + + + one_id, + + + one_name, + + + two_id, + + + two_name, + + + three_id, + + + three_name, + + + topic_type, + + + + + #{id,jdbcType=VARCHAR}, + + + #{topicId,jdbcType=VARCHAR}, + + + #{oneId,jdbcType=VARCHAR}, + + + #{oneName,jdbcType=VARCHAR}, + + + #{twoId,jdbcType=VARCHAR}, + + + #{twoName,jdbcType=VARCHAR}, + + + #{threeId,jdbcType=VARCHAR}, + + + #{threeName,jdbcType=VARCHAR}, + + + #{topicType,jdbcType=VARCHAR}, + + + + + + update sys_topic_and_course + + + id = #{record.id,jdbcType=VARCHAR}, + + + topic_id = #{record.topicId,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}, + + + topic_type = #{record.topicType,jdbcType=VARCHAR}, + + + + + + + + update sys_topic_and_course + set id = #{record.id,jdbcType=VARCHAR}, topic_id = #{record.topicId,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}, - - - topic_type = #{record.topicType,jdbcType=VARCHAR}, - - - - - - - - update sys_topic_and_course - set id = #{record.id,jdbcType=VARCHAR}, - topic_id = #{record.topicId,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}, - topic_type = #{record.topicType,jdbcType=VARCHAR} - - - - - - update sys_topic_and_course - - - topic_id = #{topicId,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}, - - - topic_type = #{topicType,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update sys_topic_and_course - set topic_id = #{topicId,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}, - topic_type = #{topicType,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - INSERT INTO sys_resource_and_course (id, topic_id, one_id, two_id, three_id, topic_type) - VALUES - - ( - #{topic.id}, - #{topic.topic_id}, - #{topic.topicType}, - #{topic.oneId}, - #{topic.oneName}, - #{topic.twoId} - #{topic.threeId} - #{topic.twoName} - #{topic.threeName} - ) - - + topic_type = #{record.topicType,jdbcType=VARCHAR} + + + + + + update sys_topic_and_course + + + topic_id = #{topicId,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}, + + + topic_type = #{topicType,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=VARCHAR} + + + update sys_topic_and_course + set topic_id = #{topicId,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}, + topic_type = #{topicType,jdbcType=VARCHAR} + where id = #{id,jdbcType=VARCHAR} + + + + INSERT INTO sys_topic_and_course (id, topic_id, one_id,one_name, two_id,two_name, three_id, + three_name,topic_type) + VALUES + + ( + #{topic.id}, + #{topic.topicId}, + #{topic.oneId}, + #{topic.oneName}, + #{topic.twoId}, + #{topic.twoName}, + #{topic.threeId}, + #{topic.threeName}, + #{topic.topicType} + ) + + \ No newline at end of file