mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-07 00:58:24 +08:00
test: 修正测试。
This commit is contained in:
parent
dc1efca50a
commit
fd7dfa963e
@ -37,7 +37,22 @@ import org.junit.Test;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import static com.mybatisflex.core.query.QueryMethods.*;
|
||||
import static com.mybatisflex.core.query.QueryMethods.avg;
|
||||
import static com.mybatisflex.core.query.QueryMethods.case_;
|
||||
import static com.mybatisflex.core.query.QueryMethods.column;
|
||||
import static com.mybatisflex.core.query.QueryMethods.convert;
|
||||
import static com.mybatisflex.core.query.QueryMethods.count;
|
||||
import static com.mybatisflex.core.query.QueryMethods.distinct;
|
||||
import static com.mybatisflex.core.query.QueryMethods.exists;
|
||||
import static com.mybatisflex.core.query.QueryMethods.left;
|
||||
import static com.mybatisflex.core.query.QueryMethods.max;
|
||||
import static com.mybatisflex.core.query.QueryMethods.noCondition;
|
||||
import static com.mybatisflex.core.query.QueryMethods.notExists;
|
||||
import static com.mybatisflex.core.query.QueryMethods.raw;
|
||||
import static com.mybatisflex.core.query.QueryMethods.select;
|
||||
import static com.mybatisflex.core.query.QueryMethods.selectCountOne;
|
||||
import static com.mybatisflex.core.query.QueryMethods.selectOne;
|
||||
import static com.mybatisflex.core.query.QueryMethods.year;
|
||||
import static com.mybatisflex.coretest.table.Account01TableDef.ACCOUNT01;
|
||||
import static com.mybatisflex.coretest.table.AccountTableDef.ACCOUNT;
|
||||
import static com.mybatisflex.coretest.table.ArticleTableDef.ARTICLE;
|
||||
@ -360,7 +375,7 @@ public class AccountSqlTester {
|
||||
|
||||
Assert.assertEquals("SELECT * FROM `tb_account` " +
|
||||
"WHERE `id` >= 100 " +
|
||||
"AND EXISTS (SELECT 1 FROM `tb_article` AS `a` WHERE `id` >= 100)"
|
||||
"AND EXISTS (SELECT 1 AS `temp_one` FROM `tb_article` AS `a` WHERE `id` >= 100)"
|
||||
, query.toSQL());
|
||||
|
||||
System.out.println(query.toSQL());
|
||||
@ -815,7 +830,7 @@ public class AccountSqlTester {
|
||||
"WHERE `a1`.`id` >= (SELECT `id` FROM `tb_article` AS `cc` WHERE `id` = 111) " +
|
||||
"AND `a1`.`user_name` LIKE '%michael%' " +
|
||||
"AND `b1`.`id` IN (SELECT `tb_article`.`id` FROM `aaa`) " +
|
||||
"AND NOT EXISTS (SELECT 1 FROM `aaa` WHERE `tb_article`.`id` >= 333) " +
|
||||
"AND NOT EXISTS (SELECT 1 AS `temp_one` FROM `aaa` WHERE `tb_article`.`id` >= 333) " +
|
||||
"GROUP BY `a1`.`id` HAVING `b1`.`id` >= 0 " +
|
||||
"ORDER BY `a1`.`id` DESC LIMIT 10, 10", queryWrapper.toSQL());
|
||||
|
||||
|
||||
@ -24,8 +24,8 @@ import com.mybatisflex.core.table.TableInfoFactory;
|
||||
import com.mybatisflex.core.util.CollectionUtil;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static com.mybatisflex.coretest.table.ArticleTableDef.ARTICLE;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
|
||||
public class ArticleSqlTester {
|
||||
@ -68,8 +68,7 @@ public class ArticleSqlTester {
|
||||
TableInfo tableInfo = TableInfoFactory.ofEntityClass(Article.class);
|
||||
String sql = dialect.forInsertEntity(tableInfo, article, true);
|
||||
System.out.println(sql);
|
||||
assertEquals("INSERT INTO `tb_article`(`uuid`, `account_id`, `content`, `created`, `modified`) " +
|
||||
"VALUES (?, ?, ?, now(), now())", sql);
|
||||
assertEquals("INSERT INTO `tb_article`(`account_id`, `content`, `created`, `modified`) VALUES (?, ?, now(), now())", sql);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user