增加区间查询字段判断

pull/2/head
xingyu 2022-07-25 19:14:33 +08:00
parent 54efb34289
commit 611e11ae23
2 changed files with 5 additions and 5 deletions

View File

@ -98,10 +98,10 @@ public class LambdaQueryWrapperX<T> extends LambdaQueryWrapper<T> {
if (values!= null && values.length >0 && values[0] != null && values[1] != null) { if (values!= null && values.length >0 && values[0] != null && values[1] != null) {
return (LambdaQueryWrapperX<T>) super.between(column, values[0], values[1]); return (LambdaQueryWrapperX<T>) super.between(column, values[0], values[1]);
} }
if (values != null && values[0] != null) { if (values != null && values.length >0 && values[0] != null) {
return (LambdaQueryWrapperX<T>) ge(column, values[0]); return (LambdaQueryWrapperX<T>) ge(column, values[0]);
} }
if (values != null && values[1] != null) { if (values != null && values.length >0 && values[1] != null) {
return (LambdaQueryWrapperX<T>) le(column, values[2]); return (LambdaQueryWrapperX<T>) le(column, values[2]);
} }
return this; return this;

View File

@ -95,13 +95,13 @@ public class QueryWrapperX<T> extends QueryWrapper<T> {
} }
public QueryWrapperX<T> betweenIfPresent(String column, Object[] values) { public QueryWrapperX<T> betweenIfPresent(String column, Object[] values) {
if (values!= null && values[0] != null && values[1] != null) { if (values!= null && values.length != 0 && values[0] != null && values[1] != null) {
return (QueryWrapperX<T>) super.between(column, values[0], values[1]); return (QueryWrapperX<T>) super.between(column, values[0], values[1]);
} }
if (values!= null && values[0] != null) { if (values!= null && values.length != 0 && values[0] != null) {
return (QueryWrapperX<T>) ge(column, values[0]); return (QueryWrapperX<T>) ge(column, values[0]);
} }
if (values!= null && values[1] != null) { if (values!= null && values.length != 0 && values[1] != null) {
return (QueryWrapperX<T>) le(column, values[1]); return (QueryWrapperX<T>) le(column, values[1]);
} }
return this; return this;