【优化】字典tree接口精简数据库查询字段

pull/227/head
vchao 5 months ago committed by 小诺
parent fd3a2b7741
commit 58e7d743c4

@ -97,6 +97,9 @@ public class DevDictServiceImpl extends ServiceImpl<DevDictMapper, DevDict> impl
@Override @Override
public List<Tree<String>> tree(DevDictTreeParam devDictTreeParam) { public List<Tree<String>> tree(DevDictTreeParam devDictTreeParam) {
LambdaQueryWrapper<DevDict> lambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<DevDict> lambdaQueryWrapper = new LambdaQueryWrapper<>();
// 查询部分字段
lambdaQueryWrapper.select(DevDict::getId, DevDict::getParentId, DevDict::getCategory, DevDict::getDictLabel,
DevDict::getDictValue, DevDict::getSortCode);
lambdaQueryWrapper.orderByAsc(DevDict::getSortCode); lambdaQueryWrapper.orderByAsc(DevDict::getSortCode);
if (ObjectUtil.isNotEmpty(devDictTreeParam.getCategory())) { if (ObjectUtil.isNotEmpty(devDictTreeParam.getCategory())) {
lambdaQueryWrapper.eq(DevDict::getCategory, devDictTreeParam.getCategory()); lambdaQueryWrapper.eq(DevDict::getCategory, devDictTreeParam.getCategory());

Loading…
Cancel
Save