public interface BaseService<T extends BaseDO>
extends com.baomidou.mybatisplus.extension.service.IService<T>
该类为 [MybatisService] 基类, 所有 [DO] 层关联 [Service] 必须继承该类
该类对 [MybatisPlus] 自带的 IService 进行了进一步的封装, 增强业务效果, 项目中均采用该类的方法以替代 IService 中的方法
| 限定符和类型 | 方法和说明 |
|---|---|
static <T extends BaseDO> |
clearEntityDefaultParameterAndGet(Collection<T> entities)
批量清除实体类默认参数值
|
static <T extends BaseDO> |
clearEntityDefaultParameterAndGet(Collection<T> entities,
boolean isClearId,
boolean isClearCreateTime,
boolean isClearModifyTime)
批量清除实体类默认参数值
|
static <T extends BaseDO> |
clearEntityDefaultParameterAndGet(T entity)
清除实体类默认参数值
|
static <T extends BaseDO> |
clearEntityDefaultParameterAndGet(T entity,
boolean isClearId,
boolean isClearCreateTime,
boolean isClearModifyTime)
清除实体类默认参数值
|
default long |
countByIdAndIgnore(Collection<Long> ids)
批量忽略ID获取数量
|
default long |
countByIdAndIgnore(Long id)
忽略ID获取数量
|
default long |
countByIdAndValidate(Collection<Long> ids)
批量验证ID获取数量
|
default long |
countByIdAndValidate(Collection<Long> ids,
String errorUserTip)
批量验证ID获取数量
|
default long |
countByIdAndValidate(Long id)
验证ID获取数量
|
default long |
countByIdAndValidate(Long id,
String errorUserTip)
验证ID获取数量
|
default T |
getByIdAndIgnore(Long id)
忽略ID并获取DO
|
default Optional<T> |
getByIdAndIgnoreOpt(Long id)
忽略ID并获取DO
|
default T |
getByIdAndValidate(Long id)
验证ID并获取DO
|
default T |
getByIdAndValidate(Long id,
String errorUserTip)
验证ID并获取DO
|
static <T extends BaseDO> |
getDeepDeclareMethod(T entity,
String methodName,
Class<?>... parameterTypes)
获取实体类的方法
|
default boolean |
isExistsByIdAndIgnore(Collection<Long> ids)
批量忽略ID获取是否存在
|
default boolean |
isExistsByIdAndIgnore(Long id)
忽略ID获取是否存在
|
default boolean |
isExistsByIdAndValidate(Collection<Long> ids)
批量验证ID获取是否存在
|
default boolean |
isExistsByIdAndValidate(Collection<Long> ids,
String errorUserTip)
批量验证ID获取是否存在
|
default boolean |
isExistsByIdAndValidate(Long id)
验证ID获取是否存在
|
default boolean |
isExistsByIdAndValidate(Long id,
String errorUserTip)
验证ID获取是否存在
|
default List<T> |
listAndIgnore(com.baomidou.mybatisplus.core.conditions.Wrapper<T> wrapper)
忽略结果并获取DO
|
default List<T> |
listAndValidate(com.baomidou.mybatisplus.core.conditions.Wrapper<T> wrapper,
String errorUserTip)
验证IDs并获取DOs
|
default List<T> |
listByIdAndIgnore(Collection<Long> ids)
忽略IDs并获取DO
|
default List<T> |
listByIdAndValidate(Collection<Long> ids)
验证IDs并获取DOs
|
default List<T> |
listByIdAndValidate(Collection<Long> ids,
String errorUserTip)
验证IDs并获取DOs
|
default List<T> |
listByIdAndValidate(com.baomidou.mybatisplus.core.conditions.Wrapper<T> wrapper)
验证IDs并获取DOs
|
default Pageable<T> |
listPageAndIgnore(PageRequest pageRequest)
忽略PageRequest并获取Pageable
默认根据
BaseDO.MODIFY_TIME 进行排序 |
default Pageable<T> |
listPageAndValidate(PageRequest pageRequest)
验证PageRequest并获取Pageable
默认根据
BaseDO.MODIFY_TIME 进行排序 |
default Pageable<T> |
listPageAndValidate(PageRequest pageRequest,
String errorUserTip)
验证PageRequest并获取Pageable
默认根据
BaseDO.MODIFY_TIME 进行排序 |
default boolean |
removeByIdAndIgnore(Collection<Long> ids)
批量怒略实体类ID并删除
|
default boolean |
removeByIdAndIgnore(Long id)
怒略实体类ID并删除
|
default boolean |
removeByIdAndValidate(Collection<Long> ids)
批量验证实体类ID并删除
|
default boolean |
removeByIdAndValidate(Collection<Long> ids,
String errorUserTip)
批量验证实体类ID并删除
|
default boolean |
removeByIdAndValidate(Long id)
验证实体类ID并删除
|
default boolean |
removeByIdAndValidate(Long id,
String errorUserTip)
验证实体类ID并删除
|
default boolean |
saveAndIgnore(Collection<T> entities)
批量怒略验证实体类ID并保存
|
default boolean |
saveAndIgnore(Collection<T> entities,
int batchSize)
批量怒略验证实体类ID并保存
|
default boolean |
saveAndIgnore(T entity)
怒略实体类ID并保存
|
default boolean |
saveAndValidate(Collection<T> entities)
批量验证实体类ID并保存
|
default boolean |
saveAndValidate(Collection<T> entities,
int batchSize)
批量验证实体类ID并保存
|
default boolean |
saveAndValidate(Collection<T> entities,
int batchSize,
String errorUserTip)
批量验证实体类ID并保存
|
default boolean |
saveAndValidate(Collection<T> entities,
String errorUserTip)
批量验证实体类ID并保存
|
default boolean |
saveAndValidate(T entity)
验证实体类ID并保存
|
default boolean |
saveAndValidate(T entity,
String errorUserTip)
验证实体类ID并保存
|
static String |
toUnderlineCase(String value)
简易驼峰转下划线
|
default boolean |
updateByIdAndIgnore(Collection<T> entities)
批量验证实体类ID并更新
|
default boolean |
updateByIdAndIgnore(Collection<T> entities,
int batchSize)
批量验证实体类ID并更新
|
default boolean |
updateByIdAndIgnore(T entity)
怒略验证实体类ID并更新
|
default boolean |
updateByIdAndValidate(Collection<T> entities)
批量验证实体类ID并更新
|
default boolean |
updateByIdAndValidate(Collection<T> entities,
int batchSize)
批量验证实体类ID并更新
|
default boolean |
updateByIdAndValidate(Collection<T> entities,
int batchSize,
String errorUserTip)
批量验证实体类ID并更新
|
default boolean |
updateByIdAndValidate(Collection<T> entities,
String errorUserTip)
批量验证实体类ID并更新
|
default boolean |
updateByIdAndValidate(T entity)
批量验证实体类ID并更新
|
default boolean |
updateByIdAndValidate(T entity,
String errorUserTip)
批量验证实体类ID并更新
|
static <T extends BaseDO> |
validateIdExistsAndGetIdMethod(T entity)
验证ID是否存在并获取ID方法
|
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 boolean isExistsByIdAndIgnore(@Nullable
Long id)
id - IDdefault boolean isExistsByIdAndIgnore(@Nullable
Collection<Long> ids)
ids - IDsdefault long countByIdAndIgnore(@Nullable
Long id)
id - IDdefault long countByIdAndIgnore(@Nullable
Collection<Long> ids)
ids - IDs@Nullable default T getByIdAndIgnore(@Nullable Long id)
id - IDdefault Optional<T> getByIdAndIgnoreOpt(@Nullable Long id)
id - IDdefault List<T> listByIdAndIgnore(@Nullable Collection<Long> ids)
ids - IDs@Nullable default List<T> listAndIgnore(com.baomidou.mybatisplus.core.conditions.Wrapper<T> wrapper)
wrapper - wrapperdefault Pageable<T> listPageAndIgnore(@Nullable PageRequest pageRequest)
BaseDO.MODIFY_TIME 进行排序pageRequest - PageRequestdefault boolean saveAndIgnore(@Nullable
T entity)
entity - 实体类default boolean saveAndIgnore(@Nullable
Collection<T> entities)
entities - 实体对象集合default boolean saveAndIgnore(@Nullable
Collection<T> entities,
int batchSize)
entities - 实体对象集合batchSize - 插入批次数量default boolean updateByIdAndIgnore(@Nullable
T entity)
entity - 实体类default boolean updateByIdAndIgnore(@Nullable
Collection<T> entities)
entities - 实体对象集合default boolean updateByIdAndIgnore(@Nullable
Collection<T> entities,
int batchSize)
entities - 实体对象集合batchSize - 插入批次数量default boolean removeByIdAndIgnore(@Nullable
Long id)
id - IDdefault boolean removeByIdAndIgnore(@Nullable
Collection<Long> ids)
ids - ID集合default boolean isExistsByIdAndValidate(Long id) throws MybatisServiceApplication
id - IDMybatisServiceApplication - ID为空default boolean isExistsByIdAndValidate(@Nullable
Long id,
String errorUserTip)
throws MybatisServiceApplication
id - IDerrorUserTip - 用户提示信息MybatisServiceApplication - ID为空default boolean isExistsByIdAndValidate(@Nullable
Collection<Long> ids)
throws MybatisServiceApplication
ids - IDsMybatisServiceApplication - ID为空default boolean isExistsByIdAndValidate(@Nullable
Collection<Long> ids,
String errorUserTip)
throws MybatisServiceApplication
ids - IDserrorUserTip - 用户提示信息MybatisServiceApplication - ID为空default long countByIdAndValidate(@Nullable
Long id)
throws MybatisServiceApplication
id - IDMybatisServiceApplication - ID为空default long countByIdAndValidate(@Nullable
Long id,
@Nullable
String errorUserTip)
throws MybatisServiceApplication
id - IDerrorUserTip - 用户提示信息MybatisServiceApplication - ID为空default long countByIdAndValidate(@Nullable
Collection<Long> ids)
throws MybatisServiceApplication
ids - IDsMybatisServiceApplication - ID为空default long countByIdAndValidate(@Nullable
Collection<Long> ids,
@Nullable
String errorUserTip)
throws MybatisServiceApplication
ids - IDserrorUserTip - 用户提示信息MybatisServiceApplication - ID为空default T getByIdAndValidate(@Nullable Long id) throws MybatisServiceApplication
id - IDMybatisServiceApplication - ID为空|ID错误default T getByIdAndValidate(@Nullable Long id, @Nullable String errorUserTip) throws MybatisServiceApplication
id - IDerrorUserTip - 用户提示信息MybatisServiceApplication - ID为空|ID错误default List<T> listByIdAndValidate(@Nullable Collection<Long> ids) throws MybatisServiceApplication
ids - IDsMybatisServiceApplication - ID为空|ID错误default List<T> listByIdAndValidate(com.baomidou.mybatisplus.core.conditions.Wrapper<T> wrapper) throws MybatisServiceApplication
wrapper - wrapperMybatisServiceApplication - ID为空|ID错误default List<T> listByIdAndValidate(@Nullable Collection<Long> ids, @Nullable String errorUserTip) throws MybatisServiceApplication
ids - IDserrorUserTip - 用户提示信息MybatisServiceApplication - ID为空|ID错误default List<T> listAndValidate(com.baomidou.mybatisplus.core.conditions.Wrapper<T> wrapper, @Nullable String errorUserTip) throws MybatisServiceApplication
wrapper - wrappererrorUserTip - 用户提示信息MybatisServiceApplication - ID为空|ID错误default Pageable<T> listPageAndValidate(@Nullable PageRequest pageRequest) throws MybatisServiceApplication
BaseDO.MODIFY_TIME 进行排序pageRequest - PageRequestMybatisServiceApplication - ID为空|ID错误default Pageable<T> listPageAndValidate(@Nullable PageRequest pageRequest, @Nullable String errorUserTip) throws MybatisServiceApplication
BaseDO.MODIFY_TIME 进行排序pageRequest - PageRequesterrorUserTip - 用户提示信息MybatisServiceApplication - ID为空|ID错误default boolean saveAndValidate(@Nullable
T entity)
throws MybatisServiceApplication
entity - 实体类MybatisServiceApplication - 参数为空|参数错误default boolean saveAndValidate(@Nullable
T entity,
@Nullable
String errorUserTip)
throws MybatisServiceApplication
entity - 实体类errorUserTip - 用户提示信息MybatisServiceApplication - 参数为空|参数错误default boolean saveAndValidate(@Nullable
Collection<T> entities)
throws MybatisServiceApplication
entities - 实体对象集合MybatisServiceApplication - 参数为空|参数错误default boolean saveAndValidate(@Nullable
Collection<T> entities,
@Nullable
String errorUserTip)
throws MybatisServiceApplication
entities - 实体对象集合errorUserTip - 用户提示信息MybatisServiceApplication - 参数为空|参数错误default boolean saveAndValidate(@Nullable
Collection<T> entities,
int batchSize)
throws MybatisServiceApplication
entities - 实体对象集合batchSize - 插入批次数量MybatisServiceApplication - 参数为空|参数错误default boolean saveAndValidate(@Nullable
Collection<T> entities,
int batchSize,
@Nullable
String errorUserTip)
throws MybatisServiceApplication
entities - 实体对象集合batchSize - 插入批次数量errorUserTip - 用户提示信息MybatisServiceApplication - 参数为空|参数错误default boolean updateByIdAndValidate(@Nullable
T entity)
throws MybatisServiceApplication
entity - 实体类MybatisServiceApplication - 参数为空|参数错误default boolean updateByIdAndValidate(@Nullable
T entity,
@Nullable
String errorUserTip)
throws MybatisServiceApplication
entity - 实体类errorUserTip - 用户提示信息MybatisServiceApplication - 参数为空|参数错误default boolean updateByIdAndValidate(@Nullable
Collection<T> entities)
throws MybatisServiceApplication
entities - 实体对象集合MybatisServiceApplication - 参数为空|参数错误default boolean updateByIdAndValidate(@Nullable
Collection<T> entities,
@Nullable
String errorUserTip)
throws MybatisServiceApplication
entities - 实体对象集合errorUserTip - 用户提示信息MybatisServiceApplication - 参数为空|参数错误default boolean updateByIdAndValidate(@Nullable
Collection<T> entities,
int batchSize)
throws MybatisServiceApplication
entities - 实体对象集合batchSize - 插入批次数量MybatisServiceApplication - 参数为空|参数错误default boolean updateByIdAndValidate(@Nullable
Collection<T> entities,
int batchSize,
@Nullable
String errorUserTip)
throws MybatisServiceApplication
entities - 实体对象集合batchSize - 插入批次数量errorUserTip - 用户提示信息MybatisServiceApplication - 参数为空|参数错误default boolean removeByIdAndValidate(@Nullable
Long id)
throws MybatisServiceApplication
id - IDMybatisServiceApplication - ID为空|ID错误default boolean removeByIdAndValidate(@Nullable
Long id,
@Nullable
String errorUserTip)
throws MybatisServiceApplication
id - IDerrorUserTip - 用户提示信息MybatisServiceApplication - ID为空|ID错误default boolean removeByIdAndValidate(@Nullable
Collection<Long> ids)
throws MybatisServiceApplication
ids - ID集合MybatisServiceApplication - ID为空|ID错误default boolean removeByIdAndValidate(@Nullable
Collection<Long> ids,
@Nullable
String errorUserTip)
throws MybatisServiceApplication
ids - ID集合errorUserTip - 用户提示信息MybatisServiceApplication - ID为空|ID错误static <T extends BaseDO> T clearEntityDefaultParameterAndGet(T entity)
T - 实体类类型entity - 实体类static <T extends BaseDO> List<T> clearEntityDefaultParameterAndGet(Collection<T> entities)
T - 实体类类型entities - 实体对象集合static <T extends BaseDO> T clearEntityDefaultParameterAndGet(T entity, boolean isClearId, boolean isClearCreateTime, boolean isClearModifyTime)
T - 实体类类型entity - 实体类isClearId - 是否清除IDisClearCreateTime - 是否清除创建时间isClearModifyTime - 是否清除更新时间static <T extends BaseDO> Collection<T> clearEntityDefaultParameterAndGet(Collection<T> entities, boolean isClearId, boolean isClearCreateTime, boolean isClearModifyTime)
T - 实体类类型entities - 实体对象集合isClearId - 是否清除IDisClearCreateTime - 是否清除创建时间isClearModifyTime - 是否清除更新时间static <T extends BaseDO> Method validateIdExistsAndGetIdMethod(T entity)
T - 实体类类型entity - 实体类@Nullable static <T extends BaseDO> Method getDeepDeclareMethod(T entity, String methodName, @Nullable Class<?>... parameterTypes)
T - 实体类类型entity - 实体类methodName - 方法名parameterTypes - 方法参数ClassCopyright © 2021 HaiChuang Inc.. All rights reserved.