mirror of
https://github.com/chillzhuang/blade-tool
synced 2024-12-12 12:19:27 +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);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean saveOrUpdate(T entity) {
|
||||
if (entity.getId() == null) {
|
||||
return this.save(entity);
|
||||
} else {
|
||||
return this.updateById(entity);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteLogic(@NotEmpty List<Long> ids) {
|
||||
return super.removeByIds(ids);
|
||||
|
Loading…
Reference in New Issue
Block a user