!281 fix:条件链指向错误。

Merge pull request !281 from 王帅/main
This commit is contained in:
Michael Yang 2023-08-14 04:29:58 +00:00 committed by Gitee
commit f32d583ddb
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 17 additions and 5 deletions

View File

@ -78,11 +78,6 @@ public class Brackets extends QueryCondition {
return childCondition.when(fn);
}
@Override
protected QueryCondition getPrevEffectiveCondition() {
return childCondition.getPrevEffectiveCondition();
}
@Override
protected QueryCondition getNextEffectiveCondition() {
return childCondition.getNextEffectiveCondition();

View File

@ -131,4 +131,21 @@ public class DynamicConditionTest {
System.out.println(queryWrapper.toSQL());
}
@Test
public void test08() {
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) {
System.out.println(condition.getColumn().getName());
condition = CPI.getNextCondition(condition);
}
System.out.println(queryWrapper.toSQL());
}
}