public class ServiceImpl<M extends com.baomidou.mybatisplus.core.mapper.BaseMapper<T>,T extends com.baomidou.mybatisplus.extension.activerecord.Model<T>> extends com.baomidou.mybatisplus.extension.service.impl.ServiceImpl<M,T> implements IService<T>
| Constructor and Description |
|---|
ServiceImpl() |
| 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 <K,V> Map<K,V> |
map(Function<? super T,? extends K> keyMapper,
Function<? super T,? extends V> valueMapper)
查询集合转化为Map
|
default <K,V> Map<K,V> |
map(com.baomidou.mybatisplus.core.conditions.Wrapper<T> queryWrapper,
Function<? super T,? extends K> keyMapper,
Function<? super T,? extends V> valueMapper)
查询集合转化为Map
默认使用主键作为key的转换规则
集合元素实体作为转换规则
|
default <K,V> Map<K,V> |
mapByIds(Collection<? extends Serializable> idList,
Function<? super T,? extends K> keyMapper,
Function<? super T,? extends V> valueMapper)
查询集合转化为Map
|
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
|
closeSqlSession, currentMapperClass, currentModelClass, executeBatch, executeBatch, executeBatch, getBaseMapper, getEntityClass, getMap, getObj, getOne, getSqlStatement, retBool, saveBatch, saveOrUpdate, saveOrUpdateBatch, sqlSessionBatch, sqlStatement, updateBatchByIdclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcount, 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, updateByIdpublic <K,V> Map<K,V> mapByIds(Collection<? extends Serializable> idList, Function<? super T,? extends K> keyMapper, Function<? super T,? extends V> valueMapper)
K - key泛型V - value泛型idList - 主键IDkeyMapper - key转换规则(主键列)valueMapper - value转换规则public <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 - 收集器public <K,V> Map<K,V> map(com.baomidou.mybatisplus.core.conditions.Wrapper<T> queryWrapper, Function<? super T,? extends K> keyMapper, Function<? super T,? extends V> valueMapper)
K - key泛型V - value泛型queryWrapper - 查询条件keyMapper - key转换规则(主键列)valueMapper - value转换规则public <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 - 收集器public <K,V> Map<K,V> map(Function<? super T,? extends K> keyMapper, Function<? super T,? extends V> valueMapper)
K - key泛型V - value泛型keyMapper - key转换规则(主键列)valueMapper - value转换规则public <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 - 收集器public <R> R getById(Serializable id, Function<? super T,? extends R> action)
R - 转化后实体VO的泛型id - 主键IDaction - 转换规则public <R> R getOne(com.baomidou.mybatisplus.core.conditions.Wrapper<T> queryWrapper,
Function<? super T,? extends R> action)
R - 转化后实体VO的泛型queryWrapper - 查询条件action - 转换规则public <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 - 转换规则public <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 - 转换规则public <R> List<R> listByIds(Collection<? extends Serializable> idList, Function<? super T,? extends R> action)
R - 转换后的泛型类(通常为实体的子类)idList - 主键ID集合action - 转换规则public <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.