Fix existence query bug again

pull/146/head
johnniang 2019-04-28 20:51:14 +08:00
parent 2933e0297f
commit 4e5694cef0
1 changed files with 2 additions and 2 deletions

View File

@ -307,10 +307,10 @@ public abstract class BasePostServiceImpl<POST extends BasePost> extends Abstrac
if (ServiceUtils.isEmptyId(post.getId())) {
// The sheet will be created
exist = basePostRepository.countByUrl(post.getUrl());
exist = basePostRepository.existsByUrl(post.getUrl());
} else {
// The sheet will be updated
exist = basePostRepository.countByIdNotAndUrl(post.getId(), post.getUrl());
exist = basePostRepository.existsByIdNotAndUrl(post.getId(), post.getUrl());
}
if (exist) {