mirror of
https://github.com/continew-org/continew-starter.git
synced 2025-09-09 20:57:23 +08:00
perf(extension/crud): 减少查询列表时可能的无用转换
This commit is contained in:
@@ -132,6 +132,9 @@ public abstract class BaseServiceImpl<M extends BaseMapper<T>, T extends BaseDO,
|
||||
// 设置排序
|
||||
this.sort(queryWrapper, sortQuery);
|
||||
List<T> entityList = baseMapper.selectList(queryWrapper);
|
||||
if (entityClass == targetClass) {
|
||||
return (List<E>) entityList;
|
||||
}
|
||||
return BeanUtil.copyToList(entityList, targetClass);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user