mirror of
https://github.com/chillzhuang/blade-tool
synced 2024-11-15 06:59:29 +08:00
⚡ 优化saveOrUpdate逻辑
This commit is contained in:
parent
87a6d93774
commit
29ba565bbf
@ -67,6 +67,15 @@ public class BaseServiceImpl<M extends BaseMapper<T>, T extends BaseEntity> exte
|
|||||||
return super.updateBatchById(entityList, batchSize);
|
return super.updateBatchById(entityList, batchSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean saveOrUpdate(T entity) {
|
||||||
|
if (entity.getId() == null) {
|
||||||
|
return this.save(entity);
|
||||||
|
} else {
|
||||||
|
return this.updateById(entity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean deleteLogic(@NotEmpty List<Long> ids) {
|
public boolean deleteLogic(@NotEmpty List<Long> ids) {
|
||||||
return super.removeByIds(ids);
|
return super.removeByIds(ids);
|
||||||
|
Loading…
Reference in New Issue
Block a user