diff --git a/src/main/java/com/sztzjy/resource_center/controller/CourseController.java b/src/main/java/com/sztzjy/resource_center/controller/CourseController.java index 1236303..126c144 100644 --- a/src/main/java/com/sztzjy/resource_center/controller/CourseController.java +++ b/src/main/java/com/sztzjy/resource_center/controller/CourseController.java @@ -7,6 +7,8 @@ import com.sztzjy.resource_center.config.Constant; import com.sztzjy.resource_center.entity.SysOneCatalog; import com.sztzjy.resource_center.entity.SysOneCatalogExample; import com.sztzjy.resource_center.mapper.SysOneCatalogMapper; +import com.sztzjy.resource_center.mapper.SysThreeCatalogMapper; +import com.sztzjy.resource_center.mapper.SysTwoCatalogMapper; import com.sztzjy.resource_center.util.ResultEntity; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -14,10 +16,14 @@ import io.swagger.annotations.ApiParam; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; import java.util.Date; import java.util.List; +import java.util.Map; /** * @Author xcj @@ -30,6 +36,11 @@ public class CourseController { @Autowired private SysOneCatalogMapper sysOneCatalogMapper; + @Autowired + private SysTwoCatalogMapper sysTwoCatalogMapper; + @Autowired + private SysThreeCatalogMapper sysThreeCatalogMapper; + @AnonymousAccess @ApiOperation("新增课程") @@ -55,4 +66,29 @@ public class CourseController { } } + + @AnonymousAccess + @ApiOperation("课程下拉框") + @PostMapping("getAllOneCatalogList") + public ResultEntity>> getAllOneCatalogList() { + return new ResultEntity<>(sysOneCatalogMapper.getAllOneCatalogList()); + } + + + @AnonymousAccess + @ApiOperation("章下拉框") + @PostMapping("getAllTwoCatalogList") + public ResultEntity>> getAllTwoCatalogList() { + return new ResultEntity<>(sysTwoCatalogMapper.getAllTwoCatalogList()); + } + + + @AnonymousAccess + @ApiOperation("节下拉框") + @PostMapping("getAllThreeCatalogList") + public ResultEntity>> getAllThreeCatalogList() { + return new ResultEntity<>(sysThreeCatalogMapper.getAllThreeCatalogList()); + } + + } diff --git a/src/main/java/com/sztzjy/resource_center/controller/ResourceController.java b/src/main/java/com/sztzjy/resource_center/controller/ResourceController.java index d5ad4c3..824449d 100644 --- a/src/main/java/com/sztzjy/resource_center/controller/ResourceController.java +++ b/src/main/java/com/sztzjy/resource_center/controller/ResourceController.java @@ -1,10 +1,27 @@ package com.sztzjy.resource_center.controller; -import com.sztzjy.resource_center.mapper.SysResourceDataMapper; +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.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.ResultEntity; +import com.sztzjy.resource_center.util.file.IFileUtil; import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.*; + +import java.util.Date; +import java.util.List; /** * @Author xcj @@ -16,5 +33,74 @@ import org.springframework.web.bind.annotation.RestController; @RequestMapping("api/sys/resource") public class ResourceController { @Autowired - private SysResourceDataMapper sysResourceDataMapper; + private SysResourceMapper sysResourceMapper; + @Autowired + private SysResourceAndCourseMapper sysResourceAndCourseMapper; + @Autowired + private IFileUtil fileUtil; + + @AnonymousAccess + @ApiOperation("上传资源") + @PostMapping("uploadResource") + public ResultEntity uploadResource(@ApiParam("") @RequestBody SysResourceDto dto) { + if (StringUtils.isBlank(dto.getResourceName())) { + return new ResultEntity<>(HttpStatus.BAD_REQUEST, "请输入资源名称!"); + } + if (dto.getFile() == null) { + return new ResultEntity<>(HttpStatus.BAD_REQUEST, "请上传文件!"); + } + //取到文件后缀名 + String fileName = dto.getResourceName(); + int lastIndex = fileName.lastIndexOf("."); + String extension = fileName.substring(lastIndex); + + SysResource sysResource = new SysResource(); + //判断文件type //todo 格式可能不够全 + if (extension.equals(".pdf") || extension.equals(".ppt") || extension.equals(".pptx") + || extension.equals(".xlsx") || extension.equals(".xls") + || extension.equals(".doc") || extension.equals(".docx")) { + sysResource.setResourceType("课件"); + } else if (extension.equals(".mp4") || extension.equals(".wmv") || extension.equals(".avi")) { + sysResource.setResourceType("视频"); + } else { + return new ResultEntity<>(HttpStatus.BAD_REQUEST, "文件类型不支持!"); + } + String url = fileUtil.upload(dto.getFile()); + String uuid = IdUtil.randomUUID(); + sysResource.setResourceId(uuid); + sysResource.setUrl(url); + sysResource.setSchoolId(dto.getSchoolId()); + sysResource.setResourceName(dto.getResourceName()); + sysResource.setCreateTime(new Date()); //todo 测试修改资源之后 新增时间会不会变化,有变化就错了 + sysResourceMapper.insert(sysResource); + + //绑定资源的对应关系 + SysResourceAndCourse sysResourceAndCourse = new SysResourceAndCourse(); + sysResourceAndCourse.setId(IdUtil.randomUUID()); + sysResourceAndCourse.setOneId(dto.getOneId()); + sysResourceAndCourse.setOneName(dto.getOneName()); + sysResourceAndCourse.setTwoId(dto.getTwoId()); + sysResourceAndCourse.setTwoName(dto.getTwoName()); + sysResourceAndCourse.setThreeId(dto.getThreeId()); + sysResourceAndCourse.setThreeName(dto.getThreeName()); + sysResourceAndCourse.setResourceId(uuid); //资源ID + sysResourceAndCourseMapper.insert(sysResourceAndCourse); + return new ResultEntity<>(HttpStatus.OK, "上传成功!"); + } + + + @AnonymousAccess + @ApiOperation("资源列表展示") + @PostMapping("selectResource") + public ResultEntity> 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 int index, + @RequestParam int size) { + PageHelper.startPage(index, size); + List sysResourceDtos = sysResourceMapper.selectResource(oneID, twoID, threeID, resourceName); + PageInfo pageInfo = new PageInfo(sysResourceDtos); + return new ResultEntity>(pageInfo); + } } diff --git a/src/main/java/com/sztzjy/resource_center/entity/SysResource.java b/src/main/java/com/sztzjy/resource_center/entity/SysResource.java new file mode 100644 index 0000000..54be78d --- /dev/null +++ b/src/main/java/com/sztzjy/resource_center/entity/SysResource.java @@ -0,0 +1,100 @@ +package com.sztzjy.resource_center.entity; + +import java.util.Date; + +import io.swagger.annotations.ApiModelProperty; +/** + * 资源表,用于存储各种资源信息 + * + * @author xcj + * sys_resource + */ +public class SysResource { + @ApiModelProperty("资源ID") + private String resourceId; + + @ApiModelProperty("资源名称") + private String resourceName; + + @ApiModelProperty("文件保存路径") + private String url; + + @ApiModelProperty("资源类型 /视频/课件") + private String resourceType; + + @ApiModelProperty("来源(内置/老师新增)") + private String source; + + @ApiModelProperty("学校ID") + private String schoolId; + + @ApiModelProperty("创建时间") + private Date createTime; + + @ApiModelProperty("更新时间") + private Date updateTime; + + public String getResourceId() { + return resourceId; + } + + public void setResourceId(String resourceId) { + this.resourceId = resourceId == null ? null : resourceId.trim(); + } + + public String getResourceName() { + return resourceName; + } + + public void setResourceName(String resourceName) { + this.resourceName = resourceName == null ? null : resourceName.trim(); + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url == null ? null : url.trim(); + } + + public String getResourceType() { + return resourceType; + } + + public void setResourceType(String resourceType) { + this.resourceType = resourceType == null ? null : resourceType.trim(); + } + + public String getSource() { + return source; + } + + public void setSource(String source) { + this.source = source == null ? null : source.trim(); + } + + public String getSchoolId() { + return schoolId; + } + + public void setSchoolId(String schoolId) { + this.schoolId = schoolId == null ? null : schoolId.trim(); + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Date getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } +} \ No newline at end of file diff --git a/src/main/java/com/sztzjy/resource_center/entity/SysResourceAndCourse.java b/src/main/java/com/sztzjy/resource_center/entity/SysResourceAndCourse.java index 6e921f8..8107b25 100644 --- a/src/main/java/com/sztzjy/resource_center/entity/SysResourceAndCourse.java +++ b/src/main/java/com/sztzjy/resource_center/entity/SysResourceAndCourse.java @@ -9,16 +9,26 @@ import io.swagger.annotations.ApiModelProperty; public class SysResourceAndCourse { private String id; + @ApiModelProperty("资源ID") + private String resourceId; + @ApiModelProperty("一级目录ID/课程ID") private String oneId; + @ApiModelProperty("课程名称") + private String oneName; + @ApiModelProperty("二级目录ID/章ID") private String twoId; + @ApiModelProperty("章名称") + private String twoName; + @ApiModelProperty("三级目录ID/节ID") private String threeId; - private Integer resourceDataId; + @ApiModelProperty("节名称") + private String threeName; public String getId() { return id; @@ -28,6 +38,14 @@ public class SysResourceAndCourse { this.id = id == null ? null : id.trim(); } + public String getResourceId() { + return resourceId; + } + + public void setResourceId(String resourceId) { + this.resourceId = resourceId == null ? null : resourceId.trim(); + } + public String getOneId() { return oneId; } @@ -36,6 +54,14 @@ public class SysResourceAndCourse { this.oneId = oneId == null ? null : oneId.trim(); } + public String getOneName() { + return oneName; + } + + public void setOneName(String oneName) { + this.oneName = oneName == null ? null : oneName.trim(); + } + public String getTwoId() { return twoId; } @@ -44,6 +70,14 @@ public class SysResourceAndCourse { this.twoId = twoId == null ? null : twoId.trim(); } + public String getTwoName() { + return twoName; + } + + public void setTwoName(String twoName) { + this.twoName = twoName == null ? null : twoName.trim(); + } + public String getThreeId() { return threeId; } @@ -52,11 +86,11 @@ public class SysResourceAndCourse { this.threeId = threeId == null ? null : threeId.trim(); } - public Integer getResourceDataId() { - return resourceDataId; + public String getThreeName() { + return threeName; } - public void setResourceDataId(Integer resourceDataId) { - this.resourceDataId = resourceDataId; + public void setThreeName(String threeName) { + this.threeName = threeName == null ? null : threeName.trim(); } } \ No newline at end of file diff --git a/src/main/java/com/sztzjy/resource_center/entity/SysResourceAndCourseExample.java b/src/main/java/com/sztzjy/resource_center/entity/SysResourceAndCourseExample.java index c8d237b..5f7a39c 100644 --- a/src/main/java/com/sztzjy/resource_center/entity/SysResourceAndCourseExample.java +++ b/src/main/java/com/sztzjy/resource_center/entity/SysResourceAndCourseExample.java @@ -174,6 +174,76 @@ public class SysResourceAndCourseExample { return (Criteria) this; } + public Criteria andResourceIdIsNull() { + addCriterion("resource_id is null"); + return (Criteria) this; + } + + public Criteria andResourceIdIsNotNull() { + addCriterion("resource_id is not null"); + return (Criteria) this; + } + + public Criteria andResourceIdEqualTo(String value) { + addCriterion("resource_id =", value, "resourceId"); + return (Criteria) this; + } + + public Criteria andResourceIdNotEqualTo(String value) { + addCriterion("resource_id <>", value, "resourceId"); + return (Criteria) this; + } + + public Criteria andResourceIdGreaterThan(String value) { + addCriterion("resource_id >", value, "resourceId"); + return (Criteria) this; + } + + public Criteria andResourceIdGreaterThanOrEqualTo(String value) { + addCriterion("resource_id >=", value, "resourceId"); + return (Criteria) this; + } + + public Criteria andResourceIdLessThan(String value) { + addCriterion("resource_id <", value, "resourceId"); + return (Criteria) this; + } + + public Criteria andResourceIdLessThanOrEqualTo(String value) { + addCriterion("resource_id <=", value, "resourceId"); + return (Criteria) this; + } + + public Criteria andResourceIdLike(String value) { + addCriterion("resource_id like", value, "resourceId"); + return (Criteria) this; + } + + public Criteria andResourceIdNotLike(String value) { + addCriterion("resource_id not like", value, "resourceId"); + return (Criteria) this; + } + + public Criteria andResourceIdIn(List values) { + addCriterion("resource_id in", values, "resourceId"); + return (Criteria) this; + } + + public Criteria andResourceIdNotIn(List values) { + addCriterion("resource_id not in", values, "resourceId"); + return (Criteria) this; + } + + public Criteria andResourceIdBetween(String value1, String value2) { + addCriterion("resource_id between", value1, value2, "resourceId"); + return (Criteria) this; + } + + public Criteria andResourceIdNotBetween(String value1, String value2) { + addCriterion("resource_id not between", value1, value2, "resourceId"); + return (Criteria) this; + } + public Criteria andOneIdIsNull() { addCriterion("one_id is null"); return (Criteria) this; @@ -244,6 +314,76 @@ public class SysResourceAndCourseExample { 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 values) { + addCriterion("one_name in", values, "oneName"); + return (Criteria) this; + } + + public Criteria andOneNameNotIn(List 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 andTwoIdIsNull() { addCriterion("two_id is null"); return (Criteria) this; @@ -314,6 +454,76 @@ public class SysResourceAndCourseExample { 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 values) { + addCriterion("two_name in", values, "twoName"); + return (Criteria) this; + } + + public Criteria andTwoNameNotIn(List 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 andThreeIdIsNull() { addCriterion("three_id is null"); return (Criteria) this; @@ -384,63 +594,73 @@ public class SysResourceAndCourseExample { return (Criteria) this; } - public Criteria andResourceDataIdIsNull() { - addCriterion("resource_data_id is null"); + 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 andResourceDataIdIsNotNull() { - addCriterion("resource_data_id is not null"); + public Criteria andThreeNameNotEqualTo(String value) { + addCriterion("three_name <>", value, "threeName"); return (Criteria) this; } - public Criteria andResourceDataIdEqualTo(Integer value) { - addCriterion("resource_data_id =", value, "resourceDataId"); + public Criteria andThreeNameGreaterThan(String value) { + addCriterion("three_name >", value, "threeName"); return (Criteria) this; } - public Criteria andResourceDataIdNotEqualTo(Integer value) { - addCriterion("resource_data_id <>", value, "resourceDataId"); + public Criteria andThreeNameGreaterThanOrEqualTo(String value) { + addCriterion("three_name >=", value, "threeName"); return (Criteria) this; } - public Criteria andResourceDataIdGreaterThan(Integer value) { - addCriterion("resource_data_id >", value, "resourceDataId"); + public Criteria andThreeNameLessThan(String value) { + addCriterion("three_name <", value, "threeName"); return (Criteria) this; } - public Criteria andResourceDataIdGreaterThanOrEqualTo(Integer value) { - addCriterion("resource_data_id >=", value, "resourceDataId"); + public Criteria andThreeNameLessThanOrEqualTo(String value) { + addCriterion("three_name <=", value, "threeName"); return (Criteria) this; } - public Criteria andResourceDataIdLessThan(Integer value) { - addCriterion("resource_data_id <", value, "resourceDataId"); + public Criteria andThreeNameLike(String value) { + addCriterion("three_name like", value, "threeName"); return (Criteria) this; } - public Criteria andResourceDataIdLessThanOrEqualTo(Integer value) { - addCriterion("resource_data_id <=", value, "resourceDataId"); + public Criteria andThreeNameNotLike(String value) { + addCriterion("three_name not like", value, "threeName"); return (Criteria) this; } - public Criteria andResourceDataIdIn(List values) { - addCriterion("resource_data_id in", values, "resourceDataId"); + public Criteria andThreeNameIn(List values) { + addCriterion("three_name in", values, "threeName"); return (Criteria) this; } - public Criteria andResourceDataIdNotIn(List values) { - addCriterion("resource_data_id not in", values, "resourceDataId"); + public Criteria andThreeNameNotIn(List values) { + addCriterion("three_name not in", values, "threeName"); return (Criteria) this; } - public Criteria andResourceDataIdBetween(Integer value1, Integer value2) { - addCriterion("resource_data_id between", value1, value2, "resourceDataId"); + public Criteria andThreeNameBetween(String value1, String value2) { + addCriterion("three_name between", value1, value2, "threeName"); return (Criteria) this; } - public Criteria andResourceDataIdNotBetween(Integer value1, Integer value2) { - addCriterion("resource_data_id not between", value1, value2, "resourceDataId"); + public Criteria andThreeNameNotBetween(String value1, String value2) { + addCriterion("three_name not between", value1, value2, "threeName"); return (Criteria) this; } } diff --git a/src/main/java/com/sztzjy/resource_center/entity/SysResourceExample.java b/src/main/java/com/sztzjy/resource_center/entity/SysResourceExample.java new file mode 100644 index 0000000..44b3122 --- /dev/null +++ b/src/main/java/com/sztzjy/resource_center/entity/SysResourceExample.java @@ -0,0 +1,740 @@ +package com.sztzjy.resource_center.entity; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class SysResourceExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public SysResourceExample() { + oredCriteria = new ArrayList<>(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andResourceIdIsNull() { + addCriterion("resource_id is null"); + return (Criteria) this; + } + + public Criteria andResourceIdIsNotNull() { + addCriterion("resource_id is not null"); + return (Criteria) this; + } + + public Criteria andResourceIdEqualTo(String value) { + addCriterion("resource_id =", value, "resourceId"); + return (Criteria) this; + } + + public Criteria andResourceIdNotEqualTo(String value) { + addCriterion("resource_id <>", value, "resourceId"); + return (Criteria) this; + } + + public Criteria andResourceIdGreaterThan(String value) { + addCriterion("resource_id >", value, "resourceId"); + return (Criteria) this; + } + + public Criteria andResourceIdGreaterThanOrEqualTo(String value) { + addCriterion("resource_id >=", value, "resourceId"); + return (Criteria) this; + } + + public Criteria andResourceIdLessThan(String value) { + addCriterion("resource_id <", value, "resourceId"); + return (Criteria) this; + } + + public Criteria andResourceIdLessThanOrEqualTo(String value) { + addCriterion("resource_id <=", value, "resourceId"); + return (Criteria) this; + } + + public Criteria andResourceIdLike(String value) { + addCriterion("resource_id like", value, "resourceId"); + return (Criteria) this; + } + + public Criteria andResourceIdNotLike(String value) { + addCriterion("resource_id not like", value, "resourceId"); + return (Criteria) this; + } + + public Criteria andResourceIdIn(List values) { + addCriterion("resource_id in", values, "resourceId"); + return (Criteria) this; + } + + public Criteria andResourceIdNotIn(List values) { + addCriterion("resource_id not in", values, "resourceId"); + return (Criteria) this; + } + + public Criteria andResourceIdBetween(String value1, String value2) { + addCriterion("resource_id between", value1, value2, "resourceId"); + return (Criteria) this; + } + + public Criteria andResourceIdNotBetween(String value1, String value2) { + addCriterion("resource_id not between", value1, value2, "resourceId"); + return (Criteria) this; + } + + public Criteria andResourceNameIsNull() { + addCriterion("resource_name is null"); + return (Criteria) this; + } + + public Criteria andResourceNameIsNotNull() { + addCriterion("resource_name is not null"); + return (Criteria) this; + } + + public Criteria andResourceNameEqualTo(String value) { + addCriterion("resource_name =", value, "resourceName"); + return (Criteria) this; + } + + public Criteria andResourceNameNotEqualTo(String value) { + addCriterion("resource_name <>", value, "resourceName"); + return (Criteria) this; + } + + public Criteria andResourceNameGreaterThan(String value) { + addCriterion("resource_name >", value, "resourceName"); + return (Criteria) this; + } + + public Criteria andResourceNameGreaterThanOrEqualTo(String value) { + addCriterion("resource_name >=", value, "resourceName"); + return (Criteria) this; + } + + public Criteria andResourceNameLessThan(String value) { + addCriterion("resource_name <", value, "resourceName"); + return (Criteria) this; + } + + public Criteria andResourceNameLessThanOrEqualTo(String value) { + addCriterion("resource_name <=", value, "resourceName"); + return (Criteria) this; + } + + public Criteria andResourceNameLike(String value) { + addCriterion("resource_name like", value, "resourceName"); + return (Criteria) this; + } + + public Criteria andResourceNameNotLike(String value) { + addCriterion("resource_name not like", value, "resourceName"); + return (Criteria) this; + } + + public Criteria andResourceNameIn(List values) { + addCriterion("resource_name in", values, "resourceName"); + return (Criteria) this; + } + + public Criteria andResourceNameNotIn(List values) { + addCriterion("resource_name not in", values, "resourceName"); + return (Criteria) this; + } + + public Criteria andResourceNameBetween(String value1, String value2) { + addCriterion("resource_name between", value1, value2, "resourceName"); + return (Criteria) this; + } + + public Criteria andResourceNameNotBetween(String value1, String value2) { + addCriterion("resource_name not between", value1, value2, "resourceName"); + return (Criteria) this; + } + + public Criteria andUrlIsNull() { + addCriterion("url is null"); + return (Criteria) this; + } + + public Criteria andUrlIsNotNull() { + addCriterion("url is not null"); + return (Criteria) this; + } + + public Criteria andUrlEqualTo(String value) { + addCriterion("url =", value, "url"); + return (Criteria) this; + } + + public Criteria andUrlNotEqualTo(String value) { + addCriterion("url <>", value, "url"); + return (Criteria) this; + } + + public Criteria andUrlGreaterThan(String value) { + addCriterion("url >", value, "url"); + return (Criteria) this; + } + + public Criteria andUrlGreaterThanOrEqualTo(String value) { + addCriterion("url >=", value, "url"); + return (Criteria) this; + } + + public Criteria andUrlLessThan(String value) { + addCriterion("url <", value, "url"); + return (Criteria) this; + } + + public Criteria andUrlLessThanOrEqualTo(String value) { + addCriterion("url <=", value, "url"); + return (Criteria) this; + } + + public Criteria andUrlLike(String value) { + addCriterion("url like", value, "url"); + return (Criteria) this; + } + + public Criteria andUrlNotLike(String value) { + addCriterion("url not like", value, "url"); + return (Criteria) this; + } + + public Criteria andUrlIn(List values) { + addCriterion("url in", values, "url"); + return (Criteria) this; + } + + public Criteria andUrlNotIn(List values) { + addCriterion("url not in", values, "url"); + return (Criteria) this; + } + + public Criteria andUrlBetween(String value1, String value2) { + addCriterion("url between", value1, value2, "url"); + return (Criteria) this; + } + + public Criteria andUrlNotBetween(String value1, String value2) { + addCriterion("url not between", value1, value2, "url"); + return (Criteria) this; + } + + public Criteria andResourceTypeIsNull() { + addCriterion("resource_type is null"); + return (Criteria) this; + } + + public Criteria andResourceTypeIsNotNull() { + addCriterion("resource_type is not null"); + return (Criteria) this; + } + + public Criteria andResourceTypeEqualTo(String value) { + addCriterion("resource_type =", value, "resourceType"); + return (Criteria) this; + } + + public Criteria andResourceTypeNotEqualTo(String value) { + addCriterion("resource_type <>", value, "resourceType"); + return (Criteria) this; + } + + public Criteria andResourceTypeGreaterThan(String value) { + addCriterion("resource_type >", value, "resourceType"); + return (Criteria) this; + } + + public Criteria andResourceTypeGreaterThanOrEqualTo(String value) { + addCriterion("resource_type >=", value, "resourceType"); + return (Criteria) this; + } + + public Criteria andResourceTypeLessThan(String value) { + addCriterion("resource_type <", value, "resourceType"); + return (Criteria) this; + } + + public Criteria andResourceTypeLessThanOrEqualTo(String value) { + addCriterion("resource_type <=", value, "resourceType"); + return (Criteria) this; + } + + public Criteria andResourceTypeLike(String value) { + addCriterion("resource_type like", value, "resourceType"); + return (Criteria) this; + } + + public Criteria andResourceTypeNotLike(String value) { + addCriterion("resource_type not like", value, "resourceType"); + return (Criteria) this; + } + + public Criteria andResourceTypeIn(List values) { + addCriterion("resource_type in", values, "resourceType"); + return (Criteria) this; + } + + public Criteria andResourceTypeNotIn(List values) { + addCriterion("resource_type not in", values, "resourceType"); + return (Criteria) this; + } + + public Criteria andResourceTypeBetween(String value1, String value2) { + addCriterion("resource_type between", value1, value2, "resourceType"); + return (Criteria) this; + } + + public Criteria andResourceTypeNotBetween(String value1, String value2) { + addCriterion("resource_type not between", value1, value2, "resourceType"); + return (Criteria) this; + } + + public Criteria andSourceIsNull() { + addCriterion("source is null"); + return (Criteria) this; + } + + public Criteria andSourceIsNotNull() { + addCriterion("source is not null"); + return (Criteria) this; + } + + public Criteria andSourceEqualTo(String value) { + addCriterion("source =", value, "source"); + return (Criteria) this; + } + + public Criteria andSourceNotEqualTo(String value) { + addCriterion("source <>", value, "source"); + return (Criteria) this; + } + + public Criteria andSourceGreaterThan(String value) { + addCriterion("source >", value, "source"); + return (Criteria) this; + } + + public Criteria andSourceGreaterThanOrEqualTo(String value) { + addCriterion("source >=", value, "source"); + return (Criteria) this; + } + + public Criteria andSourceLessThan(String value) { + addCriterion("source <", value, "source"); + return (Criteria) this; + } + + public Criteria andSourceLessThanOrEqualTo(String value) { + addCriterion("source <=", value, "source"); + return (Criteria) this; + } + + public Criteria andSourceLike(String value) { + addCriterion("source like", value, "source"); + return (Criteria) this; + } + + public Criteria andSourceNotLike(String value) { + addCriterion("source not like", value, "source"); + return (Criteria) this; + } + + public Criteria andSourceIn(List values) { + addCriterion("source in", values, "source"); + return (Criteria) this; + } + + public Criteria andSourceNotIn(List values) { + addCriterion("source not in", values, "source"); + return (Criteria) this; + } + + public Criteria andSourceBetween(String value1, String value2) { + addCriterion("source between", value1, value2, "source"); + return (Criteria) this; + } + + public Criteria andSourceNotBetween(String value1, String value2) { + addCriterion("source not between", value1, value2, "source"); + return (Criteria) this; + } + + public Criteria andSchoolIdIsNull() { + addCriterion("school_id is null"); + return (Criteria) this; + } + + public Criteria andSchoolIdIsNotNull() { + addCriterion("school_id is not null"); + return (Criteria) this; + } + + public Criteria andSchoolIdEqualTo(String value) { + addCriterion("school_id =", value, "schoolId"); + return (Criteria) this; + } + + public Criteria andSchoolIdNotEqualTo(String value) { + addCriterion("school_id <>", value, "schoolId"); + return (Criteria) this; + } + + public Criteria andSchoolIdGreaterThan(String value) { + addCriterion("school_id >", value, "schoolId"); + return (Criteria) this; + } + + public Criteria andSchoolIdGreaterThanOrEqualTo(String value) { + addCriterion("school_id >=", value, "schoolId"); + return (Criteria) this; + } + + public Criteria andSchoolIdLessThan(String value) { + addCriterion("school_id <", value, "schoolId"); + return (Criteria) this; + } + + public Criteria andSchoolIdLessThanOrEqualTo(String value) { + addCriterion("school_id <=", value, "schoolId"); + return (Criteria) this; + } + + public Criteria andSchoolIdLike(String value) { + addCriterion("school_id like", value, "schoolId"); + return (Criteria) this; + } + + public Criteria andSchoolIdNotLike(String value) { + addCriterion("school_id not like", value, "schoolId"); + return (Criteria) this; + } + + public Criteria andSchoolIdIn(List values) { + addCriterion("school_id in", values, "schoolId"); + return (Criteria) this; + } + + public Criteria andSchoolIdNotIn(List values) { + addCriterion("school_id not in", values, "schoolId"); + return (Criteria) this; + } + + public Criteria andSchoolIdBetween(String value1, String value2) { + addCriterion("school_id between", value1, value2, "schoolId"); + return (Criteria) this; + } + + public Criteria andSchoolIdNotBetween(String value1, String value2) { + addCriterion("school_id not between", value1, value2, "schoolId"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(Date value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(Date value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(Date value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(Date value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(Date value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(Date value1, Date value2) { + addCriterion("create_time between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotBetween(Date value1, Date value2) { + addCriterion("create_time not between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNull() { + addCriterion("update_time is null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNotNull() { + addCriterion("update_time is not null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeEqualTo(Date value) { + addCriterion("update_time =", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotEqualTo(Date value) { + addCriterion("update_time <>", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThan(Date value) { + addCriterion("update_time >", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("update_time >=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThan(Date value) { + addCriterion("update_time <", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThanOrEqualTo(Date value) { + addCriterion("update_time <=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIn(List values) { + addCriterion("update_time in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotIn(List values) { + addCriterion("update_time not in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeBetween(Date value1, Date value2) { + addCriterion("update_time between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotBetween(Date value1, Date value2) { + addCriterion("update_time not between", value1, value2, "updateTime"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/src/main/java/com/sztzjy/resource_center/entity/SysTopicAndCourse.java b/src/main/java/com/sztzjy/resource_center/entity/SysTopicAndCourse.java index e41fdcc..4c91801 100644 --- a/src/main/java/com/sztzjy/resource_center/entity/SysTopicAndCourse.java +++ b/src/main/java/com/sztzjy/resource_center/entity/SysTopicAndCourse.java @@ -9,17 +9,26 @@ import io.swagger.annotations.ApiModelProperty; public class SysTopicAndCourse { private String id; + @ApiModelProperty("题目ID") + private String topicId; + @ApiModelProperty("一级目录ID/课程ID") private String oneId; + @ApiModelProperty("课程名称") + private String oneName; + @ApiModelProperty("二级目录ID/章ID") private String twoId; + @ApiModelProperty("章名称") + private String twoName; + @ApiModelProperty("三级目录ID/节ID") private String threeId; - @ApiModelProperty("题目ID") - private String topicId; + @ApiModelProperty("节名称") + private String threeName; @ApiModelProperty("题目类型 0客观题 1案例题 2模型题") private String topicType; @@ -32,6 +41,14 @@ public class SysTopicAndCourse { this.id = id == null ? null : id.trim(); } + public String getTopicId() { + return topicId; + } + + public void setTopicId(String topicId) { + this.topicId = topicId == null ? null : topicId.trim(); + } + public String getOneId() { return oneId; } @@ -40,6 +57,14 @@ public class SysTopicAndCourse { this.oneId = oneId == null ? null : oneId.trim(); } + public String getOneName() { + return oneName; + } + + public void setOneName(String oneName) { + this.oneName = oneName == null ? null : oneName.trim(); + } + public String getTwoId() { return twoId; } @@ -48,6 +73,14 @@ public class SysTopicAndCourse { this.twoId = twoId == null ? null : twoId.trim(); } + public String getTwoName() { + return twoName; + } + + public void setTwoName(String twoName) { + this.twoName = twoName == null ? null : twoName.trim(); + } + public String getThreeId() { return threeId; } @@ -56,12 +89,12 @@ public class SysTopicAndCourse { this.threeId = threeId == null ? null : threeId.trim(); } - public String getTopicId() { - return topicId; + public String getThreeName() { + return threeName; } - public void setTopicId(String topicId) { - this.topicId = topicId == null ? null : topicId.trim(); + public void setThreeName(String threeName) { + this.threeName = threeName == null ? null : threeName.trim(); } public String getTopicType() { diff --git a/src/main/java/com/sztzjy/resource_center/entity/SysTopicAndCourseExample.java b/src/main/java/com/sztzjy/resource_center/entity/SysTopicAndCourseExample.java index 4a7b1ee..a2e8009 100644 --- a/src/main/java/com/sztzjy/resource_center/entity/SysTopicAndCourseExample.java +++ b/src/main/java/com/sztzjy/resource_center/entity/SysTopicAndCourseExample.java @@ -174,6 +174,76 @@ public class SysTopicAndCourseExample { return (Criteria) this; } + public Criteria andTopicIdIsNull() { + addCriterion("topic_id is null"); + return (Criteria) this; + } + + public Criteria andTopicIdIsNotNull() { + addCriterion("topic_id is not null"); + return (Criteria) this; + } + + public Criteria andTopicIdEqualTo(String value) { + addCriterion("topic_id =", value, "topicId"); + return (Criteria) this; + } + + public Criteria andTopicIdNotEqualTo(String value) { + addCriterion("topic_id <>", value, "topicId"); + return (Criteria) this; + } + + public Criteria andTopicIdGreaterThan(String value) { + addCriterion("topic_id >", value, "topicId"); + return (Criteria) this; + } + + public Criteria andTopicIdGreaterThanOrEqualTo(String value) { + addCriterion("topic_id >=", value, "topicId"); + return (Criteria) this; + } + + public Criteria andTopicIdLessThan(String value) { + addCriterion("topic_id <", value, "topicId"); + return (Criteria) this; + } + + public Criteria andTopicIdLessThanOrEqualTo(String value) { + addCriterion("topic_id <=", value, "topicId"); + return (Criteria) this; + } + + public Criteria andTopicIdLike(String value) { + addCriterion("topic_id like", value, "topicId"); + return (Criteria) this; + } + + public Criteria andTopicIdNotLike(String value) { + addCriterion("topic_id not like", value, "topicId"); + return (Criteria) this; + } + + public Criteria andTopicIdIn(List values) { + addCriterion("topic_id in", values, "topicId"); + return (Criteria) this; + } + + public Criteria andTopicIdNotIn(List values) { + addCriterion("topic_id not in", values, "topicId"); + return (Criteria) this; + } + + public Criteria andTopicIdBetween(String value1, String value2) { + addCriterion("topic_id between", value1, value2, "topicId"); + return (Criteria) this; + } + + public Criteria andTopicIdNotBetween(String value1, String value2) { + addCriterion("topic_id not between", value1, value2, "topicId"); + return (Criteria) this; + } + public Criteria andOneIdIsNull() { addCriterion("one_id is null"); return (Criteria) this; @@ -244,6 +314,76 @@ public class SysTopicAndCourseExample { 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 values) { + addCriterion("one_name in", values, "oneName"); + return (Criteria) this; + } + + public Criteria andOneNameNotIn(List 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 andTwoIdIsNull() { addCriterion("two_id is null"); return (Criteria) this; @@ -314,6 +454,76 @@ public class SysTopicAndCourseExample { 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 values) { + addCriterion("two_name in", values, "twoName"); + return (Criteria) this; + } + + public Criteria andTwoNameNotIn(List 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 andThreeIdIsNull() { addCriterion("three_id is null"); return (Criteria) this; @@ -384,73 +594,73 @@ public class SysTopicAndCourseExample { return (Criteria) this; } - public Criteria andTopicIdIsNull() { - addCriterion("topic_id is null"); + public Criteria andThreeNameIsNull() { + addCriterion("three_name is null"); return (Criteria) this; } - public Criteria andTopicIdIsNotNull() { - addCriterion("topic_id is not null"); + public Criteria andThreeNameIsNotNull() { + addCriterion("three_name is not null"); return (Criteria) this; } - public Criteria andTopicIdEqualTo(String value) { - addCriterion("topic_id =", value, "topicId"); + public Criteria andThreeNameEqualTo(String value) { + addCriterion("three_name =", value, "threeName"); return (Criteria) this; } - public Criteria andTopicIdNotEqualTo(String value) { - addCriterion("topic_id <>", value, "topicId"); + public Criteria andThreeNameNotEqualTo(String value) { + addCriterion("three_name <>", value, "threeName"); return (Criteria) this; } - public Criteria andTopicIdGreaterThan(String value) { - addCriterion("topic_id >", value, "topicId"); + public Criteria andThreeNameGreaterThan(String value) { + addCriterion("three_name >", value, "threeName"); return (Criteria) this; } - public Criteria andTopicIdGreaterThanOrEqualTo(String value) { - addCriterion("topic_id >=", value, "topicId"); + public Criteria andThreeNameGreaterThanOrEqualTo(String value) { + addCriterion("three_name >=", value, "threeName"); return (Criteria) this; } - public Criteria andTopicIdLessThan(String value) { - addCriterion("topic_id <", value, "topicId"); + public Criteria andThreeNameLessThan(String value) { + addCriterion("three_name <", value, "threeName"); return (Criteria) this; } - public Criteria andTopicIdLessThanOrEqualTo(String value) { - addCriterion("topic_id <=", value, "topicId"); + public Criteria andThreeNameLessThanOrEqualTo(String value) { + addCriterion("three_name <=", value, "threeName"); return (Criteria) this; } - public Criteria andTopicIdLike(String value) { - addCriterion("topic_id like", value, "topicId"); + public Criteria andThreeNameLike(String value) { + addCriterion("three_name like", value, "threeName"); return (Criteria) this; } - public Criteria andTopicIdNotLike(String value) { - addCriterion("topic_id not like", value, "topicId"); + public Criteria andThreeNameNotLike(String value) { + addCriterion("three_name not like", value, "threeName"); return (Criteria) this; } - public Criteria andTopicIdIn(List values) { - addCriterion("topic_id in", values, "topicId"); + public Criteria andThreeNameIn(List values) { + addCriterion("three_name in", values, "threeName"); return (Criteria) this; } - public Criteria andTopicIdNotIn(List values) { - addCriterion("topic_id not in", values, "topicId"); + public Criteria andThreeNameNotIn(List values) { + addCriterion("three_name not in", values, "threeName"); return (Criteria) this; } - public Criteria andTopicIdBetween(String value1, String value2) { - addCriterion("topic_id between", value1, value2, "topicId"); + public Criteria andThreeNameBetween(String value1, String value2) { + addCriterion("three_name between", value1, value2, "threeName"); return (Criteria) this; } - public Criteria andTopicIdNotBetween(String value1, String value2) { - addCriterion("topic_id not between", value1, value2, "topicId"); + public Criteria andThreeNameNotBetween(String value1, String value2) { + addCriterion("three_name not between", value1, value2, "threeName"); return (Criteria) this; } diff --git a/src/main/java/com/sztzjy/resource_center/entity/dto/SysResourceDto.java b/src/main/java/com/sztzjy/resource_center/entity/dto/SysResourceDto.java new file mode 100644 index 0000000..bcff50c --- /dev/null +++ b/src/main/java/com/sztzjy/resource_center/entity/dto/SysResourceDto.java @@ -0,0 +1,56 @@ +package com.sztzjy.resource_center.entity.dto; + +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.springframework.web.multipart.MultipartFile; + +import java.util.Date; + +@Data +@NoArgsConstructor +@AllArgsConstructor +public class SysResourceDto { + @ApiModelProperty("资源ID") + private String resourceId; + + @ApiModelProperty("资源名称") + private String resourceName; + + @ApiModelProperty("资源类型 /视频/课件") + private String resourceType; + + @ApiModelProperty("来源(内置/老师新增)") + private String source; + + @ApiModelProperty("学校ID") + private String schoolId; + + @ApiModelProperty("创建时间") + private Date createTime; + + @ApiModelProperty("更新时间") + private Date updateTime; + + @ApiModelProperty("所属课程ID") + private String oneId; + + @ApiModelProperty("所属课程名称") + private String oneName; + + @ApiModelProperty("所属章ID") + private String twoId; + + @ApiModelProperty("所属章名称") + private String twoName; + + @ApiModelProperty("所属节ID") + private String threeId; + + @ApiModelProperty("所属节名称") + private String threeName; + + @ApiModelProperty("资源文件") + private MultipartFile file; +} diff --git a/src/main/java/com/sztzjy/resource_center/mapper/SysOneCatalogMapper.java b/src/main/java/com/sztzjy/resource_center/mapper/SysOneCatalogMapper.java index f354580..ecf61ae 100644 --- a/src/main/java/com/sztzjy/resource_center/mapper/SysOneCatalogMapper.java +++ b/src/main/java/com/sztzjy/resource_center/mapper/SysOneCatalogMapper.java @@ -3,9 +3,13 @@ package com.sztzjy.resource_center.mapper; import com.sztzjy.resource_center.entity.SysOneCatalog; import com.sztzjy.resource_center.entity.SysOneCatalogExample; import java.util.List; +import java.util.Map; +import com.sztzjy.resource_center.util.ResultEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; + @Mapper public interface SysOneCatalogMapper { long countByExample(SysOneCatalogExample example); @@ -29,4 +33,8 @@ public interface SysOneCatalogMapper { int updateByPrimaryKeySelective(SysOneCatalog record); int updateByPrimaryKey(SysOneCatalog record); + + @Select("select one_id,one_name from sys_one_catalog order by create_time ASC") + List> getAllOneCatalogList(); + } \ No newline at end of file diff --git a/src/main/java/com/sztzjy/resource_center/mapper/SysResourceAndCourseMapper.java b/src/main/java/com/sztzjy/resource_center/mapper/SysResourceAndCourseMapper.java index 59520f3..9b84cad 100644 --- a/src/main/java/com/sztzjy/resource_center/mapper/SysResourceAndCourseMapper.java +++ b/src/main/java/com/sztzjy/resource_center/mapper/SysResourceAndCourseMapper.java @@ -3,8 +3,10 @@ package com.sztzjy.resource_center.mapper; import com.sztzjy.resource_center.entity.SysResourceAndCourse; import com.sztzjy.resource_center.entity.SysResourceAndCourseExample; import java.util.List; -import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +@Mapper public interface SysResourceAndCourseMapper { long countByExample(SysResourceAndCourseExample example); diff --git a/src/main/java/com/sztzjy/resource_center/mapper/SysResourceMapper.java b/src/main/java/com/sztzjy/resource_center/mapper/SysResourceMapper.java new file mode 100644 index 0000000..21873cc --- /dev/null +++ b/src/main/java/com/sztzjy/resource_center/mapper/SysResourceMapper.java @@ -0,0 +1,41 @@ +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); + + int deleteByExample(SysResourceExample example); + + int deleteByPrimaryKey(String resourceId); + + int insert(SysResource record); + + int insertSelective(SysResource record); + + List selectByExample(SysResourceExample example); + + SysResource selectByPrimaryKey(String resourceId); + + int updateByExampleSelective(@Param("record") SysResource record, @Param("example") SysResourceExample example); + + int updateByExample(@Param("record") SysResource record, @Param("example") SysResourceExample example); + + int updateByPrimaryKeySelective(SysResource record); + + int updateByPrimaryKey(SysResource record); + + List selectResource(@Param("oneId") String oneId, + @Param("twoId") String twoId, + @Param("threeId") String threeId, + @Param("resourceName") String resourceName); + +} \ No newline at end of file diff --git a/src/main/java/com/sztzjy/resource_center/mapper/SysThreeCatalogMapper.java b/src/main/java/com/sztzjy/resource_center/mapper/SysThreeCatalogMapper.java index 36d6ad5..9a9a224 100644 --- a/src/main/java/com/sztzjy/resource_center/mapper/SysThreeCatalogMapper.java +++ b/src/main/java/com/sztzjy/resource_center/mapper/SysThreeCatalogMapper.java @@ -3,8 +3,13 @@ package com.sztzjy.resource_center.mapper; import com.sztzjy.resource_center.entity.SysThreeCatalog; import com.sztzjy.resource_center.entity.SysThreeCatalogExample; import java.util.List; +import java.util.Map; + +import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; +@Mapper public interface SysThreeCatalogMapper { long countByExample(SysThreeCatalogExample example); @@ -27,4 +32,7 @@ public interface SysThreeCatalogMapper { int updateByPrimaryKeySelective(SysThreeCatalog record); int updateByPrimaryKey(SysThreeCatalog record); + + @Select("select three_id,three_name from sys_three_catalog order by create_time ASC") + List> getAllThreeCatalogList(); } \ No newline at end of file diff --git a/src/main/java/com/sztzjy/resource_center/mapper/SysTwoCatalogMapper.java b/src/main/java/com/sztzjy/resource_center/mapper/SysTwoCatalogMapper.java index 097b34e..dbaf322 100644 --- a/src/main/java/com/sztzjy/resource_center/mapper/SysTwoCatalogMapper.java +++ b/src/main/java/com/sztzjy/resource_center/mapper/SysTwoCatalogMapper.java @@ -3,8 +3,13 @@ package com.sztzjy.resource_center.mapper; import com.sztzjy.resource_center.entity.SysTwoCatalog; import com.sztzjy.resource_center.entity.SysTwoCatalogExample; import java.util.List; +import java.util.Map; + +import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; +@Mapper public interface SysTwoCatalogMapper { long countByExample(SysTwoCatalogExample example); @@ -27,4 +32,8 @@ public interface SysTwoCatalogMapper { int updateByPrimaryKeySelective(SysTwoCatalog record); int updateByPrimaryKey(SysTwoCatalog record); + + @Select("select two_id,two_name from sys_two_catalog order by create_time ASC") + List> getAllTwoCatalogList(); + } \ No newline at end of file diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 05dfd2f..f11f49c 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -81,5 +81,9 @@ spring: mybatis: type-aliases-package: com.sztzjy.resource_center.entity mapper-locations: classpath*:/mapper/*.xml + configuration: + log-impl: org.apache.ibatis.logging.stdout.StdOutImpl - +#logging: +# level: +# com.sztzjy.resource_center.mapper: trace # diff --git a/src/main/resources/generatorConfig.xml b/src/main/resources/generatorConfig.xml index c8d4910..2bcbbed 100644 --- a/src/main/resources/generatorConfig.xml +++ b/src/main/resources/generatorConfig.xml @@ -45,12 +45,13 @@ - - + + +
- +
diff --git a/src/main/resources/mapper/SysResourceAndCourseMapper.xml b/src/main/resources/mapper/SysResourceAndCourseMapper.xml index db0deeb..1cf2662 100644 --- a/src/main/resources/mapper/SysResourceAndCourseMapper.xml +++ b/src/main/resources/mapper/SysResourceAndCourseMapper.xml @@ -3,10 +3,13 @@ + + + - + @@ -67,7 +70,7 @@ - id, one_id, two_id, three_id, resource_data_id + id, resource_id, one_id, one_name, two_id, two_name, three_id, three_name + select + + distinct + + + from sys_resource + + + + + order by ${orderByClause} + + + + + delete + from sys_resource + where resource_id = #{resourceId,jdbcType=VARCHAR} + + + delete from sys_resource + + + + + + insert into sys_resource (resource_id, resource_name, url, + resource_type, source, school_id, + create_time, update_time) + values (#{resourceId,jdbcType=VARCHAR}, #{resourceName,jdbcType=VARCHAR}, #{url,jdbcType=VARCHAR}, + #{resourceType,jdbcType=VARCHAR}, #{source,jdbcType=VARCHAR}, #{schoolId,jdbcType=VARCHAR}, + #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}) + + + insert into sys_resource + + + resource_id, + + + resource_name, + + + url, + + + resource_type, + + + source, + + + school_id, + + + create_time, + + + update_time, + + + + + #{resourceId,jdbcType=VARCHAR}, + + + #{resourceName,jdbcType=VARCHAR}, + + + #{url,jdbcType=VARCHAR}, + + + #{resourceType,jdbcType=VARCHAR}, + + + #{source,jdbcType=VARCHAR}, + + + #{schoolId,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=TIMESTAMP}, + + + #{updateTime,jdbcType=TIMESTAMP}, + + + + + + update sys_resource + + + resource_id = #{record.resourceId,jdbcType=VARCHAR}, + + + resource_name = #{record.resourceName,jdbcType=VARCHAR}, + + + url = #{record.url,jdbcType=VARCHAR}, + + + resource_type = #{record.resourceType,jdbcType=VARCHAR}, + + + source = #{record.source,jdbcType=VARCHAR}, + + + school_id = #{record.schoolId,jdbcType=VARCHAR}, + + + create_time = #{record.createTime,jdbcType=TIMESTAMP}, + + + update_time = #{record.updateTime,jdbcType=TIMESTAMP}, + + + + + + + + update sys_resource + set resource_id = #{record.resourceId,jdbcType=VARCHAR}, + resource_name = #{record.resourceName,jdbcType=VARCHAR}, + url = #{record.url,jdbcType=VARCHAR}, + resource_type = #{record.resourceType,jdbcType=VARCHAR}, + source = #{record.source,jdbcType=VARCHAR}, + school_id = #{record.schoolId,jdbcType=VARCHAR}, + create_time = #{record.createTime,jdbcType=TIMESTAMP}, + update_time = #{record.updateTime,jdbcType=TIMESTAMP} + + + + + + update sys_resource + + + resource_name = #{resourceName,jdbcType=VARCHAR}, + + + url = #{url,jdbcType=VARCHAR}, + + + resource_type = #{resourceType,jdbcType=VARCHAR}, + + + source = #{source,jdbcType=VARCHAR}, + + + school_id = #{schoolId,jdbcType=VARCHAR}, + + + create_time = #{createTime,jdbcType=TIMESTAMP}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + where resource_id = #{resourceId,jdbcType=VARCHAR} + + + update sys_resource + set resource_name = #{resourceName,jdbcType=VARCHAR}, + url = #{url,jdbcType=VARCHAR}, + resource_type = #{resourceType,jdbcType=VARCHAR}, + source = #{source,jdbcType=VARCHAR}, + school_id = #{schoolId,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=TIMESTAMP}, + update_time = #{updateTime,jdbcType=TIMESTAMP} + where resource_id = #{resourceId,jdbcType=VARCHAR} + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/SysTopicAndCourseMapper.xml b/src/main/resources/mapper/SysTopicAndCourseMapper.xml index 74f2471..f51f434 100644 --- a/src/main/resources/mapper/SysTopicAndCourseMapper.xml +++ b/src/main/resources/mapper/SysTopicAndCourseMapper.xml @@ -3,10 +3,13 @@ + + + - + @@ -68,7 +71,7 @@ - id, one_id, two_id, three_id, topic_id, topic_type + id, topic_id, one_id, one_name, two_id, two_name, three_id, three_name, topic_type