test: 测试优化 exists 方法。

This commit is contained in:
Suomm 2023-08-25 22:02:54 +08:00
parent 1078865a20
commit 563ac10887

View File

@ -16,6 +16,7 @@
package com.mybatisflex.test.service;
import com.mybatisflex.core.query.QueryWrapper;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
@ -42,4 +43,15 @@ class ArticleServiceTest {
.forEach(System.out::println);
}
@Test
void testExists() {
QueryWrapper queryWrapper = QueryWrapper.create()
.select(ARTICLE.DEFAULT_COLUMNS)
.from(ARTICLE)
.where(ARTICLE.ACCOUNT_ID.eq(1))
.orderBy(ARTICLE.ACCOUNT_ID.desc());
boolean exists = articleService.exists(queryWrapper);
System.out.println(exists);
}
}