diff --git a/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/query/LambdaQueryWrapperX.java b/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/query/LambdaQueryWrapperX.java index d9ba7c4be..d387e2865 100644 --- a/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/query/LambdaQueryWrapperX.java +++ b/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/query/LambdaQueryWrapperX.java @@ -98,10 +98,10 @@ public class LambdaQueryWrapperX extends LambdaQueryWrapper { if (values!= null && values.length >0 && values[0] != null && values[1] != null) { return (LambdaQueryWrapperX) super.between(column, values[0], values[1]); } - if (values != null && values[0] != null) { + if (values != null && values.length >0 && values[0] != null) { return (LambdaQueryWrapperX) ge(column, values[0]); } - if (values != null && values[1] != null) { + if (values != null && values.length >0 && values[1] != null) { return (LambdaQueryWrapperX) le(column, values[2]); } return this; diff --git a/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/query/QueryWrapperX.java b/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/query/QueryWrapperX.java index 1effb19ed..a44300833 100644 --- a/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/query/QueryWrapperX.java +++ b/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/query/QueryWrapperX.java @@ -95,13 +95,13 @@ public class QueryWrapperX extends QueryWrapper { } public QueryWrapperX 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) super.between(column, values[0], values[1]); } - if (values!= null && values[0] != null) { + if (values!= null && values.length != 0 && values[0] != null) { return (QueryWrapperX) ge(column, values[0]); } - if (values!= null && values[1] != null) { + if (values!= null && values.length != 0 && values[1] != null) { return (QueryWrapperX) le(column, values[1]); } return this;