组件代码学生端动态展示、超管端支持更新修改
parent
578787d5ff
commit
634c1da3af
@ -0,0 +1,84 @@
|
||||
package com.sztzjy.resource_center.controller.new_module.stu;
|
||||
|
||||
import cn.hutool.json.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.SerializationFeature;
|
||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||
import com.sztzjy.resource_center.annotation.AnonymousAccess;
|
||||
import com.sztzjy.resource_center.entity.AdminComponentCode;
|
||||
import com.sztzjy.resource_center.entity.AdminComponentCodeWithBLOBs;
|
||||
import com.sztzjy.resource_center.entity.dto.StuCodeDTO;
|
||||
import com.sztzjy.resource_center.entity.dto.StuComponentCodeDTO;
|
||||
import com.sztzjy.resource_center.mapper.AdminComponentCodeMapper;
|
||||
import com.sztzjy.resource_center.util.ConvertUtil;
|
||||
import com.sztzjy.resource_center.util.ResultEntity;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.codehaus.jackson.JsonFactory;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
import java.text.ParseException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @author tz
|
||||
* @date 2024/7/26 10:13
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "学生端组件代码模块")
|
||||
@RequestMapping("api/stu/componentCode")
|
||||
public class StuComponentCodeController {
|
||||
@Resource
|
||||
AdminComponentCodeMapper adminComponentCodeMapper;
|
||||
@Resource
|
||||
ConvertUtil convertUtil;
|
||||
|
||||
@PostMapping("/getComponentCode")
|
||||
@ApiOperation("组件代码展示")
|
||||
@AnonymousAccess
|
||||
public ResultEntity getComponentCode(){
|
||||
//查询所有一级标签
|
||||
List<String> byCourseName = adminComponentCodeMapper.getByCourseName();
|
||||
|
||||
//查询出所有数据
|
||||
List<AdminComponentCodeWithBLOBs> adminComponentCodes = adminComponentCodeMapper.selectByExampleWithBLOBs(null);
|
||||
|
||||
|
||||
List<StuComponentCodeDTO> componentCodeDTOS=new ArrayList<>();
|
||||
|
||||
|
||||
for (String courseName : byCourseName) {
|
||||
StuComponentCodeDTO componentCodeDTO=new StuComponentCodeDTO();
|
||||
componentCodeDTO.setCourseName(courseName);
|
||||
|
||||
componentCodeDTOS.add(componentCodeDTO);
|
||||
}
|
||||
|
||||
//遍历
|
||||
for (StuComponentCodeDTO componentCodeDTO : componentCodeDTOS) {
|
||||
|
||||
List<StuCodeDTO> stuCodeDTOS=new ArrayList<>();
|
||||
|
||||
for (AdminComponentCodeWithBLOBs adminComponentCode : adminComponentCodes) {
|
||||
|
||||
if (adminComponentCode.getCourseName().equals(componentCodeDTO.getCourseName())) {
|
||||
StuCodeDTO stuCodeDTO = convertUtil.entityToDTO(adminComponentCode, StuCodeDTO.class);
|
||||
|
||||
stuCodeDTOS.add(stuCodeDTO);
|
||||
}
|
||||
}
|
||||
componentCodeDTO.setChildren(stuCodeDTOS);
|
||||
}
|
||||
return new ResultEntity(HttpStatus.OK,"成功",componentCodeDTOS);
|
||||
}
|
||||
}
|
@ -0,0 +1,77 @@
|
||||
package com.sztzjy.resource_center.entity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
/**
|
||||
*
|
||||
* @author xcj
|
||||
* admin_component_code
|
||||
*/
|
||||
public class AdminComponentCode {
|
||||
@ApiModelProperty("ID")
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty("步骤名称(一级标签)")
|
||||
private String courseName;
|
||||
|
||||
@ApiModelProperty("案例名称(二级标签)")
|
||||
private String chapterName;
|
||||
|
||||
@ApiModelProperty("管理员/学校ID")
|
||||
private String source;
|
||||
|
||||
@ApiModelProperty("创建时间")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty("0下架 1上架")
|
||||
private Integer status;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getCourseName() {
|
||||
return courseName;
|
||||
}
|
||||
|
||||
public void setCourseName(String courseName) {
|
||||
this.courseName = courseName == null ? null : courseName.trim();
|
||||
}
|
||||
|
||||
public String getChapterName() {
|
||||
return chapterName;
|
||||
}
|
||||
|
||||
public void setChapterName(String chapterName) {
|
||||
this.chapterName = chapterName == null ? null : chapterName.trim();
|
||||
}
|
||||
|
||||
public String getSource() {
|
||||
return source;
|
||||
}
|
||||
|
||||
public void setSource(String source) {
|
||||
this.source = source == null ? null : source.trim();
|
||||
}
|
||||
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public Integer getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(Integer status) {
|
||||
this.status = status;
|
||||
}
|
||||
}
|
@ -0,0 +1,590 @@
|
||||
package com.sztzjy.resource_center.entity;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class AdminComponentCodeExample {
|
||||
protected String orderByClause;
|
||||
|
||||
protected boolean distinct;
|
||||
|
||||
protected List<Criteria> oredCriteria;
|
||||
|
||||
public AdminComponentCodeExample() {
|
||||
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<Criteria> 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<Criterion> criteria;
|
||||
|
||||
protected GeneratedCriteria() {
|
||||
super();
|
||||
criteria = new ArrayList<>();
|
||||
}
|
||||
|
||||
public boolean isValid() {
|
||||
return criteria.size() > 0;
|
||||
}
|
||||
|
||||
public List<Criterion> getAllCriteria() {
|
||||
return criteria;
|
||||
}
|
||||
|
||||
public List<Criterion> 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 andIdIsNull() {
|
||||
addCriterion("id is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdIsNotNull() {
|
||||
addCriterion("id is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdEqualTo(Integer value) {
|
||||
addCriterion("id =", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotEqualTo(Integer value) {
|
||||
addCriterion("id <>", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdGreaterThan(Integer value) {
|
||||
addCriterion("id >", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdGreaterThanOrEqualTo(Integer value) {
|
||||
addCriterion("id >=", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdLessThan(Integer value) {
|
||||
addCriterion("id <", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdLessThanOrEqualTo(Integer value) {
|
||||
addCriterion("id <=", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdIn(List<Integer> values) {
|
||||
addCriterion("id in", values, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotIn(List<Integer> values) {
|
||||
addCriterion("id not in", values, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdBetween(Integer value1, Integer value2) {
|
||||
addCriterion("id between", value1, value2, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotBetween(Integer value1, Integer value2) {
|
||||
addCriterion("id not between", value1, value2, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCourseNameIsNull() {
|
||||
addCriterion("course_name is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCourseNameIsNotNull() {
|
||||
addCriterion("course_name is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCourseNameEqualTo(String value) {
|
||||
addCriterion("course_name =", value, "courseName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCourseNameNotEqualTo(String value) {
|
||||
addCriterion("course_name <>", value, "courseName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCourseNameGreaterThan(String value) {
|
||||
addCriterion("course_name >", value, "courseName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCourseNameGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("course_name >=", value, "courseName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCourseNameLessThan(String value) {
|
||||
addCriterion("course_name <", value, "courseName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCourseNameLessThanOrEqualTo(String value) {
|
||||
addCriterion("course_name <=", value, "courseName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCourseNameLike(String value) {
|
||||
addCriterion("course_name like", value, "courseName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCourseNameNotLike(String value) {
|
||||
addCriterion("course_name not like", value, "courseName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCourseNameIn(List<String> values) {
|
||||
addCriterion("course_name in", values, "courseName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCourseNameNotIn(List<String> values) {
|
||||
addCriterion("course_name not in", values, "courseName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCourseNameBetween(String value1, String value2) {
|
||||
addCriterion("course_name between", value1, value2, "courseName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCourseNameNotBetween(String value1, String value2) {
|
||||
addCriterion("course_name not between", value1, value2, "courseName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andChapterNameIsNull() {
|
||||
addCriterion("chapter_name is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andChapterNameIsNotNull() {
|
||||
addCriterion("chapter_name is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andChapterNameEqualTo(String value) {
|
||||
addCriterion("chapter_name =", value, "chapterName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andChapterNameNotEqualTo(String value) {
|
||||
addCriterion("chapter_name <>", value, "chapterName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andChapterNameGreaterThan(String value) {
|
||||
addCriterion("chapter_name >", value, "chapterName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andChapterNameGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("chapter_name >=", value, "chapterName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andChapterNameLessThan(String value) {
|
||||
addCriterion("chapter_name <", value, "chapterName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andChapterNameLessThanOrEqualTo(String value) {
|
||||
addCriterion("chapter_name <=", value, "chapterName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andChapterNameLike(String value) {
|
||||
addCriterion("chapter_name like", value, "chapterName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andChapterNameNotLike(String value) {
|
||||
addCriterion("chapter_name not like", value, "chapterName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andChapterNameIn(List<String> values) {
|
||||
addCriterion("chapter_name in", values, "chapterName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andChapterNameNotIn(List<String> values) {
|
||||
addCriterion("chapter_name not in", values, "chapterName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andChapterNameBetween(String value1, String value2) {
|
||||
addCriterion("chapter_name between", value1, value2, "chapterName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andChapterNameNotBetween(String value1, String value2) {
|
||||
addCriterion("chapter_name not between", value1, value2, "chapterName");
|
||||
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<String> values) {
|
||||
addCriterion("source in", values, "source");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSourceNotIn(List<String> 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 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<Date> values) {
|
||||
addCriterion("create_time in", values, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeNotIn(List<Date> 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 andStatusIsNull() {
|
||||
addCriterion("status is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusIsNotNull() {
|
||||
addCriterion("status is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusEqualTo(Integer value) {
|
||||
addCriterion("status =", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusNotEqualTo(Integer value) {
|
||||
addCriterion("status <>", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusGreaterThan(Integer value) {
|
||||
addCriterion("status >", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusGreaterThanOrEqualTo(Integer value) {
|
||||
addCriterion("status >=", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusLessThan(Integer value) {
|
||||
addCriterion("status <", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusLessThanOrEqualTo(Integer value) {
|
||||
addCriterion("status <=", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusIn(List<Integer> values) {
|
||||
addCriterion("status in", values, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusNotIn(List<Integer> values) {
|
||||
addCriterion("status not in", values, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusBetween(Integer value1, Integer value2) {
|
||||
addCriterion("status between", value1, value2, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusNotBetween(Integer value1, Integer value2) {
|
||||
addCriterion("status not between", value1, value2, "status");
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package com.sztzjy.resource_center.entity;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
/**
|
||||
*
|
||||
* @author xcj
|
||||
* admin_component_code
|
||||
*/
|
||||
public class AdminComponentCodeWithBLOBs extends AdminComponentCode {
|
||||
@ApiModelProperty("代码内容")
|
||||
private String item;
|
||||
|
||||
@ApiModelProperty("参数释义")
|
||||
private String definition;
|
||||
|
||||
public String getItem() {
|
||||
return item;
|
||||
}
|
||||
|
||||
public void setItem(String item) {
|
||||
this.item = item == null ? null : item.trim();
|
||||
}
|
||||
|
||||
public String getDefinition() {
|
||||
return definition;
|
||||
}
|
||||
|
||||
public void setDefinition(String definition) {
|
||||
this.definition = definition == null ? null : definition.trim();
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package com.sztzjy.resource_center.entity.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author tz
|
||||
* @date 2024/7/26 16:16
|
||||
*/
|
||||
@Data
|
||||
public class StuCodeDTO {
|
||||
private String chapterName;
|
||||
|
||||
private String item;
|
||||
|
||||
private String definition;
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package com.sztzjy.resource_center.entity.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author tz
|
||||
* @date 2024/7/26 16:14
|
||||
*/
|
||||
@Data
|
||||
public class StuComponentCodeDTO {
|
||||
private String courseName;
|
||||
|
||||
private List<StuCodeDTO> children;
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
package com.sztzjy.resource_center.mapper;
|
||||
|
||||
import com.sztzjy.resource_center.entity.AdminComponentCode;
|
||||
import com.sztzjy.resource_center.entity.AdminComponentCodeExample;
|
||||
import com.sztzjy.resource_center.entity.AdminComponentCodeWithBLOBs;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@Mapper
|
||||
public interface AdminComponentCodeMapper {
|
||||
long countByExample(AdminComponentCodeExample example);
|
||||
|
||||
int deleteByExample(AdminComponentCodeExample example);
|
||||
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
int insert(AdminComponentCodeWithBLOBs record);
|
||||
|
||||
int insertSelective(AdminComponentCodeWithBLOBs record);
|
||||
|
||||
List<AdminComponentCodeWithBLOBs> selectByExampleWithBLOBs(AdminComponentCodeExample example);
|
||||
|
||||
List<AdminComponentCode> selectByExample(AdminComponentCodeExample example);
|
||||
|
||||
AdminComponentCodeWithBLOBs selectByPrimaryKey(Integer id);
|
||||
|
||||
int updateByExampleSelective(@Param("record") AdminComponentCodeWithBLOBs record, @Param("example") AdminComponentCodeExample example);
|
||||
|
||||
int updateByExampleWithBLOBs(@Param("record") AdminComponentCodeWithBLOBs record, @Param("example") AdminComponentCodeExample example);
|
||||
|
||||
int updateByExample(@Param("record") AdminComponentCode record, @Param("example") AdminComponentCodeExample example);
|
||||
|
||||
int updateByPrimaryKeySelective(AdminComponentCodeWithBLOBs record);
|
||||
|
||||
int updateByPrimaryKeyWithBLOBs(AdminComponentCodeWithBLOBs record);
|
||||
|
||||
int updateByPrimaryKey(AdminComponentCode record);
|
||||
|
||||
List<String> getByCourseName();
|
||||
}
|
@ -0,0 +1,306 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.sztzjy.resource_center.mapper.AdminComponentCodeMapper">
|
||||
<resultMap id="BaseResultMap" type="com.sztzjy.resource_center.entity.AdminComponentCode">
|
||||
<id column="id" jdbcType="INTEGER" property="id" />
|
||||
<result column="course_name" jdbcType="VARCHAR" property="courseName" />
|
||||
<result column="chapter_name" jdbcType="VARCHAR" property="chapterName" />
|
||||
<result column="source" jdbcType="VARCHAR" property="source" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="status" jdbcType="INTEGER" property="status" />
|
||||
</resultMap>
|
||||
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.sztzjy.resource_center.entity.AdminComponentCodeWithBLOBs">
|
||||
<result column="item" jdbcType="LONGVARCHAR" property="item" />
|
||||
<result column="definition" jdbcType="LONGVARCHAR" property="definition" />
|
||||
</resultMap>
|
||||
<sql id="Example_Where_Clause">
|
||||
<where>
|
||||
<foreach collection="oredCriteria" item="criteria" separator="or">
|
||||
<if test="criteria.valid">
|
||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||
<foreach collection="criteria.criteria" item="criterion">
|
||||
<choose>
|
||||
<when test="criterion.noValue">
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue">
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue">
|
||||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue">
|
||||
and ${criterion.condition}
|
||||
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Update_By_Example_Where_Clause">
|
||||
<where>
|
||||
<foreach collection="example.oredCriteria" item="criteria" separator="or">
|
||||
<if test="criteria.valid">
|
||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||
<foreach collection="criteria.criteria" item="criterion">
|
||||
<choose>
|
||||
<when test="criterion.noValue">
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue">
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue">
|
||||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue">
|
||||
and ${criterion.condition}
|
||||
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Base_Column_List">
|
||||
id, course_name, chapter_name, source, create_time, status
|
||||
</sql>
|
||||
<sql id="Blob_Column_List">
|
||||
item, definition
|
||||
</sql>
|
||||
<select id="selectByExampleWithBLOBs" parameterType="com.sztzjy.resource_center.entity.AdminComponentCodeExample" resultMap="ResultMapWithBLOBs">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
,
|
||||
<include refid="Blob_Column_List" />
|
||||
from admin_component_code
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByExample" parameterType="com.sztzjy.resource_center.entity.AdminComponentCodeExample" resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
from admin_component_code
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="ResultMapWithBLOBs">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
,
|
||||
<include refid="Blob_Column_List" />
|
||||
from admin_component_code
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
delete from admin_component_code
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<delete id="deleteByExample" parameterType="com.sztzjy.resource_center.entity.AdminComponentCodeExample">
|
||||
delete from admin_component_code
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.sztzjy.resource_center.entity.AdminComponentCodeWithBLOBs">
|
||||
insert into admin_component_code (id, course_name, chapter_name,
|
||||
source, create_time, status,
|
||||
item, definition)
|
||||
values (#{id,jdbcType=INTEGER}, #{courseName,jdbcType=VARCHAR}, #{chapterName,jdbcType=VARCHAR},
|
||||
#{source,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER},
|
||||
#{item,jdbcType=LONGVARCHAR}, #{definition,jdbcType=LONGVARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.sztzjy.resource_center.entity.AdminComponentCodeWithBLOBs">
|
||||
insert into admin_component_code
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="courseName != null">
|
||||
course_name,
|
||||
</if>
|
||||
<if test="chapterName != null">
|
||||
chapter_name,
|
||||
</if>
|
||||
<if test="source != null">
|
||||
source,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="status != null">
|
||||
status,
|
||||
</if>
|
||||
<if test="item != null">
|
||||
item,
|
||||
</if>
|
||||
<if test="definition != null">
|
||||
definition,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="courseName != null">
|
||||
#{courseName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="chapterName != null">
|
||||
#{chapterName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="source != null">
|
||||
#{source,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
#{status,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="item != null">
|
||||
#{item,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
<if test="definition != null">
|
||||
#{definition,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample" parameterType="com.sztzjy.resource_center.entity.AdminComponentCodeExample" resultType="java.lang.Long">
|
||||
select count(*) from admin_component_code
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByExampleSelective" parameterType="map">
|
||||
update admin_component_code
|
||||
<set>
|
||||
<if test="record.id != null">
|
||||
id = #{record.id,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="record.courseName != null">
|
||||
course_name = #{record.courseName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.chapterName != null">
|
||||
chapter_name = #{record.chapterName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.source != null">
|
||||
source = #{record.source,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.createTime != null">
|
||||
create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="record.status != null">
|
||||
status = #{record.status,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="record.item != null">
|
||||
item = #{record.item,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
<if test="record.definition != null">
|
||||
definition = #{record.definition,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByExampleWithBLOBs" parameterType="map">
|
||||
update admin_component_code
|
||||
set id = #{record.id,jdbcType=INTEGER},
|
||||
course_name = #{record.courseName,jdbcType=VARCHAR},
|
||||
chapter_name = #{record.chapterName,jdbcType=VARCHAR},
|
||||
source = #{record.source,jdbcType=VARCHAR},
|
||||
create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
||||
status = #{record.status,jdbcType=INTEGER},
|
||||
item = #{record.item,jdbcType=LONGVARCHAR},
|
||||
definition = #{record.definition,jdbcType=LONGVARCHAR}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByExample" parameterType="map">
|
||||
update admin_component_code
|
||||
set id = #{record.id,jdbcType=INTEGER},
|
||||
course_name = #{record.courseName,jdbcType=VARCHAR},
|
||||
chapter_name = #{record.chapterName,jdbcType=VARCHAR},
|
||||
source = #{record.source,jdbcType=VARCHAR},
|
||||
create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
||||
status = #{record.status,jdbcType=INTEGER}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.resource_center.entity.AdminComponentCodeWithBLOBs">
|
||||
update admin_component_code
|
||||
<set>
|
||||
<if test="courseName != null">
|
||||
course_name = #{courseName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="chapterName != null">
|
||||
chapter_name = #{chapterName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="source != null">
|
||||
source = #{source,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
status = #{status,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="item != null">
|
||||
item = #{item,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
<if test="definition != null">
|
||||
definition = #{definition,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.sztzjy.resource_center.entity.AdminComponentCodeWithBLOBs">
|
||||
update admin_component_code
|
||||
set course_name = #{courseName,jdbcType=VARCHAR},
|
||||
chapter_name = #{chapterName,jdbcType=VARCHAR},
|
||||
source = #{source,jdbcType=VARCHAR},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
status = #{status,jdbcType=INTEGER},
|
||||
item = #{item,jdbcType=LONGVARCHAR},
|
||||
definition = #{definition,jdbcType=LONGVARCHAR}
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.sztzjy.resource_center.entity.AdminComponentCode">
|
||||
update admin_component_code
|
||||
set course_name = #{courseName,jdbcType=VARCHAR},
|
||||
chapter_name = #{chapterName,jdbcType=VARCHAR},
|
||||
source = #{source,jdbcType=VARCHAR},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
status = #{status,jdbcType=INTEGER}
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
|
||||
<select id="getByCourseName" resultType="java.lang.String">
|
||||
select DISTINCT course_name from admin_component_code
|
||||
</select>
|
||||
</mapper>
|
Loading…
Reference in New Issue