From 5b9106fdb5af2c7caa910fba8faf85037492f9a6 Mon Sep 17 00:00:00 2001 From: lemoncc <4831703@qq.com> Date: Tue, 15 Aug 2023 17:54:55 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=9C=A8=E8=B0=83=E7=94=A8=20selectList?= =?UTF-8?q?()=20=E7=9A=84=E6=97=B6=E5=80=99=20=E5=A6=82=E6=9E=9C=20Collect?= =?UTF-8?q?ion=20=E5=8F=82=E6=95=B0=E4=B8=BA=E7=A9=BA=E4=BC=9A=E6=8A=A5?= =?UTF-8?q?=E9=94=99=20sql=20=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yudao/framework/mybatis/core/mapper/BaseMapperX.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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..dde17fc6e 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)); } @@ -115,4 +122,4 @@ public interface BaseMapperX extends BaseMapper { Db.saveOrUpdateBatch(collection); } -} +} \ No newline at end of file