mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-07 17:18:24 +08:00
test: 测试 IFNULL 函数。
This commit is contained in:
parent
dbdbe7b498
commit
1499640f96
@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user