From c22cf007d1578a63852d88a3c8d5912b1513a93f Mon Sep 17 00:00:00 2001 From: YunaiV Date: Tue, 25 Jul 2023 20:58:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20LambdaQueryWrapperX=20?= =?UTF-8?q?=E7=9A=84=20inIfPresent=20=E5=88=A4=E7=A9=BA=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../framework/mybatis/core/query/LambdaQueryWrapperX.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 9fd1d16f8..7649e02c4 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 @@ -1,9 +1,9 @@ package cn.iocoder.yudao.framework.mybatis.core.query; import cn.hutool.core.util.ArrayUtil; +import cn.hutool.core.util.ObjectUtil; import cn.iocoder.yudao.framework.common.util.collection.ArrayUtils; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import com.baomidou.mybatisplus.core.toolkit.support.SFunction; import org.springframework.util.StringUtils; @@ -26,14 +26,14 @@ public class LambdaQueryWrapperX extends LambdaQueryWrapper { } public LambdaQueryWrapperX inIfPresent(SFunction column, Collection values) { - if (!CollectionUtils.isEmpty(values)) { + if (ObjectUtil.isAllNotEmpty(values) && !ArrayUtil.isEmpty(values)) { return (LambdaQueryWrapperX) super.in(column, values); } return this; } public LambdaQueryWrapperX inIfPresent(SFunction column, Object... values) { - if (!ArrayUtil.isEmpty(values)) { + if (ObjectUtil.isAllNotEmpty(values) && !ArrayUtil.isEmpty(values)) { return (LambdaQueryWrapperX) super.in(column, values); } return this;