| 限定符和类型 | 字段和说明 |
|---|---|
protected M |
baseMapper |
| 构造器和说明 |
|---|
ServiceImpl() |
| 限定符和类型 | 方法和说明 |
|---|---|
protected void |
closeSqlSession(org.apache.ibatis.session.SqlSession sqlSession)
释放sqlSession
|
int |
count(com.baomidou.mybatisplus.core.conditions.Wrapper<T> queryWrapper)
根据 Wrapper 条件,查询总记录数
|
protected Class<T> |
currentModelClass() |
M |
getBaseMapper()
获取对应 entity 的 BaseMapper
|
T |
getById(Serializable id)
根据 ID 查询
|
Map<String,Object> |
getMap(com.baomidou.mybatisplus.core.conditions.Wrapper<T> queryWrapper)
根据 Wrapper,查询一条记录
|
T |
getOne(com.baomidou.mybatisplus.core.conditions.Wrapper<T> queryWrapper,
boolean throwEx)
根据 Wrapper,查询一条记录
|
List<T> |
list(com.baomidou.mybatisplus.core.conditions.Wrapper<T> queryWrapper)
查询列表
|
Collection<T> |
listByIds(Collection<? extends Serializable> idList)
查询(根据ID 批量查询)
|
Collection<T> |
listByMap(Map<String,Object> columnMap)
查询(根据 columnMap 条件)
|
List<Map<String,Object>> |
listMaps(com.baomidou.mybatisplus.core.conditions.Wrapper<T> queryWrapper)
查询列表
|
<V> List<V> |
listObjs(com.baomidou.mybatisplus.core.conditions.Wrapper<T> queryWrapper,
Function<? super Object,V> mapper)
根据 Wrapper 条件,查询全部记录
|
com.baomidou.mybatisplus.core.metadata.IPage<T> |
page(com.baomidou.mybatisplus.core.metadata.IPage<T> page,
com.baomidou.mybatisplus.core.conditions.Wrapper<T> queryWrapper)
翻页查询
|
com.baomidou.mybatisplus.core.metadata.IPage<Map<String,Object>> |
pageMaps(com.baomidou.mybatisplus.core.metadata.IPage<T> page,
com.baomidou.mybatisplus.core.conditions.Wrapper<T> queryWrapper)
翻页查询
|
boolean |
remove(com.baomidou.mybatisplus.core.conditions.Wrapper<T> wrapper)
根据 entity 条件,删除记录
|
boolean |
removeById(Serializable id)
根据 ID 删除
|
boolean |
removeByIds(Collection<? extends Serializable> idList)
删除(根据ID 批量删除)
|
boolean |
removeByMap(Map<String,Object> columnMap)
根据 columnMap 条件,删除记录
|
protected boolean |
retBool(Integer result)
判断数据库操作是否成功
|
boolean |
save(T entity)
插入一条记录(选择字段,策略插入)
|
boolean |
saveBatch(Collection<T> entityList,
int batchSize)
批量插入
|
boolean |
saveOrUpdate(T entity)
TableId 注解存在更新记录,否插入一条记录
|
boolean |
saveOrUpdateBatch(Collection<T> entityList,
int batchSize)
批量修改插入
|
protected org.apache.ibatis.session.SqlSession |
sqlSessionBatch()
批量操作 SqlSession
|
protected String |
sqlStatement(com.baomidou.mybatisplus.core.enums.SqlMethod sqlMethod)
获取 SqlStatement
|
boolean |
update(T entity,
com.baomidou.mybatisplus.core.conditions.Wrapper<T> updateWrapper)
根据 whereEntity 条件,更新记录
|
boolean |
updateBatchById(Collection<T> entityList,
int batchSize)
根据ID 批量更新
|
boolean |
updateById(T entity)
根据 ID 选择修改
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcount, getObj, getOne, lambdaQuery, lambdaUpdate, list, listMaps, listObjs, listObjs, listObjs, page, pageMaps, query, saveBatch, saveOrUpdateBatch, update, update, updateBatchByIdpublic M getBaseMapper()
IServicegetBaseMapper 在接口中 IService<T>protected boolean retBool(Integer result)
result - 数据库操作返回影响条数protected org.apache.ibatis.session.SqlSession sqlSessionBatch()
protected void closeSqlSession(org.apache.ibatis.session.SqlSession sqlSession)
sqlSession - sessionprotected String sqlStatement(com.baomidou.mybatisplus.core.enums.SqlMethod sqlMethod)
sqlMethod - ignore@Transactional(rollbackFor=java.lang.Exception.class) public boolean saveBatch(Collection<T> entityList, int batchSize)
@Transactional(rollbackFor=java.lang.Exception.class) public boolean saveOrUpdate(T entity)
saveOrUpdate 在接口中 IService<T>entity - 实体对象@Transactional(rollbackFor=java.lang.Exception.class) public boolean saveOrUpdateBatch(Collection<T> entityList, int batchSize)
IServicesaveOrUpdateBatch 在接口中 IService<T>entityList - 实体对象集合batchSize - 每次的数量public boolean removeById(Serializable id)
IServiceremoveById 在接口中 IService<T>id - 主键IDpublic boolean removeByMap(Map<String,Object> columnMap)
IServiceremoveByMap 在接口中 IService<T>columnMap - 表字段 map 对象public boolean remove(com.baomidou.mybatisplus.core.conditions.Wrapper<T> wrapper)
IServicepublic boolean removeByIds(Collection<? extends Serializable> idList)
IServiceremoveByIds 在接口中 IService<T>idList - 主键ID列表public boolean updateById(T entity)
IServiceupdateById 在接口中 IService<T>entity - 实体对象public boolean update(T entity, com.baomidou.mybatisplus.core.conditions.Wrapper<T> updateWrapper)
IService@Transactional(rollbackFor=java.lang.Exception.class) public boolean updateBatchById(Collection<T> entityList, int batchSize)
IServiceupdateBatchById 在接口中 IService<T>entityList - 实体对象集合batchSize - 更新批次数量public T getById(Serializable id)
IServicepublic Collection<T> listByIds(Collection<? extends Serializable> idList)
IServicepublic Collection<T> listByMap(Map<String,Object> columnMap)
IServicepublic T getOne(com.baomidou.mybatisplus.core.conditions.Wrapper<T> queryWrapper, boolean throwEx)
IServicepublic Map<String,Object> getMap(com.baomidou.mybatisplus.core.conditions.Wrapper<T> queryWrapper)
IServicepublic int count(com.baomidou.mybatisplus.core.conditions.Wrapper<T> queryWrapper)
IServicepublic List<T> list(com.baomidou.mybatisplus.core.conditions.Wrapper<T> queryWrapper)
IServicepublic com.baomidou.mybatisplus.core.metadata.IPage<T> page(com.baomidou.mybatisplus.core.metadata.IPage<T> page, com.baomidou.mybatisplus.core.conditions.Wrapper<T> queryWrapper)
IServicepublic List<Map<String,Object>> listMaps(com.baomidou.mybatisplus.core.conditions.Wrapper<T> queryWrapper)
IServicepublic <V> List<V> listObjs(com.baomidou.mybatisplus.core.conditions.Wrapper<T> queryWrapper, Function<? super Object,V> mapper)
IService