mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-08 01:28:24 +08:00
feat: 添加 concat 方法。
This commit is contained in:
parent
9d31e8742a
commit
e4da76af74
@ -18,6 +18,9 @@ package com.mybatisflex.core.query;
|
|||||||
import com.mybatisflex.core.util.LambdaGetter;
|
import com.mybatisflex.core.util.LambdaGetter;
|
||||||
import com.mybatisflex.core.util.LambdaUtil;
|
import com.mybatisflex.core.util.LambdaUtil;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import static com.mybatisflex.core.constant.SqlConsts.*;
|
import static com.mybatisflex.core.constant.SqlConsts.*;
|
||||||
|
|
||||||
public class QueryMethods {
|
public class QueryMethods {
|
||||||
@ -163,6 +166,15 @@ public class QueryMethods {
|
|||||||
return new StringFunctionQueryColumn(CONVERT, params);
|
return new StringFunctionQueryColumn(CONVERT, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
///CONCAT
|
||||||
|
public static FunctionQueryColumn concat(String str1, String str2, String... more) {
|
||||||
|
List<String> args = Arrays.asList(str1, str2);
|
||||||
|
args.addAll(Arrays.asList(more));
|
||||||
|
String[] columns = new String[args.size()];
|
||||||
|
args.toArray(columns);
|
||||||
|
return new FunctionQueryColumn("CONCAT", columns);
|
||||||
|
}
|
||||||
|
|
||||||
public static StringQueryColumn column(String column) {
|
public static StringQueryColumn column(String column) {
|
||||||
return new StringQueryColumn(column);
|
return new StringQueryColumn(column);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user