mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-12-01 19:51:53 +08:00
infra: 修正 查询实体列表方法,传入的ID集合为空时,会导致异常的问题
This commit is contained in:
parent
a3e161a9a3
commit
f998d43e68
@ -64,14 +64,14 @@ public class ${table.className}ServiceImpl implements ${table.className}Service
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ${table.className}DO get${simpleClassName}(${primaryColumn.javaType} id) {
|
public ${table.className}DO get${simpleClassName}(${primaryColumn.javaType} id) {
|
||||||
if (CollUtil.isEmpty(ids)) {
|
|
||||||
return ListUtil.empty();
|
|
||||||
}
|
|
||||||
return ${classNameVar}Mapper.selectById(id);
|
return ${classNameVar}Mapper.selectById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<${table.className}DO> get${simpleClassName}List(Collection<${primaryColumn.javaType}> ids) {
|
public List<${table.className}DO> get${simpleClassName}List(Collection<${primaryColumn.javaType}> ids) {
|
||||||
|
if (CollUtil.isEmpty(ids)) {
|
||||||
|
return ListUtil.empty();
|
||||||
|
}
|
||||||
return ${classNameVar}Mapper.selectBatchIds(ids);
|
return ${classNameVar}Mapper.selectBatchIds(ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user