feat;增加角色模块
This commit is contained in:
@@ -22,7 +22,7 @@ import java.lang.annotation.*;
|
||||
CoreAutoConfigurer.class,
|
||||
LoginAutoConfigurer.class,
|
||||
DatabaseAutoConfigurer.class,
|
||||
EncryptAutoConfigurer.class
|
||||
EncryptAutoConfigurer.class,
|
||||
})
|
||||
public @interface EnableTieshengWeb {
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import com.tiesheng.annotation.token.TokenIgnore;
|
||||
import com.tiesheng.core.pojos.dao.CoreConfigEnum;
|
||||
import com.tiesheng.core.pojos.dao.CoreConfigFunc;
|
||||
import com.tiesheng.core.pojos.dao.CoreConfigSystem;
|
||||
import com.tiesheng.core.pojos.dto.PageDTO;
|
||||
import com.tiesheng.util.pojos.PageDTO;
|
||||
import com.tiesheng.core.pojos.dto.config.ConfigFuncDTO;
|
||||
import com.tiesheng.core.pojos.dto.config.ConfigSystemDTO;
|
||||
import com.tiesheng.core.pojos.dto.config.EnumTypeDTO;
|
||||
|
||||
@@ -4,8 +4,8 @@ import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.tiesheng.core.pojos.dao.CoreJob;
|
||||
import com.tiesheng.core.pojos.dto.IdDTO;
|
||||
import com.tiesheng.core.pojos.dto.PageDTO;
|
||||
import com.tiesheng.util.pojos.IdDTO;
|
||||
import com.tiesheng.util.pojos.PageDTO;
|
||||
import com.tiesheng.core.pojos.dto.job.JobUpdateDTO;
|
||||
import com.tiesheng.core.pojos.dto.job.JobUpdateRxDTO;
|
||||
import com.tiesheng.core.pojos.dto.job.JobUserAssignDTO;
|
||||
|
||||
@@ -3,12 +3,11 @@ package com.tiesheng.core.controller;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.tiesheng.annotation.token.TokenIgnore;
|
||||
import com.tiesheng.core.pojos.dao.CoreLogLogin;
|
||||
import com.tiesheng.core.pojos.dao.CoreLogMessage;
|
||||
import com.tiesheng.core.pojos.dao.CoreLogOperation;
|
||||
import com.tiesheng.core.pojos.dao.CoreLogProcess;
|
||||
import com.tiesheng.core.pojos.dto.PageDTO;
|
||||
import com.tiesheng.util.pojos.PageDTO;
|
||||
import com.tiesheng.core.pojos.vo.ProcessDetailVo;
|
||||
import com.tiesheng.core.service.CoreLogService;
|
||||
import com.tiesheng.util.pojos.ApiResp;
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
package com.tiesheng.core.pojos;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class DaoBase {
|
||||
|
||||
public static final String ID = "id";
|
||||
public static final String CREATE_TIME = "create_time";
|
||||
public static final String UPDATE_TIME = "update_time";
|
||||
public static final String IS_DELETED = "is_deleted";
|
||||
public static final String LIMIT_1 = "limit 1";
|
||||
|
||||
@TableId(value = "id", type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
|
||||
@TableField(value = "create_time", fill = FieldFill.INSERT)
|
||||
private Date createTime;
|
||||
|
||||
@TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
|
||||
private Date updateTime;
|
||||
|
||||
@TableField(value = "is_deleted")
|
||||
private Integer isDeleted;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// setter\getter
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
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 Integer getIsDeleted() {
|
||||
return isDeleted;
|
||||
}
|
||||
|
||||
public void setIsDeleted(Integer isDeleted) {
|
||||
this.isDeleted = isDeleted;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,11 +1,8 @@
|
||||
package com.tiesheng.core.pojos.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.tiesheng.core.pojos.DaoBase;
|
||||
import java.util.Date;
|
||||
import com.tiesheng.util.pojos.DaoBase;
|
||||
|
||||
/**
|
||||
* 配置-枚举
|
||||
@@ -107,4 +104,4 @@ public class CoreConfigEnum extends DaoBase {
|
||||
public void setExt(String ext) {
|
||||
this.ext = ext;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
package com.tiesheng.core.pojos.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.tiesheng.core.pojos.DaoBase;
|
||||
import java.util.Date;
|
||||
import com.tiesheng.util.pojos.DaoBase;
|
||||
|
||||
/**
|
||||
* 职位-功能点
|
||||
@@ -107,4 +104,4 @@ public class CoreConfigFunc extends DaoBase {
|
||||
public void setIsUsed(Integer isUsed) {
|
||||
this.isUsed = isUsed;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
package com.tiesheng.core.pojos.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.tiesheng.core.pojos.DaoBase;
|
||||
import java.util.Date;
|
||||
import com.tiesheng.util.pojos.DaoBase;
|
||||
|
||||
/**
|
||||
* 配置-系统
|
||||
@@ -141,4 +138,4 @@ public class CoreConfigSystem extends DaoBase {
|
||||
public void setReadOnly(Integer readOnly) {
|
||||
this.readOnly = readOnly;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
package com.tiesheng.core.pojos.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.tiesheng.core.pojos.DaoBase;
|
||||
import java.util.Date;
|
||||
import com.tiesheng.util.pojos.DaoBase;
|
||||
|
||||
/**
|
||||
* 职位
|
||||
@@ -83,4 +80,4 @@ public class CoreJob extends DaoBase {
|
||||
public void setIsSystem(Integer isSystem) {
|
||||
this.isSystem = isSystem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
package com.tiesheng.core.pojos.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.tiesheng.core.pojos.DaoBase;
|
||||
import java.util.Date;
|
||||
import com.tiesheng.util.pojos.DaoBase;
|
||||
|
||||
/**
|
||||
* 职位-用户
|
||||
@@ -155,4 +152,4 @@ public class CoreJobUser extends DaoBase {
|
||||
public void setExtText(String extText) {
|
||||
this.extText = extText;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.tiesheng.core.pojos.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.tiesheng.core.pojos.DaoBase;
|
||||
import com.tiesheng.util.pojos.DaoBase;
|
||||
|
||||
/**
|
||||
* 日志-登录
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
package com.tiesheng.core.pojos.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.tiesheng.core.pojos.DaoBase;
|
||||
import java.util.Date;
|
||||
import com.tiesheng.util.pojos.DaoBase;
|
||||
|
||||
/**
|
||||
* 日志-消息
|
||||
@@ -131,4 +128,4 @@ public class CoreLogMessage extends DaoBase {
|
||||
public void setResult(Integer result) {
|
||||
this.result = result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
package com.tiesheng.core.pojos.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.tiesheng.core.pojos.DaoBase;
|
||||
import java.util.Date;
|
||||
import com.tiesheng.util.pojos.DaoBase;
|
||||
|
||||
/**
|
||||
* 日志-操作
|
||||
@@ -131,4 +128,4 @@ public class CoreLogOperation extends DaoBase {
|
||||
public void setParams(String params) {
|
||||
this.params = params;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
package com.tiesheng.core.pojos.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.tiesheng.core.pojos.DaoBase;
|
||||
import java.util.Date;
|
||||
import com.tiesheng.util.pojos.DaoBase;
|
||||
|
||||
/**
|
||||
* 日志-过程
|
||||
@@ -227,4 +224,4 @@ public class CoreLogProcess extends DaoBase {
|
||||
public void setProcess(Integer process) {
|
||||
this.process = process;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
package com.tiesheng.core.pojos.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.tiesheng.core.pojos.DaoBase;
|
||||
import java.util.Date;
|
||||
import com.tiesheng.util.pojos.DaoBase;
|
||||
|
||||
/**
|
||||
* 平台-唯一值
|
||||
@@ -131,4 +128,4 @@ public class CorePlatformUnique extends DaoBase {
|
||||
public void setInfo(String info) {
|
||||
this.info = info;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
package com.tiesheng.core.pojos.dto;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
|
||||
public class IdDTO {
|
||||
|
||||
@NotEmpty(message = "需要ID")
|
||||
private String id;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// setter\getter
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,226 +0,0 @@
|
||||
package com.tiesheng.core.pojos.dto;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author hao
|
||||
*/
|
||||
public class PageDTO {
|
||||
|
||||
private Long pageNum;
|
||||
private Long pageSize;
|
||||
private String keyword;
|
||||
private String between;
|
||||
private String equals;
|
||||
private String order;
|
||||
|
||||
|
||||
/**
|
||||
* 启用分页
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public <T> Page<T> pageObj() {
|
||||
Page<T> page = new Page<>();
|
||||
page.setSize(getPageSize());
|
||||
page.setCurrent(getPageNum());
|
||||
return page;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 启用分页
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Page<Map<String, Object>> pageMap() {
|
||||
Page<Map<String, Object>> page = new Page<>();
|
||||
page.setSize(getPageSize());
|
||||
page.setCurrent(getPageNum());
|
||||
return page;
|
||||
}
|
||||
|
||||
/***
|
||||
* 启用排序
|
||||
* @param queryWrapper
|
||||
* @param <T>
|
||||
*/
|
||||
public <T> void doOrder(QueryWrapper<T> queryWrapper) {
|
||||
if (!StrUtil.isEmpty(order)) {
|
||||
if (order.contains("-")) {
|
||||
queryWrapper.orderByDesc(StrUtil.toUnderlineCase(order.replace("-", "")));
|
||||
} else {
|
||||
queryWrapper.orderByAsc(StrUtil.toUnderlineCase(order));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 关键字查询
|
||||
*
|
||||
* @param queryWrapper
|
||||
* @param columns
|
||||
* @param <T>
|
||||
*/
|
||||
public <T> void likeColumns(QueryWrapper<T> queryWrapper, String... columns) {
|
||||
keyword = StrUtil.trim(keyword);
|
||||
if (!StrUtil.isEmpty(keyword) && columns != null && columns.length > 0) {
|
||||
queryWrapper.and(s -> {
|
||||
for (String col : columns) {
|
||||
s.like(col, keyword).or();
|
||||
}
|
||||
});
|
||||
}
|
||||
betweenColumns(queryWrapper);
|
||||
equalsColumns(queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 区间
|
||||
*
|
||||
* @param queryWrapper
|
||||
* @param <T>
|
||||
*/
|
||||
public <T> void betweenColumns(QueryWrapper<T> queryWrapper) {
|
||||
if (!StrUtil.isEmpty(between)) {
|
||||
String[] bets = between.split("=");
|
||||
if (bets.length == 2) {
|
||||
String[] vals = bets[1].split(",");
|
||||
if (vals.length == 2) {
|
||||
queryWrapper.between(StrUtil.toUnderlineCase(bets[0]), vals[0], vals[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 匹配列
|
||||
*
|
||||
* @param <T>
|
||||
*/
|
||||
public <T> void equalsColumns(QueryWrapper<T> queryWrapper) {
|
||||
if (!StrUtil.isEmpty(equals)) {
|
||||
String[] kv = equals.split(",");
|
||||
for (String key : kv) {
|
||||
String[] cols = key.split("=");
|
||||
if (cols.length == 2) {
|
||||
queryWrapper.eq(StrUtil.toUnderlineCase(cols[0]), cols[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* between
|
||||
*
|
||||
* @param alias
|
||||
* @return
|
||||
*/
|
||||
public String betweenSql(String alias) {
|
||||
String sql = "";
|
||||
if (!StrUtil.isEmpty(between)) {
|
||||
String[] bets = between.split("=");
|
||||
if (bets.length == 2) {
|
||||
String[] vals = bets[1].split(",");
|
||||
if (vals.length == 2) {
|
||||
sql = sql + " and (" + alias + "." + StrUtil.toUnderlineCase(bets[0])
|
||||
+ " between '" + vals[0] + "' and '" + vals[1] + "')";
|
||||
}
|
||||
}
|
||||
}
|
||||
return sql;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取排序的sql
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getOrderSql(String alias) {
|
||||
String sql = "";
|
||||
if (!StrUtil.isEmpty(order)) {
|
||||
if (order.contains("-")) {
|
||||
sql = StrUtil.toUnderlineCase(order.replace("-", "")) + " desc";
|
||||
} else {
|
||||
sql = StrUtil.toUnderlineCase(order) + " asc";
|
||||
}
|
||||
sql = "order by " + alias + "." + sql;
|
||||
}
|
||||
return sql;
|
||||
}
|
||||
|
||||
public String getEqualsSql(String alias) {
|
||||
StringBuilder sql = new StringBuilder();
|
||||
if (!StrUtil.isEmpty(equals)) {
|
||||
String[] kv = equals.split(",");
|
||||
for (String key : kv) {
|
||||
String[] cols = key.split("=");
|
||||
if (cols.length == 2) {
|
||||
sql.append(" and ").append(alias).append(".").append(StrUtil.toUnderlineCase(cols[0])).append("=").append(cols[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return sql.toString();
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// setter\getter
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
public Long getPageNum() {
|
||||
return pageNum == null ? 1 : pageNum;
|
||||
}
|
||||
|
||||
public void setPageNum(Long pageNum) {
|
||||
this.pageNum = pageNum;
|
||||
}
|
||||
|
||||
public Long getPageSize() {
|
||||
return pageSize == null ? 10 : pageSize;
|
||||
}
|
||||
|
||||
public void setPageSize(Long pageSize) {
|
||||
this.pageSize = pageSize;
|
||||
}
|
||||
|
||||
public String getKeyword() {
|
||||
return keyword;
|
||||
}
|
||||
|
||||
public void setKeyword(String keyword) {
|
||||
this.keyword = keyword;
|
||||
}
|
||||
|
||||
public String getBetween() {
|
||||
return between;
|
||||
}
|
||||
|
||||
public void setBetween(String between) {
|
||||
this.between = between;
|
||||
}
|
||||
|
||||
public String getEquals() {
|
||||
return equals;
|
||||
}
|
||||
|
||||
public void setEquals(String equals) {
|
||||
this.equals = equals;
|
||||
}
|
||||
|
||||
public String getOrder() {
|
||||
return order;
|
||||
}
|
||||
|
||||
public void setOrder(String order) {
|
||||
this.order = order;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import com.tiesheng.core.mapper.CoreConfigFuncMapper;
|
||||
import com.tiesheng.core.mapper.CoreConfigSystemMapper;
|
||||
import com.tiesheng.core.pojos.dao.CoreConfigFunc;
|
||||
import com.tiesheng.core.pojos.dao.CoreConfigSystem;
|
||||
import com.tiesheng.util.service.TsServiceBase;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.tiesheng.core.mapper.CoreJobUserMapper;
|
||||
import com.tiesheng.core.pojos.dao.CoreJob;
|
||||
import com.tiesheng.core.pojos.dao.CoreJobUser;
|
||||
import com.tiesheng.util.pojos.IdName;
|
||||
import com.tiesheng.util.service.TsServiceBase;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@@ -24,6 +24,7 @@ import com.tiesheng.login.config.token.bean.TokenBean;
|
||||
import com.tiesheng.util.ServletKit;
|
||||
import com.tiesheng.util.config.Ip2regionConfig;
|
||||
import com.tiesheng.util.exception.ApiException;
|
||||
import com.tiesheng.util.service.TsServiceBase;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.tiesheng.core.pojos.dao.CorePlatformUnique;
|
||||
import com.tiesheng.login.config.token.bean.TokenBean;
|
||||
import com.tiesheng.login.pojos.DoLoginInfo;
|
||||
import com.tiesheng.login.service.TieshengLoginConfigurer;
|
||||
import com.tiesheng.util.service.TsServiceBase;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
package com.tiesheng.core.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
/**
|
||||
* 基础Service
|
||||
*
|
||||
* @author hao
|
||||
*/
|
||||
public class TsServiceBase<M extends BaseMapper<T>, T> extends ServiceImpl<M, T> {
|
||||
|
||||
|
||||
/**
|
||||
* 通过属性获取一个对象
|
||||
*
|
||||
* @param column
|
||||
* @param val
|
||||
* @return
|
||||
*/
|
||||
public T getOneByColumn(String column, Object val) {
|
||||
QueryWrapper<T> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("is_deleted", 0);
|
||||
queryWrapper.eq(column, val);
|
||||
queryWrapper.last("limit 1");
|
||||
return getOne(queryWrapper);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user