public interface IService<T>
| Modifier and Type | Method and Description |
|---|---|
default <R,A> R |
collect(Collector<? super T,A,R> collector)
查询集合转化为Map
|
default <R,A> R |
collect(com.baomidou.mybatisplus.core.conditions.Wrapper<T> queryWrapper,
Collector<? super T,A,R> collector)
查询集合转化为Map
默认使用主键作为key的转换规则
集合元素实体作为转换规则
|
default <R,A> R |
collectByIds(Collection<? extends Serializable> idList,
Collector<? super T,A,R> collector)
查询集合转化为Map
|
default <R> R |
getById(Serializable id,
Function<? super T,? extends R> action)
通过主键ID查询实体VO
|
default <R> R |
getOne(com.baomidou.mybatisplus.core.conditions.Wrapper<T> queryWrapper,
Function<? super T,? extends R> action)
通过唯一索引查询
|
default <R> List<R> |
list(Function<? super T,? extends R> action)
查询实体并转化为实体VO
|
default <R> List<R> |
list(com.baomidou.mybatisplus.core.conditions.Wrapper<T> queryWrapper,
Function<? super T,? extends R> action)
查询实体并转化为实体VO
|
default <R> List<R> |
listByIds(Collection<? extends Serializable> idList,
Function<? super T,? extends R> action)
通过主键ID集合查询,并将实体集合映射为其它类型集合,比如VO
|
default <E extends com.baomidou.mybatisplus.core.metadata.IPage<T>,R> |
page(E page,
Function<? super T,? extends R> action)
分页查询实体并转化为实体VO
|
default <E extends com.baomidou.mybatisplus.core.metadata.IPage<T>,R> |
page(E page,
com.baomidou.mybatisplus.core.conditions.Wrapper<T> queryWrapper,
Function<? super T,? extends R> action)
分页查询实体并转化为实体VO
|
count, count, getBaseMapper, getById, getEntityClass, getMap, getObj, getOne, getOne, ktQuery, ktUpdate, lambdaQuery, lambdaUpdate, list, list, listByIds, listByMap, listMaps, listMaps, listObjs, listObjs, listObjs, listObjs, page, page, pageMaps, pageMaps, query, remove, removeById, removeById, removeByIds, removeByMap, save, saveBatch, saveBatch, saveOrUpdate, saveOrUpdate, saveOrUpdateBatch, saveOrUpdateBatch, update, update, update, updateBatchById, updateBatchById, updateByIddefault <R,A> R collectByIds(Collection<? extends Serializable> idList, Collector<? super T,A,R> collector)
R - 目标类泛型A - the mutable accumulation type of the reduction operation (often hidden as an implementation detail)idList - 主键ID集合collector - 收集器default <R,A> R collect(com.baomidou.mybatisplus.core.conditions.Wrapper<T> queryWrapper,
Collector<? super T,A,R> collector)
R - 目标类泛型A - the mutable accumulation type of the reduction operation (often hidden as an implementation detail)queryWrapper - 查询条件collector - 收集器default <R,A> R collect(Collector<? super T,A,R> collector)
R - 目标类泛型A - the mutable accumulation type of the reduction operation (often hidden as an implementation detail)collector - 收集器default <R> R getById(Serializable id, Function<? super T,? extends R> action)
R - 转化后实体VO的泛型id - 主键IDaction - 转换规则default <R> R getOne(com.baomidou.mybatisplus.core.conditions.Wrapper<T> queryWrapper,
Function<? super T,? extends R> action)
R - 转化后实体VO的泛型queryWrapper - 查询条件action - 转换规则default <E extends com.baomidou.mybatisplus.core.metadata.IPage<T>,R> com.baomidou.mybatisplus.core.metadata.IPage<R> page(E page,
com.baomidou.mybatisplus.core.conditions.Wrapper<T> queryWrapper,
Function<? super T,? extends R> action)
E - 分页对象泛型R - 实体VO分页对象泛型page - 分页对象queryWrapper - 查询条件action - 转换规则default <E extends com.baomidou.mybatisplus.core.metadata.IPage<T>,R> com.baomidou.mybatisplus.core.metadata.IPage<R> page(E page,
Function<? super T,? extends R> action)
E - 分页对象泛型R - 实体VO分页对象泛型page - 分页对象action - 转换规则default <R> List<R> listByIds(Collection<? extends Serializable> idList, Function<? super T,? extends R> action)
R - 转换后的泛型类(通常为实体的子类)idList - 主键ID集合action - 转换规则default <R> List<R> list(com.baomidou.mybatisplus.core.conditions.Wrapper<T> queryWrapper, Function<? super T,? extends R> action)
R - 转换后的泛型类(通常为实体的子类)queryWrapper - 查询条件action - 转换规则Copyright © 2021. All rights reserved.