public interface ISuperService<T>
extends com.baomidou.mybatisplus.extension.service.IService<T>
| Modifier and Type | Method and Description |
|---|---|
boolean |
changeStatus(@NotEmpty List<Long> ids,
Integer status)
变更状态
|
boolean |
deleteLogic(@NotEmpty List<Long> ids)
逻辑删除
|
boolean |
saveIdempotency(T entity,
DistributedLock locker,
String lockKey,
com.baomidou.mybatisplus.core.conditions.Wrapper<T> countWrapper) |
boolean |
saveIdempotency(T entity,
DistributedLock locker,
String lockKey,
com.baomidou.mybatisplus.core.conditions.Wrapper<T> countWrapper,
String msg)
幂等性新增记录
例子如下:
String username = sysUser.getUsername();
boolean result = super.saveIdempotency(sysUser, lock
, LOCK_KEY_USERNAME+username
, new QueryWrapper
|
boolean |
saveIgnore(T entity)
插入如果中已经存在相同的记录,则忽略当前新数据
|
boolean |
saveIgnoreBatch(Collection<T> entityList,
int batchSize)
插入(批量),插入如果中已经存在相同的记录,则忽略当前新数据
|
boolean |
saveOrUpdateIdempotency(T entity,
DistributedLock locker,
String lockKey,
com.baomidou.mybatisplus.core.conditions.Wrapper<T> countWrapper) |
boolean |
saveOrUpdateIdempotency(T entity,
DistributedLock locker,
String lockKey,
com.baomidou.mybatisplus.core.conditions.Wrapper<T> countWrapper,
String msg)
幂等性新增或更新记录
例子如下:
String username = sysUser.getUsername();
boolean result = super.saveOrUpdateIdempotency(sysUser, lock
, LOCK_KEY_USERNAME+username
, new QueryWrapper
|
boolean |
saveReplace(T entity)
表示插入替换数据,需求表中有PrimaryKey,或者unique索引,如果数据库已经存在数据,则用新数据替换,如果没有数据效果则和insert into一样;
|
default boolean |
saveReplaceBatch(Collection<T> entityList)
插入(批量),表示插入替换数据,需求表中有PrimaryKey,或者unique索引,如果数据库已经存在数据,则用新数据替换,如果没有数据效果则和insert into一样;
|
boolean |
saveReplaceBatch(Collection<T> entityList,
int batchSize)
插入(批量),表示插入替换数据,需求表中有PrimaryKey,或者unique索引,如果数据库已经存在数据,则用新数据替换,如果没有数据效果则和insert into一样;
|
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, removeBatchByIds, removeBatchByIds, removeBatchByIds, removeBatchByIds, removeById, removeById, removeById, removeByIds, removeByIds, removeByMap, save, saveBatch, saveBatch, saveOrUpdate, saveOrUpdate, saveOrUpdateBatch, saveOrUpdateBatch, update, update, update, updateBatchById, updateBatchById, updateByIdboolean saveIdempotency(T entity, DistributedLock locker, String lockKey, com.baomidou.mybatisplus.core.conditions.Wrapper<T> countWrapper, String msg) throws Exception
entity - 实体对象locker - 锁实例lockKey - 锁的keycountWrapper - 判断是否存在的条件msg - 对象已存在提示信息Exceptionboolean saveIdempotency(T entity, DistributedLock locker, String lockKey, com.baomidou.mybatisplus.core.conditions.Wrapper<T> countWrapper) throws Exception
Exceptionboolean saveOrUpdateIdempotency(T entity, DistributedLock locker, String lockKey, com.baomidou.mybatisplus.core.conditions.Wrapper<T> countWrapper, String msg) throws Exception
entity - 实体对象locker - 锁实例lockKey - 锁的keycountWrapper - 判断是否存在的条件msg - 对象已存在提示信息Exceptionboolean saveOrUpdateIdempotency(T entity, DistributedLock locker, String lockKey, com.baomidou.mybatisplus.core.conditions.Wrapper<T> countWrapper) throws Exception
Exceptionboolean deleteLogic(@NotEmpty
@NotEmpty List<Long> ids)
ids - id 集合boolean changeStatus(@NotEmpty
@NotEmpty List<Long> ids,
Integer status)
ids - id 集合status - 状态值boolean saveIgnore(T entity)
entity - entityboolean saveReplace(T entity)
entity - entityboolean saveIgnoreBatch(Collection<T> entityList, int batchSize)
entityList - 实体对象集合batchSize - 批次大小boolean saveReplaceBatch(Collection<T> entityList, int batchSize)
entityList - 实体对象集合batchSize - 批次大小@Transactional(rollbackFor=java.lang.Exception.class) default boolean saveReplaceBatch(Collection<T> entityList)
entityList - 实体对象集合Copyright © 2023. All rights reserved.