diff --git a/blade-core-mybatis/src/main/java/org/springblade/core/mp/base/BaseServiceImpl.java b/blade-core-mybatis/src/main/java/org/springblade/core/mp/base/BaseServiceImpl.java index 2f61b44..ba8c27e 100644 --- a/blade-core-mybatis/src/main/java/org/springblade/core/mp/base/BaseServiceImpl.java +++ b/blade-core-mybatis/src/main/java/org/springblade/core/mp/base/BaseServiceImpl.java @@ -67,6 +67,15 @@ public class BaseServiceImpl, 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 ids) { return super.removeByIds(ids);