xiaoCJ 9 months ago
parent 51a4b59636
commit 659ad3f5bb

@ -1,40 +1,20 @@
//package com.sztzjy.resource_center.config.security; package com.sztzjy.resource_center.config.security;
//
//import com.sztzjy.resource_center.entity.StuUser; import org.springframework.security.core.userdetails.UserDetails;
//import com.sztzjy.resource_center.entity.StuUserExample; import org.springframework.security.core.userdetails.UserDetailsService;
//import com.sztzjy.resource_center.mapper.StuUserMapper; import org.springframework.security.core.userdetails.UsernameNotFoundException;
//import io.jsonwebtoken.lang.Assert; import org.springframework.stereotype.Service;
//import org.springframework.security.core.userdetails.UserDetails;
//import org.springframework.security.core.userdetails.UserDetailsService;
//import org.springframework.security.core.userdetails.UsernameNotFoundException; @Service
//import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; public class AuthenticationService implements UserDetailsService {
//import org.springframework.stereotype.Service;
//
//import javax.annotation.Resource; @Override
//import java.util.List; public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
// com.sztzjy.resource_center.config.security.JwtUser jwtUser = new com.sztzjy.resource_center.config.security.JwtUser();
// jwtUser.setUsername(username);
//@Service return jwtUser;
//public class AuthenticationService implements UserDetailsService { }
// @Resource
// private StuUserMapper stuUserMapper; }
//
//
// @Override
// public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
// StuUserExample stuUserExample = new StuUserExample();
// stuUserExample.createCriteria().andUsernameEqualTo(username);
// List<StuUser> list = stuUserMapper.selectByExample(stuUserExample);
// Assert.notNull(list, "用户不存在");
// StuUser user = list.get(0);
// com.sztzjy.resource_center.config.security.JwtUser jwtUser = new com.sztzjy.resource_center.config.security.JwtUser();
// jwtUser.setUsername(user.getUsername());
// jwtUser.setPassword(new BCryptPasswordEncoder().encode(user.getPassword())); //不加密会报错Encoded password does not look like BCrypt
// jwtUser.setUserId(user.getUserid());
// jwtUser.setName(user.getName());
// jwtUser.setRoleId(user.getRoleId());
// jwtUser.setStudentId(user.getStudentId());
// return jwtUser;
// }
//
//}

@ -72,11 +72,6 @@ public class TokenProvider {
Key key = Keys.hmacShaKeyFor(SECRET.getBytes()); Key key = Keys.hmacShaKeyFor(SECRET.getBytes());
Date expiration = new Date(System.currentTimeMillis() + EXP_TIME); Date expiration = new Date(System.currentTimeMillis() + EXP_TIME);
return Jwts.builder() return Jwts.builder()
.claim("userId", jwtUser.getUserId())
.claim("roleId", jwtUser.getRoleId())
.claim("name", jwtUser.getName())
.claim("classId", jwtUser.getClassId())
.claim("schoolId", jwtUser.getSchoolId())
.claim("username", jwtUser.getUsername()) .claim("username", jwtUser.getUsername())
.claim("authorityCodes", jwtUser.getAuthorityCodes()) .claim("authorityCodes", jwtUser.getAuthorityCodes())
.setIssuedAt(new Date(System.currentTimeMillis())) .setIssuedAt(new Date(System.currentTimeMillis()))

@ -120,7 +120,7 @@ public class CourseManageController {
@RequestParam Integer size) { @RequestParam Integer size) {
PageHelper.startPage(index, size); PageHelper.startPage(index, size);
SysOneCatalogExample example = new SysOneCatalogExample(); SysOneCatalogExample example = new SysOneCatalogExample();
example.setOrderByClause("rank ASC"); example.setOrderByClause("sort ASC");
List<SysOneCatalog> sysOneCatalogs = sysOneCatalogMapper.selectByExample(example); List<SysOneCatalog> sysOneCatalogs = sysOneCatalogMapper.selectByExample(example);
PageInfo<SysOneCatalog> pageInfo = new PageInfo(sysOneCatalogs); PageInfo<SysOneCatalog> pageInfo = new PageInfo(sysOneCatalogs);
return new ResultEntity<PageInfo<SysOneCatalog>>(pageInfo); return new ResultEntity<PageInfo<SysOneCatalog>>(pageInfo);

@ -2,6 +2,8 @@ package com.sztzjy.resource_center.controller;
import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.IdUtil;
import com.sztzjy.resource_center.annotation.AnonymousAccess; import com.sztzjy.resource_center.annotation.AnonymousAccess;
import com.sztzjy.resource_center.config.security.JwtUser;
import com.sztzjy.resource_center.config.security.TokenProvider;
import com.sztzjy.resource_center.entity.SysOneCatalog; import com.sztzjy.resource_center.entity.SysOneCatalog;
import com.sztzjy.resource_center.entity.SysThreeCatalog; import com.sztzjy.resource_center.entity.SysThreeCatalog;
import com.sztzjy.resource_center.entity.SysTwoCatalog; import com.sztzjy.resource_center.entity.SysTwoCatalog;
@ -15,9 +17,16 @@ import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.Date; import java.util.Date;
import java.util.HashMap;
import java.util.Map;
/** /**
* @Author xcj * @Author xcj
@ -33,7 +42,8 @@ public class CourseTagManageController {
private SysTwoCatalogMapper sysTwoCatalogMapper; private SysTwoCatalogMapper sysTwoCatalogMapper;
@Autowired @Autowired
private SysThreeCatalogMapper sysThreeCatalogMapper; private SysThreeCatalogMapper sysThreeCatalogMapper;
@Resource
private AuthenticationManagerBuilder authenticationManagerBuilder;
@AnonymousAccess @AnonymousAccess
@ApiOperation("添加二级目录") @ApiOperation("添加二级目录")
@ -52,7 +62,7 @@ public class CourseTagManageController {
} }
@AnonymousAccess @AnonymousAccess
@ApiOperation("添加级目录") @ApiOperation("添加级目录")
@PostMapping("insertSysThreeCatalog") @PostMapping("insertSysThreeCatalog")
public ResultEntity<String> insertSysThreeCatalog(@RequestBody SysThreeCatalog sysThreeCatalog) { public ResultEntity<String> insertSysThreeCatalog(@RequestBody SysThreeCatalog sysThreeCatalog) {
if (StringUtils.isBlank(sysThreeCatalog.getOntId())) { if (StringUtils.isBlank(sysThreeCatalog.getOntId())) {
@ -111,19 +121,41 @@ public class CourseTagManageController {
@RequestParam int rank) { @RequestParam int rank) {
if (type == 1) { if (type == 1) {
SysOneCatalog sysOneCatalog = sysOneCatalogMapper.selectByPrimaryKey(id); SysOneCatalog sysOneCatalog = sysOneCatalogMapper.selectByPrimaryKey(id);
sysOneCatalog.setRank(rank); sysOneCatalog.setSort(rank);
sysOneCatalogMapper.updateByPrimaryKey(sysOneCatalog); sysOneCatalogMapper.updateByPrimaryKey(sysOneCatalog);
return new ResultEntity<>(HttpStatus.OK, "排序成功"); return new ResultEntity<>(HttpStatus.OK, "排序成功");
} else if (type == 2) { } else if (type == 2) {
SysTwoCatalog sysTwoCatalog = sysTwoCatalogMapper.selectByPrimaryKey(id); SysTwoCatalog sysTwoCatalog = sysTwoCatalogMapper.selectByPrimaryKey(id);
sysTwoCatalog.setRank(rank); sysTwoCatalog.setSort(rank);
sysTwoCatalogMapper.updateByPrimaryKey(sysTwoCatalog); sysTwoCatalogMapper.updateByPrimaryKey(sysTwoCatalog);
return new ResultEntity<>(HttpStatus.OK, "排序成功"); return new ResultEntity<>(HttpStatus.OK, "排序成功");
} else { } else {
SysThreeCatalog sysThreeCatalog = sysThreeCatalogMapper.selectByPrimaryKey(id); SysThreeCatalog sysThreeCatalog = sysThreeCatalogMapper.selectByPrimaryKey(id);
sysThreeCatalog.setRank(rank); sysThreeCatalog.setSort(rank);
sysThreeCatalogMapper.updateByPrimaryKey(sysThreeCatalog); sysThreeCatalogMapper.updateByPrimaryKey(sysThreeCatalog);
return new ResultEntity<>(HttpStatus.OK, "排序成功"); return new ResultEntity<>(HttpStatus.OK, "排序成功");
} }
} }
@PostMapping("/login")
@ApiOperation("登录接口")
@AnonymousAccess
public ResultEntity login(@RequestParam String password,
@RequestParam String userName) {
if (StringUtils.isBlank(password)
|| !userName.equals("admin")
|| StringUtils.isBlank(userName)
|| !password.equals("tianze@admin@123")) {
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "账号或密码不正确!");
}else {
Map<String,Object> map =new HashMap();
map.put("username", userName);
JwtUser jwtUser =new JwtUser();
jwtUser.setUsername(userName);
jwtUser.setPassword(password);
String token = TokenProvider.createToken(jwtUser);
map.put("token", token);
return new ResultEntity(map);
}
}
} }

@ -22,7 +22,7 @@ public class SysOneCatalog {
private String courseIntroduction; private String courseIntroduction;
@ApiModelProperty("排序") @ApiModelProperty("排序")
private Integer rank; private Integer sort;
@ApiModelProperty("0未启用 1启用") @ApiModelProperty("0未启用 1启用")
private Integer status; private Integer status;
@ -65,12 +65,12 @@ public class SysOneCatalog {
this.courseIntroduction = courseIntroduction == null ? null : courseIntroduction.trim(); this.courseIntroduction = courseIntroduction == null ? null : courseIntroduction.trim();
} }
public Integer getRank() { public Integer getSort() {
return rank; return sort;
} }
public void setRank(Integer rank) { public void setSort(Integer sort) {
this.rank = rank; this.sort = sort;
} }
public Integer getStatus() { public Integer getStatus() {

@ -385,63 +385,63 @@ public class SysOneCatalogExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andRankIsNull() { public Criteria andSortIsNull() {
addCriterion("rank is null"); addCriterion("sort is null");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andRankIsNotNull() { public Criteria andSortIsNotNull() {
addCriterion("rank is not null"); addCriterion("sort is not null");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andRankEqualTo(Integer value) { public Criteria andSortEqualTo(Integer value) {
addCriterion("rank =", value, "rank"); addCriterion("sort =", value, "sort");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andRankNotEqualTo(Integer value) { public Criteria andSortNotEqualTo(Integer value) {
addCriterion("rank <>", value, "rank"); addCriterion("sort <>", value, "sort");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andRankGreaterThan(Integer value) { public Criteria andSortGreaterThan(Integer value) {
addCriterion("rank >", value, "rank"); addCriterion("sort >", value, "sort");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andRankGreaterThanOrEqualTo(Integer value) { public Criteria andSortGreaterThanOrEqualTo(Integer value) {
addCriterion("rank >=", value, "rank"); addCriterion("sort >=", value, "sort");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andRankLessThan(Integer value) { public Criteria andSortLessThan(Integer value) {
addCriterion("rank <", value, "rank"); addCriterion("sort <", value, "sort");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andRankLessThanOrEqualTo(Integer value) { public Criteria andSortLessThanOrEqualTo(Integer value) {
addCriterion("rank <=", value, "rank"); addCriterion("sort <=", value, "sort");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andRankIn(List<Integer> values) { public Criteria andSortIn(List<Integer> values) {
addCriterion("rank in", values, "rank"); addCriterion("sort in", values, "sort");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andRankNotIn(List<Integer> values) { public Criteria andSortNotIn(List<Integer> values) {
addCriterion("rank not in", values, "rank"); addCriterion("sort not in", values, "sort");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andRankBetween(Integer value1, Integer value2) { public Criteria andSortBetween(Integer value1, Integer value2) {
addCriterion("rank between", value1, value2, "rank"); addCriterion("sort between", value1, value2, "sort");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andRankNotBetween(Integer value1, Integer value2) { public Criteria andSortNotBetween(Integer value1, Integer value2) {
addCriterion("rank not between", value1, value2, "rank"); addCriterion("sort not between", value1, value2, "sort");
return (Criteria) this; return (Criteria) this;
} }

@ -9,7 +9,7 @@ import io.swagger.annotations.ApiModelProperty;
* sys_three_catalog * sys_three_catalog
*/ */
public class SysThreeCatalog { public class SysThreeCatalog {
@ApiModelProperty("三级目录ID ") @ApiModelProperty("三级目录ID")
private String threeId; private String threeId;
@ApiModelProperty("三级目录名称 /应用名称 ") @ApiModelProperty("三级目录名称 /应用名称 ")
@ -22,7 +22,7 @@ public class SysThreeCatalog {
private String twoId; private String twoId;
@ApiModelProperty("排序") @ApiModelProperty("排序")
private Integer rank; private Integer sort;
@ApiModelProperty("创建人/默认管理员") @ApiModelProperty("创建人/默认管理员")
private String creator; private String creator;
@ -62,12 +62,12 @@ public class SysThreeCatalog {
this.twoId = twoId == null ? null : twoId.trim(); this.twoId = twoId == null ? null : twoId.trim();
} }
public Integer getRank() { public Integer getSort() {
return rank; return sort;
} }
public void setRank(Integer rank) { public void setSort(Integer sort) {
this.rank = rank; this.sort = sort;
} }
public String getCreator() { public String getCreator() {

@ -385,63 +385,63 @@ public class SysThreeCatalogExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andRankIsNull() { public Criteria andSortIsNull() {
addCriterion("rank is null"); addCriterion("sort is null");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andRankIsNotNull() { public Criteria andSortIsNotNull() {
addCriterion("rank is not null"); addCriterion("sort is not null");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andRankEqualTo(Integer value) { public Criteria andSortEqualTo(Integer value) {
addCriterion("rank =", value, "rank"); addCriterion("sort =", value, "sort");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andRankNotEqualTo(Integer value) { public Criteria andSortNotEqualTo(Integer value) {
addCriterion("rank <>", value, "rank"); addCriterion("sort <>", value, "sort");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andRankGreaterThan(Integer value) { public Criteria andSortGreaterThan(Integer value) {
addCriterion("rank >", value, "rank"); addCriterion("sort >", value, "sort");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andRankGreaterThanOrEqualTo(Integer value) { public Criteria andSortGreaterThanOrEqualTo(Integer value) {
addCriterion("rank >=", value, "rank"); addCriterion("sort >=", value, "sort");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andRankLessThan(Integer value) { public Criteria andSortLessThan(Integer value) {
addCriterion("rank <", value, "rank"); addCriterion("sort <", value, "sort");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andRankLessThanOrEqualTo(Integer value) { public Criteria andSortLessThanOrEqualTo(Integer value) {
addCriterion("rank <=", value, "rank"); addCriterion("sort <=", value, "sort");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andRankIn(List<Integer> values) { public Criteria andSortIn(List<Integer> values) {
addCriterion("rank in", values, "rank"); addCriterion("sort in", values, "sort");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andRankNotIn(List<Integer> values) { public Criteria andSortNotIn(List<Integer> values) {
addCriterion("rank not in", values, "rank"); addCriterion("sort not in", values, "sort");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andRankBetween(Integer value1, Integer value2) { public Criteria andSortBetween(Integer value1, Integer value2) {
addCriterion("rank between", value1, value2, "rank"); addCriterion("sort between", value1, value2, "sort");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andRankNotBetween(Integer value1, Integer value2) { public Criteria andSortNotBetween(Integer value1, Integer value2) {
addCriterion("rank not between", value1, value2, "rank"); addCriterion("sort not between", value1, value2, "sort");
return (Criteria) this; return (Criteria) this;
} }

@ -25,7 +25,7 @@ public class SysTwoCatalog {
private Date createTime; private Date createTime;
@ApiModelProperty("排序") @ApiModelProperty("排序")
private Integer rank; private Integer sort;
public String getTwoId() { public String getTwoId() {
return twoId; return twoId;
@ -67,11 +67,11 @@ public class SysTwoCatalog {
this.createTime = createTime; this.createTime = createTime;
} }
public Integer getRank() { public Integer getSort() {
return rank; return sort;
} }
public void setRank(Integer rank) { public void setSort(Integer sort) {
this.rank = rank; this.sort = sort;
} }
} }

@ -445,63 +445,63 @@ public class SysTwoCatalogExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andRankIsNull() { public Criteria andSortIsNull() {
addCriterion("rank is null"); addCriterion("sort is null");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andRankIsNotNull() { public Criteria andSortIsNotNull() {
addCriterion("rank is not null"); addCriterion("sort is not null");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andRankEqualTo(Integer value) { public Criteria andSortEqualTo(Integer value) {
addCriterion("rank =", value, "rank"); addCriterion("sort =", value, "sort");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andRankNotEqualTo(Integer value) { public Criteria andSortNotEqualTo(Integer value) {
addCriterion("rank <>", value, "rank"); addCriterion("sort <>", value, "sort");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andRankGreaterThan(Integer value) { public Criteria andSortGreaterThan(Integer value) {
addCriterion("rank >", value, "rank"); addCriterion("sort >", value, "sort");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andRankGreaterThanOrEqualTo(Integer value) { public Criteria andSortGreaterThanOrEqualTo(Integer value) {
addCriterion("rank >=", value, "rank"); addCriterion("sort >=", value, "sort");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andRankLessThan(Integer value) { public Criteria andSortLessThan(Integer value) {
addCriterion("rank <", value, "rank"); addCriterion("sort <", value, "sort");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andRankLessThanOrEqualTo(Integer value) { public Criteria andSortLessThanOrEqualTo(Integer value) {
addCriterion("rank <=", value, "rank"); addCriterion("sort <=", value, "sort");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andRankIn(List<Integer> values) { public Criteria andSortIn(List<Integer> values) {
addCriterion("rank in", values, "rank"); addCriterion("sort in", values, "sort");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andRankNotIn(List<Integer> values) { public Criteria andSortNotIn(List<Integer> values) {
addCriterion("rank not in", values, "rank"); addCriterion("sort not in", values, "sort");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andRankBetween(Integer value1, Integer value2) { public Criteria andSortBetween(Integer value1, Integer value2) {
addCriterion("rank between", value1, value2, "rank"); addCriterion("sort between", value1, value2, "sort");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andRankNotBetween(Integer value1, Integer value2) { public Criteria andSortNotBetween(Integer value1, Integer value2) {
addCriterion("rank not between", value1, value2, "rank"); addCriterion("sort not between", value1, value2, "sort");
return (Criteria) this; return (Criteria) this;
} }
} }

@ -32,6 +32,6 @@ public interface SysOneCatalogMapper {
int updateByPrimaryKey(SysOneCatalog record); int updateByPrimaryKey(SysOneCatalog record);
@Select("select one_id,one_name from sys_one_catalog order by rank ASC") @Select("select one_id,one_name from sys_one_catalog order by sort ASC")
List<Map<String, String>> getAllOneCatalogListByDropDown(); List<Map<String, String>> getAllOneCatalogListByDropDown();
} }

@ -8,7 +8,6 @@ import java.util.Map;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
@Mapper @Mapper
public interface SysThreeCatalogMapper { public interface SysThreeCatalogMapper {
long countByExample(SysThreeCatalogExample example); long countByExample(SysThreeCatalogExample example);
@ -33,6 +32,6 @@ public interface SysThreeCatalogMapper {
int updateByPrimaryKey(SysThreeCatalog record); int updateByPrimaryKey(SysThreeCatalog record);
@Select("select three_id,three_name from sys_three_catalog where one_id = #{oneId} and two_id =#{twoId} order by rank ASC") @Select("select three_id,three_name from sys_three_catalog where ont_id = #{oneId} and two_id =#{twoId} order by sort ASC")
List<Map<String, String>> getAllThreeCatalogList(@Param("oneId")String oneId,@Param("twoId")String twoId); List<Map<String, String>> getAllThreeCatalogList(@Param("oneId")String oneId, @Param("twoId")String twoId);
} }

@ -32,6 +32,6 @@ public interface SysTwoCatalogMapper {
int updateByPrimaryKey(SysTwoCatalog record); int updateByPrimaryKey(SysTwoCatalog record);
@Select("select two_id,two_name from sys_two_catalog where one_id = #{oneId} order by rank ASC") @Select("select two_id,two_name from sys_two_catalog where one_id = #{oneId} order by sort ASC")
List<Map<String, String>> getAllTwoCatalogList(@Param("oneId")String oneId); List<Map<String, String>> getAllTwoCatalogList(@Param("oneId")String oneId);
} }

@ -40,19 +40,19 @@
<property name="enableSubPackages" value="true"/> <property name="enableSubPackages" value="true"/>
</javaClientGenerator> </javaClientGenerator>
<!-- 需要生成的表 --> <!-- 需要生成的表 -->
<table tableName="sys_case_questions" domainObjectName="SysCaseQuestion" /> <!-- <table tableName="sys_case_questions" domainObjectName="SysCaseQuestion" />-->
<table tableName="sys_case_question_steps" domainObjectName="SysCaseQuestionStep" /> <!-- <table tableName="sys_case_question_steps" domainObjectName="SysCaseQuestionStep" />-->
<!-- <table tableName="sys_model" domainObjectName="SysModel" />--> <!-- <table tableName="sys_model" domainObjectName="SysModel" />-->
<!-- <table tableName="sys_model_question" domainObjectName="SysModelQuestion" />--> <!-- <table tableName="sys_model_question" domainObjectName="SysModelQuestion" />-->
<!-- <table tableName="sys_objective_question" domainObjectName="SysObjectiveQuestions" />--> <!-- <table tableName="sys_objective_question" domainObjectName="SysObjectiveQuestions" />-->
<!-- <table tableName="sys_one_catalog" domainObjectName="SysOneCatalog" />--> <table tableName="sys_one_catalog" domainObjectName="SysOneCatalog" />
<!-- <table tableName="sys_resource" domainObjectName="SysResource" />--> <!-- <table tableName="sys_resource" domainObjectName="SysResource" />-->
<!-- <table tableName="sys_resource_and_course" domainObjectName="SysResourceAndCourse" />--> <!-- <table tableName="sys_resource_and_course" domainObjectName="SysResourceAndCourse" />-->
<!-- <table tableName="sys_resource_data" domainObjectName="SysResourceData" />--> <!-- <table tableName="sys_resource_data" domainObjectName="SysResourceData" />-->
<!-- <table tableName="sys_school" domainObjectName="SysSchool" />--> <!-- <table tableName="sys_school" domainObjectName="SysSchool" />-->
<!-- <table tableName="sys_three_catalog" domainObjectName="SysThreeCatalog" />--> <table tableName="sys_three_catalog" domainObjectName="SysThreeCatalog" />
<!-- <table tableName="sys_topic_and_course" domainObjectName="SysTopicAndCourse" />--> <!-- <table tableName="sys_topic_and_course" domainObjectName="SysTopicAndCourse" />-->
<!-- <table tableName="sys_two_catalog" domainObjectName="SysTwoCatalog" />--> <table tableName="sys_two_catalog" domainObjectName="SysTwoCatalog" />
</context> </context>

@ -6,7 +6,7 @@
<result column="one_name" jdbcType="VARCHAR" property="oneName" /> <result column="one_name" jdbcType="VARCHAR" property="oneName" />
<result column="course_url" jdbcType="VARCHAR" property="courseUrl" /> <result column="course_url" jdbcType="VARCHAR" property="courseUrl" />
<result column="course_introduction" jdbcType="VARCHAR" property="courseIntroduction" /> <result column="course_introduction" jdbcType="VARCHAR" property="courseIntroduction" />
<result column="rank" jdbcType="INTEGER" property="rank" /> <result column="sort" jdbcType="INTEGER" property="sort" />
<result column="status" jdbcType="INTEGER" property="status" /> <result column="status" jdbcType="INTEGER" property="status" />
<result column="creator" jdbcType="VARCHAR" property="creator" /> <result column="creator" jdbcType="VARCHAR" property="creator" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
@ -70,7 +70,7 @@
</where> </where>
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
one_id, one_name, course_url, course_introduction, rank, status, creator, create_time one_id, one_name, course_url, course_introduction, sort, status, creator, create_time
</sql> </sql>
<select id="selectByExample" parameterType="com.sztzjy.resource_center.entity.SysOneCatalogExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="com.sztzjy.resource_center.entity.SysOneCatalogExample" resultMap="BaseResultMap">
select select
@ -104,10 +104,10 @@
</delete> </delete>
<insert id="insert" parameterType="com.sztzjy.resource_center.entity.SysOneCatalog"> <insert id="insert" parameterType="com.sztzjy.resource_center.entity.SysOneCatalog">
insert into sys_one_catalog (one_id, one_name, course_url, insert into sys_one_catalog (one_id, one_name, course_url,
course_introduction, rank, status, course_introduction, sort, status,
creator, create_time) creator, create_time)
values (#{oneId,jdbcType=VARCHAR}, #{oneName,jdbcType=VARCHAR}, #{courseUrl,jdbcType=VARCHAR}, values (#{oneId,jdbcType=VARCHAR}, #{oneName,jdbcType=VARCHAR}, #{courseUrl,jdbcType=VARCHAR},
#{courseIntroduction,jdbcType=VARCHAR}, #{rank,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, #{courseIntroduction,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER}, #{status,jdbcType=INTEGER},
#{creator,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}) #{creator,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP})
</insert> </insert>
<insert id="insertSelective" parameterType="com.sztzjy.resource_center.entity.SysOneCatalog"> <insert id="insertSelective" parameterType="com.sztzjy.resource_center.entity.SysOneCatalog">
@ -125,8 +125,8 @@
<if test="courseIntroduction != null"> <if test="courseIntroduction != null">
course_introduction, course_introduction,
</if> </if>
<if test="rank != null"> <if test="sort != null">
rank, sort,
</if> </if>
<if test="status != null"> <if test="status != null">
status, status,
@ -151,8 +151,8 @@
<if test="courseIntroduction != null"> <if test="courseIntroduction != null">
#{courseIntroduction,jdbcType=VARCHAR}, #{courseIntroduction,jdbcType=VARCHAR},
</if> </if>
<if test="rank != null"> <if test="sort != null">
#{rank,jdbcType=INTEGER}, #{sort,jdbcType=INTEGER},
</if> </if>
<if test="status != null"> <if test="status != null">
#{status,jdbcType=INTEGER}, #{status,jdbcType=INTEGER},
@ -186,8 +186,8 @@
<if test="record.courseIntroduction != null"> <if test="record.courseIntroduction != null">
course_introduction = #{record.courseIntroduction,jdbcType=VARCHAR}, course_introduction = #{record.courseIntroduction,jdbcType=VARCHAR},
</if> </if>
<if test="record.rank != null"> <if test="record.sort != null">
rank = #{record.rank,jdbcType=INTEGER}, sort = #{record.sort,jdbcType=INTEGER},
</if> </if>
<if test="record.status != null"> <if test="record.status != null">
status = #{record.status,jdbcType=INTEGER}, status = #{record.status,jdbcType=INTEGER},
@ -209,7 +209,7 @@
one_name = #{record.oneName,jdbcType=VARCHAR}, one_name = #{record.oneName,jdbcType=VARCHAR},
course_url = #{record.courseUrl,jdbcType=VARCHAR}, course_url = #{record.courseUrl,jdbcType=VARCHAR},
course_introduction = #{record.courseIntroduction,jdbcType=VARCHAR}, course_introduction = #{record.courseIntroduction,jdbcType=VARCHAR},
rank = #{record.rank,jdbcType=INTEGER}, sort = #{record.sort,jdbcType=INTEGER},
status = #{record.status,jdbcType=INTEGER}, status = #{record.status,jdbcType=INTEGER},
creator = #{record.creator,jdbcType=VARCHAR}, creator = #{record.creator,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP} create_time = #{record.createTime,jdbcType=TIMESTAMP}
@ -229,8 +229,8 @@
<if test="courseIntroduction != null"> <if test="courseIntroduction != null">
course_introduction = #{courseIntroduction,jdbcType=VARCHAR}, course_introduction = #{courseIntroduction,jdbcType=VARCHAR},
</if> </if>
<if test="rank != null"> <if test="sort != null">
rank = #{rank,jdbcType=INTEGER}, sort = #{sort,jdbcType=INTEGER},
</if> </if>
<if test="status != null"> <if test="status != null">
status = #{status,jdbcType=INTEGER}, status = #{status,jdbcType=INTEGER},
@ -249,7 +249,7 @@
set one_name = #{oneName,jdbcType=VARCHAR}, set one_name = #{oneName,jdbcType=VARCHAR},
course_url = #{courseUrl,jdbcType=VARCHAR}, course_url = #{courseUrl,jdbcType=VARCHAR},
course_introduction = #{courseIntroduction,jdbcType=VARCHAR}, course_introduction = #{courseIntroduction,jdbcType=VARCHAR},
rank = #{rank,jdbcType=INTEGER}, sort = #{sort,jdbcType=INTEGER},
status = #{status,jdbcType=INTEGER}, status = #{status,jdbcType=INTEGER},
creator = #{creator,jdbcType=VARCHAR}, creator = #{creator,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP} create_time = #{createTime,jdbcType=TIMESTAMP}

@ -325,23 +325,23 @@
<!-- order by sr.create_time--> <!-- order by sr.create_time-->
<!-- </select>--> <!-- </select>-->
<select id="selectResource" parameterType="java.lang.String" resultMap="SelectResourceMap"> <select id="selectResource" parameterType="java.lang.String" resultMap="BaseResultMap">
SELECT * SELECT *
FROM sys_resource FROM sys_resource
<where> <where>
<if test="oneId != null and oneId != ''"> <if test="oneId != null and oneId != ''">
sys_resource.one_tag = #{oneId} ont_tag = #{oneId}
</if> </if>
<if test="twoId != null and twoId != ''"> <if test="twoId != null and twoId != ''">
and sys_resource.two_tag = #{twoId} and two_tag = #{twoId}
</if> </if>
<if test="threeId != null and threeId != ''"> <if test="threeId != null and threeId != ''">
and sys_resource.three_tag = #{threeId} and three_tag = #{threeId}
</if> </if>
<if test="resourceName != null and resourceName != ''"> <if test="resourceName != null and resourceName != ''">
and sys_resource.resource_name = #{resourceName} and resource_name = #{resourceName}
</if> </if>
</where> </where>
order by sr.create_time order by create_time
</select> </select>
</mapper> </mapper>

@ -6,7 +6,7 @@
<result column="three_name" jdbcType="VARCHAR" property="threeName" /> <result column="three_name" jdbcType="VARCHAR" property="threeName" />
<result column="ont_id" jdbcType="VARCHAR" property="ontId" /> <result column="ont_id" jdbcType="VARCHAR" property="ontId" />
<result column="two_id" jdbcType="VARCHAR" property="twoId" /> <result column="two_id" jdbcType="VARCHAR" property="twoId" />
<result column="rank" jdbcType="INTEGER" property="rank" /> <result column="sort" jdbcType="INTEGER" property="sort" />
<result column="creator" jdbcType="VARCHAR" property="creator" /> <result column="creator" jdbcType="VARCHAR" property="creator" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
</resultMap> </resultMap>
@ -69,7 +69,7 @@
</where> </where>
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
three_id, three_name, ont_id, two_id, rank, creator, create_time three_id, three_name, ont_id, two_id, sort, creator, create_time
</sql> </sql>
<select id="selectByExample" parameterType="com.sztzjy.resource_center.entity.SysThreeCatalogExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="com.sztzjy.resource_center.entity.SysThreeCatalogExample" resultMap="BaseResultMap">
select select
@ -103,10 +103,10 @@
</delete> </delete>
<insert id="insert" parameterType="com.sztzjy.resource_center.entity.SysThreeCatalog"> <insert id="insert" parameterType="com.sztzjy.resource_center.entity.SysThreeCatalog">
insert into sys_three_catalog (three_id, three_name, ont_id, insert into sys_three_catalog (three_id, three_name, ont_id,
two_id, rank, creator, two_id, sort, creator,
create_time) create_time)
values (#{threeId,jdbcType=VARCHAR}, #{threeName,jdbcType=VARCHAR}, #{ontId,jdbcType=VARCHAR}, values (#{threeId,jdbcType=VARCHAR}, #{threeName,jdbcType=VARCHAR}, #{ontId,jdbcType=VARCHAR},
#{twoId,jdbcType=VARCHAR}, #{rank,jdbcType=INTEGER}, #{creator,jdbcType=VARCHAR}, #{twoId,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER}, #{creator,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}) #{createTime,jdbcType=TIMESTAMP})
</insert> </insert>
<insert id="insertSelective" parameterType="com.sztzjy.resource_center.entity.SysThreeCatalog"> <insert id="insertSelective" parameterType="com.sztzjy.resource_center.entity.SysThreeCatalog">
@ -124,8 +124,8 @@
<if test="twoId != null"> <if test="twoId != null">
two_id, two_id,
</if> </if>
<if test="rank != null"> <if test="sort != null">
rank, sort,
</if> </if>
<if test="creator != null"> <if test="creator != null">
creator, creator,
@ -147,8 +147,8 @@
<if test="twoId != null"> <if test="twoId != null">
#{twoId,jdbcType=VARCHAR}, #{twoId,jdbcType=VARCHAR},
</if> </if>
<if test="rank != null"> <if test="sort != null">
#{rank,jdbcType=INTEGER}, #{sort,jdbcType=INTEGER},
</if> </if>
<if test="creator != null"> <if test="creator != null">
#{creator,jdbcType=VARCHAR}, #{creator,jdbcType=VARCHAR},
@ -179,8 +179,8 @@
<if test="record.twoId != null"> <if test="record.twoId != null">
two_id = #{record.twoId,jdbcType=VARCHAR}, two_id = #{record.twoId,jdbcType=VARCHAR},
</if> </if>
<if test="record.rank != null"> <if test="record.sort != null">
rank = #{record.rank,jdbcType=INTEGER}, sort = #{record.sort,jdbcType=INTEGER},
</if> </if>
<if test="record.creator != null"> <if test="record.creator != null">
creator = #{record.creator,jdbcType=VARCHAR}, creator = #{record.creator,jdbcType=VARCHAR},
@ -199,7 +199,7 @@
three_name = #{record.threeName,jdbcType=VARCHAR}, three_name = #{record.threeName,jdbcType=VARCHAR},
ont_id = #{record.ontId,jdbcType=VARCHAR}, ont_id = #{record.ontId,jdbcType=VARCHAR},
two_id = #{record.twoId,jdbcType=VARCHAR}, two_id = #{record.twoId,jdbcType=VARCHAR},
rank = #{record.rank,jdbcType=INTEGER}, sort = #{record.sort,jdbcType=INTEGER},
creator = #{record.creator,jdbcType=VARCHAR}, creator = #{record.creator,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP} create_time = #{record.createTime,jdbcType=TIMESTAMP}
<if test="_parameter != null"> <if test="_parameter != null">
@ -218,8 +218,8 @@
<if test="twoId != null"> <if test="twoId != null">
two_id = #{twoId,jdbcType=VARCHAR}, two_id = #{twoId,jdbcType=VARCHAR},
</if> </if>
<if test="rank != null"> <if test="sort != null">
rank = #{rank,jdbcType=INTEGER}, sort = #{sort,jdbcType=INTEGER},
</if> </if>
<if test="creator != null"> <if test="creator != null">
creator = #{creator,jdbcType=VARCHAR}, creator = #{creator,jdbcType=VARCHAR},
@ -235,7 +235,7 @@
set three_name = #{threeName,jdbcType=VARCHAR}, set three_name = #{threeName,jdbcType=VARCHAR},
ont_id = #{ontId,jdbcType=VARCHAR}, ont_id = #{ontId,jdbcType=VARCHAR},
two_id = #{twoId,jdbcType=VARCHAR}, two_id = #{twoId,jdbcType=VARCHAR},
rank = #{rank,jdbcType=INTEGER}, sort = #{sort,jdbcType=INTEGER},
creator = #{creator,jdbcType=VARCHAR}, creator = #{creator,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP} create_time = #{createTime,jdbcType=TIMESTAMP}
where three_id = #{threeId,jdbcType=VARCHAR} where three_id = #{threeId,jdbcType=VARCHAR}

@ -7,7 +7,7 @@
<result column="one_id" jdbcType="VARCHAR" property="oneId" /> <result column="one_id" jdbcType="VARCHAR" property="oneId" />
<result column="creator" jdbcType="VARCHAR" property="creator" /> <result column="creator" jdbcType="VARCHAR" property="creator" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="rank" jdbcType="INTEGER" property="rank" /> <result column="sort" jdbcType="INTEGER" property="sort" />
</resultMap> </resultMap>
<sql id="Example_Where_Clause"> <sql id="Example_Where_Clause">
<where> <where>
@ -68,7 +68,7 @@
</where> </where>
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
two_id, two_name, one_id, creator, create_time, rank two_id, two_name, one_id, creator, create_time, sort
</sql> </sql>
<select id="selectByExample" parameterType="com.sztzjy.resource_center.entity.SysTwoCatalogExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="com.sztzjy.resource_center.entity.SysTwoCatalogExample" resultMap="BaseResultMap">
select select
@ -102,10 +102,10 @@
</delete> </delete>
<insert id="insert" parameterType="com.sztzjy.resource_center.entity.SysTwoCatalog"> <insert id="insert" parameterType="com.sztzjy.resource_center.entity.SysTwoCatalog">
insert into sys_two_catalog (two_id, two_name, one_id, insert into sys_two_catalog (two_id, two_name, one_id,
creator, create_time, rank creator, create_time, sort
) )
values (#{twoId,jdbcType=VARCHAR}, #{twoName,jdbcType=VARCHAR}, #{oneId,jdbcType=VARCHAR}, values (#{twoId,jdbcType=VARCHAR}, #{twoName,jdbcType=VARCHAR}, #{oneId,jdbcType=VARCHAR},
#{creator,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{rank,jdbcType=INTEGER} #{creator,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{sort,jdbcType=INTEGER}
) )
</insert> </insert>
<insert id="insertSelective" parameterType="com.sztzjy.resource_center.entity.SysTwoCatalog"> <insert id="insertSelective" parameterType="com.sztzjy.resource_center.entity.SysTwoCatalog">
@ -126,8 +126,8 @@
<if test="createTime != null"> <if test="createTime != null">
create_time, create_time,
</if> </if>
<if test="rank != null"> <if test="sort != null">
rank, sort,
</if> </if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
@ -146,8 +146,8 @@
<if test="createTime != null"> <if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP},
</if> </if>
<if test="rank != null"> <if test="sort != null">
#{rank,jdbcType=INTEGER}, #{sort,jdbcType=INTEGER},
</if> </if>
</trim> </trim>
</insert> </insert>
@ -175,8 +175,8 @@
<if test="record.createTime != null"> <if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP}, create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if> </if>
<if test="record.rank != null"> <if test="record.sort != null">
rank = #{record.rank,jdbcType=INTEGER}, sort = #{record.sort,jdbcType=INTEGER},
</if> </if>
</set> </set>
<if test="_parameter != null"> <if test="_parameter != null">
@ -190,7 +190,7 @@
one_id = #{record.oneId,jdbcType=VARCHAR}, one_id = #{record.oneId,jdbcType=VARCHAR},
creator = #{record.creator,jdbcType=VARCHAR}, creator = #{record.creator,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP}, create_time = #{record.createTime,jdbcType=TIMESTAMP},
rank = #{record.rank,jdbcType=INTEGER} sort = #{record.sort,jdbcType=INTEGER}
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
</if> </if>
@ -210,8 +210,8 @@
<if test="createTime != null"> <if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP}, create_time = #{createTime,jdbcType=TIMESTAMP},
</if> </if>
<if test="rank != null"> <if test="sort != null">
rank = #{rank,jdbcType=INTEGER}, sort = #{sort,jdbcType=INTEGER},
</if> </if>
</set> </set>
where two_id = #{twoId,jdbcType=VARCHAR} where two_id = #{twoId,jdbcType=VARCHAR}
@ -222,7 +222,7 @@
one_id = #{oneId,jdbcType=VARCHAR}, one_id = #{oneId,jdbcType=VARCHAR},
creator = #{creator,jdbcType=VARCHAR}, creator = #{creator,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP}, create_time = #{createTime,jdbcType=TIMESTAMP},
rank = #{rank,jdbcType=INTEGER} sort = #{sort,jdbcType=INTEGER}
where two_id = #{twoId,jdbcType=VARCHAR} where two_id = #{twoId,jdbcType=VARCHAR}
</update> </update>
</mapper> </mapper>
Loading…
Cancel
Save