Commit 7d99c6dbe874502ab5d99c63646d6a9e501ac663

Authored by YunaiV
2 parents acee7345 544e650e

Merge branch 'master' of https://github.com/YunaiV/ruoyi-vue-pro

yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/mapper/BaseMapperX.java
1 package cn.iocoder.yudao.framework.mybatis.core.mapper; 1 package cn.iocoder.yudao.framework.mybatis.core.mapper;
2 2
  3 +import cn.hutool.core.collection.CollUtil;
3 import cn.iocoder.yudao.framework.common.pojo.PageParam; 4 import cn.iocoder.yudao.framework.common.pojo.PageParam;
4 import cn.iocoder.yudao.framework.common.pojo.PageResult; 5 import cn.iocoder.yudao.framework.common.pojo.PageResult;
5 import cn.iocoder.yudao.framework.mybatis.core.util.MyBatisUtils; 6 import cn.iocoder.yudao.framework.mybatis.core.util.MyBatisUtils;
@@ -75,10 +76,16 @@ public interface BaseMapperX<T> extends BaseMapper<T> { @@ -75,10 +76,16 @@ public interface BaseMapperX<T> extends BaseMapper<T> {
75 } 76 }
76 77
77 default List<T> selectList(String field, Collection<?> values) { 78 default List<T> selectList(String field, Collection<?> values) {
  79 + if (CollUtil.isEmpty(values)) {
  80 + return CollUtil.newArrayList();
  81 + }
78 return selectList(new QueryWrapper<T>().in(field, values)); 82 return selectList(new QueryWrapper<T>().in(field, values));
79 } 83 }
80 84
81 default List<T> selectList(SFunction<T, ?> field, Collection<?> values) { 85 default List<T> selectList(SFunction<T, ?> field, Collection<?> values) {
  86 + if (CollUtil.isEmpty(values)) {
  87 + return CollUtil.newArrayList();
  88 + }
82 return selectList(new LambdaQueryWrapper<T>().in(field, values)); 89 return selectList(new LambdaQueryWrapper<T>().in(field, values));
83 } 90 }
84 91
@@ -121,4 +128,4 @@ public interface BaseMapperX&lt;T&gt; extends BaseMapper&lt;T&gt; { @@ -121,4 +128,4 @@ public interface BaseMapperX&lt;T&gt; extends BaseMapper&lt;T&gt; {
121 Db.saveOrUpdateBatch(collection); 128 Db.saveOrUpdateBatch(collection);
122 } 129 }
123 130
124 -} 131 -}
  132 +}
125 \ No newline at end of file 133 \ No newline at end of file