mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-07 00:58:24 +08:00
修复ArithmeticQueryColumn算术运算无法拼接条件的问题
This commit is contained in:
parent
318f94d1c2
commit
390b01c4eb
@ -22,11 +22,12 @@ import com.mybatisflex.core.util.CollectionUtil;
|
||||
import com.mybatisflex.core.util.StringUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import static com.mybatisflex.core.constant.SqlConsts.*;
|
||||
|
||||
public class ArithmeticQueryColumn extends QueryColumn {
|
||||
public class ArithmeticQueryColumn extends QueryColumn implements HasParamsColumn {
|
||||
|
||||
private List<ArithmeticInfo> arithmeticInfos;
|
||||
|
||||
@ -114,6 +115,16 @@ public class ArithmeticQueryColumn extends QueryColumn {
|
||||
return SqlConsts.BRACKET_LEFT + sql + SqlConsts.BRACKET_RIGHT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object[] getParamValues() {
|
||||
return arithmeticInfos.stream()
|
||||
.map(arithmeticInfo -> arithmeticInfo.value)
|
||||
.filter(value -> value instanceof HasParamsColumn)
|
||||
.map(value -> ((HasParamsColumn) value).getParamValues())
|
||||
.flatMap(Arrays::stream)
|
||||
.toArray();
|
||||
}
|
||||
|
||||
|
||||
static class ArithmeticInfo implements CloneSupport<ArithmeticInfo> {
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user