mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-26 17:21:53 +08:00
infra: 修正 查询实体列表方法,传入的ID集合为空时,会导致异常的问题
This commit is contained in:
parent
dffdd471d5
commit
0c9485a6bf
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user