@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;
}
这个是根据我个人的需求做的,当然代码的结构就是这样,可以根据自己的需求进行修改!!
如有疑问,欢迎来访交流群: 398918539