mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-26 17:21:53 +08:00
Merge pull request #326 from Lemon-cc-hang/base
fix: 在调用 selectList() 的时候 如果 Collection 参数为空会报错 sql 异常
This commit is contained in:
commit
544e650e15
@ -1,5 +1,6 @@
|
|||||||
package cn.iocoder.yudao.framework.mybatis.core.mapper;
|
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.PageParam;
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
import cn.iocoder.yudao.framework.mybatis.core.util.MyBatisUtils;
|
import cn.iocoder.yudao.framework.mybatis.core.util.MyBatisUtils;
|
||||||
@ -69,10 +70,16 @@ public interface BaseMapperX<T> extends BaseMapper<T> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
default List<T> selectList(String field, Collection<?> values) {
|
default List<T> selectList(String field, Collection<?> values) {
|
||||||
|
if (CollUtil.isEmpty(values)) {
|
||||||
|
return CollUtil.newArrayList();
|
||||||
|
}
|
||||||
return selectList(new QueryWrapper<T>().in(field, values));
|
return selectList(new QueryWrapper<T>().in(field, values));
|
||||||
}
|
}
|
||||||
|
|
||||||
default List<T> selectList(SFunction<T, ?> field, Collection<?> values) {
|
default List<T> selectList(SFunction<T, ?> field, Collection<?> values) {
|
||||||
|
if (CollUtil.isEmpty(values)) {
|
||||||
|
return CollUtil.newArrayList();
|
||||||
|
}
|
||||||
return selectList(new LambdaQueryWrapper<T>().in(field, values));
|
return selectList(new LambdaQueryWrapper<T>().in(field, values));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user