当前位置:网站首页>Get tree menu list
Get tree menu list
2020-11-07 21:03:00 【Maiyuweng】
Get tree menu list
/**
* Get area tree list
* @return
*/
public List<MapAreaTreeVo> getAreaTreeList(){
List<MapAreaTreeVo> arealist = areaDao.getAreaTreeList(0);
for(MapAreaTreeVo vo :arealist){
// Recursive loop acquisition
vo.setChildren(getAreaTreePidList(vo.getId()));
}
return arealist;
}
/**
* Get the tree list under the parent menu
* @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;
}
Entity class
public class MapAreaTreeVo {
private Integer id;
private Integer pid;
private String title;
private List<MapAreaTreeVo> children;
}
版权声明
本文为[Maiyuweng]所创,转载请带上原文链接,感谢
边栏推荐
- Insight -- the application of sanet in arbitrary style transfer
- On the coverage technology and best practice of go code
- Python image recognition OCR
- Improvement of maintenance mode of laravel8 update
- Practice of Xiaoxiong school development board: real equipment access of smart street lamp sandbox experiment
- The instanceof operator in ecmascript7 specification
- The emergence and significance of micro service
- [C + + learning notes] how about the simple use of the C + + standard library STD:: thread?
- 数据库基本操作
- 虚拟DOM中给同一层级的元素设置固定且唯一的key为什么能提高性能
猜你喜欢
websocket+probuf.原理篇
C language I blog assignment 03
状态压缩:对动态规划进行降维打击
统计文本中字母的频次(不区分大小写)
【原创】ARM平台内存和cache对xenomai实时性的影响
Go之发送钉钉和邮箱
WPF personal summary on drawing
On the coverage technology and best practice of go code
The emergence and significance of micro service
A detailed explanation of microservice architecture
随机推荐
Adobe Prelude /Pl 2020软件安装包(附安装教程)
Annual salary of 900000 programmers is not as good as 3800 civil servants a month? How to choose between stability and high income?
laravel8更新之维护模式改进
一万四千字分布式事务原理解析,全部掌握你还怕面试被问?
Web安全(二)---跨域资源共享
Design pattern of facade and mediator
Analysis of kubernetes service types: from concept to practice
WPF 关于绘图个人总结
Using subprocess residue in supervisor and python multiprocessing
Cpp(二) 创建Cpp工程
Python image recognition OCR
A compilation bug brought by vs2015 Update1 update [existing solutions]
C language I blog assignment 03
Git代码提交操作,以及git push提示failed to push some refs'XXX'
Delphi10's rest.json And system.json Step on the pit
Data transmission of asynchronous serial communication controlled by group bus communication
Summary of the resumption of a 618 promotion project
On the concurrency of update operation
Exploration and practice of growingio responsive programming
快速上手Git