From 0c9485a6bfa88cf667f61779ac562ad5efb88833 Mon Sep 17 00:00:00 2001 From: owen Date: Sun, 10 Sep 2023 23:36:23 +0800 Subject: [PATCH] infra: 修正 查询实体列表方法,传入的ID集合为空时,会导致异常的问题 --- yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/service/serviceImpl.vm | 6 ++++++ 1 file changed, 6 insertions(+), 0 deletions(-) diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/service/serviceImpl.vm b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/service/serviceImpl.vm index a732039..148d1fa 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/service/serviceImpl.vm +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/service/serviceImpl.vm @@ -15,6 +15,9 @@ import ${basePackage}.module.${table.moduleName}.dal.mysql.${table.businessName} import static ${ServiceExceptionUtilClassName}.exception; import static ${basePackage}.module.${table.moduleName}.enums.ErrorCodeConstants.*; +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.collection.ListUtil; + /** * ${table.classComment} Service 实现类 * @@ -61,6 +64,9 @@ public class ${table.className}ServiceImpl implements ${table.className}Service @Override public ${table.className}DO get${simpleClassName}(${primaryColumn.javaType} id) { + if (CollUtil.isEmpty(ids)) { + return ListUtil.empty(); + } return ${classNameVar}Mapper.selectById(id); } -- libgit2 0.21.4