mirror of
https://gitee.com/smallc/blade-tool.git
synced 2026-08-01 02:12:09 +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