Java无限级树(递归)超实用案例
程序员文章站
2024-03-12 11:04:26
如下所示:
@override
public string getemployeebysup(string employeeid) {
st...
如下所示:
@override public string getemployeebysup(string employeeid) { string str=""; str = getemployeebysupselas(employeeid, str); return str.substring(0, str.lastindexof(",")); } @override public string getemployeebysupselas(string employeeid, string str) { str+="'"+employeeid+"',"; system.out.println(str); string sql="select u.employeeid from tbl_system_user u where supervisorid='"+employeeid+"'"; list<string> list= jdbctemplate.queryforlist(sql, string.class); if(list!=null&&list.size()>0){ for(int i=0;i<list.size();i++){ str = getemployeebysupselas(list.get(i), str); } } return str; }
以上就是小编为大家带来的java无限级树(递归)超实用案例全部内容了,希望大家多多支持~
上一篇: 详解php实现页面静态化原理