mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-08 01:28:24 +08:00
feat: 添加 RawValue 获取参数的方法。
This commit is contained in:
parent
743ece8ca0
commit
139a4fccc0
@ -18,6 +18,7 @@ package com.mybatisflex.core.update;
|
||||
import com.mybatisflex.core.constant.SqlConsts;
|
||||
import com.mybatisflex.core.dialect.IDialect;
|
||||
import com.mybatisflex.core.query.CPI;
|
||||
import com.mybatisflex.core.query.HasParamsColumn;
|
||||
import com.mybatisflex.core.query.QueryColumn;
|
||||
import com.mybatisflex.core.query.QueryCondition;
|
||||
import com.mybatisflex.core.query.QueryWrapper;
|
||||
@ -56,4 +57,24 @@ public class RawValue implements Serializable {
|
||||
return object.toString();
|
||||
}
|
||||
|
||||
public Object[] getParams() {
|
||||
if (object instanceof String) {
|
||||
return new Object[0];
|
||||
}
|
||||
|
||||
if (object instanceof QueryWrapper) {
|
||||
return CPI.getValueArray((QueryWrapper) object);
|
||||
}
|
||||
|
||||
if (object instanceof QueryCondition) {
|
||||
return CPI.getConditionParams((QueryCondition) object);
|
||||
}
|
||||
|
||||
if (object instanceof HasParamsColumn) {
|
||||
return ((HasParamsColumn) object).getParamValues();
|
||||
}
|
||||
|
||||
return new Object[0];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user