/**
*临时写的伪代码
*/
//获取第N级的所有节点
public list getTreeLeverNode(int lever)
rs0 = select id from menu where parentid is null; //先从数据库取出第一级的所有节点
if(lever<=1)
return rs0
//循环第一级的节点递归取下面的节点
for(int i=0; i<rs0.length; i++){
rslist = getNextNode(rs0[i],lever-1);
list.add(rslist);
}
return rs1;
}
public list getNextNode(int reqParentid,int lever){
rs2 = select id from menu where parentid = reqParentid;
lever = lever -1;
if(lever>0){
for(int i=0; i<rs2.length; i++){
rs2 = getNextNode(rs2[i],lever);
list.add(rs2);
}
}
return rs2;
}