From 389df409b77e0bdd45f2732a4777d9332831d854 Mon Sep 17 00:00:00 2001 From: Suomm <1474983351@qq.com> Date: Thu, 3 Oct 2024 16:12:58 +0800 Subject: [PATCH] =?UTF-8?q?test:=20=E6=B5=8B=E8=AF=95=E9=80=9A=E8=BF=87=20?= =?UTF-8?q?Entity=20=E5=92=8C=20Map=20=E6=9E=84=E5=BB=BA=20WHERE=20?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../coretest/AccountSqlTester.java | 49 ++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/mybatis-flex-core/src/test/java/com/mybatisflex/coretest/AccountSqlTester.java b/mybatis-flex-core/src/test/java/com/mybatisflex/coretest/AccountSqlTester.java index a45fe10b..3c642884 100644 --- a/mybatis-flex-core/src/test/java/com/mybatisflex/coretest/AccountSqlTester.java +++ b/mybatis-flex-core/src/test/java/com/mybatisflex/coretest/AccountSqlTester.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2025, Mybatis-Flex (fuhai999@gmail.com). + * Copyright (c) 2022-2024, Mybatis-Flex (fuhai999@gmail.com). *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -23,6 +23,7 @@ import com.mybatisflex.core.dialect.KeywordWrap;
import com.mybatisflex.core.dialect.LimitOffsetProcessor;
import com.mybatisflex.core.dialect.impl.CommonsDialectImpl;
import com.mybatisflex.core.dialect.impl.OracleDialect;
+import com.mybatisflex.core.query.CPI;
import com.mybatisflex.core.query.DistinctQueryColumn;
import com.mybatisflex.core.query.QueryWrapper;
import com.mybatisflex.core.query.RawQueryColumn;
@@ -35,7 +36,10 @@ import com.mybatisflex.coretest.table.ArticleTableDef;
import org.junit.Assert;
import org.junit.Test;
+import java.util.ArrayList;
import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
import static com.mybatisflex.core.query.QueryMethods.avg;
import static com.mybatisflex.core.query.QueryMethods.case_;
@@ -887,4 +891,47 @@ public class AccountSqlTester {
System.out.println(SqlFormatter.format(qw.toSQL()));
}
+ @Test
+ public void testToQueryWrapper() {
+ Account account = new Account();
+ account.setId(1L);
+ account.setSex(3);
+ account.setAge(18);
+ account.setUserName("michael");
+
+ Map