Comme indiqué ci-dessous:
@Override public String getEmployEEBySup (String EmployeeId) {String str = ""; str = getEmployeeySupSelas (EmployeeId, Str); return str.substring (0, str.lastindexof (",")); } @Override public String getEmployEEEBySupSelas (String EmployeeId, String str) {str + = "'" + employeeId + "',"; System.out.println (STR); String sql = "SELECT U.EmployEEID dans TBL_SYSTEM_USER U où 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 = getEmployeeSupSuLas (list.get (i), str); }} return str; }Ce qui précède est le contenu complet du cas super pratique de Java Infinite Tree (Recursion) que l'éditeur. J'espère que tout le monde soutiendra Wulin.com plus ~