当前位置:网站首页>获取树形菜单列表
获取树形菜单列表
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
边栏推荐
- 三步一坑五步一雷,高速成长下的技术团队怎么带?
- 如何应对事关业务生死的数据泄露和删改?
- Improvement of maintenance mode of laravel8 update
- 模型预测准确率高达94%!利用机器学习完美解决2000亿美元库存难题
- 动态规划——用二进制表示集合的状态压缩DP
- The prediction accuracy of the model is as high as 94%! Using machine learning to solve the 200 billion dollar inventory problem perfectly
- Awk implements SQL like join operation
- 洞察——风格注意力网络(SANet)在任意风格迁移中的应用
- Huawei HCIA notes
- 在pandas中使用pipe()提升代码可读性
猜你喜欢
Business Facade 与 Business Rule
Using thread communication to solve the problem of cache penetrating database avalanche
手撕算法-手写单例模式
[original] the influence of arm platform memory and cache on the real-time performance of xenomai
大数据算法——布隆过滤器
bgfx编译教程
深入web workers (上)
What magic things can a line of Python code do?
Reflection on a case of bus card being stolen and swiped
一万四千字分布式事务原理解析,全部掌握你还怕面试被问?
随机推荐
DOM节点操作
Don't treat exceptions as business logic, which you can't afford
快速上手Git
如何应对事关业务生死的数据泄露和删改?
某618大促项目的复盘总结
What do you think of the most controversial programming ideas?
Thinkphp6中where条件中字段与字段比较条件的写法
大数据算法——布隆过滤器
graph generation model
使用 Xunit.DependencyInjection 改造测试项目
Adobe Prelude /Pl 2020软件安装包(附安装教程)
Let's talk about the locks in the database
看一遍就理解,图解单链表反转
构造请求日志分析系统
Kylin on Kubernetes 在 eBay 的实践
深入web workers (上)
小熊派开发板实践:智慧路灯沙箱实验之真实设备接入
In the age of screen reading, we suffer from attention deficit syndrome
留给快手的时间不多了
Advanced concurrent programming series 9 (lock interface analysis)