fixed value is QueryColumn or RawValue

This commit is contained in:
开源海哥 2023-04-13 18:51:59 +08:00
parent 045b5fe106
commit 9777c71da9
2 changed files with 35 additions and 20 deletions

View File

@ -49,8 +49,16 @@ class WrapperUtil {
if (condition == null) {
return;
}
Object value = condition.getValue();
if (value != null) {
if (value == null
|| value instanceof QueryColumn
|| value instanceof RawValue) {
getValues(condition.next, paras);
return;
}
if (value.getClass().isArray()) {
Object[] values = (Object[]) value;
for (Object object : values) {
@ -73,7 +81,6 @@ class WrapperUtil {
} else {
paras.add(value);
}
}
getValues(condition.next, paras);
}

View File

@ -59,6 +59,14 @@ public class TenantTester {
TenantAccountMapper mapper = MybatisFlexBootstrap.getInstance().getMapper(TenantAccountMapper.class);
// mapper.selectListByQuery(QueryWrapper.create()
// .select(TENANT_ACCOUNT.ALL_COLUMNS)
// .from(TENANT_ACCOUNT.as("a"), TENANT_ACCOUNT1.as("b"))
// .where(TENANT_ACCOUNT.ID.eq(TENANT_ACCOUNT1.ID))
// .and(TENANT_ACCOUNT.ID.eq(1))
// );
//SELECT * FROM `tb_account` WHERE `tenant_id` = 1
List<TenantAccount> tenantAccounts = mapper.selectAll();
System.out.println(tenantAccounts);