test: 测试 IFNULL 函数。

This commit is contained in:
Suomm 2023-07-08 08:28:01 +08:00
parent dbdbe7b498
commit 1499640f96

View File

@ -19,8 +19,7 @@ package com.mybatisflex.coretest;
import com.mybatisflex.core.query.QueryWrapper;
import org.junit.Test;
import static com.mybatisflex.core.query.QueryMethods.if_;
import static com.mybatisflex.core.query.QueryMethods.string;
import static com.mybatisflex.core.query.QueryMethods.*;
import static com.mybatisflex.coretest.table.AccountTableDef.ACCOUNT;
/**
@ -48,4 +47,13 @@ public class IfFunctionTest {
System.out.println(queryWrapper.toSQL());
}
@Test
public void test03() {
QueryWrapper queryWrapper = QueryWrapper.create()
.select(ifNull(ACCOUNT.ID, number(0)))
.from(ACCOUNT)
.where(ACCOUNT.ID.eq(1));
System.out.println(queryWrapper.toSQL());
}
}