新增三方接口

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,8 +93,8 @@ 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,
@ -105,29 +103,25 @@ public class CaseApi {
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);
if (!sysTopicAndCourses.isEmpty()) {
return false;
} else {
SysCaseQuestion sysCaseQuestion = caseQuestionMapper.selectByPrimaryKey(caseId); SysCaseQuestion sysCaseQuestion = caseQuestionMapper.selectByPrimaryKey(caseId);
String source = sysCaseQuestion.getSource(); String source = sysCaseQuestion.getSource();
//todo 管理员任意删除 老师只能删除自己上传的 //todo 管理员任意删除 老师只能删除自己上传的
@ -140,7 +134,7 @@ public class CaseApi {
return false; return false;
} }
} }
}
private List<SysTopicAndCourse> getSysTopicAndCourses(String caseId) { private List<SysTopicAndCourse> getSysTopicAndCourses(String caseId) {
SysTopicAndCourseExample example = new SysTopicAndCourseExample(); SysTopicAndCourseExample example = new SysTopicAndCourseExample();
@ -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

@ -30,7 +30,8 @@
</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="("
separator=",">
#{listItem} #{listItem}
</foreach> </foreach>
</when> </when>
@ -59,7 +60,8 @@
</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="("
separator=",">
#{listItem} #{listItem}
</foreach> </foreach>
</when> </when>
@ -71,9 +73,11 @@
</where> </where>
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, topic_id, one_id, one_name, two_id, two_name, three_id, three_name, topic_type id
, topic_id, one_id, one_name, two_id, two_name, three_id, three_name, topic_type
</sql> </sql>
<select id="selectByExample" parameterType="com.sztzjy.resource_center.entity.SysTopicAndCourseExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="com.sztzjy.resource_center.entity.SysTopicAndCourseExample"
resultMap="BaseResultMap">
select select
<if test="distinct"> <if test="distinct">
distinct distinct
@ -94,7 +98,8 @@
where id = #{id,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR}
</select> </select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String"> <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from sys_topic_and_course delete
from sys_topic_and_course
where id = #{id,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR}
</delete> </delete>
<delete id="deleteByExample" parameterType="com.sztzjy.resource_center.entity.SysTopicAndCourseExample"> <delete id="deleteByExample" parameterType="com.sztzjy.resource_center.entity.SysTopicAndCourseExample">
@ -106,12 +111,10 @@
<insert id="insert" parameterType="com.sztzjy.resource_center.entity.SysTopicAndCourse"> <insert id="insert" parameterType="com.sztzjy.resource_center.entity.SysTopicAndCourse">
insert into sys_topic_and_course (id, topic_id, one_id, insert into sys_topic_and_course (id, topic_id, one_id,
one_name, two_id, two_name, one_name, two_id, two_name,
three_id, three_name, topic_type three_id, three_name, topic_type)
)
values (#{id,jdbcType=VARCHAR}, #{topicId,jdbcType=VARCHAR}, #{oneId,jdbcType=VARCHAR}, values (#{id,jdbcType=VARCHAR}, #{topicId,jdbcType=VARCHAR}, #{oneId,jdbcType=VARCHAR},
#{oneName,jdbcType=VARCHAR}, #{twoId,jdbcType=VARCHAR}, #{twoName,jdbcType=VARCHAR}, #{oneName,jdbcType=VARCHAR}, #{twoId,jdbcType=VARCHAR}, #{twoName,jdbcType=VARCHAR},
#{threeId,jdbcType=VARCHAR}, #{threeName,jdbcType=VARCHAR}, #{topicType,jdbcType=VARCHAR} #{threeId,jdbcType=VARCHAR}, #{threeName,jdbcType=VARCHAR}, #{topicType,jdbcType=VARCHAR})
)
</insert> </insert>
<insert id="insertSelective" parameterType="com.sztzjy.resource_center.entity.SysTopicAndCourse"> <insert id="insertSelective" parameterType="com.sztzjy.resource_center.entity.SysTopicAndCourse">
insert into sys_topic_and_course insert into sys_topic_and_course
@ -174,7 +177,8 @@
</if> </if>
</trim> </trim>
</insert> </insert>
<select id="countByExample" parameterType="com.sztzjy.resource_center.entity.SysTopicAndCourseExample" resultType="java.lang.Long"> <select id="countByExample" parameterType="com.sztzjy.resource_center.entity.SysTopicAndCourseExample"
resultType="java.lang.Long">
select count(*) from sys_topic_and_course select count(*) from sys_topic_and_course
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Example_Where_Clause"/> <include refid="Example_Where_Clause"/>
@ -274,19 +278,20 @@
</update> </update>
<!-- 批量新增 --> <!-- 批量新增 -->
<insert id="batchInsert" parameterType="java.util.List"> <insert id="batchInsert" parameterType="java.util.List">
INSERT INTO sys_resource_and_course (id, topic_id, one_id, two_id, three_id, topic_type) INSERT INTO sys_topic_and_course (id, topic_id, one_id,one_name, two_id,two_name, three_id,
three_name,topic_type)
VALUES VALUES
<foreach collection="list" item="topic" separator=","> <foreach collection="list" item="topic" separator=",">
( (
#{topic.id}, #{topic.id},
#{topic.topic_id}, #{topic.topicId},
#{topic.topicType},
#{topic.oneId}, #{topic.oneId},
#{topic.oneName}, #{topic.oneName},
#{topic.twoId} #{topic.twoId},
#{topic.threeId} #{topic.twoName},
#{topic.twoName} #{topic.threeId},
#{topic.threeName} #{topic.threeName},
#{topic.topicType}
) )
</foreach> </foreach>
</insert> </insert>

Loading…
Cancel
Save