mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-07 00:58:24 +08:00
close #I70OIA
This commit is contained in:
parent
c0d89a3e67
commit
1294c32e72
@ -58,6 +58,22 @@ public class Brackets extends QueryCondition {
|
||||
return childCondition;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkEffective() {
|
||||
boolean effective = super.checkEffective();
|
||||
if (!effective) {
|
||||
return false;
|
||||
}
|
||||
QueryCondition condition = this.childCondition;
|
||||
while (condition != null) {
|
||||
if (condition.checkEffective()) {
|
||||
return true;
|
||||
}
|
||||
condition = condition.next;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toSql(List<QueryTable> queryTables, IDialect dialect) {
|
||||
|
||||
|
||||
@ -56,21 +56,21 @@ public class EntityTestStarter {
|
||||
|
||||
// List<Account> accounts1 = myAccountMapper.selectAll();
|
||||
|
||||
// QueryWrapper wrapper = QueryWrapper.create().select().from(ACCOUNT)
|
||||
// .and(ACCOUNT.ID.ge(100).and(ACCOUNT.ID.ge(200)))
|
||||
// .and(ACCOUNT.ID.ge(100).and(ACCOUNT.ID.ge(200)))
|
||||
// .groupBy(ACCOUNT.ID);
|
||||
//
|
||||
// List<Account> accounts = accountMapper.selectListByQuery(wrapper);
|
||||
|
||||
|
||||
QueryWrapper wrapper = QueryWrapper.create().select().from(ACCOUNT)
|
||||
// .leftJoin(ARTICLE).on(ARTICLE.ACCOUNT_ID.eq(ACCOUNT.ID).and(ACCOUNT.ID.ge(100)))
|
||||
.and(ACCOUNT.ID.ge(100).when(false));
|
||||
.and(ACCOUNT.ID.ge(100).and(ACCOUNT.ID.ge(200)))
|
||||
.and(ACCOUNT.ID.ge(100).and(ACCOUNT.ID.ge(200)))
|
||||
.groupBy(ACCOUNT.ID);
|
||||
|
||||
List<Account> accounts = accountMapper.selectListByQuery(wrapper);
|
||||
System.out.println(accounts);
|
||||
|
||||
QueryWrapper wrapper1 = QueryWrapper.create().select().from(ACCOUNT)
|
||||
// .leftJoin(ARTICLE).on(ARTICLE.ACCOUNT_ID.eq(ACCOUNT.ID).and(ACCOUNT.ID.ge(100)))
|
||||
.and(ACCOUNT.ID.ge(100).when(false).and(ACCOUNT.ID.ge(100).when(false)));
|
||||
|
||||
List<Account> accounts1 = accountMapper.selectListByQuery(wrapper1);
|
||||
System.out.println(accounts1);
|
||||
|
||||
|
||||
// QueryWrapper queryWrapper = new QueryWrapper();
|
||||
// queryWrapper.where(ACCOUNT.ID.in(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user