From 63064de2886f6ebb401a9af0e37ae7fdc812b170 Mon Sep 17 00:00:00 2001 From: Suomm <1474983351@qq.com> Date: Thu, 24 Aug 2023 09:08:30 +0800 Subject: [PATCH] =?UTF-8?q?test:=20=E6=B5=8B=E8=AF=95=E5=8A=A8=E6=80=81?= =?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/DynamicConditionTest.java | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/mybatis-flex-core/src/test/java/com/mybatisflex/coretest/DynamicConditionTest.java b/mybatis-flex-core/src/test/java/com/mybatisflex/coretest/DynamicConditionTest.java index 0d18aa94..f52b10bd 100644 --- a/mybatis-flex-core/src/test/java/com/mybatisflex/coretest/DynamicConditionTest.java +++ b/mybatis-flex-core/src/test/java/com/mybatisflex/coretest/DynamicConditionTest.java @@ -133,11 +133,11 @@ public class DynamicConditionTest { @Test public void test08() { - QueryWrapper queryWrapper = QueryWrapper.create(). - from(ACCOUNT) + QueryWrapper queryWrapper = QueryWrapper.create() + .from(ACCOUNT) .where(ACCOUNT.ID.eq(1) .and(ACCOUNT.AGE.in(17, 18, 19).or(ACCOUNT.USER_NAME.eq("zhang san")) - )); + )); QueryCondition condition = CPI.getWhereQueryCondition(queryWrapper); while (condition != null) { @@ -148,4 +148,16 @@ public class DynamicConditionTest { System.out.println(queryWrapper.toSQL()); } + @Test + public void test09() { + QueryColumnBehavior.setIgnoreFunction(e -> e == null || "".equals(e)); + QueryColumnBehavior.setSmartConvertInToEquals(false); + + QueryWrapper queryWrapper = QueryWrapper.create() + .from(ACCOUNT) + .where(ACCOUNT.USER_NAME.in( "")); + + System.out.println(queryWrapper.toSQL()); + } + }