新增三方接口

master
xiaoCJ 8 months ago
parent 6b35c97fb0
commit dfcb513a1b

@ -4,10 +4,12 @@ import cn.hutool.core.util.IdUtil;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.sztzjy.resource_center.annotation.AnonymousAccess; 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.SysResource;
import com.sztzjy.resource_center.entity.SysResourceAndCourse; import com.sztzjy.resource_center.entity.SysResourceAndCourse;
import com.sztzjy.resource_center.entity.SysResourceAndCourseExample; import com.sztzjy.resource_center.entity.SysResourceAndCourseExample;
import com.sztzjy.resource_center.entity.dto.SysResourceDto; 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.SysResourceAndCourseMapper;
import com.sztzjy.resource_center.mapper.SysResourceMapper; import com.sztzjy.resource_center.mapper.SysResourceMapper;
import com.sztzjy.resource_center.util.ResultEntity; import com.sztzjy.resource_center.util.ResultEntity;
@ -38,6 +40,8 @@ public class CourseConfigController {
@Autowired @Autowired
private SysResourceAndCourseMapper sysResourceAndCourseMapper; private SysResourceAndCourseMapper sysResourceAndCourseMapper;
@Autowired @Autowired
private SysCaseQuestionMapper sysCaseQuestionMapper;
@Autowired
private IFileUtil fileUtil; private IFileUtil fileUtil;
@AnonymousAccess @AnonymousAccess
@ -137,9 +141,21 @@ public class CourseConfigController {
@AnonymousAccess @AnonymousAccess
@ApiOperation("课程配置删除资源") //只删除绑定关系 @ApiOperation("课程配置删除资源") //只删除绑定关系
@PostMapping("deleteResource") @PostMapping("deleteResource")
public ResultEntity<String> deleteResource(@RequestParam String id) { public ResultEntity<String> deleteResource(@RequestParam String id,
@RequestParam(required = false) String oneId,
@RequestParam(required = false) String twoId,
@RequestParam(required = false) String threeId) {
SysResourceAndCourseExample example = new SysResourceAndCourseExample(); 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 { try {
sysResourceAndCourseMapper.deleteByExample(example); sysResourceAndCourseMapper.deleteByExample(example);
} catch (Exception e) { } catch (Exception e) {

@ -89,9 +89,22 @@ public class KnowledgeSummaryController {
@AnonymousAccess @AnonymousAccess
@ApiOperation("知识概要删除绑定关系") @ApiOperation("知识概要删除绑定关系")
@PostMapping("deleteKnowledgeSummaryBind") @PostMapping("deleteKnowledgeSummaryBind")
public ResultEntity<String> deleteKnowledgeSummaryBind(@RequestParam String id) { public ResultEntity<String> deleteKnowledgeSummaryBind(@RequestParam String id,
@RequestParam(required = false) String oneId,
@RequestParam(required = false) String twoId,
@RequestParam(required = false) String threeId) {
SysKnowledgeAndCourseExample example = new SysKnowledgeAndCourseExample(); 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<SysKnowledgeAndCourse> sysKnowledgeAndCourses = knowledgeAndCourseMapper.selectByExample(example); List<SysKnowledgeAndCourse> sysKnowledgeAndCourses = knowledgeAndCourseMapper.selectByExample(example);
if (sysKnowledgeAndCourses == null || sysKnowledgeAndCourses.isEmpty()) { if (sysKnowledgeAndCourses == null || sysKnowledgeAndCourses.isEmpty()) {
return new ResultEntity<>(HttpStatus.INTERNAL_SERVER_ERROR, "该知识概要暂无绑定关系!"); return new ResultEntity<>(HttpStatus.INTERNAL_SERVER_ERROR, "该知识概要暂无绑定关系!");

@ -69,12 +69,12 @@ public class TopicResourceController {
if (StringUtils.isBlank(objectiveQuestion.getOneID())) { if (StringUtils.isBlank(objectiveQuestion.getOneID())) {
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "所属课程不能为空!"); 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()) if (StringUtils.isBlank(objectiveQuestion.getQuestionA()) || StringUtils.isBlank(objectiveQuestion.getQuestionB())
|| StringUtils.isBlank(objectiveQuestion.getQuestionC()) || StringUtils.isBlank(objectiveQuestion.getQuestionD())) || StringUtils.isBlank(objectiveQuestion.getQuestionC()) || StringUtils.isBlank(objectiveQuestion.getQuestionD()))
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "选择题至少有四个选项!"); 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())) if (StringUtils.isBlank(objectiveQuestion.getQuestionA()) || StringUtils.isBlank(objectiveQuestion.getQuestionB()))
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "判断题必须有两个选项!"); return new ResultEntity<>(HttpStatus.BAD_REQUEST, "判断题必须有两个选项!");
} }
@ -140,7 +140,7 @@ public class TopicResourceController {
try { try {
sysTopicAndCourseMapper.batchInsert(list); sysTopicAndCourseMapper.batchInsert(list);
} catch (Exception e) { } catch (Exception e) {
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "删除失败,请联系管理员!"); return new ResultEntity<>(HttpStatus.BAD_REQUEST, "导入失败,请联系管理员!");
} }
return new ResultEntity<>(HttpStatus.OK, "添加成功!"); return new ResultEntity<>(HttpStatus.OK, "添加成功!");
} }

@ -9,13 +9,11 @@ import com.sztzjy.resource_center.mapper.SysCaseQuestionMapper;
import com.sztzjy.resource_center.mapper.SysCaseQuestionStepMapper; import com.sztzjy.resource_center.mapper.SysCaseQuestionStepMapper;
import com.sztzjy.resource_center.mapper.SysOneCatalogMapper; import com.sztzjy.resource_center.mapper.SysOneCatalogMapper;
import com.sztzjy.resource_center.mapper.SysTopicAndCourseMapper; import com.sztzjy.resource_center.mapper.SysTopicAndCourseMapper;
import com.sztzjy.resource_center.util.ResultEntity;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.Date; import java.util.Date;
@ -24,7 +22,7 @@ import java.util.UUID;
@RestController @RestController
@Api(tags = "课程方面API") @Api(tags = "课程方面API")
@RequestMapping("api/sys/CaseApi") @RequestMapping("api/tea/CaseApi")
public class CaseApi { public class CaseApi {
@Autowired @Autowired
@ -44,7 +42,7 @@ public class CaseApi {
if (("3").equals(sysCaseQuestion.getType())) { if (("3").equals(sysCaseQuestion.getType())) {
return false; return false;
} }
if (StringUtils.isBlank(sysCaseQuestion.getOneId())) { //todo 目前二级三级ID可以为空 if (StringUtils.isBlank(sysCaseQuestion.getOneName())) { //todo 目前二级三级ID可以为空
return false; return false;
} }
if (StringUtils.isBlank(sysCaseQuestion.getContent()) || StringUtils.isBlank(sysCaseQuestion.getTitle())) { if (StringUtils.isBlank(sysCaseQuestion.getContent()) || StringUtils.isBlank(sysCaseQuestion.getTitle())) {
@ -71,10 +69,10 @@ public class CaseApi {
sysTopicAndCourse.setId(IdUtil.randomUUID()); sysTopicAndCourse.setId(IdUtil.randomUUID());
sysTopicAndCourse.setTopicType("1"); sysTopicAndCourse.setTopicType("1");
sysTopicAndCourse.setTopicId(uuid); sysTopicAndCourse.setTopicId(uuid);
SysOneCatalog sysOneCatalogs = getSysOneCatalogs(sysCaseQuestion.getOneId()); //name放在ID传过来 SysOneCatalog sysOneCatalogs = getSysOneCatalogs(sysCaseQuestion.getOneName());
String oneId = sysOneCatalogs.getOneId(); String oneId = sysOneCatalogs.getOneId();
sysTopicAndCourse.setOneId(oneId); sysTopicAndCourse.setOneId(oneId);
sysTopicAndCourse.setOneName(sysCaseQuestion.getOneId()); sysTopicAndCourse.setOneName(sysCaseQuestion.getOneName());
if (StringUtils.isNotBlank(sysCaseQuestion.getTwoId())) { if (StringUtils.isNotBlank(sysCaseQuestion.getTwoId())) {
sysTopicAndCourse.setTwoId(sysCaseQuestion.getTwoId()); sysTopicAndCourse.setTwoId(sysCaseQuestion.getTwoId());
} }
@ -95,53 +93,49 @@ public class CaseApi {
//案例题列表查询 schoolId keyword index size systemOwner //案例题列表查询 schoolId keyword index size systemOwner
@AnonymousAccess @AnonymousAccess
@ApiOperation("案例题页面查询") @ApiOperation("案例题页面查询")
@PostMapping("selectCaseByConditions") @PostMapping("selectCaseList")
public ResultEntity<PageInfo<SysCaseQuestion>> selectCaseByConditions(@RequestParam Integer index, public PageInfo<SysCaseQuestion> selectCaseByConditions(@RequestParam Integer index,
@RequestParam Integer size, @RequestParam Integer size,
@RequestParam(required = false) String keyword, @RequestParam(required = false) String keyword,
@RequestParam(required = false) String systemOwner, @RequestParam(required = false) String systemOwner,
@RequestParam(required = false) String schoolId) { @RequestParam(required = false) String schoolId) {
PageHelper.startPage(index, size); PageHelper.startPage(index, size);
SysOneCatalog sysOneCatalogs = getSysOneCatalogs(systemOwner); SysOneCatalog sysOneCatalogs = getSysOneCatalogs(systemOwner);
String oneId = sysOneCatalogs.getOneId(); String oneId = sysOneCatalogs.getOneId();
List<SysCaseQuestion> list = caseQuestionMapper.selectCaseByConditions(keyword, oneId, schoolId); List<SysCaseQuestion> list = caseQuestionMapper.selectCaseByConditions(keyword, oneId, schoolId);
PageInfo pageInfo = new PageInfo<SysCaseQuestion>(list); PageInfo<SysCaseQuestion> pageInfo = new PageInfo<SysCaseQuestion>(list);
return new ResultEntity<PageInfo<SysCaseQuestion>>(pageInfo); return pageInfo;
} }
//案例题详情查询 caseId //案例题详情查询 caseId
@AnonymousAccess @AnonymousAccess
@ApiOperation("案例题详细内容展示") @ApiOperation("案例题详细内容展示")
@PostMapping("selectCaseByConditionsByID") @PostMapping("selectCaseDetails")
public ResultEntity<SysCaseQuestion> selectCaseByConditionsByID(@RequestParam String caseId) { public SysCaseQuestion selectCaseByConditionsByID(@RequestParam String caseId) {
SysCaseQuestion sysCaseQuestion = caseQuestionMapper.selectByPrimaryKey(caseId); return caseQuestionMapper.selectByPrimaryKey(caseId);
return new ResultEntity<SysCaseQuestion>(sysCaseQuestion);
} }
//案例题删除 caseId //案例题删除 caseId
@AnonymousAccess @AnonymousAccess
@ApiOperation("案例题删除") //逻辑删除 @ApiOperation("案例题删除") //逻辑删除
@PostMapping("deleteCase") @PostMapping("caseDelete")
public Boolean deleteCase(@RequestParam String caseId) { public Boolean deleteCase(@RequestParam String caseId) {
List<SysTopicAndCourse> sysTopicAndCourses = getSysTopicAndCourses(caseId); SysCaseQuestion sysCaseQuestion = caseQuestionMapper.selectByPrimaryKey(caseId);
if (!sysTopicAndCourses.isEmpty()) { String source = sysCaseQuestion.getSource();
return false; //todo 管理员任意删除 老师只能删除自己上传的
if (!"管理员".equals(source)) {
SysCaseQuestion dataSysCaseQuestion = caseQuestionMapper.selectByPrimaryKey(sysCaseQuestion.getCaseId());
dataSysCaseQuestion.setUnmountStatus(true);
caseQuestionMapper.updateByPrimaryKey(dataSysCaseQuestion);
return true;
} else { } else {
SysCaseQuestion sysCaseQuestion = caseQuestionMapper.selectByPrimaryKey(caseId); return false;
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;
}
} }
} }
private List<SysTopicAndCourse> getSysTopicAndCourses(String caseId) { private List<SysTopicAndCourse> getSysTopicAndCourses(String caseId) {
SysTopicAndCourseExample example = new SysTopicAndCourseExample(); SysTopicAndCourseExample example = new SysTopicAndCourseExample();
example.createCriteria().andTopicIdEqualTo(caseId).andTopicTypeEqualTo("1"); example.createCriteria().andTopicIdEqualTo(caseId).andTopicTypeEqualTo("1");
@ -168,20 +162,19 @@ public class CaseApi {
//案例题步骤信息查询 caseId //案例题步骤信息查询 caseId
@AnonymousAccess @AnonymousAccess
@ApiOperation("案例步骤展示") @ApiOperation("案例步骤展示")
@PostMapping("selectCaseStep") @PostMapping("selectCaseStepDetailByCaseId")
public ResultEntity<List<SysCaseQuestionStepWithBLOBs>> selectCaseStep(@ApiParam("案例题ID") @RequestParam String caseId) { public List<SysCaseQuestionStepWithBLOBs> selectCaseStep(@ApiParam("案例题ID") @RequestParam String caseId) {
SysCaseQuestionStepExample example = new SysCaseQuestionStepExample(); SysCaseQuestionStepExample example = new SysCaseQuestionStepExample();
example.createCriteria().andCaseIdEqualTo(caseId); example.createCriteria().andCaseIdEqualTo(caseId);
example.setOrderByClause("sort ASC"); example.setOrderByClause("sort ASC");
List<SysCaseQuestionStepWithBLOBs> stepList = caseQuestionStepMapper.selectByExampleWithBLOBs(example); return caseQuestionStepMapper.selectByExampleWithBLOBs(example);
return new ResultEntity<>(stepList);
} }
//案例题步骤新增 SysCaseQuestionStep //案例题步骤新增 SysCaseQuestionStep
@AnonymousAccess @AnonymousAccess
@ApiOperation("案例题添加步骤") @ApiOperation("案例题添加步骤")
@PostMapping("insertCaseStepByCaseId") @PostMapping("insertCaseStep")
public Boolean insertCaseStepByCaseId(@RequestBody SysCaseQuestionStepWithBLOBs caseQuestionStep) { public Boolean insertCaseStepByCaseId(@RequestBody SysCaseQuestionStepWithBLOBs caseQuestionStep) {
if (caseQuestionStep.getCaseId().isEmpty()) { if (caseQuestionStep.getCaseId().isEmpty()) {
return false; return false;
@ -233,9 +226,8 @@ public class CaseApi {
//案例题步骤内容查看 caseStepId //案例题步骤内容查看 caseStepId
@PostMapping("selectCaseStepDetails") @PostMapping("selectCaseStepDetails")
@ApiOperation("案例题步骤内容查看") @ApiOperation("案例题步骤内容查看")
public ResultEntity<SysCaseQuestionStep> selectCaseStepDetails(@ApiParam("案例题步骤ID") @RequestParam String caseStepId) { public SysCaseQuestionStep selectCaseStepDetails(@ApiParam("案例题步骤ID") @RequestParam String caseStepId) {
SysCaseQuestionStep sysCaseQuestionStep = caseQuestionStepMapper.selectByPrimaryKey(caseStepId); return caseQuestionStepMapper.selectByPrimaryKey(caseStepId);
return new ResultEntity<>(HttpStatus.OK, "案例题步骤内容查看成功", sysCaseQuestionStep);
} }
} }

@ -19,6 +19,9 @@ public class SysCaseQuestionStepWithBLOBs extends SysCaseQuestionStep {
@ApiModelProperty("步骤答案") @ApiModelProperty("步骤答案")
private String answer; private String answer;
@ApiModelProperty("练习答案")
private String practiceAnswer;
@ApiModelProperty("内容原始数据") @ApiModelProperty("内容原始数据")
private String contentOriginal; private String contentOriginal;
@ -28,6 +31,9 @@ public class SysCaseQuestionStepWithBLOBs extends SysCaseQuestionStep {
@ApiModelProperty("答案原始数据") @ApiModelProperty("答案原始数据")
private String answerOriginal; private String answerOriginal;
@ApiModelProperty("练习答案原始数据")
private String practiceAnswerOriginal;
public String getTitle() { public String getTitle() {
return title; return title;
} }
@ -60,6 +66,14 @@ public class SysCaseQuestionStepWithBLOBs extends SysCaseQuestionStep {
this.answer = answer == null ? null : answer.trim(); 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() { public String getContentOriginal() {
return contentOriginal; return contentOriginal;
} }
@ -83,4 +97,12 @@ public class SysCaseQuestionStepWithBLOBs extends SysCaseQuestionStep {
public void setAnswerOriginal(String answerOriginal) { public void setAnswerOriginal(String answerOriginal) {
this.answerOriginal = answerOriginal == null ? null : answerOriginal.trim(); this.answerOriginal = answerOriginal == null ? null : answerOriginal.trim();
} }
public String getPracticeAnswerOriginal() {
return practiceAnswerOriginal;
}
public void setPracticeAnswerOriginal(String practiceAnswerOriginal) {
this.practiceAnswerOriginal = practiceAnswerOriginal == null ? null : practiceAnswerOriginal.trim();
}
} }

@ -1,11 +1,14 @@
package com.sztzjy.resource_center.entity; package com.sztzjy.resource_center.entity;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/** /**
* *
* @author xcj * @author xcj
* sys_topic_and_course * sys_topic_and_course
*/ */
@Data
public class SysTopicAndCourse { public class SysTopicAndCourse {
private String id; private String id;

@ -41,13 +41,13 @@
</javaClientGenerator> </javaClientGenerator>
<!-- 需要生成的表 --> <!-- 需要生成的表 -->
<!-- <table tableName="sys_case_questions" domainObjectName="SysCaseQuestion" />--> <!-- <table tableName="sys_case_questions" domainObjectName="SysCaseQuestion" />-->
<!-- <table tableName="sys_case_question_steps" domainObjectName="SysCaseQuestionStep" />--> <table tableName="sys_case_question_steps" domainObjectName="SysCaseQuestionStep" />
<!-- <table tableName="sys_model" domainObjectName="SysModel" />--> <!-- <table tableName="sys_model" domainObjectName="SysModel" />-->
<!-- <table tableName="sys_model_question" domainObjectName="SysModelQuestion" />--> <!-- <table tableName="sys_model_question" domainObjectName="SysModelQuestion" />-->
<!-- <table tableName="sys_objective_questions" domainObjectName="SysObjectiveQuestions" />--> <!-- <table tableName="sys_objective_questions" domainObjectName="SysObjectiveQuestions" />-->
<!-- <table tableName="sys_one_catalog" domainObjectName="SysOneCatalog" />--> <!-- <table tableName="sys_one_catalog" domainObjectName="SysOneCatalog" />-->
<!-- <table tableName="sys_resource" domainObjectName="SysResource" />--> <!-- <table tableName="sys_resource" domainObjectName="SysResource" />-->
<table tableName="sys_resource_and_course" domainObjectName="SysResourceAndCourse" /> <!-- <table tableName="sys_resource_and_course" domainObjectName="SysResourceAndCourse" />-->
<!-- <table tableName="sys_resource_data" domainObjectName="SysResourceData" />--> <!-- <table tableName="sys_resource_data" domainObjectName="SysResourceData" />-->
<!-- <table tableName="sys_school" domainObjectName="SysSchool" />--> <!-- <table tableName="sys_school" domainObjectName="SysSchool" />-->
<!-- <table tableName="sys_three_catalog" domainObjectName="SysThreeCatalog" />--> <!-- <table tableName="sys_three_catalog" domainObjectName="SysThreeCatalog" />-->

@ -12,9 +12,11 @@
<result column="content" jdbcType="LONGVARCHAR" property="content" /> <result column="content" jdbcType="LONGVARCHAR" property="content" />
<result column="question" jdbcType="LONGVARCHAR" property="question" /> <result column="question" jdbcType="LONGVARCHAR" property="question" />
<result column="answer" jdbcType="LONGVARCHAR" property="answer" /> <result column="answer" jdbcType="LONGVARCHAR" property="answer" />
<result column="practice_answer" jdbcType="LONGVARCHAR" property="practiceAnswer" />
<result column="content_original" jdbcType="LONGVARCHAR" property="contentOriginal" /> <result column="content_original" jdbcType="LONGVARCHAR" property="contentOriginal" />
<result column="question_original" jdbcType="LONGVARCHAR" property="questionOriginal" /> <result column="question_original" jdbcType="LONGVARCHAR" property="questionOriginal" />
<result column="answer_original" jdbcType="LONGVARCHAR" property="answerOriginal" /> <result column="answer_original" jdbcType="LONGVARCHAR" property="answerOriginal" />
<result column="practice_answer_original" jdbcType="LONGVARCHAR" property="practiceAnswerOriginal" />
</resultMap> </resultMap>
<sql id="Example_Where_Clause"> <sql id="Example_Where_Clause">
<where> <where>
@ -78,7 +80,8 @@
case_step_id, case_id, sort, score case_step_id, case_id, sort, score
</sql> </sql>
<sql id="Blob_Column_List"> <sql id="Blob_Column_List">
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
</sql> </sql>
<select id="selectByExampleWithBLOBs" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestionStepExample" resultMap="ResultMapWithBLOBs"> <select id="selectByExampleWithBLOBs" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestionStepExample" resultMap="ResultMapWithBLOBs">
select select
@ -131,13 +134,15 @@
<insert id="insert" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestionStepWithBLOBs"> <insert id="insert" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestionStepWithBLOBs">
insert into sys_case_question_steps (case_step_id, case_id, sort, insert into sys_case_question_steps (case_step_id, case_id, sort,
score, title, content, score, title, content,
question, answer, content_original, question, answer, practice_answer,
question_original, answer_original content_original, question_original,
answer_original, practice_answer_original
) )
values (#{caseStepId,jdbcType=VARCHAR}, #{caseId,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER}, values (#{caseStepId,jdbcType=VARCHAR}, #{caseId,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER},
#{score,jdbcType=DECIMAL}, #{title,jdbcType=LONGVARCHAR}, #{content,jdbcType=LONGVARCHAR}, #{score,jdbcType=DECIMAL}, #{title,jdbcType=LONGVARCHAR}, #{content,jdbcType=LONGVARCHAR},
#{question,jdbcType=LONGVARCHAR}, #{answer,jdbcType=LONGVARCHAR}, #{contentOriginal,jdbcType=LONGVARCHAR}, #{question,jdbcType=LONGVARCHAR}, #{answer,jdbcType=LONGVARCHAR}, #{practiceAnswer,jdbcType=LONGVARCHAR},
#{questionOriginal,jdbcType=LONGVARCHAR}, #{answerOriginal,jdbcType=LONGVARCHAR} #{contentOriginal,jdbcType=LONGVARCHAR}, #{questionOriginal,jdbcType=LONGVARCHAR},
#{answerOriginal,jdbcType=LONGVARCHAR}, #{practiceAnswerOriginal,jdbcType=LONGVARCHAR}
) )
</insert> </insert>
<insert id="insertSelective" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestionStepWithBLOBs"> <insert id="insertSelective" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestionStepWithBLOBs">
@ -167,6 +172,9 @@
<if test="answer != null"> <if test="answer != null">
answer, answer,
</if> </if>
<if test="practiceAnswer != null">
practice_answer,
</if>
<if test="contentOriginal != null"> <if test="contentOriginal != null">
content_original, content_original,
</if> </if>
@ -176,6 +184,9 @@
<if test="answerOriginal != null"> <if test="answerOriginal != null">
answer_original, answer_original,
</if> </if>
<if test="practiceAnswerOriginal != null">
practice_answer_original,
</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="caseStepId != null"> <if test="caseStepId != null">
@ -202,6 +213,9 @@
<if test="answer != null"> <if test="answer != null">
#{answer,jdbcType=LONGVARCHAR}, #{answer,jdbcType=LONGVARCHAR},
</if> </if>
<if test="practiceAnswer != null">
#{practiceAnswer,jdbcType=LONGVARCHAR},
</if>
<if test="contentOriginal != null"> <if test="contentOriginal != null">
#{contentOriginal,jdbcType=LONGVARCHAR}, #{contentOriginal,jdbcType=LONGVARCHAR},
</if> </if>
@ -211,6 +225,9 @@
<if test="answerOriginal != null"> <if test="answerOriginal != null">
#{answerOriginal,jdbcType=LONGVARCHAR}, #{answerOriginal,jdbcType=LONGVARCHAR},
</if> </if>
<if test="practiceAnswerOriginal != null">
#{practiceAnswerOriginal,jdbcType=LONGVARCHAR},
</if>
</trim> </trim>
</insert> </insert>
<select id="countByExample" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestionStepExample" resultType="java.lang.Long"> <select id="countByExample" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestionStepExample" resultType="java.lang.Long">
@ -246,6 +263,9 @@
<if test="record.answer != null"> <if test="record.answer != null">
answer = #{record.answer,jdbcType=LONGVARCHAR}, answer = #{record.answer,jdbcType=LONGVARCHAR},
</if> </if>
<if test="record.practiceAnswer != null">
practice_answer = #{record.practiceAnswer,jdbcType=LONGVARCHAR},
</if>
<if test="record.contentOriginal != null"> <if test="record.contentOriginal != null">
content_original = #{record.contentOriginal,jdbcType=LONGVARCHAR}, content_original = #{record.contentOriginal,jdbcType=LONGVARCHAR},
</if> </if>
@ -255,6 +275,9 @@
<if test="record.answerOriginal != null"> <if test="record.answerOriginal != null">
answer_original = #{record.answerOriginal,jdbcType=LONGVARCHAR}, answer_original = #{record.answerOriginal,jdbcType=LONGVARCHAR},
</if> </if>
<if test="record.practiceAnswerOriginal != null">
practice_answer_original = #{record.practiceAnswerOriginal,jdbcType=LONGVARCHAR},
</if>
</set> </set>
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
@ -270,9 +293,11 @@
content = #{record.content,jdbcType=LONGVARCHAR}, content = #{record.content,jdbcType=LONGVARCHAR},
question = #{record.question,jdbcType=LONGVARCHAR}, question = #{record.question,jdbcType=LONGVARCHAR},
answer = #{record.answer,jdbcType=LONGVARCHAR}, answer = #{record.answer,jdbcType=LONGVARCHAR},
practice_answer = #{record.practiceAnswer,jdbcType=LONGVARCHAR},
content_original = #{record.contentOriginal,jdbcType=LONGVARCHAR}, content_original = #{record.contentOriginal,jdbcType=LONGVARCHAR},
question_original = #{record.questionOriginal,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}
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
</if> </if>
@ -311,6 +336,9 @@
<if test="answer != null"> <if test="answer != null">
answer = #{answer,jdbcType=LONGVARCHAR}, answer = #{answer,jdbcType=LONGVARCHAR},
</if> </if>
<if test="practiceAnswer != null">
practice_answer = #{practiceAnswer,jdbcType=LONGVARCHAR},
</if>
<if test="contentOriginal != null"> <if test="contentOriginal != null">
content_original = #{contentOriginal,jdbcType=LONGVARCHAR}, content_original = #{contentOriginal,jdbcType=LONGVARCHAR},
</if> </if>
@ -320,6 +348,9 @@
<if test="answerOriginal != null"> <if test="answerOriginal != null">
answer_original = #{answerOriginal,jdbcType=LONGVARCHAR}, answer_original = #{answerOriginal,jdbcType=LONGVARCHAR},
</if> </if>
<if test="practiceAnswerOriginal != null">
practice_answer_original = #{practiceAnswerOriginal,jdbcType=LONGVARCHAR},
</if>
</set> </set>
where case_step_id = #{caseStepId,jdbcType=VARCHAR} where case_step_id = #{caseStepId,jdbcType=VARCHAR}
</update> </update>
@ -332,9 +363,11 @@
content = #{content,jdbcType=LONGVARCHAR}, content = #{content,jdbcType=LONGVARCHAR},
question = #{question,jdbcType=LONGVARCHAR}, question = #{question,jdbcType=LONGVARCHAR},
answer = #{answer,jdbcType=LONGVARCHAR}, answer = #{answer,jdbcType=LONGVARCHAR},
practice_answer = #{practiceAnswer,jdbcType=LONGVARCHAR},
content_original = #{contentOriginal,jdbcType=LONGVARCHAR}, content_original = #{contentOriginal,jdbcType=LONGVARCHAR},
question_original = #{questionOriginal,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} where case_step_id = #{caseStepId,jdbcType=VARCHAR}
</update> </update>
<update id="updateByPrimaryKey" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestionStep"> <update id="updateByPrimaryKey" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestionStep">

@ -273,7 +273,7 @@
<!-- 批量新增 --> <!-- 批量新增 -->
<insert id="batchInsert" parameterType="java.util.List"> <insert id="batchInsert" parameterType="java.util.List">
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 VALUES
<foreach collection="resourceAndCourses" item="resourceAndCourse" separator=","> <foreach collection="resourceAndCourses" item="resourceAndCourse" separator=",">
( (
@ -281,7 +281,10 @@
#{resourceAndCourse.resourceId}, #{resourceAndCourse.resourceId},
#{resourceAndCourse.oneId}, #{resourceAndCourse.oneId},
#{resourceAndCourse.twoId}, #{resourceAndCourse.twoId},
#{resourceAndCourse.threeId} #{resourceAndCourse.threeId},
#{resourceAndCourse.oneName},
#{resourceAndCourse.twoName},
#{resourceAndCourse.threeName}
) )
</foreach> </foreach>
</insert> </insert>

@ -374,11 +374,11 @@
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/> <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
</resultMap> </resultMap>
<!--重复 join--> <!--重复-->
<select id="selectResourceByRepeat" parameterType="java.lang.String" resultMap="DtoMap"> <select id="selectResourceByRepeat" parameterType="java.lang.String" resultMap="DtoMap">
SELECT sc.*,sr.resource_name,sr.url,sr.picture_url,sr.resource_type,sr.source,sr.status,sr.create_time SELECT sc.one_id,sc.two_id,sc.three_id,sc.one_name,sc.two_name,sc.three_name,sr.resource_name,sr.resource_id,sr.url,sr.picture_url,sr.resource_type,sr.source,sr.status,sr.create_time
FROM sys_resource sr FROM sys_resource sr
JOIN left JOIN
sys_resource_and_course sc sys_resource_and_course sc
on sr.resource_id =sc.resource_id on sr.resource_id =sc.resource_id
<where> <where>
@ -398,9 +398,9 @@
order by sr.create_time order by sr.create_time
</select> </select>
<!--不重复 leftjoin--> <!--不重复-->
<select id="selectResource" parameterType="java.lang.String" resultMap="DtoMap"> <select id="selectResource" parameterType="java.lang.String" resultMap="DtoMap">
SELECT sc.*,sr.resource_name,sr.url,sr.picture_url,sr.resource_type,sr.source,sr.status,sr.create_time SELECT DISTINCT sc.one_id,sc.two_id,sc.three_id,sc.one_name,sc.two_name,sc.three_name,sr.resource_name,sr.resource_id,sr.url,sr.picture_url,sr.resource_type,sr.source,sr.status,sr.create_time
FROM sys_resource sr FROM sys_resource sr
left JOIN left JOIN
sys_resource_and_course sc sys_resource_and_course sc

@ -1,293 +1,298 @@
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.sztzjy.resource_center.mapper.SysTopicAndCourseMapper"> <mapper namespace="com.sztzjy.resource_center.mapper.SysTopicAndCourseMapper">
<resultMap id="BaseResultMap" type="com.sztzjy.resource_center.entity.SysTopicAndCourse"> <resultMap id="BaseResultMap" type="com.sztzjy.resource_center.entity.SysTopicAndCourse">
<id column="id" jdbcType="VARCHAR" property="id" /> <id column="id" jdbcType="VARCHAR" property="id"/>
<result column="topic_id" jdbcType="VARCHAR" property="topicId" /> <result column="topic_id" jdbcType="VARCHAR" property="topicId"/>
<result column="one_id" jdbcType="VARCHAR" property="oneId" /> <result column="one_id" jdbcType="VARCHAR" property="oneId"/>
<result column="one_name" jdbcType="VARCHAR" property="oneName" /> <result column="one_name" jdbcType="VARCHAR" property="oneName"/>
<result column="two_id" jdbcType="VARCHAR" property="twoId" /> <result column="two_id" jdbcType="VARCHAR" property="twoId"/>
<result column="two_name" jdbcType="VARCHAR" property="twoName" /> <result column="two_name" jdbcType="VARCHAR" property="twoName"/>
<result column="three_id" jdbcType="VARCHAR" property="threeId" /> <result column="three_id" jdbcType="VARCHAR" property="threeId"/>
<result column="three_name" jdbcType="VARCHAR" property="threeName" /> <result column="three_name" jdbcType="VARCHAR" property="threeName"/>
<result column="topic_type" jdbcType="VARCHAR" property="topicType" /> <result column="topic_type" jdbcType="VARCHAR" property="topicType"/>
</resultMap> </resultMap>
<sql id="Example_Where_Clause"> <sql id="Example_Where_Clause">
<where> <where>
<foreach collection="oredCriteria" item="criteria" separator="or"> <foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid"> <if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")"> <trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion"> <foreach collection="criteria.criteria" item="criterion">
<choose> <choose>
<when test="criterion.noValue"> <when test="criterion.noValue">
and ${criterion.condition} and ${criterion.condition}
</when> </when>
<when test="criterion.singleValue"> <when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value} and ${criterion.condition} #{criterion.value}
</when> </when>
<when test="criterion.betweenValue"> <when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when> </when>
<when test="criterion.listValue"> <when test="criterion.listValue">
and ${criterion.condition} and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> <foreach close=")" collection="criterion.value" item="listItem" open="("
#{listItem} separator=",">
</foreach> #{listItem}
</when> </foreach>
</choose> </when>
</choose>
</foreach>
</trim>
</if>
</foreach> </foreach>
</trim> </where>
</if> </sql>
</foreach> <sql id="Update_By_Example_Where_Clause">
</where> <where>
</sql> <foreach collection="example.oredCriteria" item="criteria" separator="or">
<sql id="Update_By_Example_Where_Clause"> <if test="criteria.valid">
<where> <trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="example.oredCriteria" item="criteria" separator="or"> <foreach collection="criteria.criteria" item="criterion">
<if test="criteria.valid"> <choose>
<trim prefix="(" prefixOverrides="and" suffix=")"> <when test="criterion.noValue">
<foreach collection="criteria.criteria" item="criterion"> and ${criterion.condition}
<choose> </when>
<when test="criterion.noValue"> <when test="criterion.singleValue">
and ${criterion.condition} and ${criterion.condition} #{criterion.value}
</when> </when>
<when test="criterion.singleValue"> <when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when> </when>
<when test="criterion.betweenValue"> <when test="criterion.listValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} and ${criterion.condition}
</when> <foreach close=")" collection="criterion.value" item="listItem" open="("
<when test="criterion.listValue"> separator=",">
and ${criterion.condition} #{listItem}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> </foreach>
#{listItem} </when>
</foreach> </choose>
</when> </foreach>
</choose> </trim>
</if>
</foreach> </foreach>
</trim> </where>
</sql>
<sql id="Base_Column_List">
id
, topic_id, one_id, one_name, two_id, two_name, three_id, three_name, topic_type
</sql>
<select id="selectByExample" parameterType="com.sztzjy.resource_center.entity.SysTopicAndCourseExample"
resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List"/>
from sys_topic_and_course
<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_topic_and_course
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete
from sys_topic_and_course
where id = #{id,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="com.sztzjy.resource_center.entity.SysTopicAndCourseExample">
delete from sys_topic_and_course
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if> </if>
</foreach> </delete>
</where> <insert id="insert" parameterType="com.sztzjy.resource_center.entity.SysTopicAndCourse">
</sql> insert into sys_topic_and_course (id, topic_id, one_id,
<sql id="Base_Column_List"> one_name, two_id, two_name,
id, topic_id, one_id, one_name, two_id, two_name, three_id, three_name, topic_type three_id, three_name, topic_type)
</sql> values (#{id,jdbcType=VARCHAR}, #{topicId,jdbcType=VARCHAR}, #{oneId,jdbcType=VARCHAR},
<select id="selectByExample" parameterType="com.sztzjy.resource_center.entity.SysTopicAndCourseExample" resultMap="BaseResultMap"> #{oneName,jdbcType=VARCHAR}, #{twoId,jdbcType=VARCHAR}, #{twoName,jdbcType=VARCHAR},
select #{threeId,jdbcType=VARCHAR}, #{threeName,jdbcType=VARCHAR}, #{topicType,jdbcType=VARCHAR})
<if test="distinct"> </insert>
distinct <insert id="insertSelective" parameterType="com.sztzjy.resource_center.entity.SysTopicAndCourse">
</if> insert into sys_topic_and_course
<include refid="Base_Column_List" /> <trim prefix="(" suffix=")" suffixOverrides=",">
from sys_topic_and_course <if test="id != null">
<if test="_parameter != null"> id,
<include refid="Example_Where_Clause" /> </if>
</if> <if test="topicId != null">
<if test="orderByClause != null"> topic_id,
order by ${orderByClause} </if>
</if> <if test="oneId != null">
</select> one_id,
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap"> </if>
select <if test="oneName != null">
<include refid="Base_Column_List" /> one_name,
from sys_topic_and_course </if>
where id = #{id,jdbcType=VARCHAR} <if test="twoId != null">
</select> two_id,
<delete id="deleteByPrimaryKey" parameterType="java.lang.String"> </if>
delete from sys_topic_and_course <if test="twoName != null">
where id = #{id,jdbcType=VARCHAR} two_name,
</delete> </if>
<delete id="deleteByExample" parameterType="com.sztzjy.resource_center.entity.SysTopicAndCourseExample"> <if test="threeId != null">
delete from sys_topic_and_course three_id,
<if test="_parameter != null"> </if>
<include refid="Example_Where_Clause" /> <if test="threeName != null">
</if> three_name,
</delete> </if>
<insert id="insert" parameterType="com.sztzjy.resource_center.entity.SysTopicAndCourse"> <if test="topicType != null">
insert into sys_topic_and_course (id, topic_id, one_id, topic_type,
one_name, two_id, two_name, </if>
three_id, three_name, topic_type </trim>
) <trim prefix="values (" suffix=")" suffixOverrides=",">
values (#{id,jdbcType=VARCHAR}, #{topicId,jdbcType=VARCHAR}, #{oneId,jdbcType=VARCHAR}, <if test="id != null">
#{oneName,jdbcType=VARCHAR}, #{twoId,jdbcType=VARCHAR}, #{twoName,jdbcType=VARCHAR}, #{id,jdbcType=VARCHAR},
#{threeId,jdbcType=VARCHAR}, #{threeName,jdbcType=VARCHAR}, #{topicType,jdbcType=VARCHAR} </if>
) <if test="topicId != null">
</insert> #{topicId,jdbcType=VARCHAR},
<insert id="insertSelective" parameterType="com.sztzjy.resource_center.entity.SysTopicAndCourse"> </if>
insert into sys_topic_and_course <if test="oneId != null">
<trim prefix="(" suffix=")" suffixOverrides=","> #{oneId,jdbcType=VARCHAR},
<if test="id != null"> </if>
id, <if test="oneName != null">
</if> #{oneName,jdbcType=VARCHAR},
<if test="topicId != null"> </if>
topic_id, <if test="twoId != null">
</if> #{twoId,jdbcType=VARCHAR},
<if test="oneId != null"> </if>
one_id, <if test="twoName != null">
</if> #{twoName,jdbcType=VARCHAR},
<if test="oneName != null"> </if>
one_name, <if test="threeId != null">
</if> #{threeId,jdbcType=VARCHAR},
<if test="twoId != null"> </if>
two_id, <if test="threeName != null">
</if> #{threeName,jdbcType=VARCHAR},
<if test="twoName != null"> </if>
two_name, <if test="topicType != null">
</if> #{topicType,jdbcType=VARCHAR},
<if test="threeId != null"> </if>
three_id, </trim>
</if> </insert>
<if test="threeName != null"> <select id="countByExample" parameterType="com.sztzjy.resource_center.entity.SysTopicAndCourseExample"
three_name, resultType="java.lang.Long">
</if> select count(*) from sys_topic_and_course
<if test="topicType != null"> <if test="_parameter != null">
topic_type, <include refid="Example_Where_Clause"/>
</if> </if>
</trim> </select>
<trim prefix="values (" suffix=")" suffixOverrides=","> <update id="updateByExampleSelective" parameterType="map">
<if test="id != null"> update sys_topic_and_course
#{id,jdbcType=VARCHAR}, <set>
</if> <if test="record.id != null">
<if test="topicId != null"> id = #{record.id,jdbcType=VARCHAR},
#{topicId,jdbcType=VARCHAR}, </if>
</if> <if test="record.topicId != null">
<if test="oneId != null"> topic_id = #{record.topicId,jdbcType=VARCHAR},
#{oneId,jdbcType=VARCHAR}, </if>
</if> <if test="record.oneId != null">
<if test="oneName != null"> one_id = #{record.oneId,jdbcType=VARCHAR},
#{oneName,jdbcType=VARCHAR}, </if>
</if> <if test="record.oneName != null">
<if test="twoId != null"> one_name = #{record.oneName,jdbcType=VARCHAR},
#{twoId,jdbcType=VARCHAR}, </if>
</if> <if test="record.twoId != null">
<if test="twoName != null"> two_id = #{record.twoId,jdbcType=VARCHAR},
#{twoName,jdbcType=VARCHAR}, </if>
</if> <if test="record.twoName != null">
<if test="threeId != null"> two_name = #{record.twoName,jdbcType=VARCHAR},
#{threeId,jdbcType=VARCHAR}, </if>
</if> <if test="record.threeId != null">
<if test="threeName != null"> three_id = #{record.threeId,jdbcType=VARCHAR},
#{threeName,jdbcType=VARCHAR}, </if>
</if> <if test="record.threeName != null">
<if test="topicType != null"> three_name = #{record.threeName,jdbcType=VARCHAR},
#{topicType,jdbcType=VARCHAR}, </if>
</if> <if test="record.topicType != null">
</trim> topic_type = #{record.topicType,jdbcType=VARCHAR},
</insert> </if>
<select id="countByExample" parameterType="com.sztzjy.resource_center.entity.SysTopicAndCourseExample" resultType="java.lang.Long"> </set>
select count(*) from sys_topic_and_course <if test="_parameter != null">
<if test="_parameter != null"> <include refid="Update_By_Example_Where_Clause"/>
<include refid="Example_Where_Clause" /> </if>
</if> </update>
</select> <update id="updateByExample" parameterType="map">
<update id="updateByExampleSelective" parameterType="map"> update sys_topic_and_course
update sys_topic_and_course set id = #{record.id,jdbcType=VARCHAR},
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=VARCHAR},
</if>
<if test="record.topicId != null">
topic_id = #{record.topicId,jdbcType=VARCHAR}, topic_id = #{record.topicId,jdbcType=VARCHAR},
</if>
<if test="record.oneId != null">
one_id = #{record.oneId,jdbcType=VARCHAR}, one_id = #{record.oneId,jdbcType=VARCHAR},
</if>
<if test="record.oneName != null">
one_name = #{record.oneName,jdbcType=VARCHAR}, one_name = #{record.oneName,jdbcType=VARCHAR},
</if>
<if test="record.twoId != null">
two_id = #{record.twoId,jdbcType=VARCHAR}, two_id = #{record.twoId,jdbcType=VARCHAR},
</if>
<if test="record.twoName != null">
two_name = #{record.twoName,jdbcType=VARCHAR}, two_name = #{record.twoName,jdbcType=VARCHAR},
</if>
<if test="record.threeId != null">
three_id = #{record.threeId,jdbcType=VARCHAR}, three_id = #{record.threeId,jdbcType=VARCHAR},
</if>
<if test="record.threeName != null">
three_name = #{record.threeName,jdbcType=VARCHAR}, three_name = #{record.threeName,jdbcType=VARCHAR},
</if> topic_type = #{record.topicType,jdbcType=VARCHAR}
<if test="record.topicType != null"> <if test="_parameter != null">
topic_type = #{record.topicType,jdbcType=VARCHAR}, <include refid="Update_By_Example_Where_Clause"/>
</if> </if>
</set> </update>
<if test="_parameter != null"> <update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.resource_center.entity.SysTopicAndCourse">
<include refid="Update_By_Example_Where_Clause" /> update sys_topic_and_course
</if> <set>
</update> <if test="topicId != null">
<update id="updateByExample" parameterType="map"> topic_id = #{topicId,jdbcType=VARCHAR},
update sys_topic_and_course </if>
set id = #{record.id,jdbcType=VARCHAR}, <if test="oneId != null">
topic_id = #{record.topicId,jdbcType=VARCHAR}, one_id = #{oneId,jdbcType=VARCHAR},
one_id = #{record.oneId,jdbcType=VARCHAR}, </if>
one_name = #{record.oneName,jdbcType=VARCHAR}, <if test="oneName != null">
two_id = #{record.twoId,jdbcType=VARCHAR}, one_name = #{oneName,jdbcType=VARCHAR},
two_name = #{record.twoName,jdbcType=VARCHAR}, </if>
three_id = #{record.threeId,jdbcType=VARCHAR}, <if test="twoId != null">
three_name = #{record.threeName,jdbcType=VARCHAR}, two_id = #{twoId,jdbcType=VARCHAR},
topic_type = #{record.topicType,jdbcType=VARCHAR} </if>
<if test="_parameter != null"> <if test="twoName != null">
<include refid="Update_By_Example_Where_Clause" /> two_name = #{twoName,jdbcType=VARCHAR},
</if> </if>
</update> <if test="threeId != null">
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.resource_center.entity.SysTopicAndCourse"> three_id = #{threeId,jdbcType=VARCHAR},
update sys_topic_and_course </if>
<set> <if test="threeName != null">
<if test="topicId != null"> three_name = #{threeName,jdbcType=VARCHAR},
topic_id = #{topicId,jdbcType=VARCHAR}, </if>
</if> <if test="topicType != null">
<if test="oneId != null"> topic_type = #{topicType,jdbcType=VARCHAR},
one_id = #{oneId,jdbcType=VARCHAR}, </if>
</if> </set>
<if test="oneName != null"> where id = #{id,jdbcType=VARCHAR}
one_name = #{oneName,jdbcType=VARCHAR}, </update>
</if> <update id="updateByPrimaryKey" parameterType="com.sztzjy.resource_center.entity.SysTopicAndCourse">
<if test="twoId != null"> update sys_topic_and_course
two_id = #{twoId,jdbcType=VARCHAR}, set topic_id = #{topicId,jdbcType=VARCHAR},
</if> one_id = #{oneId,jdbcType=VARCHAR},
<if test="twoName != null"> one_name = #{oneName,jdbcType=VARCHAR},
two_name = #{twoName,jdbcType=VARCHAR}, two_id = #{twoId,jdbcType=VARCHAR},
</if> two_name = #{twoName,jdbcType=VARCHAR},
<if test="threeId != null"> three_id = #{threeId,jdbcType=VARCHAR},
three_id = #{threeId,jdbcType=VARCHAR}, three_name = #{threeName,jdbcType=VARCHAR},
</if> topic_type = #{topicType,jdbcType=VARCHAR}
<if test="threeName != null"> where id = #{id,jdbcType=VARCHAR}
three_name = #{threeName,jdbcType=VARCHAR}, </update>
</if> <!-- 批量新增 -->
<if test="topicType != null"> <insert id="batchInsert" parameterType="java.util.List">
topic_type = #{topicType,jdbcType=VARCHAR}, INSERT INTO sys_topic_and_course (id, topic_id, one_id,one_name, two_id,two_name, three_id,
</if> three_name,topic_type)
</set> VALUES
where id = #{id,jdbcType=VARCHAR} <foreach collection="list" item="topic" separator=",">
</update> (
<update id="updateByPrimaryKey" parameterType="com.sztzjy.resource_center.entity.SysTopicAndCourse"> #{topic.id},
update sys_topic_and_course #{topic.topicId},
set topic_id = #{topicId,jdbcType=VARCHAR}, #{topic.oneId},
one_id = #{oneId,jdbcType=VARCHAR}, #{topic.oneName},
one_name = #{oneName,jdbcType=VARCHAR}, #{topic.twoId},
two_id = #{twoId,jdbcType=VARCHAR}, #{topic.twoName},
two_name = #{twoName,jdbcType=VARCHAR}, #{topic.threeId},
three_id = #{threeId,jdbcType=VARCHAR}, #{topic.threeName},
three_name = #{threeName,jdbcType=VARCHAR}, #{topic.topicType}
topic_type = #{topicType,jdbcType=VARCHAR} )
where id = #{id,jdbcType=VARCHAR} </foreach>
</update> </insert>
<!-- 批量新增 -->
<insert id="batchInsert" parameterType="java.util.List">
INSERT INTO sys_resource_and_course (id, topic_id, one_id, two_id, three_id, topic_type)
VALUES
<foreach collection="list" item="topic" separator=",">
(
#{topic.id},
#{topic.topic_id},
#{topic.topicType},
#{topic.oneId},
#{topic.oneName},
#{topic.twoId}
#{topic.threeId}
#{topic.twoName}
#{topic.threeName}
)
</foreach>
</insert>
</mapper> </mapper>
Loading…
Cancel
Save