feat;增加角色模块
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
package com.tiesheng.util.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