Java无限级树(递归)超实用案例
如下所示:
@Override
publicStringgetEmployeeBysup(StringemployeeID){
Stringstr="";
str=getEmployeeBysupSelas(employeeID,str);
returnstr.substring(0,str.lastIndexOf(","));
}
@Override
publicStringgetEmployeeBysupSelas(StringemployeeID,Stringstr){
str+="'"+employeeID+"',";
System.out.println(str);
Stringsql="SELECTu.employeeIDfromtbl_system_useruwheresupervisorID='"+employeeID+"'";
List<String>list=jdbcTemplate.queryForList(sql,String.class);
if(list!=null&&list.size()>0){
for(inti=0;i<list.size();i++){
str=getEmployeeBysupSelas(list.get(i),str);
}
}
returnstr;
}
以上就是小编为大家带来的Java无限级树(递归)超实用案例全部内容了,希望大家多多支持毛票票~
热门推荐
10 简短的几句新年祝福语
11 圣诞祝福语简短贺卡英文
12 高考加油祝福语简短押韵
13 对好友的祝福语简短
14 爱人出国祝福语简短英文
15 新年祝福语姨姨简短
16 辞职发给公司祝福语简短
17 男生的生日祝福语简短
18 结婚新娘妈妈祝福语简短