From bb34cdea2c04156bbfef7448b422172b9706a42e Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sun, 27 Aug 2023 10:53:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5=20https://github.com/YunaiV/?= =?UTF-8?q?ruoyi-vue-pro/pull/326?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yudao/framework/mybatis/core/mapper/BaseMapperX.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/mapper/BaseMapperX.java b/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/mapper/BaseMapperX.java index 9eed6d0e0..4137da347 100644 --- a/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/mapper/BaseMapperX.java +++ b/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/mapper/BaseMapperX.java @@ -1,5 +1,6 @@ package cn.iocoder.yudao.framework.mybatis.core.mapper; +import cn.hutool.core.collection.CollUtil; import cn.iocoder.yudao.framework.common.pojo.PageParam; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.mybatis.core.util.MyBatisUtils; @@ -69,10 +70,16 @@ public interface BaseMapperX extends BaseMapper { } default List selectList(String field, Collection values) { + if (CollUtil.isEmpty(values)) { + return CollUtil.newArrayList(); + } return selectList(new QueryWrapper().in(field, values)); } default List selectList(SFunction field, Collection values) { + if (CollUtil.isEmpty(values)) { + return CollUtil.newArrayList(); + } return selectList(new LambdaQueryWrapper().in(field, values)); }