新增三方接口

master
xiaoCJ 8 months ago
parent 643fa12b28
commit d12d97df5c

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

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

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

@ -21,6 +21,12 @@ public class SysResourceAndCourse {
@ApiModelProperty("三级目录ID/节ID") @ApiModelProperty("三级目录ID/节ID")
private String threeId; private String threeId;
private String oneName;
private String twoName;
private String threeName;
public String getId() { public String getId() {
return id; return id;
} }
@ -60,4 +66,28 @@ public class SysResourceAndCourse {
public void setThreeId(String threeId) { public void setThreeId(String threeId) {
this.threeId = threeId == null ? null : threeId.trim(); 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"); addCriterion("three_id not between", value1, value2, "threeId");
return (Criteria) this; 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 { 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 com.sztzjy.resource_center.entity.SysObjectiveQuestions;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
/** /**
* @Author xcj * @Author xcj

@ -38,4 +38,10 @@ public interface SysObjectiveQuestionsMapper {
@Param("content") String content); @Param("content") String content);
int insertBatch(@Param("objectiveQuestionList") List<SysObjectiveQuestions> objectiveQuestionList); 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.SysResourceAndCourse;
import com.sztzjy.resource_center.entity.SysResourceAndCourseExample; 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 java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper @Mapper
public interface SysResourceAndCourseMapper { public interface SysResourceAndCourseMapper {
long countByExample(SysResourceAndCourseExample example); long countByExample(SysResourceAndCourseExample example);
@ -34,10 +32,10 @@ public interface SysResourceAndCourseMapper {
void batchDeleteByIds(@Param("idList") List<String> idList); 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, List<String> selectResourceId(@Param("oneID") String oneID,
@Param("twoID") String twoID, @Param("twoID") String twoID,
@Param("threeID") String threeID); @Param("threeID") String threeID);
void batchInsert(@Param("resourceAndCourses") List<SysResourceAndCourse> resourceAndCourses); 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.SysResource;
import com.sztzjy.resource_center.entity.SysResourceExample; import com.sztzjy.resource_center.entity.SysResourceExample;
import java.util.List; import java.util.List;
import com.sztzjy.resource_center.entity.dto.SysResourceDto;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@Mapper @Mapper
public interface SysResourceMapper { public interface SysResourceMapper {
long countByExample(SysResourceExample example); long countByExample(SysResourceExample example);
@ -31,8 +34,13 @@ public interface SysResourceMapper {
int updateByPrimaryKey(SysResource record); int updateByPrimaryKey(SysResource record);
List<SysResource> selectResource(@Param("oneId") String oneId, List<SysResourceDto> selectResource(@Param("oneId") String oneId,
@Param("twoId") String twoId, @Param("twoId") String twoId,
@Param("threeId") String threeId, @Param("threeId") String threeId);
@Param("resourceName") String resourceName);
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_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" />-->
@ -56,8 +56,8 @@
<!-- <table tableName="admin_data" domainObjectName="AdminData" />--> <!-- <table tableName="admin_data" domainObjectName="AdminData" />-->
<!-- <table tableName="admin_data_label" domainObjectName="AdminDataLabel" />--> <!-- <table tableName="admin_data_label" domainObjectName="AdminDataLabel" />-->
<!-- <table tableName="admin_file" domainObjectName="AdminFile" />--> <!-- <table tableName="admin_file" domainObjectName="AdminFile" />-->
<table tableName="sys_knowledge_and_course" domainObjectName="SysKnowledgeAndCourse" /> <!-- <table tableName="sys_knowledge_and_course" domainObjectName="SysKnowledgeAndCourse" />-->
<table tableName="sys_knowledge_summary" domainObjectName="SysKnowledgeSummary" /> <!-- <table tableName="sys_knowledge_summary" domainObjectName="SysKnowledgeSummary" />-->
<!-- <table tableName="sys_two_catalog" domainObjectName="SysTwoCatalog" />--> <!-- <table tableName="sys_two_catalog" domainObjectName="SysTwoCatalog" />-->
</context> </context>

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

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

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