public String loadTree(String nodeID) { UserModel um = (UserModel) TreadLocalConstant.getSession().getAttribute(ICnsView.LOGIN_USERMODEL);
String deptId = um.getDeptId();
String sql = "SELECT CODE, NAME FROM US_APP.PROVINCE_DISTRICT T, US_APP.DEPTMENT_UNIT_REFER R WHERE T.CODE = R.AREA AND R.STATE_DEPT_CODE = '" + deptId + "'"; List<Object[]> list = genericDao.getDataWithNativeSql(sql);
StringBuffer bf = new StringBuffer();
for (int i = 0; i < list.size(); i++) { Object[] obj = (Object[]) list.get(i); bf.append("{id:'"+obj[0]+"',"); bf.append("text:'"+obj[1]+"'},"); }
String s = bf.toString();
if (s.length() > 0) { s = s.substring(0, s.length() - 1); }
return "[" + s + "]"; }
public String loadTreeNode(String nodeID) { String sql = "SELECT CODE, NAME FROM US_APP.PROVINCE_DISTRICT T WHERE PARENT_CODE = '" + nodeID + "'"; List<Object[]> list = genericDao.getDataWithNativeSql(sql);
StringBuffer bf = new StringBuffer();
for (int i = 0; i < list.size(); i++) { Object[] obj = (Object[]) list.get(i); bf.append("{id:'"+obj[0]+"',"); bf.append("text:'"+obj[1]+"'},"); }
String s = bf.toString();
if (s.length() > 0) { s = s.substring(0, s.length() - 1); }