增加deleteByIds空集合处理.

https://github.com/baomidou/mybatis-plus/issues/6257
This commit is contained in:
nieqiurong 2024-06-14 22:44:33 +08:00
parent 151a7d53e5
commit 423d43425f

View File

@ -203,6 +203,9 @@ public interface BaseMapper<T> extends Mapper<T> {
* @since 3.5.7
*/
default int deleteByIds(@Param(Constants.COLL) Collection<?> collections, boolean useFill) {
if (CollectionUtils.isEmpty(collections)) {
return 0;
}
MybatisMapperProxy<?> mybatisMapperProxy = MybatisUtils.getMybatisMapperProxy(this);
Class<?> entityClass = GenericTypeUtils.resolveTypeArguments(getClass(), BaseMapper.class)[0];
SqlSession sqlSession = mybatisMapperProxy.getSqlSession();