mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-07 00:58:24 +08:00
feat(): QueryColumn 的 between 增加数组参数
This commit is contained in:
parent
08df2957ba
commit
ebbfd1096e
@ -387,6 +387,21 @@ public interface Conditional<R> {
|
|||||||
*/
|
*/
|
||||||
R notIn(QueryWrapper queryWrapper, BooleanSupplier isEffective);
|
R notIn(QueryWrapper queryWrapper, BooleanSupplier isEffective);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@code BETWEEN values[0] AND values[1]}
|
||||||
|
*
|
||||||
|
* @param values 范围值
|
||||||
|
*/
|
||||||
|
R between(Object[] values);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@code BETWEEN values[0] AND values[1]}
|
||||||
|
*
|
||||||
|
* @param values 值
|
||||||
|
* @param isEffective 是否有效
|
||||||
|
*/
|
||||||
|
R between(Object[] values, boolean isEffective);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@code BETWEEN start AND end}
|
* {@code BETWEEN start AND end}
|
||||||
*
|
*
|
||||||
@ -422,6 +437,21 @@ public interface Conditional<R> {
|
|||||||
*/
|
*/
|
||||||
<S, E> R between(S start, E end, BiPredicate<S, E> isEffective);
|
<S, E> R between(S start, E end, BiPredicate<S, E> isEffective);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@code NOT BETWEEN values[0] AND values[1]}
|
||||||
|
*
|
||||||
|
* @param values 范围值
|
||||||
|
*/
|
||||||
|
R notBetween(Object[] values);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@code NOT BETWEEN values[0] AND values[1]}
|
||||||
|
*
|
||||||
|
* @param values 值
|
||||||
|
* @param isEffective 是否有效
|
||||||
|
*/
|
||||||
|
R notBetween(Object[] values, boolean isEffective);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@code NOT BETWEEN start AND end}
|
* {@code NOT BETWEEN start AND end}
|
||||||
*
|
*
|
||||||
|
|||||||
@ -578,6 +578,24 @@ public class QueryColumn implements CloneSupport<QueryColumn>, Conditional<Query
|
|||||||
return QueryColumnBehavior.castCondition(QueryCondition.create(this, SqlOperator.NOT_IN, queryWrapper).when(isEffective));
|
return QueryColumnBehavior.castCondition(QueryCondition.create(this, SqlOperator.NOT_IN, queryWrapper).when(isEffective));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public QueryCondition between(Object[] values) {
|
||||||
|
if (QueryColumnBehavior.shouldIgnoreValue(values) || values.length < 2) {
|
||||||
|
return QueryCondition.createEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
return between(values[0], values[1]);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public QueryCondition between(Object[] values, boolean isEffective) {
|
||||||
|
if (QueryColumnBehavior.shouldIgnoreValue(values) || values.length < 2) {
|
||||||
|
return QueryCondition.createEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
return between(values[0], values[1], isEffective);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public QueryCondition between(Object start, Object end) {
|
public QueryCondition between(Object start, Object end) {
|
||||||
if (QueryColumnBehavior.shouldIgnoreValue(start) || QueryColumnBehavior.shouldIgnoreValue(end)) {
|
if (QueryColumnBehavior.shouldIgnoreValue(start) || QueryColumnBehavior.shouldIgnoreValue(end)) {
|
||||||
@ -610,6 +628,24 @@ public class QueryColumn implements CloneSupport<QueryColumn>, Conditional<Query
|
|||||||
return QueryColumnBehavior.castCondition(QueryCondition.create(this, SqlOperator.BETWEEN, new Object[]{start, end}).when(isEffective.test(start, end)));
|
return QueryColumnBehavior.castCondition(QueryCondition.create(this, SqlOperator.BETWEEN, new Object[]{start, end}).when(isEffective.test(start, end)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public QueryCondition notBetween(Object[] values) {
|
||||||
|
if (QueryColumnBehavior.shouldIgnoreValue(values) || values.length < 2) {
|
||||||
|
return QueryCondition.createEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
return notBetween(values[0], values[1]);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public QueryCondition notBetween(Object[] values, boolean isEffective) {
|
||||||
|
if (QueryColumnBehavior.shouldIgnoreValue(values) || values.length < 2) {
|
||||||
|
return QueryCondition.createEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
return notBetween(values[0], values[1], isEffective);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public QueryCondition notBetween(Object start, Object end) {
|
public QueryCondition notBetween(Object start, Object end) {
|
||||||
if (QueryColumnBehavior.shouldIgnoreValue(start) || QueryColumnBehavior.shouldIgnoreValue(end)) {
|
if (QueryColumnBehavior.shouldIgnoreValue(start) || QueryColumnBehavior.shouldIgnoreValue(end)) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user