Commit 35d6bca5 authored by 韩桐桐's avatar 韩桐桐

fix(jg):代码回退

parent 68cffe70
......@@ -322,18 +322,23 @@ public class CommonServiceImpl implements ICommonService {
@Override
public List<EquipmentCategory> getEquipmentCategoryList(String code, String type) {
if (StringUtils.isEmpty(code)) {
return Collections.emptyList();
}
List<EquipmentCategory> result = new ArrayList<>();
LambdaQueryWrapper<EquipmentCategory> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(EquipmentCategory::getCode, code);
EquipmentCategory equipmentCategory = equipmentCategoryMapper.selectOne(wrapper);
if (equipmentCategory == null) {
return Collections.emptyList();
if (ObjectUtils.isEmpty(type)) {
if (!ValidationUtil.isEmpty(equipmentCategory)) {
result.add(equipmentCategory);
}
} else {
LambdaQueryWrapper<EquipmentCategory> wrapper2 = new LambdaQueryWrapper<>();
wrapper2.eq(EquipmentCategory::getParentId, equipmentCategory.getId());
List<EquipmentCategory> equipmentCategories = equipmentCategoryMapper.selectList(wrapper2);
if (!ValidationUtil.isEmpty(equipmentCategories)) {
result = equipmentCategories;
}
}
LambdaQueryWrapper<EquipmentCategory> wrapper2 = new LambdaQueryWrapper<>();
wrapper2.eq(!StringUtils.isEmpty(type), EquipmentCategory::getParentId, equipmentCategory.getId());
return equipmentCategoryMapper.selectList(wrapper2);
return result;
}
@Override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment