Commit f998d43e6852bdfbafd824ee8174ae40d8c886aa

Authored by owen
1 parent a3e161a9

infra: 修正 查询实体列表方法,传入的ID集合为空时,会导致异常的问题

yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/service/serviceImpl.vm
... ... @@ -64,14 +64,14 @@ public class ${table.className}ServiceImpl implements ${table.className}Service
64 64  
65 65 @Override
66 66 public ${table.className}DO get${simpleClassName}(${primaryColumn.javaType} id) {
67   - if (CollUtil.isEmpty(ids)) {
68   - return ListUtil.empty();
69   - }
70 67 return ${classNameVar}Mapper.selectById(id);
71 68 }
72 69  
73 70 @Override
74 71 public List<${table.className}DO> get${simpleClassName}List(Collection<${primaryColumn.javaType}> ids) {
  72 + if (CollUtil.isEmpty(ids)) {
  73 + return ListUtil.empty();
  74 + }
75 75 return ${classNameVar}Mapper.selectBatchIds(ids);
76 76 }
77 77  
... ...