当前位置:网站首页>获取树形菜单列表
获取树形菜单列表
2020-11-07 21:03:00 【麦漁翁】
获取树形菜单列表
/**
* 获取区域树形列表
* @return
*/
public List<MapAreaTreeVo> getAreaTreeList(){
List<MapAreaTreeVo> arealist = areaDao.getAreaTreeList(0);
for(MapAreaTreeVo vo :arealist){
//递归循环获取
vo.setChildren(getAreaTreePidList(vo.getId()));
}
return arealist;
}
/**
* 获取父菜单下的树形列表
* @param pid
* @return
*/
public List<MapAreaTreeVo> getAreaTreePidList(Integer pid){
List<MapAreaTreeVo> mapAreaTreeVoList = areaDao.getAreaTreeList(pid);
if(null!=mapAreaTreeVoList && mapAreaTreeVoList.size()>0){
for(MapAreaTreeVo vo:mapAreaTreeVoList){
vo.setChildren(getAreaTreePidList(vo.getId()));
}
}
return mapAreaTreeVoList;
}
实体类
public class MapAreaTreeVo {
private Integer id;
private Integer pid;
private String title;
private List<MapAreaTreeVo> children;
}
版权声明
本文为[麦漁翁]所创,转载请带上原文链接,感谢
https://my.oschina.net/u/3204029/blog/4707687
边栏推荐
- Share several vs Code plug-ins I use everyday
- 分享几个我日常使用的VS Code插件
- WPF 关于绘图个人总结
- Facebook开源框架如何简化 PyTorch 实验
- 汇编函数mcall systemstack asmcgocall syscall
- Kylin on Kubernetes 在 eBay 的实践
- 不懂数据库索引的底层原理?那是因为你心里没点b树
- Win10官方1909版本无法打开windows安全中心中病毒和威胁防护的实时保护解决方案。
- 如何应对事关业务生死的数据泄露和删改?
- Recommend suicide, openai warns: gpt-3 is too risky for medical purposes
猜你喜欢
From technology to management, the technology of system optimization is applied to enterprise management
A detailed explanation of microservice architecture
Win10官方1909版本无法打开windows安全中心中病毒和威胁防护的实时保护解决方案。
Git code submission operation, and git push prompt failed to push some refs'xxx '
爆一个VS2015 Update1更新带来的编译BUG【已有解决方案】
【C++学习笔记】C++ 标准库 std::thread 的简单使用,一文搞定还不简单?
Don't treat exceptions as business logic, which you can't afford
delphi10的rest.json与system.json的踩坑
Ac86u KX Online
laravel8更新之维护模式改进
随机推荐
[C + + learning notes] how about the simple use of the C + + standard library STD:: thread?
Why do we need software engineering -- looking at a simple project
Awk implements SQL like join operation
Analysis of kubernetes service types: from concept to practice
一文详解微服务架构
Business facade and business rule
Reflection on a case of bus card being stolen and swiped
Principles of websocket + probuf
How to choose a good company
洞察——风格注意力网络(SANet)在任意风格迁移中的应用
awk实现类sql的join操作
When tidb and Flink are combined: efficient and easy to use real-time data warehouse
手撕算法-手写单例模式
【解决方案】分布式定时任务解决方案
Vscode configuration
A detailed explanation of microservice architecture
Web安全(二)---跨域资源共享
Web API系列(三)统一异常处理
工作1-3年的程序员,应该具备怎么样的技术能力?该如何提升?
Adobe media encoder /Me 2021软件安装包(附安装教程)