新增三方接口

master
xiaoCJ 8 months ago
parent 643fa12b28
commit d12d97df5c

@ -1,16 +1,15 @@
package com.sztzjy.resource_center.controller;
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.SysResource;
import com.sztzjy.resource_center.entity.SysResourceAndCourse;
import com.sztzjy.resource_center.entity.SysResourceAndCourseExample;
import com.sztzjy.resource_center.entity.SysResourceExample;
import com.sztzjy.resource_center.entity.dto.SysResourceDto;
import com.sztzjy.resource_center.mapper.SysResourceAndCourseMapper;
import com.sztzjy.resource_center.mapper.SysResourceMapper;
import com.sztzjy.resource_center.util.PageUtil;
import com.sztzjy.resource_center.util.ResultEntity;
import com.sztzjy.resource_center.util.file.IFileUtil;
import io.swagger.annotations.Api;
@ -22,7 +21,6 @@ import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
@ -76,12 +74,6 @@ public class CourseConfigController {
String uuid = IdUtil.randomUUID();
sysResource.setResourceId(uuid);
sysResource.setPictureUrl(pictureName);
sysResource.setOneTag(dto.getOneId());
sysResource.setOneName(dto.getOneName());
sysResource.setTwoTag(dto.getTwoId());
sysResource.setTwoName(dto.getTwoName());
sysResource.setThreeTag(dto.getThreeId());
sysResource.setThreeName(dto.getThreeName());
sysResource.setUrl(url);
sysResource.setSource(dto.getSource()); //管理员或者 xx学校
sysResource.setResourceName(dto.getResourceName());
@ -95,6 +87,9 @@ public class CourseConfigController {
sysResourceAndCourse.setOneId(dto.getOneId());
sysResourceAndCourse.setTwoId(dto.getTwoId());
sysResourceAndCourse.setThreeId(dto.getThreeId());
sysResourceAndCourse.setOneName(dto.getOneName());
sysResourceAndCourse.setTwoName(dto.getTwoName());
sysResourceAndCourse.setThreeName(dto.getThreeName());
sysResourceAndCourse.setResourceId(uuid); //资源ID
sysResourceAndCourseMapper.insert(sysResourceAndCourse);
return new ResultEntity<>(HttpStatus.OK, "上传成功!");
@ -124,30 +119,18 @@ public class CourseConfigController {
@AnonymousAccess
@ApiOperation("课程配置/资源列表展示")
@ApiOperation("课程配置/资源列表展示,无重复")
@PostMapping("selectResourceByIDAndSource")
public ResultEntity<PageInfo<SysResource>> selectResource(@ApiParam("课程ID") @RequestParam String oneID,
@ApiParam("章ID") @RequestParam(required = false) String twoID,
@ApiParam("节ID") @RequestParam(required = false) String threeID,
@RequestParam(required = false) String source, //子系统调用时传
@RequestParam Integer index,
@RequestParam Integer size) {
List<String> list = sysResourceAndCourseMapper.selectResourceId(oneID, twoID, threeID);
if (list == null || list.isEmpty()) {
return new ResultEntity<PageInfo<SysResource>>(new PageInfo<>());
}
SysResourceExample example = new SysResourceExample();
SysResourceExample.Criteria criteria = example.createCriteria();
criteria.andResourceIdIn(list);
//不为空子系统调用
if (StringUtils.isNotBlank(source)) {
List<String> sources = Arrays.asList(source, "内置");
criteria.andSourceIn(sources);
}
example.setOrderByClause("create_time ASC");
List<SysResource> sysResources = sysResourceMapper.selectByExample(example);
PageInfo pageInfo = PageUtil.pageHelper(sysResources, index, size);
return new ResultEntity<PageInfo<SysResource>>(pageInfo);
public ResultEntity<PageInfo<SysResourceDto>> selectResource(@ApiParam("课程ID") @RequestParam String oneID,
@ApiParam("章ID") @RequestParam String twoID,
@ApiParam("节ID") @RequestParam String threeID,
@RequestParam(required = false) String source, //子系统调用时传
@RequestParam Integer index,
@RequestParam Integer size) {
PageHelper.startPage(index, size);
List<SysResourceDto> sysResourceDtos = sysResourceMapper.selectResource(oneID, twoID, threeID);
PageInfo<SysResourceDto> pageInfo = new PageInfo(sysResourceDtos);
return new ResultEntity<PageInfo<SysResourceDto>>(pageInfo);
}

@ -4,6 +4,7 @@ import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.sztzjy.resource_center.annotation.AnonymousAccess;
import com.sztzjy.resource_center.entity.SysResource;
import com.sztzjy.resource_center.entity.dto.SysResourceDto;
import com.sztzjy.resource_center.mapper.SysResourceMapper;
import com.sztzjy.resource_center.util.ResultEntity;
import io.swagger.annotations.Api;
@ -36,21 +37,23 @@ public class LearningResourceController {
private String filePath;
@AnonymousAccess
@ApiOperation("学习资源/资源列表展示")
@PostMapping("selectResource")
public ResultEntity<PageInfo<SysResource>> selectResource(@ApiParam("课程ID") @RequestParam(required = false) String oneID,
@ApiParam("章ID") @RequestParam(required = false) String twoID,
@ApiParam("节ID") @RequestParam(required = false) String threeID,
@ApiParam("资源名称") @RequestParam(required = false) String resourceName,
@RequestParam Integer index,
@RequestParam Integer size) {
@ApiOperation("学习资源/资源列表展示/有重复数据")
@PostMapping("selectResourceByRepeat")
public ResultEntity<PageInfo<SysResourceDto>> selectResourceByRepeat(@ApiParam("课程ID") @RequestParam(required = false) String oneID,
@ApiParam("章ID") @RequestParam(required = false) String twoID,
@ApiParam("节ID") @RequestParam(required = false) String threeID,
@ApiParam("资源名称") @RequestParam(required = false) String resourceName,
@RequestParam Integer index,
@RequestParam Integer size) {
PageHelper.startPage(index, size);
List<SysResource> sysResourceDtos = sysResourceMapper.selectResource(oneID, twoID, threeID, resourceName);
PageInfo<SysResource> pageInfo = new PageInfo(sysResourceDtos);
return new ResultEntity<PageInfo<SysResource>>(pageInfo);
List<SysResourceDto> sysResourceDtos = sysResourceMapper.selectResourceByRepeat(oneID, twoID, threeID, resourceName);
PageInfo<SysResourceDto> pageInfo = new PageInfo(sysResourceDtos);
return new ResultEntity<PageInfo<SysResourceDto>>(pageInfo);
}
@AnonymousAccess
@ApiOperation("学习资源/删除") //同步过来的不做删除
@PostMapping("deleteResource")

@ -49,6 +49,8 @@ public class TopicResourceController {
@Value("${file.path}")
private String filePath;
@AnonymousAccess
@ApiOperation("新增单个试题") //新增 题干不允许重复
@PostMapping("addTopic")
private ResultEntity<String> addTopic(@RequestBody SysObjectiveQuestionsDto objectiveQuestion) {
@ -97,11 +99,11 @@ public class TopicResourceController {
sysTopicAndCourse.setOneId(objectiveQuestion.getOneID());
sysTopicAndCourse.setOneName(objectiveQuestion.getOneName());
if (StringUtils.isNotBlank(objectiveQuestion.getTwoID())) {
sysTopicAndCourse.setTwoId(sysTopicAndCourse.getTwoId());
sysTopicAndCourse.setTwoId(objectiveQuestion.getTwoID());
sysTopicAndCourse.setTwoName(objectiveQuestion.getTwoName());
}
if (StringUtils.isNotBlank(objectiveQuestion.getThreeID())) {
sysTopicAndCourse.setThreeId(sysTopicAndCourse.getThreeId());
sysTopicAndCourse.setThreeId(objectiveQuestion.getThreeID());
sysTopicAndCourse.setThreeName(objectiveQuestion.getThreeName());
}
sysTopicAndCourseMapper.insert(sysTopicAndCourse);
@ -153,26 +155,69 @@ public class TopicResourceController {
@AnonymousAccess
@ApiOperation("条件查询")
@ApiOperation("条件查询/不重复")
@PostMapping("selectTopicByConditions") //todo 关于老师删除的题库如何查询
private ResultEntity<PageInfo<SysObjectiveQuestionsDto>> selectTopicByConditions(@RequestParam Integer index,
@RequestParam Integer size,
@RequestParam(required = false) String oneID,
@RequestParam(required = false) String twoID,
@RequestParam(required = false) String threeID,
@RequestParam String oneID,
@RequestParam String twoID,
@RequestParam String threeID,
@RequestParam(required = false) String type,
@ApiParam("题干") @RequestParam(required = false) String content) {
PageHelper.startPage(index, size);
List<SysObjectiveQuestionsDto> list = sysObjectiveQuestionMapper.selectTopicByConditions(oneID, twoID, threeID, type,content);
List<SysObjectiveQuestionsDto> list = sysObjectiveQuestionMapper.selectTopicByConditions(oneID, twoID, threeID, type, content);
PageInfo<SysObjectiveQuestionsDto> pageInfo = new PageInfo(list);
return new ResultEntity<PageInfo<SysObjectiveQuestionsDto>>(pageInfo);
}
@AnonymousAccess
@ApiOperation("课程配置/题目条件查询")
@PostMapping("getTopicByConfig") //todo 关于老师删除的题库如何查询
private ResultEntity<PageInfo<SysObjectiveQuestionsDto>> getTopicByConfig(@RequestParam Integer index,
@RequestParam Integer size,
@RequestParam(required = false) String oneID,
@RequestParam(required = false) String twoID,
@RequestParam(required = false) String threeID,
@RequestParam(required = false) String type,
@ApiParam("题干") @RequestParam(required = false) String content) {
PageHelper.startPage(index, size);
List<SysObjectiveQuestionsDto> list = sysObjectiveQuestionMapper.getTopicByConfig(oneID, twoID, threeID, type, content);
PageInfo<SysObjectiveQuestionsDto> pageInfo = new PageInfo(list);
return new ResultEntity<PageInfo<SysObjectiveQuestionsDto>>(pageInfo);
// SysTopicAndCourseExample example = new SysTopicAndCourseExample();
// SysTopicAndCourseExample.Criteria criteria = example.createCriteria();
// if (StringUtils.isNotBlank(oneID)) {
// criteria.andOneIdEqualTo(oneID);
// }
// if (StringUtils.isNotBlank(twoID)) {
// criteria.andTwoIdEqualTo(twoID);
// }
// if (StringUtils.isNotBlank(threeID)) {
// criteria.andThreeIdEqualTo(threeID);
// }
// List<SysTopicAndCourse> sysTopicAndCourses = sysTopicAndCourseMapper.selectByExample(example);
// List<String> collect = sysTopicAndCourses.stream().map(SysTopicAndCourse::getTopicId).collect(Collectors.toList());
// SysObjectiveQuestionsExample example1 = new SysObjectiveQuestionsExample();
// SysObjectiveQuestionsExample.Criteria criteria1 = example1.createCriteria();
// if (StringUtils.isNotBlank(type)) {
// criteria1.andTypeEqualTo(type);
// }
// if (StringUtils.isNotBlank(content)) {
// criteria1.andContentLike(content);
// }
// criteria1.andObjectiveIdIn(collect);
// List<SysObjectiveQuestions> sysObjectiveQuestions = sysObjectiveQuestionMapper.selectByExample(example1);
// PageInfo pageInfo = PageUtil.pageHelper(sysObjectiveQuestions, index, size);
// return new ResultEntity<PageInfo<SysObjectiveQuestionsDto>>(pageInfo);
}
//老师新增的题目正在使用的话资源中心只能查看,不能编辑和删除,
// 如果老师自己删除了这个题目资源中心题库管理也可以编辑和删除。如果题目正在被使用则删除的时候提示题目被xx课程xx章节使用不能删除。
@ApiOperation("编辑")
@PostMapping("updateTopic")
private ResultEntity<String> updateTopic(@ApiParam("修改绑定关系需要传topicAndCourseId") @RequestParam SysObjectiveQuestionsDto dto) {
private ResultEntity<String> updateTopic(@ApiParam("修改绑定关系需要传topicAndCourseId") @RequestBody SysObjectiveQuestionsDto dto) {
if (!dto.getSource().equals("管理员")) { //老师新增的不能编辑
SysTopicAndCourseExample example = new SysTopicAndCourseExample();
example.createCriteria().andTopicIdEqualTo(dto.getObjectiveId());
@ -194,12 +239,25 @@ public class TopicResourceController {
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "编辑完成!");
}
@AnonymousAccess
@ApiOperation("删除题目绑定关系")
@PostMapping("deleteTopicBinding")
private ResultEntity<String> deleteTopicBinding(@RequestParam String id) {
private ResultEntity<String> deleteTopicBinding(@RequestParam String id,
@RequestParam(required = false) String oneId,
@RequestParam(required = false) String twoId,
@RequestParam(required = false) String threeId) {
SysTopicAndCourseExample example = new SysTopicAndCourseExample();
example.createCriteria().andTopicTypeEqualTo(id);
SysTopicAndCourseExample.Criteria criteria = example.createCriteria();
if (StringUtils.isNotBlank(oneId)) {
criteria.andOneIdEqualTo(oneId);
}
if (StringUtils.isNotBlank(twoId)) {
criteria.andTwoIdEqualTo(twoId);
}
if (StringUtils.isNotBlank(threeId)) {
criteria.andThreeIdEqualTo(threeId);
}
criteria.andTopicIdEqualTo(id);
sysTopicAndCourseMapper.deleteByExample(example);
return new ResultEntity<>(HttpStatus.OK, "成功删除绑定关系!");
}

@ -21,6 +21,12 @@ public class SysResourceAndCourse {
@ApiModelProperty("三级目录ID/节ID")
private String threeId;
private String oneName;
private String twoName;
private String threeName;
public String getId() {
return id;
}
@ -60,4 +66,28 @@ public class SysResourceAndCourse {
public void setThreeId(String threeId) {
this.threeId = threeId == null ? null : threeId.trim();
}
public String getOneName() {
return oneName;
}
public void setOneName(String oneName) {
this.oneName = oneName == null ? null : oneName.trim();
}
public String getTwoName() {
return twoName;
}
public void setTwoName(String twoName) {
this.twoName = twoName == null ? null : twoName.trim();
}
public String getThreeName() {
return threeName;
}
public void setThreeName(String threeName) {
this.threeName = threeName == null ? null : threeName.trim();
}
}

@ -453,6 +453,216 @@ public class SysResourceAndCourseExample {
addCriterion("three_id not between", value1, value2, "threeId");
return (Criteria) this;
}
public Criteria andOneNameIsNull() {
addCriterion("one_name is null");
return (Criteria) this;
}
public Criteria andOneNameIsNotNull() {
addCriterion("one_name is not null");
return (Criteria) this;
}
public Criteria andOneNameEqualTo(String value) {
addCriterion("one_name =", value, "oneName");
return (Criteria) this;
}
public Criteria andOneNameNotEqualTo(String value) {
addCriterion("one_name <>", value, "oneName");
return (Criteria) this;
}
public Criteria andOneNameGreaterThan(String value) {
addCriterion("one_name >", value, "oneName");
return (Criteria) this;
}
public Criteria andOneNameGreaterThanOrEqualTo(String value) {
addCriterion("one_name >=", value, "oneName");
return (Criteria) this;
}
public Criteria andOneNameLessThan(String value) {
addCriterion("one_name <", value, "oneName");
return (Criteria) this;
}
public Criteria andOneNameLessThanOrEqualTo(String value) {
addCriterion("one_name <=", value, "oneName");
return (Criteria) this;
}
public Criteria andOneNameLike(String value) {
addCriterion("one_name like", value, "oneName");
return (Criteria) this;
}
public Criteria andOneNameNotLike(String value) {
addCriterion("one_name not like", value, "oneName");
return (Criteria) this;
}
public Criteria andOneNameIn(List<String> values) {
addCriterion("one_name in", values, "oneName");
return (Criteria) this;
}
public Criteria andOneNameNotIn(List<String> values) {
addCriterion("one_name not in", values, "oneName");
return (Criteria) this;
}
public Criteria andOneNameBetween(String value1, String value2) {
addCriterion("one_name between", value1, value2, "oneName");
return (Criteria) this;
}
public Criteria andOneNameNotBetween(String value1, String value2) {
addCriterion("one_name not between", value1, value2, "oneName");
return (Criteria) this;
}
public Criteria andTwoNameIsNull() {
addCriterion("two_name is null");
return (Criteria) this;
}
public Criteria andTwoNameIsNotNull() {
addCriterion("two_name is not null");
return (Criteria) this;
}
public Criteria andTwoNameEqualTo(String value) {
addCriterion("two_name =", value, "twoName");
return (Criteria) this;
}
public Criteria andTwoNameNotEqualTo(String value) {
addCriterion("two_name <>", value, "twoName");
return (Criteria) this;
}
public Criteria andTwoNameGreaterThan(String value) {
addCriterion("two_name >", value, "twoName");
return (Criteria) this;
}
public Criteria andTwoNameGreaterThanOrEqualTo(String value) {
addCriterion("two_name >=", value, "twoName");
return (Criteria) this;
}
public Criteria andTwoNameLessThan(String value) {
addCriterion("two_name <", value, "twoName");
return (Criteria) this;
}
public Criteria andTwoNameLessThanOrEqualTo(String value) {
addCriterion("two_name <=", value, "twoName");
return (Criteria) this;
}
public Criteria andTwoNameLike(String value) {
addCriterion("two_name like", value, "twoName");
return (Criteria) this;
}
public Criteria andTwoNameNotLike(String value) {
addCriterion("two_name not like", value, "twoName");
return (Criteria) this;
}
public Criteria andTwoNameIn(List<String> values) {
addCriterion("two_name in", values, "twoName");
return (Criteria) this;
}
public Criteria andTwoNameNotIn(List<String> values) {
addCriterion("two_name not in", values, "twoName");
return (Criteria) this;
}
public Criteria andTwoNameBetween(String value1, String value2) {
addCriterion("two_name between", value1, value2, "twoName");
return (Criteria) this;
}
public Criteria andTwoNameNotBetween(String value1, String value2) {
addCriterion("two_name not between", value1, value2, "twoName");
return (Criteria) this;
}
public Criteria andThreeNameIsNull() {
addCriterion("three_name is null");
return (Criteria) this;
}
public Criteria andThreeNameIsNotNull() {
addCriterion("three_name is not null");
return (Criteria) this;
}
public Criteria andThreeNameEqualTo(String value) {
addCriterion("three_name =", value, "threeName");
return (Criteria) this;
}
public Criteria andThreeNameNotEqualTo(String value) {
addCriterion("three_name <>", value, "threeName");
return (Criteria) this;
}
public Criteria andThreeNameGreaterThan(String value) {
addCriterion("three_name >", value, "threeName");
return (Criteria) this;
}
public Criteria andThreeNameGreaterThanOrEqualTo(String value) {
addCriterion("three_name >=", value, "threeName");
return (Criteria) this;
}
public Criteria andThreeNameLessThan(String value) {
addCriterion("three_name <", value, "threeName");
return (Criteria) this;
}
public Criteria andThreeNameLessThanOrEqualTo(String value) {
addCriterion("three_name <=", value, "threeName");
return (Criteria) this;
}
public Criteria andThreeNameLike(String value) {
addCriterion("three_name like", value, "threeName");
return (Criteria) this;
}
public Criteria andThreeNameNotLike(String value) {
addCriterion("three_name not like", value, "threeName");
return (Criteria) this;
}
public Criteria andThreeNameIn(List<String> values) {
addCriterion("three_name in", values, "threeName");
return (Criteria) this;
}
public Criteria andThreeNameNotIn(List<String> values) {
addCriterion("three_name not in", values, "threeName");
return (Criteria) this;
}
public Criteria andThreeNameBetween(String value1, String value2) {
addCriterion("three_name between", value1, value2, "threeName");
return (Criteria) this;
}
public Criteria andThreeNameNotBetween(String value1, String value2) {
addCriterion("three_name not between", value1, value2, "threeName");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {

@ -2,8 +2,6 @@ package com.sztzjy.resource_center.entity.dto;
import com.sztzjy.resource_center.entity.SysObjectiveQuestions;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
/**
* @Author xcj

@ -38,4 +38,10 @@ public interface SysObjectiveQuestionsMapper {
@Param("content") String content);
int insertBatch(@Param("objectiveQuestionList") List<SysObjectiveQuestions> objectiveQuestionList);
List<SysObjectiveQuestionsDto> getTopicByConfig(@Param("oneID")String oneID,
@Param("twoID") String twoID,
@Param("threeID") String threeID,
@Param("type")String type,
@Param("content") String content);
}

@ -2,12 +2,10 @@ package com.sztzjy.resource_center.mapper;
import com.sztzjy.resource_center.entity.SysResourceAndCourse;
import com.sztzjy.resource_center.entity.SysResourceAndCourseExample;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface SysResourceAndCourseMapper {
long countByExample(SysResourceAndCourseExample example);
@ -34,10 +32,10 @@ public interface SysResourceAndCourseMapper {
void batchDeleteByIds(@Param("idList") List<String> idList);
// @Select("SELECT resource_id FROM sys_resource_and_course where one_id = #{oneId} and two_id = #{twoID} and three_id = #{threeID}")
List<String> selectResourceId(@Param("oneID") String oneID,
@Param("twoID") String twoID,
@Param("threeID") String threeID);
void batchInsert(@Param("resourceAndCourses") List<SysResourceAndCourse> resourceAndCourses);
}

@ -2,10 +2,13 @@ package com.sztzjy.resource_center.mapper;
import com.sztzjy.resource_center.entity.SysResource;
import com.sztzjy.resource_center.entity.SysResourceExample;
import java.util.List;
import com.sztzjy.resource_center.entity.dto.SysResourceDto;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface SysResourceMapper {
long countByExample(SysResourceExample example);
@ -31,8 +34,13 @@ public interface SysResourceMapper {
int updateByPrimaryKey(SysResource record);
List<SysResource> selectResource(@Param("oneId") String oneId,
@Param("twoId") String twoId,
@Param("threeId") String threeId,
@Param("resourceName") String resourceName);
List<SysResourceDto> selectResource(@Param("oneId") String oneId,
@Param("twoId") String twoId,
@Param("threeId") String threeId);
List<SysResourceDto> selectResourceByRepeat(@Param("oneId") String oneId,
@Param("twoId") String twoId,
@Param("threeId") String threeId,
@Param("resourceName") String resourceName);
}

@ -47,7 +47,7 @@
<!-- <table tableName="sys_objective_questions" domainObjectName="SysObjectiveQuestions" />-->
<!-- <table tableName="sys_one_catalog" domainObjectName="SysOneCatalog" />-->
<!-- <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_school" domainObjectName="SysSchool" />-->
<!-- <table tableName="sys_three_catalog" domainObjectName="SysThreeCatalog" />-->
@ -56,8 +56,8 @@
<!-- <table tableName="admin_data" domainObjectName="AdminData" />-->
<!-- <table tableName="admin_data_label" domainObjectName="AdminDataLabel" />-->
<!-- <table tableName="admin_file" domainObjectName="AdminFile" />-->
<table tableName="sys_knowledge_and_course" domainObjectName="SysKnowledgeAndCourse" />
<table tableName="sys_knowledge_summary" domainObjectName="SysKnowledgeSummary" />
<!-- <table tableName="sys_knowledge_and_course" domainObjectName="SysKnowledgeAndCourse" />-->
<!-- <table tableName="sys_knowledge_summary" domainObjectName="SysKnowledgeSummary" />-->
<!-- <table tableName="sys_two_catalog" domainObjectName="SysTwoCatalog" />-->
</context>

@ -1,431 +1,466 @@
<?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">
<mapper namespace="com.sztzjy.resource_center.mapper.SysObjectiveQuestionsMapper">
<resultMap id="BaseResultMap" type="com.sztzjy.resource_center.entity.SysObjectiveQuestions">
<id column="objective_id" jdbcType="VARCHAR" property="objectiveId" />
<result column="source" jdbcType="VARCHAR" property="source" />
<result column="content" jdbcType="VARCHAR" property="content" />
<result column="question_a" jdbcType="VARCHAR" property="questionA" />
<result column="question_b" jdbcType="VARCHAR" property="questionB" />
<result column="question_c" jdbcType="VARCHAR" property="questionC" />
<result column="question_d" jdbcType="VARCHAR" property="questionD" />
<result column="question_e" jdbcType="VARCHAR" property="questionE" />
<result column="score" jdbcType="DECIMAL" property="score" />
<result column="answer" jdbcType="VARCHAR" property="answer" />
<result column="analysis" jdbcType="VARCHAR" property="analysis" />
<result column="type" jdbcType="VARCHAR" property="type" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="is_delete" jdbcType="BIT" property="isDelete" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
<resultMap id="BaseResultMap" type="com.sztzjy.resource_center.entity.SysObjectiveQuestions">
<id column="objective_id" jdbcType="VARCHAR" property="objectiveId"/>
<result column="source" jdbcType="VARCHAR" property="source"/>
<result column="content" jdbcType="VARCHAR" property="content"/>
<result column="question_a" jdbcType="VARCHAR" property="questionA"/>
<result column="question_b" jdbcType="VARCHAR" property="questionB"/>
<result column="question_c" jdbcType="VARCHAR" property="questionC"/>
<result column="question_d" jdbcType="VARCHAR" property="questionD"/>
<result column="question_e" jdbcType="VARCHAR" property="questionE"/>
<result column="score" jdbcType="DECIMAL" property="score"/>
<result column="answer" jdbcType="VARCHAR" property="answer"/>
<result column="analysis" jdbcType="VARCHAR" property="analysis"/>
<result column="type" jdbcType="VARCHAR" property="type"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
<result column="is_delete" jdbcType="BIT" property="isDelete"/>
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="("
separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="("
separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
objective_id, source, content, question_a, question_b, question_c, question_d, question_e,
</where>
</sql>
<sql id="Base_Column_List">
objective_id
, source, content, question_a, question_b, question_c, question_d, question_e,
score, answer, analysis, type, create_time, update_time, is_delete
</sql>
<select id="selectByExample" parameterType="com.sztzjy.resource_center.entity.SysObjectiveQuestionsExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from sys_objective_questions
<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_objective_questions
where objective_id = #{objectiveId,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from sys_objective_questions
where objective_id = #{objectiveId,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="com.sztzjy.resource_center.entity.SysObjectiveQuestionsExample">
delete from sys_objective_questions
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.sztzjy.resource_center.entity.SysObjectiveQuestions">
insert into sys_objective_questions (objective_id, source, content,
question_a, question_b, question_c,
question_d, question_e, score,
answer, analysis, type,
create_time, update_time, is_delete
)
values (#{objectiveId,jdbcType=VARCHAR}, #{source,jdbcType=VARCHAR}, #{content,jdbcType=VARCHAR},
#{questionA,jdbcType=VARCHAR}, #{questionB,jdbcType=VARCHAR}, #{questionC,jdbcType=VARCHAR},
#{questionD,jdbcType=VARCHAR}, #{questionE,jdbcType=VARCHAR}, #{score,jdbcType=DECIMAL},
#{answer,jdbcType=VARCHAR}, #{analysis,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{isDelete,jdbcType=BIT}
)
</insert>
<insert id="insertSelective" parameterType="com.sztzjy.resource_center.entity.SysObjectiveQuestions">
insert into sys_objective_questions
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="objectiveId != null">
objective_id,
</if>
<if test="source != null">
source,
</if>
<if test="content != null">
content,
</if>
<if test="questionA != null">
question_a,
</if>
<if test="questionB != null">
question_b,
</if>
<if test="questionC != null">
question_c,
</if>
<if test="questionD != null">
question_d,
</if>
<if test="questionE != null">
question_e,
</if>
<if test="score != null">
score,
</if>
<if test="answer != null">
answer,
</if>
<if test="analysis != null">
analysis,
</if>
<if test="type != null">
type,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="isDelete != null">
is_delete,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="objectiveId != null">
#{objectiveId,jdbcType=VARCHAR},
</if>
<if test="source != null">
#{source,jdbcType=VARCHAR},
</if>
<if test="content != null">
#{content,jdbcType=VARCHAR},
</if>
<if test="questionA != null">
#{questionA,jdbcType=VARCHAR},
</if>
<if test="questionB != null">
#{questionB,jdbcType=VARCHAR},
</if>
<if test="questionC != null">
#{questionC,jdbcType=VARCHAR},
</if>
<if test="questionD != null">
#{questionD,jdbcType=VARCHAR},
</if>
<if test="questionE != null">
#{questionE,jdbcType=VARCHAR},
</if>
<if test="score != null">
#{score,jdbcType=DECIMAL},
</if>
<if test="answer != null">
#{answer,jdbcType=VARCHAR},
</if>
<if test="analysis != null">
#{analysis,jdbcType=VARCHAR},
</if>
<if test="type != null">
#{type,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="isDelete != null">
#{isDelete,jdbcType=BIT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.sztzjy.resource_center.entity.SysObjectiveQuestionsExample" resultType="java.lang.Long">
select count(*) from sys_objective_questions
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update sys_objective_questions
<set>
<if test="record.objectiveId != null">
objective_id = #{record.objectiveId,jdbcType=VARCHAR},
</if>
<if test="record.source != null">
</sql>
<select id="selectByExample" parameterType="com.sztzjy.resource_center.entity.SysObjectiveQuestionsExample"
resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List"/>
from sys_objective_questions
<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_objective_questions
where objective_id = #{objectiveId,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete
from sys_objective_questions
where objective_id = #{objectiveId,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="com.sztzjy.resource_center.entity.SysObjectiveQuestionsExample">
delete from sys_objective_questions
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if>
</delete>
<insert id="insert" parameterType="com.sztzjy.resource_center.entity.SysObjectiveQuestions">
insert into sys_objective_questions (objective_id, source, content,
question_a, question_b, question_c,
question_d, question_e, score,
answer, analysis, type,
create_time, update_time, is_delete)
values (#{objectiveId,jdbcType=VARCHAR}, #{source,jdbcType=VARCHAR}, #{content,jdbcType=VARCHAR},
#{questionA,jdbcType=VARCHAR}, #{questionB,jdbcType=VARCHAR}, #{questionC,jdbcType=VARCHAR},
#{questionD,jdbcType=VARCHAR}, #{questionE,jdbcType=VARCHAR}, #{score,jdbcType=DECIMAL},
#{answer,jdbcType=VARCHAR}, #{analysis,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{isDelete,jdbcType=BIT})
</insert>
<insert id="insertSelective" parameterType="com.sztzjy.resource_center.entity.SysObjectiveQuestions">
insert into sys_objective_questions
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="objectiveId != null">
objective_id,
</if>
<if test="source != null">
source,
</if>
<if test="content != null">
content,
</if>
<if test="questionA != null">
question_a,
</if>
<if test="questionB != null">
question_b,
</if>
<if test="questionC != null">
question_c,
</if>
<if test="questionD != null">
question_d,
</if>
<if test="questionE != null">
question_e,
</if>
<if test="score != null">
score,
</if>
<if test="answer != null">
answer,
</if>
<if test="analysis != null">
analysis,
</if>
<if test="type != null">
type,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="isDelete != null">
is_delete,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="objectiveId != null">
#{objectiveId,jdbcType=VARCHAR},
</if>
<if test="source != null">
#{source,jdbcType=VARCHAR},
</if>
<if test="content != null">
#{content,jdbcType=VARCHAR},
</if>
<if test="questionA != null">
#{questionA,jdbcType=VARCHAR},
</if>
<if test="questionB != null">
#{questionB,jdbcType=VARCHAR},
</if>
<if test="questionC != null">
#{questionC,jdbcType=VARCHAR},
</if>
<if test="questionD != null">
#{questionD,jdbcType=VARCHAR},
</if>
<if test="questionE != null">
#{questionE,jdbcType=VARCHAR},
</if>
<if test="score != null">
#{score,jdbcType=DECIMAL},
</if>
<if test="answer != null">
#{answer,jdbcType=VARCHAR},
</if>
<if test="analysis != null">
#{analysis,jdbcType=VARCHAR},
</if>
<if test="type != null">
#{type,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="isDelete != null">
#{isDelete,jdbcType=BIT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.sztzjy.resource_center.entity.SysObjectiveQuestionsExample"
resultType="java.lang.Long">
select count(*) from sys_objective_questions
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update sys_objective_questions
<set>
<if test="record.objectiveId != null">
objective_id = #{record.objectiveId,jdbcType=VARCHAR},
</if>
<if test="record.source != null">
source = #{record.source,jdbcType=VARCHAR},
</if>
<if test="record.content != null">
content = #{record.content,jdbcType=VARCHAR},
</if>
<if test="record.questionA != null">
question_a = #{record.questionA,jdbcType=VARCHAR},
</if>
<if test="record.questionB != null">
question_b = #{record.questionB,jdbcType=VARCHAR},
</if>
<if test="record.questionC != null">
question_c = #{record.questionC,jdbcType=VARCHAR},
</if>
<if test="record.questionD != null">
question_d = #{record.questionD,jdbcType=VARCHAR},
</if>
<if test="record.questionE != null">
question_e = #{record.questionE,jdbcType=VARCHAR},
</if>
<if test="record.score != null">
score = #{record.score,jdbcType=DECIMAL},
</if>
<if test="record.answer != null">
answer = #{record.answer,jdbcType=VARCHAR},
</if>
<if test="record.analysis != null">
analysis = #{record.analysis,jdbcType=VARCHAR},
</if>
<if test="record.type != null">
type = #{record.type,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
</if>
<if test="record.isDelete != null">
is_delete = #{record.isDelete,jdbcType=BIT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause"/>
</if>
</update>
<update id="updateByExample" parameterType="map">
update sys_objective_questions
set objective_id = #{record.objectiveId,jdbcType=VARCHAR},
source = #{record.source,jdbcType=VARCHAR},
</if>
<if test="record.content != null">
content = #{record.content,jdbcType=VARCHAR},
</if>
<if test="record.questionA != null">
question_a = #{record.questionA,jdbcType=VARCHAR},
</if>
<if test="record.questionB != null">
question_b = #{record.questionB,jdbcType=VARCHAR},
</if>
<if test="record.questionC != null">
question_c = #{record.questionC,jdbcType=VARCHAR},
</if>
<if test="record.questionD != null">
question_d = #{record.questionD,jdbcType=VARCHAR},
</if>
<if test="record.questionE != null">
question_e = #{record.questionE,jdbcType=VARCHAR},
</if>
<if test="record.score != null">
score = #{record.score,jdbcType=DECIMAL},
</if>
<if test="record.answer != null">
answer = #{record.answer,jdbcType=VARCHAR},
</if>
<if test="record.analysis != null">
analysis = #{record.analysis,jdbcType=VARCHAR},
</if>
<if test="record.type != null">
type = #{record.type,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
</if>
<if test="record.isDelete != null">
is_delete = #{record.isDelete,jdbcType=BIT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update sys_objective_questions
set objective_id = #{record.objectiveId,jdbcType=VARCHAR},
source = #{record.source,jdbcType=VARCHAR},
content = #{record.content,jdbcType=VARCHAR},
question_a = #{record.questionA,jdbcType=VARCHAR},
question_b = #{record.questionB,jdbcType=VARCHAR},
question_c = #{record.questionC,jdbcType=VARCHAR},
question_d = #{record.questionD,jdbcType=VARCHAR},
question_e = #{record.questionE,jdbcType=VARCHAR},
score = #{record.score,jdbcType=DECIMAL},
answer = #{record.answer,jdbcType=VARCHAR},
analysis = #{record.analysis,jdbcType=VARCHAR},
type = #{record.type,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
is_delete = #{record.isDelete,jdbcType=BIT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.resource_center.entity.SysObjectiveQuestions">
update sys_objective_questions
<set>
<if test="source != null">
source = #{source,jdbcType=VARCHAR},
</if>
<if test="content != null">
content = #{content,jdbcType=VARCHAR},
</if>
<if test="questionA != null">
question_a = #{questionA,jdbcType=VARCHAR},
</if>
<if test="questionB != null">
question_b = #{questionB,jdbcType=VARCHAR},
</if>
<if test="questionC != null">
question_c = #{questionC,jdbcType=VARCHAR},
</if>
<if test="questionD != null">
question_d = #{questionD,jdbcType=VARCHAR},
</if>
<if test="questionE != null">
question_e = #{questionE,jdbcType=VARCHAR},
</if>
<if test="score != null">
score = #{score,jdbcType=DECIMAL},
</if>
<if test="answer != null">
answer = #{answer,jdbcType=VARCHAR},
</if>
<if test="analysis != null">
analysis = #{analysis,jdbcType=VARCHAR},
</if>
<if test="type != null">
type = #{type,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="isDelete != null">
is_delete = #{isDelete,jdbcType=BIT},
</if>
</set>
where objective_id = #{objectiveId,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.sztzjy.resource_center.entity.SysObjectiveQuestions">
update sys_objective_questions
set source = #{source,jdbcType=VARCHAR},
content = #{content,jdbcType=VARCHAR},
question_a = #{questionA,jdbcType=VARCHAR},
question_b = #{questionB,jdbcType=VARCHAR},
question_c = #{questionC,jdbcType=VARCHAR},
question_d = #{questionD,jdbcType=VARCHAR},
question_e = #{questionE,jdbcType=VARCHAR},
score = #{score,jdbcType=DECIMAL},
answer = #{answer,jdbcType=VARCHAR},
analysis = #{analysis,jdbcType=VARCHAR},
type = #{type,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
is_delete = #{isDelete,jdbcType=BIT}
where objective_id = #{objectiveId,jdbcType=VARCHAR}
</update>
is_delete = #{record.isDelete,jdbcType=BIT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause"/>
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.resource_center.entity.SysObjectiveQuestions">
update sys_objective_questions
<set>
<if test="source != null">
source = #{source,jdbcType=VARCHAR},
</if>
<if test="content != null">
content = #{content,jdbcType=VARCHAR},
</if>
<if test="questionA != null">
question_a = #{questionA,jdbcType=VARCHAR},
</if>
<if test="questionB != null">
question_b = #{questionB,jdbcType=VARCHAR},
</if>
<if test="questionC != null">
question_c = #{questionC,jdbcType=VARCHAR},
</if>
<if test="questionD != null">
question_d = #{questionD,jdbcType=VARCHAR},
</if>
<if test="questionE != null">
question_e = #{questionE,jdbcType=VARCHAR},
</if>
<if test="score != null">
score = #{score,jdbcType=DECIMAL},
</if>
<if test="answer != null">
answer = #{answer,jdbcType=VARCHAR},
</if>
<if test="analysis != null">
analysis = #{analysis,jdbcType=VARCHAR},
</if>
<if test="type != null">
type = #{type,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="isDelete != null">
is_delete = #{isDelete,jdbcType=BIT},
</if>
</set>
where objective_id = #{objectiveId,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.sztzjy.resource_center.entity.SysObjectiveQuestions">
update sys_objective_questions
set source = #{source,jdbcType=VARCHAR},
content = #{content,jdbcType=VARCHAR},
question_a = #{questionA,jdbcType=VARCHAR},
question_b = #{questionB,jdbcType=VARCHAR},
question_c = #{questionC,jdbcType=VARCHAR},
question_d = #{questionD,jdbcType=VARCHAR},
question_e = #{questionE,jdbcType=VARCHAR},
score = #{score,jdbcType=DECIMAL},
answer = #{answer,jdbcType=VARCHAR},
analysis = #{analysis,jdbcType=VARCHAR},
type = #{type,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
is_delete = #{isDelete,jdbcType=BIT}
where objective_id = #{objectiveId,jdbcType=VARCHAR}
</update>
<resultMap id="DtoMap" type="com.sztzjy.resource_center.entity.dto.SysObjectiveQuestionsDto">
<id column="objective_id" jdbcType="VARCHAR" property="objectiveId"/>
<id column="id" jdbcType="VARCHAR" property="topicAndCourseId"/>
<result column="source" jdbcType="VARCHAR" property="source"/>
<result column="content" jdbcType="VARCHAR" property="content"/>
<result column="question_a" jdbcType="VARCHAR" property="questionA"/>
<result column="question_b" jdbcType="VARCHAR" property="questionB"/>
<result column="question_c" jdbcType="VARCHAR" property="questionC"/>
<result column="question_d" jdbcType="VARCHAR" property="questionD"/>
<result column="question_e" jdbcType="VARCHAR" property="questionE"/>
<result column="score" jdbcType="DECIMAL" property="score"/>
<result column="answer" jdbcType="VARCHAR" property="answer"/>
<result column="analysis" jdbcType="VARCHAR" property="analysis"/>
<result column="type" jdbcType="VARCHAR" property="type"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
<result column="one_id" jdbcType="VARCHAR" property="oneID"/>
<result column="two_id" jdbcType="VARCHAR" property="twoID"/>
<result column="three_id" jdbcType="VARCHAR" property="threeID"/>
<result column="one_name" jdbcType="VARCHAR" property="oneName"/>
<result column="two_name" jdbcType="VARCHAR" property="twoName"/>
<result column="three_name" jdbcType="VARCHAR" property="threeName"/>
</resultMap>
<!-- 条件查询-->
<select id="selectTopicByConditions" parameterType="java.lang.String" resultMap="DtoMap">
SELECT sb.*,st.one_id,st.two_id,st.three_id,st.id,st.one_name,st.two_name,st.three_name
FROM sys_objective_questions sb
left JOIN sys_topic_and_course st
on sb.objective_id = st.topic_id
<where>
<!-- <if test="oneID != null and oneID != ''">-->
<!-- st.one_id = #{oneID}-->
<!-- </if>-->
<!-- <if test="twoID != null and twoID != ''">-->
<!-- and st.two_id = #{twoID}-->
<!-- </if>-->
<!-- <if test="threeID != null and threeID != '' ">-->
<!-- and st.three_id = #{threeID}-->
<!-- </if>-->
<if test="type != null and type != '' ">
and sb.type = #{type}
</if>
<if test="content != null and content != ''">
and sb.content = #{content}
</if>
</where>
order by sb.create_time
</select>
<resultMap id="DtoMap" type="com.sztzjy.resource_center.entity.dto.SysObjectiveQuestionsDto">
<id column="objective_id" jdbcType="VARCHAR" property="objectiveId" />
<id column="id" jdbcType="VARCHAR" property="topicAndCourseId" />
<result column="source" jdbcType="VARCHAR" property="source" />
<result column="content" jdbcType="VARCHAR" property="content" />
<result column="question_a" jdbcType="VARCHAR" property="questionA" />
<result column="question_b" jdbcType="VARCHAR" property="questionB" />
<result column="question_c" jdbcType="VARCHAR" property="questionC" />
<result column="question_d" jdbcType="VARCHAR" property="questionD" />
<result column="question_e" jdbcType="VARCHAR" property="questionE" />
<result column="score" jdbcType="DECIMAL" property="score" />
<result column="answer" jdbcType="VARCHAR" property="answer" />
<result column="analysis" jdbcType="VARCHAR" property="analysis" />
<result column="type" jdbcType="VARCHAR" property="type" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="one_id" jdbcType="VARCHAR" property="oneID" />
<result column="two_id" jdbcType="VARCHAR" property="twoID" />
<result column="three_id" jdbcType="VARCHAR" property="threeId" />
<result column="one_name" jdbcType="VARCHAR" property="oneName" />
<result column="two_name" jdbcType="VARCHAR" property="twoName" />
<result column="three_name" jdbcType="VARCHAR" property="threeName" />
</resultMap>
<!-- 条件查询-->
<select id="getTopicByConfig" parameterType="java.lang.String" resultMap="DtoMap">
SELECT sb.*,st.one_id,st.two_id,st.three_id,st.id,st.one_name,st.two_name,st.three_name
FROM sys_topic_and_course st
JOIN sys_objective_questions sb
on sb.objective_id = st.topic_id
<where>
<if test="oneID != null and oneID != ''">
st.one_id = #{oneID}
</if>
<if test="twoID != null and twoID != ''">
and st.two_id = #{twoID}
</if>
<if test="threeID != null and threeID != '' ">
and st.three_id = #{threeID}
</if>
<if test="type != null and type != '' ">
and sb.type = #{type}
</if>
<if test="content != null and content != ''">
and sb.content = #{content}
</if>
</where>
order by sb.create_time
</select>
<!-- 条件查询-->
<select id="selectTopicByConditions" parameterType="java.lang.String" resultMap="DtoMap">
SELECT sb.*,st.one_id,st.two_id,st.three_id,st.id,st.one_name,st.two_name,st.three_name
FROM sys_objective_questions sb
JOIN sys_topic_and_course st
on sb.objective_id = st.topic_id
<where>
<if test="oneID != null and oneID != ''">
st.one_id = #{oneID}
</if>
<if test="twoID != null and twoID != ''">
and st.two_id = #{twoID}
</if>
<if test="threeID != null and threeID != '' ">
and st.three_id = #{threeID}
</if>
<if test="type != null and type != '' ">
and sb.type = #{type}
</if>
<if test="content != null and content != ''">
and sb.content = #{content}
</if>
</where>
order by sb.create_time
</select>
<insert id="insertBatch" parameterType="java.util.List">
INSERT INTO sys_objective_questions (
objective_id, source, content, question_a, question_b, question_c, question_d, question_e, score, answer, analysis, type, create_time, update_time, is_delete
) VALUES
<foreach collection="objectiveQuestionList" item="item" index="index" separator=",">
(
#{item.objectiveId}, #{item.source}, #{item.content}, #{item.questionA}, #{item.questionB}, #{item.questionC}, #{item.questionD}, #{item.questionE}, #{item.score}, #{item.answer}, #{item.analysis}, #{item.type}, #{item.createTime}, #{item.updateTime}, #{item.isDelete}
)
</foreach>
</insert>
<insert id="insertBatch" parameterType="java.util.List">
INSERT INTO sys_objective_questions (
objective_id, source, content, question_a, question_b, question_c, question_d, question_e, score, answer,
analysis, type, create_time, update_time, is_delete
) VALUES
<foreach collection="objectiveQuestionList" item="item" index="index" separator=",">
(
#{item.objectiveId}, #{item.source}, #{item.content}, #{item.questionA}, #{item.questionB},
#{item.questionC}, #{item.questionD}, #{item.questionE}, #{item.score}, #{item.answer}, #{item.analysis},
#{item.type}, #{item.createTime}, #{item.updateTime}, #{item.isDelete}
)
</foreach>
</insert>
</mapper>

@ -7,6 +7,9 @@
<result column="one_id" jdbcType="VARCHAR" property="oneId"/>
<result column="two_id" jdbcType="VARCHAR" property="twoId"/>
<result column="three_id" jdbcType="VARCHAR" property="threeId"/>
<result column="one_name" jdbcType="VARCHAR" property="oneName"/>
<result column="two_name" jdbcType="VARCHAR" property="twoName"/>
<result column="three_name" jdbcType="VARCHAR" property="threeName"/>
</resultMap>
<sql id="Example_Where_Clause">
<where>
@ -70,7 +73,7 @@
</sql>
<sql id="Base_Column_List">
id
, resource_id, one_id, two_id, three_id
, resource_id, one_id, two_id, three_id, one_name, two_name, three_name
</sql>
<select id="selectByExample" parameterType="com.sztzjy.resource_center.entity.SysResourceAndCourseExample"
resultMap="BaseResultMap">
@ -106,9 +109,11 @@
</delete>
<insert id="insert" parameterType="com.sztzjy.resource_center.entity.SysResourceAndCourse">
insert into sys_resource_and_course (id, resource_id, one_id,
two_id, three_id)
two_id, three_id, one_name,
two_name, three_name)
values (#{id,jdbcType=VARCHAR}, #{resourceId,jdbcType=VARCHAR}, #{oneId,jdbcType=VARCHAR},
#{twoId,jdbcType=VARCHAR}, #{threeId,jdbcType=VARCHAR})
#{twoId,jdbcType=VARCHAR}, #{threeId,jdbcType=VARCHAR}, #{oneName,jdbcType=VARCHAR},
#{twoName,jdbcType=VARCHAR}, #{threeName,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.sztzjy.resource_center.entity.SysResourceAndCourse">
insert into sys_resource_and_course
@ -128,6 +133,15 @@
<if test="threeId != null">
three_id,
</if>
<if test="oneName != null">
one_name,
</if>
<if test="twoName != null">
two_name,
</if>
<if test="threeName != null">
three_name,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
@ -145,6 +159,15 @@
<if test="threeId != null">
#{threeId,jdbcType=VARCHAR},
</if>
<if test="oneName != null">
#{oneName,jdbcType=VARCHAR},
</if>
<if test="twoName != null">
#{twoName,jdbcType=VARCHAR},
</if>
<if test="threeName != null">
#{threeName,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.sztzjy.resource_center.entity.SysResourceAndCourseExample"
@ -172,6 +195,15 @@
<if test="record.threeId != null">
three_id = #{record.threeId,jdbcType=VARCHAR},
</if>
<if test="record.oneName != null">
one_name = #{record.oneName,jdbcType=VARCHAR},
</if>
<if test="record.twoName != null">
two_name = #{record.twoName,jdbcType=VARCHAR},
</if>
<if test="record.threeName != null">
three_name = #{record.threeName,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause"/>
@ -183,7 +215,10 @@
resource_id = #{record.resourceId,jdbcType=VARCHAR},
one_id = #{record.oneId,jdbcType=VARCHAR},
two_id = #{record.twoId,jdbcType=VARCHAR},
three_id = #{record.threeId,jdbcType=VARCHAR}
three_id = #{record.threeId,jdbcType=VARCHAR},
one_name = #{record.oneName,jdbcType=VARCHAR},
two_name = #{record.twoName,jdbcType=VARCHAR},
three_name = #{record.threeName,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause"/>
</if>
@ -203,6 +238,15 @@
<if test="threeId != null">
three_id = #{threeId,jdbcType=VARCHAR},
</if>
<if test="oneName != null">
one_name = #{oneName,jdbcType=VARCHAR},
</if>
<if test="twoName != null">
two_name = #{twoName,jdbcType=VARCHAR},
</if>
<if test="threeName != null">
three_name = #{threeName,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
@ -211,7 +255,10 @@
set resource_id = #{resourceId,jdbcType=VARCHAR},
one_id = #{oneId,jdbcType=VARCHAR},
two_id = #{twoId,jdbcType=VARCHAR},
three_id = #{threeId,jdbcType=VARCHAR}
three_id = #{threeId,jdbcType=VARCHAR},
one_name = #{oneName,jdbcType=VARCHAR},
two_name = #{twoName,jdbcType=VARCHAR},
three_name = #{threeName,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
@ -239,19 +286,4 @@
</foreach>
</insert>
<select id="selectResourceId" parameterType="java.lang.String" resultType="java.lang.String">
SELECT resource_id FROM sys_resource_and_course
<where>
<if test="oneID != null and oneID !=''">
one_id = #{oneID}
</if>
<if test="twoID != null and twoID !=''">
and two_id = #{twoID}
</if>
<if test="threeID != null and threeID !=''">
and three_id = #{threeID}
</if>
</where>
</select>
</mapper>

@ -1,373 +1,415 @@
<?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">
<mapper namespace="com.sztzjy.resource_center.mapper.SysResourceMapper">
<resultMap id="BaseResultMap" type="com.sztzjy.resource_center.entity.SysResource">
<id column="resource_id" jdbcType="VARCHAR" property="resourceId" />
<result column="resource_name" jdbcType="VARCHAR" property="resourceName" />
<result column="url" jdbcType="VARCHAR" property="url" />
<result column="picture_url" jdbcType="VARCHAR" property="pictureUrl" />
<result column="resource_type" jdbcType="VARCHAR" property="resourceType" />
<result column="source" jdbcType="VARCHAR" property="source" />
<result column="one_tag" jdbcType="VARCHAR" property="oneTag" />
<result column="one_name" jdbcType="VARCHAR" property="oneName" />
<result column="two_tag" jdbcType="VARCHAR" property="twoTag" />
<result column="two_name" jdbcType="VARCHAR" property="twoName" />
<result column="three_tag" jdbcType="VARCHAR" property="threeTag" />
<result column="three_name" jdbcType="VARCHAR" property="threeName" />
<result column="status" jdbcType="INTEGER" property="status" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
<resultMap id="BaseResultMap" type="com.sztzjy.resource_center.entity.SysResource">
<id column="resource_id" jdbcType="VARCHAR" property="resourceId"/>
<result column="resource_name" jdbcType="VARCHAR" property="resourceName"/>
<result column="url" jdbcType="VARCHAR" property="url"/>
<result column="picture_url" jdbcType="VARCHAR" property="pictureUrl"/>
<result column="resource_type" jdbcType="VARCHAR" property="resourceType"/>
<result column="source" jdbcType="VARCHAR" property="source"/>
<result column="one_tag" jdbcType="VARCHAR" property="oneTag"/>
<result column="one_name" jdbcType="VARCHAR" property="oneName"/>
<result column="two_tag" jdbcType="VARCHAR" property="twoTag"/>
<result column="two_name" jdbcType="VARCHAR" property="twoName"/>
<result column="three_tag" jdbcType="VARCHAR" property="threeTag"/>
<result column="three_name" jdbcType="VARCHAR" property="threeName"/>
<result column="status" jdbcType="INTEGER" property="status"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="("
separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="("
separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
resource_id, resource_name, url, picture_url, resource_type, source, one_tag, one_name,
</where>
</sql>
<sql id="Base_Column_List">
resource_id
, resource_name, url, picture_url, resource_type, source, one_tag, one_name,
two_tag, two_name, three_tag, three_name, status, create_time
</sql>
<select id="selectByExample" parameterType="com.sztzjy.resource_center.entity.SysResourceExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from sys_resource
<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_resource
where resource_id = #{resourceId,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from sys_resource
where resource_id = #{resourceId,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="com.sztzjy.resource_center.entity.SysResourceExample">
delete from sys_resource
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.sztzjy.resource_center.entity.SysResource">
insert into sys_resource (resource_id, resource_name, url,
picture_url, resource_type, source,
one_tag, one_name, two_tag,
two_name, three_tag, three_name,
status, create_time)
values (#{resourceId,jdbcType=VARCHAR}, #{resourceName,jdbcType=VARCHAR}, #{url,jdbcType=VARCHAR},
#{pictureUrl,jdbcType=VARCHAR}, #{resourceType,jdbcType=VARCHAR}, #{source,jdbcType=VARCHAR},
#{oneTag,jdbcType=VARCHAR}, #{oneName,jdbcType=VARCHAR}, #{twoTag,jdbcType=VARCHAR},
#{twoName,jdbcType=VARCHAR}, #{threeTag,jdbcType=VARCHAR}, #{threeName,jdbcType=VARCHAR},
#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.sztzjy.resource_center.entity.SysResource">
insert into sys_resource
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="resourceId != null">
resource_id,
</if>
<if test="resourceName != null">
resource_name,
</if>
<if test="url != null">
url,
</if>
<if test="pictureUrl != null">
picture_url,
</if>
<if test="resourceType != null">
resource_type,
</if>
<if test="source != null">
source,
</if>
<if test="oneTag != null">
one_tag,
</if>
<if test="oneName != null">
one_name,
</if>
<if test="twoTag != null">
two_tag,
</if>
<if test="twoName != null">
two_name,
</if>
<if test="threeTag != null">
three_tag,
</if>
<if test="threeName != null">
three_name,
</if>
<if test="status != null">
status,
</if>
<if test="createTime != null">
create_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="resourceId != null">
#{resourceId,jdbcType=VARCHAR},
</if>
<if test="resourceName != null">
#{resourceName,jdbcType=VARCHAR},
</if>
<if test="url != null">
#{url,jdbcType=VARCHAR},
</if>
<if test="pictureUrl != null">
#{pictureUrl,jdbcType=VARCHAR},
</if>
<if test="resourceType != null">
#{resourceType,jdbcType=VARCHAR},
</if>
<if test="source != null">
#{source,jdbcType=VARCHAR},
</if>
<if test="oneTag != null">
#{oneTag,jdbcType=VARCHAR},
</if>
<if test="oneName != null">
#{oneName,jdbcType=VARCHAR},
</if>
<if test="twoTag != null">
#{twoTag,jdbcType=VARCHAR},
</if>
<if test="twoName != null">
#{twoName,jdbcType=VARCHAR},
</if>
<if test="threeTag != null">
#{threeTag,jdbcType=VARCHAR},
</if>
<if test="threeName != null">
#{threeName,jdbcType=VARCHAR},
</if>
<if test="status != null">
#{status,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.sztzjy.resource_center.entity.SysResourceExample" resultType="java.lang.Long">
select count(*) from sys_resource
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update sys_resource
<set>
<if test="record.resourceId != null">
resource_id = #{record.resourceId,jdbcType=VARCHAR},
</if>
<if test="record.resourceName != null">
</sql>
<select id="selectByExample" parameterType="com.sztzjy.resource_center.entity.SysResourceExample"
resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List"/>
from sys_resource
<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_resource
where resource_id = #{resourceId,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete
from sys_resource
where resource_id = #{resourceId,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="com.sztzjy.resource_center.entity.SysResourceExample">
delete from sys_resource
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if>
</delete>
<insert id="insert" parameterType="com.sztzjy.resource_center.entity.SysResource">
insert into sys_resource (resource_id, resource_name, url,
picture_url, resource_type, source,
one_tag, one_name, two_tag,
two_name, three_tag, three_name,
status, create_time)
values (#{resourceId,jdbcType=VARCHAR}, #{resourceName,jdbcType=VARCHAR}, #{url,jdbcType=VARCHAR},
#{pictureUrl,jdbcType=VARCHAR}, #{resourceType,jdbcType=VARCHAR}, #{source,jdbcType=VARCHAR},
#{oneTag,jdbcType=VARCHAR}, #{oneName,jdbcType=VARCHAR}, #{twoTag,jdbcType=VARCHAR},
#{twoName,jdbcType=VARCHAR}, #{threeTag,jdbcType=VARCHAR}, #{threeName,jdbcType=VARCHAR},
#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.sztzjy.resource_center.entity.SysResource">
insert into sys_resource
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="resourceId != null">
resource_id,
</if>
<if test="resourceName != null">
resource_name,
</if>
<if test="url != null">
url,
</if>
<if test="pictureUrl != null">
picture_url,
</if>
<if test="resourceType != null">
resource_type,
</if>
<if test="source != null">
source,
</if>
<if test="oneTag != null">
one_tag,
</if>
<if test="oneName != null">
one_name,
</if>
<if test="twoTag != null">
two_tag,
</if>
<if test="twoName != null">
two_name,
</if>
<if test="threeTag != null">
three_tag,
</if>
<if test="threeName != null">
three_name,
</if>
<if test="status != null">
status,
</if>
<if test="createTime != null">
create_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="resourceId != null">
#{resourceId,jdbcType=VARCHAR},
</if>
<if test="resourceName != null">
#{resourceName,jdbcType=VARCHAR},
</if>
<if test="url != null">
#{url,jdbcType=VARCHAR},
</if>
<if test="pictureUrl != null">
#{pictureUrl,jdbcType=VARCHAR},
</if>
<if test="resourceType != null">
#{resourceType,jdbcType=VARCHAR},
</if>
<if test="source != null">
#{source,jdbcType=VARCHAR},
</if>
<if test="oneTag != null">
#{oneTag,jdbcType=VARCHAR},
</if>
<if test="oneName != null">
#{oneName,jdbcType=VARCHAR},
</if>
<if test="twoTag != null">
#{twoTag,jdbcType=VARCHAR},
</if>
<if test="twoName != null">
#{twoName,jdbcType=VARCHAR},
</if>
<if test="threeTag != null">
#{threeTag,jdbcType=VARCHAR},
</if>
<if test="threeName != null">
#{threeName,jdbcType=VARCHAR},
</if>
<if test="status != null">
#{status,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.sztzjy.resource_center.entity.SysResourceExample"
resultType="java.lang.Long">
select count(*) from sys_resource
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update sys_resource
<set>
<if test="record.resourceId != null">
resource_id = #{record.resourceId,jdbcType=VARCHAR},
</if>
<if test="record.resourceName != null">
resource_name = #{record.resourceName,jdbcType=VARCHAR},
</if>
<if test="record.url != null">
url = #{record.url,jdbcType=VARCHAR},
</if>
<if test="record.pictureUrl != null">
picture_url = #{record.pictureUrl,jdbcType=VARCHAR},
</if>
<if test="record.resourceType != null">
resource_type = #{record.resourceType,jdbcType=VARCHAR},
</if>
<if test="record.source != null">
source = #{record.source,jdbcType=VARCHAR},
</if>
<if test="record.oneTag != null">
one_tag = #{record.oneTag,jdbcType=VARCHAR},
</if>
<if test="record.oneName != null">
one_name = #{record.oneName,jdbcType=VARCHAR},
</if>
<if test="record.twoTag != null">
two_tag = #{record.twoTag,jdbcType=VARCHAR},
</if>
<if test="record.twoName != null">
two_name = #{record.twoName,jdbcType=VARCHAR},
</if>
<if test="record.threeTag != null">
three_tag = #{record.threeTag,jdbcType=VARCHAR},
</if>
<if test="record.threeName != null">
three_name = #{record.threeName,jdbcType=VARCHAR},
</if>
<if test="record.status != null">
status = #{record.status,jdbcType=INTEGER},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause"/>
</if>
</update>
<update id="updateByExample" parameterType="map">
update sys_resource
set resource_id = #{record.resourceId,jdbcType=VARCHAR},
resource_name = #{record.resourceName,jdbcType=VARCHAR},
</if>
<if test="record.url != null">
url = #{record.url,jdbcType=VARCHAR},
</if>
<if test="record.pictureUrl != null">
picture_url = #{record.pictureUrl,jdbcType=VARCHAR},
</if>
<if test="record.resourceType != null">
resource_type = #{record.resourceType,jdbcType=VARCHAR},
</if>
<if test="record.source != null">
source = #{record.source,jdbcType=VARCHAR},
</if>
<if test="record.oneTag != null">
one_tag = #{record.oneTag,jdbcType=VARCHAR},
</if>
<if test="record.oneName != null">
one_name = #{record.oneName,jdbcType=VARCHAR},
</if>
<if test="record.twoTag != null">
two_tag = #{record.twoTag,jdbcType=VARCHAR},
</if>
<if test="record.twoName != null">
two_name = #{record.twoName,jdbcType=VARCHAR},
</if>
<if test="record.threeTag != null">
three_tag = #{record.threeTag,jdbcType=VARCHAR},
</if>
<if test="record.threeName != null">
three_name = #{record.threeName,jdbcType=VARCHAR},
</if>
<if test="record.status != null">
status = #{record.status,jdbcType=INTEGER},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update sys_resource
set resource_id = #{record.resourceId,jdbcType=VARCHAR},
resource_name = #{record.resourceName,jdbcType=VARCHAR},
url = #{record.url,jdbcType=VARCHAR},
picture_url = #{record.pictureUrl,jdbcType=VARCHAR},
resource_type = #{record.resourceType,jdbcType=VARCHAR},
source = #{record.source,jdbcType=VARCHAR},
one_tag = #{record.oneTag,jdbcType=VARCHAR},
one_name = #{record.oneName,jdbcType=VARCHAR},
two_tag = #{record.twoTag,jdbcType=VARCHAR},
two_name = #{record.twoName,jdbcType=VARCHAR},
three_tag = #{record.threeTag,jdbcType=VARCHAR},
three_name = #{record.threeName,jdbcType=VARCHAR},
status = #{record.status,jdbcType=INTEGER},
create_time = #{record.createTime,jdbcType=TIMESTAMP}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.resource_center.entity.SysResource">
update sys_resource
<set>
<if test="resourceName != null">
resource_name = #{resourceName,jdbcType=VARCHAR},
</if>
<if test="url != null">
url = #{url,jdbcType=VARCHAR},
</if>
<if test="pictureUrl != null">
picture_url = #{pictureUrl,jdbcType=VARCHAR},
</if>
<if test="resourceType != null">
resource_type = #{resourceType,jdbcType=VARCHAR},
</if>
<if test="source != null">
source = #{source,jdbcType=VARCHAR},
</if>
<if test="oneTag != null">
one_tag = #{oneTag,jdbcType=VARCHAR},
</if>
<if test="oneName != null">
one_name = #{oneName,jdbcType=VARCHAR},
</if>
<if test="twoTag != null">
two_tag = #{twoTag,jdbcType=VARCHAR},
</if>
<if test="twoName != null">
two_name = #{twoName,jdbcType=VARCHAR},
</if>
<if test="threeTag != null">
three_tag = #{threeTag,jdbcType=VARCHAR},
</if>
<if test="threeName != null">
three_name = #{threeName,jdbcType=VARCHAR},
</if>
<if test="status != null">
status = #{status,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
</set>
where resource_id = #{resourceId,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.sztzjy.resource_center.entity.SysResource">
update sys_resource
set resource_name = #{resourceName,jdbcType=VARCHAR},
url = #{url,jdbcType=VARCHAR},
picture_url = #{pictureUrl,jdbcType=VARCHAR},
resource_type = #{resourceType,jdbcType=VARCHAR},
source = #{source,jdbcType=VARCHAR},
one_tag = #{oneTag,jdbcType=VARCHAR},
one_name = #{oneName,jdbcType=VARCHAR},
two_tag = #{twoTag,jdbcType=VARCHAR},
two_name = #{twoName,jdbcType=VARCHAR},
three_tag = #{threeTag,jdbcType=VARCHAR},
three_name = #{threeName,jdbcType=VARCHAR},
status = #{status,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP}
where resource_id = #{resourceId,jdbcType=VARCHAR}
</update>
create_time = #{record.createTime,jdbcType=TIMESTAMP}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause"/>
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.resource_center.entity.SysResource">
update sys_resource
<set>
<if test="resourceName != null">
resource_name = #{resourceName,jdbcType=VARCHAR},
</if>
<if test="url != null">
url = #{url,jdbcType=VARCHAR},
</if>
<if test="pictureUrl != null">
picture_url = #{pictureUrl,jdbcType=VARCHAR},
</if>
<if test="resourceType != null">
resource_type = #{resourceType,jdbcType=VARCHAR},
</if>
<if test="source != null">
source = #{source,jdbcType=VARCHAR},
</if>
<if test="oneTag != null">
one_tag = #{oneTag,jdbcType=VARCHAR},
</if>
<if test="oneName != null">
one_name = #{oneName,jdbcType=VARCHAR},
</if>
<if test="twoTag != null">
two_tag = #{twoTag,jdbcType=VARCHAR},
</if>
<if test="twoName != null">
two_name = #{twoName,jdbcType=VARCHAR},
</if>
<if test="threeTag != null">
three_tag = #{threeTag,jdbcType=VARCHAR},
</if>
<if test="threeName != null">
three_name = #{threeName,jdbcType=VARCHAR},
</if>
<if test="status != null">
status = #{status,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
</set>
where resource_id = #{resourceId,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.sztzjy.resource_center.entity.SysResource">
update sys_resource
set resource_name = #{resourceName,jdbcType=VARCHAR},
url = #{url,jdbcType=VARCHAR},
picture_url = #{pictureUrl,jdbcType=VARCHAR},
resource_type = #{resourceType,jdbcType=VARCHAR},
source = #{source,jdbcType=VARCHAR},
one_tag = #{oneTag,jdbcType=VARCHAR},
one_name = #{oneName,jdbcType=VARCHAR},
two_tag = #{twoTag,jdbcType=VARCHAR},
two_name = #{twoName,jdbcType=VARCHAR},
three_tag = #{threeTag,jdbcType=VARCHAR},
three_name = #{threeName,jdbcType=VARCHAR},
status = #{status,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP}
where resource_id = #{resourceId,jdbcType=VARCHAR}
</update>
<resultMap id="DtoMap" type="com.sztzjy.resource_center.entity.SysResource">
<id column="resource_id" jdbcType="VARCHAR" property="resourceId"/>
<result column="resource_name" jdbcType="VARCHAR" property="resourceName"/>
<result column="url" jdbcType="VARCHAR" property="url"/>
<result column="picture_url" jdbcType="VARCHAR" property="pictureUrl"/>
<result column="resource_type" jdbcType="VARCHAR" property="resourceType"/>
<result column="source" jdbcType="VARCHAR" property="source"/>
<result column="one_id" jdbcType="VARCHAR" property="oneTag"/>
<result column="one_name" jdbcType="VARCHAR" property="oneName"/>
<result column="two_id" jdbcType="VARCHAR" property="twoTag"/>
<result column="two_name" jdbcType="VARCHAR" property="twoName"/>
<result column="three_id" jdbcType="VARCHAR" property="threeTag"/>
<result column="three_name" jdbcType="VARCHAR" property="threeName"/>
<result column="status" jdbcType="INTEGER" property="status"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
</resultMap>
<!--重复 join-->
<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
FROM sys_resource sr
JOIN
sys_resource_and_course sc
on sr.resource_id =sc.resource_id
<where>
<if test="oneId != null and oneId != ''">
sc.one_id = #{oneId}
</if>
<if test="twoId != null and twoId != ''">
and sc.two_id = #{twoId}
</if>
<if test="threeId != null and threeId != ''">
and sc.three_id = #{threeId}
</if>
<if test="resourceName != null and resourceName != ''">
and sr.resource_name = #{resourceName}
</if>
</where>
order by sr.create_time
</select>
<select id="selectResource" parameterType="java.lang.String" resultMap="BaseResultMap">
SELECT *
FROM sys_resource
<where>
<if test="oneId != null and oneId != ''">
one_tag = #{oneId}
</if>
<if test="twoId != null and twoId != ''">
and two_tag = #{twoId}
</if>
<if test="threeId != null and threeId != ''">
and three_tag = #{threeId}
</if>
<if test="resourceName != null and resourceName != ''">
and resource_name = #{resourceName}
</if>
</where>
order by create_time
</select>
<!--不重复 leftjoin-->
<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
FROM sys_resource sr
left JOIN
sys_resource_and_course sc
on sr.resource_id =sc.resource_id
<where>
sc.one_id = #{oneId}
and sc.two_id = #{twoId}
and sc.three_id = #{threeId}
</where>
order by sr.create_time
</select>
</mapper>
Loading…
Cancel
Save