修改实体类无参构造报错和教师端报错问题
parent
8cc6fe38e3
commit
44960c7555
@ -0,0 +1,38 @@
|
||||
package com.sztzjy.trade.controller.task;
|
||||
|
||||
import com.sztzjy.trade.mapper.StuUserMapper;
|
||||
import com.sztzjy.trade.util.CacheProvider;
|
||||
import com.sztzjy.trade.util.RedisUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author 17803
|
||||
* @date 2024-12-20 16:22
|
||||
*/
|
||||
@Component
|
||||
public class TaskController {
|
||||
|
||||
@Autowired
|
||||
private RedisUtil redisUtil;
|
||||
|
||||
// @Scheduled(fixedDelay = 10000)
|
||||
public void updateUserRank(){
|
||||
//先查询所有学校id
|
||||
Map<String, Long> log = (Map<String, Long>)redisUtil.get("loginLog");
|
||||
|
||||
|
||||
|
||||
System.out.println(log);
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
package com.sztzjy.trade.controller.tch;
|
||||
|
||||
import com.sztzjy.trade.annotation.AnonymousAccess;
|
||||
import com.sztzjy.trade.entity.dto.LoginLogDTO;
|
||||
import com.sztzjy.trade.service.TchKnowledgeGraphService;
|
||||
import com.sztzjy.trade.util.ResultEntity;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* @author 17803
|
||||
* @date 2024-12-20 14:52
|
||||
*/
|
||||
@Api(tags = "教师端知识图谱")
|
||||
@RequestMapping("api/tch/knowledgeGraph")
|
||||
@RestController
|
||||
public class TchKnowledgeGraphController {
|
||||
|
||||
@Autowired
|
||||
private TchKnowledgeGraphService service;
|
||||
|
||||
|
||||
@ApiOperation("知识图谱展示")
|
||||
@GetMapping("/knowledgeGraphBaseInfo")
|
||||
@AnonymousAccess
|
||||
public ResultEntity knowledgeGraphBaseInfo(@RequestParam(required = false) String schoolId) {
|
||||
//"yyyy-MM-dd HH:mm:ss"
|
||||
|
||||
return service.knowledgeGraphBaseInfo(schoolId);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,139 @@
|
||||
package com.sztzjy.trade.entity;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 教师端知识图谱
|
||||
*
|
||||
* @author whb
|
||||
* tch_knowledge_graph
|
||||
*/
|
||||
@Data
|
||||
public class TchKnowledgeGraph {
|
||||
@ApiModelProperty(notes = "id")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(notes = "分支等级")
|
||||
private Integer level;
|
||||
|
||||
@ApiModelProperty(notes = "章节名")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(notes = "1重点 0非重点")
|
||||
private Integer keynote;
|
||||
|
||||
@ApiModelProperty(notes = "1难点 0非难点")
|
||||
private Integer difficulty;
|
||||
|
||||
@ApiModelProperty(notes = "一级分支序号")
|
||||
private Integer chapterNumber;
|
||||
|
||||
@ApiModelProperty(notes = "分支ID")
|
||||
private String chapterNumberId;
|
||||
|
||||
@ApiModelProperty(notes = "1考点 0非考点")
|
||||
private Integer examCenter;
|
||||
|
||||
@ApiModelProperty(notes = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(notes = "更新时间")
|
||||
private Date updateTime;
|
||||
|
||||
@ApiModelProperty(notes = "学校ID")
|
||||
private String schoolId;
|
||||
|
||||
private List<TchKnowledgeGraph> children; // 子目录列表
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id == null ? null : id.trim();
|
||||
}
|
||||
|
||||
public Integer getLevel() {
|
||||
return level;
|
||||
}
|
||||
|
||||
public void setLevel(Integer level) {
|
||||
this.level = level;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name == null ? null : name.trim();
|
||||
}
|
||||
|
||||
public Integer getKeynote() {
|
||||
return keynote;
|
||||
}
|
||||
|
||||
public void setKeynote(Integer keynote) {
|
||||
this.keynote = keynote;
|
||||
}
|
||||
|
||||
public Integer getDifficulty() {
|
||||
return difficulty;
|
||||
}
|
||||
|
||||
public void setDifficulty(Integer difficulty) {
|
||||
this.difficulty = difficulty;
|
||||
}
|
||||
|
||||
public Integer getChapterNumber() {
|
||||
return chapterNumber;
|
||||
}
|
||||
|
||||
public void setChapterNumber(Integer chapterNumber) {
|
||||
this.chapterNumber = chapterNumber;
|
||||
}
|
||||
|
||||
public String getChapterNumberId() {
|
||||
return chapterNumberId;
|
||||
}
|
||||
|
||||
public void setChapterNumberId(String chapterNumberId) {
|
||||
this.chapterNumberId = chapterNumberId == null ? null : chapterNumberId.trim();
|
||||
}
|
||||
|
||||
public Integer getExamCenter() {
|
||||
return examCenter;
|
||||
}
|
||||
|
||||
public void setExamCenter(Integer examCenter) {
|
||||
this.examCenter = examCenter;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
public String getSchoolId() {
|
||||
return schoolId;
|
||||
}
|
||||
|
||||
public void setSchoolId(String schoolId) {
|
||||
this.schoolId = schoolId == null ? null : schoolId.trim();
|
||||
}
|
||||
}
|
@ -0,0 +1,900 @@
|
||||
package com.sztzjy.trade.entity;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class TchKnowledgeGraphExample {
|
||||
protected String orderByClause;
|
||||
|
||||
protected boolean distinct;
|
||||
|
||||
protected List<Criteria> oredCriteria;
|
||||
|
||||
public TchKnowledgeGraphExample() {
|
||||
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(String value) {
|
||||
addCriterion("id =", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotEqualTo(String value) {
|
||||
addCriterion("id <>", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdGreaterThan(String value) {
|
||||
addCriterion("id >", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("id >=", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdLessThan(String value) {
|
||||
addCriterion("id <", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdLessThanOrEqualTo(String value) {
|
||||
addCriterion("id <=", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdLike(String value) {
|
||||
addCriterion("id like", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotLike(String value) {
|
||||
addCriterion("id not like", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdIn(List<String> values) {
|
||||
addCriterion("id in", values, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotIn(List<String> values) {
|
||||
addCriterion("id not in", values, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdBetween(String value1, String value2) {
|
||||
addCriterion("id between", value1, value2, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotBetween(String value1, String value2) {
|
||||
addCriterion("id not between", value1, value2, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLevelIsNull() {
|
||||
addCriterion("level is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLevelIsNotNull() {
|
||||
addCriterion("level is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLevelEqualTo(Integer value) {
|
||||
addCriterion("level =", value, "level");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLevelNotEqualTo(Integer value) {
|
||||
addCriterion("level <>", value, "level");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLevelGreaterThan(Integer value) {
|
||||
addCriterion("level >", value, "level");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLevelGreaterThanOrEqualTo(Integer value) {
|
||||
addCriterion("level >=", value, "level");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLevelLessThan(Integer value) {
|
||||
addCriterion("level <", value, "level");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLevelLessThanOrEqualTo(Integer value) {
|
||||
addCriterion("level <=", value, "level");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLevelIn(List<Integer> values) {
|
||||
addCriterion("level in", values, "level");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLevelNotIn(List<Integer> values) {
|
||||
addCriterion("level not in", values, "level");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLevelBetween(Integer value1, Integer value2) {
|
||||
addCriterion("level between", value1, value2, "level");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLevelNotBetween(Integer value1, Integer value2) {
|
||||
addCriterion("level not between", value1, value2, "level");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameIsNull() {
|
||||
addCriterion("name is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameIsNotNull() {
|
||||
addCriterion("name is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameEqualTo(String value) {
|
||||
addCriterion("name =", value, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameNotEqualTo(String value) {
|
||||
addCriterion("name <>", value, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameGreaterThan(String value) {
|
||||
addCriterion("name >", value, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("name >=", value, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameLessThan(String value) {
|
||||
addCriterion("name <", value, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameLessThanOrEqualTo(String value) {
|
||||
addCriterion("name <=", value, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameLike(String value) {
|
||||
addCriterion("name like", value, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameNotLike(String value) {
|
||||
addCriterion("name not like", value, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameIn(List<String> values) {
|
||||
addCriterion("name in", values, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameNotIn(List<String> values) {
|
||||
addCriterion("name not in", values, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameBetween(String value1, String value2) {
|
||||
addCriterion("name between", value1, value2, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameNotBetween(String value1, String value2) {
|
||||
addCriterion("name not between", value1, value2, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andKeynoteIsNull() {
|
||||
addCriterion("keynote is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andKeynoteIsNotNull() {
|
||||
addCriterion("keynote is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andKeynoteEqualTo(Integer value) {
|
||||
addCriterion("keynote =", value, "keynote");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andKeynoteNotEqualTo(Integer value) {
|
||||
addCriterion("keynote <>", value, "keynote");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andKeynoteGreaterThan(Integer value) {
|
||||
addCriterion("keynote >", value, "keynote");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andKeynoteGreaterThanOrEqualTo(Integer value) {
|
||||
addCriterion("keynote >=", value, "keynote");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andKeynoteLessThan(Integer value) {
|
||||
addCriterion("keynote <", value, "keynote");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andKeynoteLessThanOrEqualTo(Integer value) {
|
||||
addCriterion("keynote <=", value, "keynote");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andKeynoteIn(List<Integer> values) {
|
||||
addCriterion("keynote in", values, "keynote");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andKeynoteNotIn(List<Integer> values) {
|
||||
addCriterion("keynote not in", values, "keynote");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andKeynoteBetween(Integer value1, Integer value2) {
|
||||
addCriterion("keynote between", value1, value2, "keynote");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andKeynoteNotBetween(Integer value1, Integer value2) {
|
||||
addCriterion("keynote not between", value1, value2, "keynote");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDifficultyIsNull() {
|
||||
addCriterion("difficulty is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDifficultyIsNotNull() {
|
||||
addCriterion("difficulty is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDifficultyEqualTo(Integer value) {
|
||||
addCriterion("difficulty =", value, "difficulty");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDifficultyNotEqualTo(Integer value) {
|
||||
addCriterion("difficulty <>", value, "difficulty");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDifficultyGreaterThan(Integer value) {
|
||||
addCriterion("difficulty >", value, "difficulty");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDifficultyGreaterThanOrEqualTo(Integer value) {
|
||||
addCriterion("difficulty >=", value, "difficulty");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDifficultyLessThan(Integer value) {
|
||||
addCriterion("difficulty <", value, "difficulty");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDifficultyLessThanOrEqualTo(Integer value) {
|
||||
addCriterion("difficulty <=", value, "difficulty");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDifficultyIn(List<Integer> values) {
|
||||
addCriterion("difficulty in", values, "difficulty");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDifficultyNotIn(List<Integer> values) {
|
||||
addCriterion("difficulty not in", values, "difficulty");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDifficultyBetween(Integer value1, Integer value2) {
|
||||
addCriterion("difficulty between", value1, value2, "difficulty");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDifficultyNotBetween(Integer value1, Integer value2) {
|
||||
addCriterion("difficulty not between", value1, value2, "difficulty");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andChapterNumberIsNull() {
|
||||
addCriterion("chapter_number is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andChapterNumberIsNotNull() {
|
||||
addCriterion("chapter_number is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andChapterNumberEqualTo(Integer value) {
|
||||
addCriterion("chapter_number =", value, "chapterNumber");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andChapterNumberNotEqualTo(Integer value) {
|
||||
addCriterion("chapter_number <>", value, "chapterNumber");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andChapterNumberGreaterThan(Integer value) {
|
||||
addCriterion("chapter_number >", value, "chapterNumber");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andChapterNumberGreaterThanOrEqualTo(Integer value) {
|
||||
addCriterion("chapter_number >=", value, "chapterNumber");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andChapterNumberLessThan(Integer value) {
|
||||
addCriterion("chapter_number <", value, "chapterNumber");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andChapterNumberLessThanOrEqualTo(Integer value) {
|
||||
addCriterion("chapter_number <=", value, "chapterNumber");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andChapterNumberIn(List<Integer> values) {
|
||||
addCriterion("chapter_number in", values, "chapterNumber");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andChapterNumberNotIn(List<Integer> values) {
|
||||
addCriterion("chapter_number not in", values, "chapterNumber");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andChapterNumberBetween(Integer value1, Integer value2) {
|
||||
addCriterion("chapter_number between", value1, value2, "chapterNumber");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andChapterNumberNotBetween(Integer value1, Integer value2) {
|
||||
addCriterion("chapter_number not between", value1, value2, "chapterNumber");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andChapterNumberIdIsNull() {
|
||||
addCriterion("chapter_number_id is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andChapterNumberIdIsNotNull() {
|
||||
addCriterion("chapter_number_id is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andChapterNumberIdEqualTo(String value) {
|
||||
addCriterion("chapter_number_id =", value, "chapterNumberId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andChapterNumberIdNotEqualTo(String value) {
|
||||
addCriterion("chapter_number_id <>", value, "chapterNumberId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andChapterNumberIdGreaterThan(String value) {
|
||||
addCriterion("chapter_number_id >", value, "chapterNumberId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andChapterNumberIdGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("chapter_number_id >=", value, "chapterNumberId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andChapterNumberIdLessThan(String value) {
|
||||
addCriterion("chapter_number_id <", value, "chapterNumberId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andChapterNumberIdLessThanOrEqualTo(String value) {
|
||||
addCriterion("chapter_number_id <=", value, "chapterNumberId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andChapterNumberIdLike(String value) {
|
||||
addCriterion("chapter_number_id like", value, "chapterNumberId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andChapterNumberIdNotLike(String value) {
|
||||
addCriterion("chapter_number_id not like", value, "chapterNumberId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andChapterNumberIdIn(List<String> values) {
|
||||
addCriterion("chapter_number_id in", values, "chapterNumberId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andChapterNumberIdNotIn(List<String> values) {
|
||||
addCriterion("chapter_number_id not in", values, "chapterNumberId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andChapterNumberIdBetween(String value1, String value2) {
|
||||
addCriterion("chapter_number_id between", value1, value2, "chapterNumberId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andChapterNumberIdNotBetween(String value1, String value2) {
|
||||
addCriterion("chapter_number_id not between", value1, value2, "chapterNumberId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andExamCenterIsNull() {
|
||||
addCriterion("exam_center is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andExamCenterIsNotNull() {
|
||||
addCriterion("exam_center is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andExamCenterEqualTo(Integer value) {
|
||||
addCriterion("exam_center =", value, "examCenter");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andExamCenterNotEqualTo(Integer value) {
|
||||
addCriterion("exam_center <>", value, "examCenter");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andExamCenterGreaterThan(Integer value) {
|
||||
addCriterion("exam_center >", value, "examCenter");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andExamCenterGreaterThanOrEqualTo(Integer value) {
|
||||
addCriterion("exam_center >=", value, "examCenter");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andExamCenterLessThan(Integer value) {
|
||||
addCriterion("exam_center <", value, "examCenter");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andExamCenterLessThanOrEqualTo(Integer value) {
|
||||
addCriterion("exam_center <=", value, "examCenter");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andExamCenterIn(List<Integer> values) {
|
||||
addCriterion("exam_center in", values, "examCenter");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andExamCenterNotIn(List<Integer> values) {
|
||||
addCriterion("exam_center not in", values, "examCenter");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andExamCenterBetween(Integer value1, Integer value2) {
|
||||
addCriterion("exam_center between", value1, value2, "examCenter");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andExamCenterNotBetween(Integer value1, Integer value2) {
|
||||
addCriterion("exam_center not between", value1, value2, "examCenter");
|
||||
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 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<Date> values) {
|
||||
addCriterion("update_time in", values, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeNotIn(List<Date> 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 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<String> values) {
|
||||
addCriterion("school_id in", values, "schoolId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSchoolIdNotIn(List<String> 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 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,30 @@
|
||||
package com.sztzjy.trade.mapper;
|
||||
|
||||
import com.sztzjy.trade.entity.TchKnowledgeGraph;
|
||||
import com.sztzjy.trade.entity.TchKnowledgeGraphExample;
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
public interface TchKnowledgeGraphMapper {
|
||||
long countByExample(TchKnowledgeGraphExample example);
|
||||
|
||||
int deleteByExample(TchKnowledgeGraphExample example);
|
||||
|
||||
int deleteByPrimaryKey(String id);
|
||||
|
||||
int insert(TchKnowledgeGraph record);
|
||||
|
||||
int insertSelective(TchKnowledgeGraph record);
|
||||
|
||||
List<TchKnowledgeGraph> selectByExample(TchKnowledgeGraphExample example);
|
||||
|
||||
TchKnowledgeGraph selectByPrimaryKey(String id);
|
||||
|
||||
int updateByExampleSelective(@Param("record") TchKnowledgeGraph record, @Param("example") TchKnowledgeGraphExample example);
|
||||
|
||||
int updateByExample(@Param("record") TchKnowledgeGraph record, @Param("example") TchKnowledgeGraphExample example);
|
||||
|
||||
int updateByPrimaryKeySelective(TchKnowledgeGraph record);
|
||||
|
||||
int updateByPrimaryKey(TchKnowledgeGraph record);
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
package com.sztzjy.trade.service;
|
||||
|
||||
import com.sztzjy.trade.util.ResultEntity;
|
||||
|
||||
/**
|
||||
* @author 17803
|
||||
* @date 2024-12-20 14:53
|
||||
*/
|
||||
public interface TchKnowledgeGraphService {
|
||||
//知识图谱展示
|
||||
ResultEntity knowledgeGraphBaseInfo(String schoolId);
|
||||
}
|
@ -0,0 +1,85 @@
|
||||
package com.sztzjy.trade.service.impl;
|
||||
|
||||
import com.sztzjy.trade.entity.TchKnowledgeGraph;
|
||||
import com.sztzjy.trade.entity.TchKnowledgeGraphExample;
|
||||
import com.sztzjy.trade.mapper.TchKnowledgeGraphMapper;
|
||||
import com.sztzjy.trade.service.TchKnowledgeGraphService;
|
||||
import com.sztzjy.trade.util.ResultEntity;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author 17803
|
||||
* @date 2024-12-20 14:53
|
||||
*/
|
||||
@Service
|
||||
public class TchKnowledgeGraphServiceImpl implements TchKnowledgeGraphService {
|
||||
|
||||
@Autowired
|
||||
private TchKnowledgeGraphMapper mapper;
|
||||
|
||||
//知识图谱展示
|
||||
@Override
|
||||
public ResultEntity knowledgeGraphBaseInfo(String schoolId) {
|
||||
|
||||
//递归查询出所有数据
|
||||
TchKnowledgeGraphExample example = new TchKnowledgeGraphExample();
|
||||
example.createCriteria().getAllCriteria();
|
||||
List<TchKnowledgeGraph> tchKnowledgeGraphList = mapper.selectByExample(example);
|
||||
if (!tchKnowledgeGraphList.isEmpty()) {
|
||||
//按照章节顺序查询出所有一级目录
|
||||
List<TchKnowledgeGraph> collect = tchKnowledgeGraphList.stream()
|
||||
.filter(item -> item.getChapterNumberId() == null) // 确保这个条件是必要的
|
||||
.sorted(Comparator.comparing(TchKnowledgeGraph::getChapterNumber, Comparator.nullsLast(Comparator.naturalOrder()))) // 确保有效排序
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 递归获取所有目录
|
||||
List<TchKnowledgeGraph> allEntriesWithChildren = new ArrayList<>();
|
||||
|
||||
//查询二级目录 三级目录 等等 递归查询
|
||||
for (TchKnowledgeGraph tchKnowledgeGraph : tchKnowledgeGraphList) {
|
||||
|
||||
collect.forEach(item -> {
|
||||
//说明是三级目录
|
||||
if (item.getId().equals(tchKnowledgeGraph.getChapterNumberId())) {
|
||||
|
||||
// 获取当前目录及其所有子目录
|
||||
item.setChildren(getChildren(tchKnowledgeGraphList, item.getId()));
|
||||
allEntriesWithChildren.add(item);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return new ResultEntity(HttpStatus.OK, allEntriesWithChildren);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
// 递归获取子目录
|
||||
private static List<TchKnowledgeGraph> getChildren(List<TchKnowledgeGraph> allEntries, String parentId) {
|
||||
List<TchKnowledgeGraph> children = allEntries.stream()
|
||||
.filter(item -> parentId.equals(item.getChapterNumberId())) // 根据父ID查找子项
|
||||
.sorted(Comparator.comparing(TchKnowledgeGraph::getChapterNumber, Comparator.nullsLast(Comparator.naturalOrder()))) // 排序
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 对于每个子项,递归查找其子目录
|
||||
for (TchKnowledgeGraph child : children) {
|
||||
child.setChildren(getChildren(allEntries, child.getId())); // 递归查找
|
||||
}
|
||||
|
||||
return children;
|
||||
}
|
||||
|
||||
}
|
@ -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.trade.mapper.TchKnowledgeGraphMapper">
|
||||
<resultMap id="BaseResultMap" type="com.sztzjy.trade.entity.TchKnowledgeGraph">
|
||||
<id column="id" jdbcType="VARCHAR" property="id" />
|
||||
<result column="level" jdbcType="INTEGER" property="level" />
|
||||
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||
<result column="keynote" jdbcType="INTEGER" property="keynote" />
|
||||
<result column="difficulty" jdbcType="INTEGER" property="difficulty" />
|
||||
<result column="chapter_number" jdbcType="INTEGER" property="chapterNumber" />
|
||||
<result column="chapter_number_id" jdbcType="VARCHAR" property="chapterNumberId" />
|
||||
<result column="exam_center" jdbcType="INTEGER" property="examCenter" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
<result column="school_id" jdbcType="VARCHAR" property="schoolId" />
|
||||
</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, level, name, keynote, difficulty, chapter_number, chapter_number_id, exam_center,
|
||||
create_time, update_time, school_id
|
||||
</sql>
|
||||
<select id="selectByExample" parameterType="com.sztzjy.trade.entity.TchKnowledgeGraphExample" resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
from tch_knowledge_graph
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from tch_knowledge_graph
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
||||
delete from tch_knowledge_graph
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</delete>
|
||||
<delete id="deleteByExample" parameterType="com.sztzjy.trade.entity.TchKnowledgeGraphExample">
|
||||
delete from tch_knowledge_graph
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.sztzjy.trade.entity.TchKnowledgeGraph">
|
||||
insert into tch_knowledge_graph (id, level, name,
|
||||
keynote, difficulty, chapter_number,
|
||||
chapter_number_id, exam_center, create_time,
|
||||
update_time, school_id)
|
||||
values (#{id,jdbcType=VARCHAR}, #{level,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR},
|
||||
#{keynote,jdbcType=INTEGER}, #{difficulty,jdbcType=INTEGER}, #{chapterNumber,jdbcType=INTEGER},
|
||||
#{chapterNumberId,jdbcType=VARCHAR}, #{examCenter,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
|
||||
#{updateTime,jdbcType=TIMESTAMP}, #{schoolId,jdbcType=VARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.sztzjy.trade.entity.TchKnowledgeGraph">
|
||||
insert into tch_knowledge_graph
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="level != null">
|
||||
level,
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name,
|
||||
</if>
|
||||
<if test="keynote != null">
|
||||
keynote,
|
||||
</if>
|
||||
<if test="difficulty != null">
|
||||
difficulty,
|
||||
</if>
|
||||
<if test="chapterNumber != null">
|
||||
chapter_number,
|
||||
</if>
|
||||
<if test="chapterNumberId != null">
|
||||
chapter_number_id,
|
||||
</if>
|
||||
<if test="examCenter != null">
|
||||
exam_center,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
<if test="schoolId != null">
|
||||
school_id,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="level != null">
|
||||
#{level,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
#{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="keynote != null">
|
||||
#{keynote,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="difficulty != null">
|
||||
#{difficulty,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="chapterNumber != null">
|
||||
#{chapterNumber,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="chapterNumberId != null">
|
||||
#{chapterNumberId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="examCenter != null">
|
||||
#{examCenter,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="schoolId != null">
|
||||
#{schoolId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample" parameterType="com.sztzjy.trade.entity.TchKnowledgeGraphExample" resultType="java.lang.Long">
|
||||
select count(*) from tch_knowledge_graph
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByExampleSelective" parameterType="map">
|
||||
update tch_knowledge_graph
|
||||
<set>
|
||||
<if test="record.id != null">
|
||||
id = #{record.id,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.level != null">
|
||||
level = #{record.level,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="record.name != null">
|
||||
name = #{record.name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.keynote != null">
|
||||
keynote = #{record.keynote,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="record.difficulty != null">
|
||||
difficulty = #{record.difficulty,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="record.chapterNumber != null">
|
||||
chapter_number = #{record.chapterNumber,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="record.chapterNumberId != null">
|
||||
chapter_number_id = #{record.chapterNumberId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.examCenter != null">
|
||||
exam_center = #{record.examCenter,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="record.createTime != null">
|
||||
create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="record.updateTime != null">
|
||||
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="record.schoolId != null">
|
||||
school_id = #{record.schoolId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByExample" parameterType="map">
|
||||
update tch_knowledge_graph
|
||||
set id = #{record.id,jdbcType=VARCHAR},
|
||||
level = #{record.level,jdbcType=INTEGER},
|
||||
name = #{record.name,jdbcType=VARCHAR},
|
||||
keynote = #{record.keynote,jdbcType=INTEGER},
|
||||
difficulty = #{record.difficulty,jdbcType=INTEGER},
|
||||
chapter_number = #{record.chapterNumber,jdbcType=INTEGER},
|
||||
chapter_number_id = #{record.chapterNumberId,jdbcType=VARCHAR},
|
||||
exam_center = #{record.examCenter,jdbcType=INTEGER},
|
||||
create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
||||
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
|
||||
school_id = #{record.schoolId,jdbcType=VARCHAR}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.trade.entity.TchKnowledgeGraph">
|
||||
update tch_knowledge_graph
|
||||
<set>
|
||||
<if test="level != null">
|
||||
level = #{level,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="keynote != null">
|
||||
keynote = #{keynote,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="difficulty != null">
|
||||
difficulty = #{difficulty,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="chapterNumber != null">
|
||||
chapter_number = #{chapterNumber,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="chapterNumberId != null">
|
||||
chapter_number_id = #{chapterNumberId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="examCenter != null">
|
||||
exam_center = #{examCenter,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="schoolId != null">
|
||||
school_id = #{schoolId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.sztzjy.trade.entity.TchKnowledgeGraph">
|
||||
update tch_knowledge_graph
|
||||
set level = #{level,jdbcType=INTEGER},
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
keynote = #{keynote,jdbcType=INTEGER},
|
||||
difficulty = #{difficulty,jdbcType=INTEGER},
|
||||
chapter_number = #{chapterNumber,jdbcType=INTEGER},
|
||||
chapter_number_id = #{chapterNumberId,jdbcType=VARCHAR},
|
||||
exam_center = #{examCenter,jdbcType=INTEGER},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
||||
school_id = #{schoolId,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</update>
|
||||
</mapper>
|
Loading…
Reference in New Issue