mirror of
https://gitee.com/smallc/blade-tool.git
synced 2026-07-11 02:49:45 +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