xiaoCJ 9 months ago
parent 51a4b59636
commit 659ad3f5bb

@ -1,40 +1,20 @@
//package com.sztzjy.resource_center.config.security;
//
//import com.sztzjy.resource_center.entity.StuUser;
//import com.sztzjy.resource_center.entity.StuUserExample;
//import com.sztzjy.resource_center.mapper.StuUserMapper;
//import io.jsonwebtoken.lang.Assert;
//import org.springframework.security.core.userdetails.UserDetails;
//import org.springframework.security.core.userdetails.UserDetailsService;
//import org.springframework.security.core.userdetails.UsernameNotFoundException;
//import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
//import org.springframework.stereotype.Service;
//
//import javax.annotation.Resource;
//import java.util.List;
//
//
//@Service
//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;
// }
//
//}
package com.sztzjy.resource_center.config.security;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;
@Service
public class AuthenticationService implements UserDetailsService {
@Override
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);
return jwtUser;
}
}

@ -72,11 +72,6 @@ public class TokenProvider {
Key key = Keys.hmacShaKeyFor(SECRET.getBytes());
Date expiration = new Date(System.currentTimeMillis() + EXP_TIME);
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("authorityCodes", jwtUser.getAuthorityCodes())
.setIssuedAt(new Date(System.currentTimeMillis()))

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

@ -2,6 +2,8 @@ package com.sztzjy.resource_center.controller;
import cn.hutool.core.util.IdUtil;
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.SysThreeCatalog;
import com.sztzjy.resource_center.entity.SysTwoCatalog;
@ -15,9 +17,16 @@ import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.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 javax.annotation.Resource;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
/**
* @Author xcj
@ -33,7 +42,8 @@ public class CourseTagManageController {
private SysTwoCatalogMapper sysTwoCatalogMapper;
@Autowired
private SysThreeCatalogMapper sysThreeCatalogMapper;
@Resource
private AuthenticationManagerBuilder authenticationManagerBuilder;
@AnonymousAccess
@ApiOperation("添加二级目录")
@ -52,7 +62,7 @@ public class CourseTagManageController {
}
@AnonymousAccess
@ApiOperation("添加级目录")
@ApiOperation("添加级目录")
@PostMapping("insertSysThreeCatalog")
public ResultEntity<String> insertSysThreeCatalog(@RequestBody SysThreeCatalog sysThreeCatalog) {
if (StringUtils.isBlank(sysThreeCatalog.getOntId())) {
@ -111,19 +121,41 @@ public class CourseTagManageController {
@RequestParam int rank) {
if (type == 1) {
SysOneCatalog sysOneCatalog = sysOneCatalogMapper.selectByPrimaryKey(id);
sysOneCatalog.setRank(rank);
sysOneCatalog.setSort(rank);
sysOneCatalogMapper.updateByPrimaryKey(sysOneCatalog);
return new ResultEntity<>(HttpStatus.OK, "排序成功");
} else if (type == 2) {
SysTwoCatalog sysTwoCatalog = sysTwoCatalogMapper.selectByPrimaryKey(id);
sysTwoCatalog.setRank(rank);
sysTwoCatalog.setSort(rank);
sysTwoCatalogMapper.updateByPrimaryKey(sysTwoCatalog);
return new ResultEntity<>(HttpStatus.OK, "排序成功");
} else {
SysThreeCatalog sysThreeCatalog = sysThreeCatalogMapper.selectByPrimaryKey(id);
sysThreeCatalog.setRank(rank);
sysThreeCatalog.setSort(rank);
sysThreeCatalogMapper.updateByPrimaryKey(sysThreeCatalog);
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;
@ApiModelProperty("排序")
private Integer rank;
private Integer sort;
@ApiModelProperty("0未启用 1启用")
private Integer status;
@ -65,12 +65,12 @@ public class SysOneCatalog {
this.courseIntroduction = courseIntroduction == null ? null : courseIntroduction.trim();
}
public Integer getRank() {
return rank;
public Integer getSort() {
return sort;
}
public void setRank(Integer rank) {
this.rank = rank;
public void setSort(Integer sort) {
this.sort = sort;
}
public Integer getStatus() {

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

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

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

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

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

@ -32,6 +32,6 @@ public interface SysOneCatalogMapper {
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();
}

@ -8,7 +8,6 @@ import java.util.Map;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
@Mapper
public interface SysThreeCatalogMapper {
long countByExample(SysThreeCatalogExample example);
@ -33,6 +32,6 @@ public interface SysThreeCatalogMapper {
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")
List<Map<String, String>> getAllThreeCatalogList(@Param("oneId")String oneId,@Param("twoId")String twoId);
@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);
}

@ -32,6 +32,6 @@ public interface SysTwoCatalogMapper {
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);
}

@ -40,19 +40,19 @@
<property name="enableSubPackages" value="true"/>
</javaClientGenerator>
<!-- 需要生成的表 -->
<table tableName="sys_case_questions" domainObjectName="SysCaseQuestion" />
<table tableName="sys_case_question_steps" domainObjectName="SysCaseQuestionStep" />
<!-- <table tableName="sys_case_questions" domainObjectName="SysCaseQuestion" />-->
<!-- <table tableName="sys_case_question_steps" domainObjectName="SysCaseQuestionStep" />-->
<!-- <table tableName="sys_model" domainObjectName="SysModel" />-->
<!-- <table tableName="sys_model_question" domainObjectName="SysModelQuestion" />-->
<!-- <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_and_course" domainObjectName="SysResourceAndCourse" />-->
<!-- <table tableName="sys_resource_data" domainObjectName="SysResourceData" />-->
<!-- <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_two_catalog" domainObjectName="SysTwoCatalog" />-->
<table tableName="sys_two_catalog" domainObjectName="SysTwoCatalog" />
</context>

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

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

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

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