mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-07 09:08:24 +08:00
test: 测试取消括号内的条件。
This commit is contained in:
parent
83354bc1bf
commit
b18b7b9615
@ -114,4 +114,21 @@ public class DynamicConditionTest {
|
|||||||
System.out.println(queryWrapper.toSQL());
|
System.out.println(queryWrapper.toSQL());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void test07() {
|
||||||
|
QueryWrapper queryWrapper = QueryWrapper.create()
|
||||||
|
.from(ACCOUNT)
|
||||||
|
.where(ACCOUNT.ID.in(1, 2, 3)
|
||||||
|
.and(ACCOUNT.AGE.ge(18))
|
||||||
|
.or(ACCOUNT.USER_NAME.eq("zhang san")));
|
||||||
|
|
||||||
|
for (QueryCondition condition = CPI.getWhereQueryCondition(queryWrapper); condition != null; condition = CPI.getNextCondition(condition)) {
|
||||||
|
if (condition.getColumn().getName().equals(ACCOUNT.AGE.getName())) {
|
||||||
|
condition.when(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
System.out.println(queryWrapper.toSQL());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user