紧接上一篇,将List<Menu>的扁平结构数据, 转换成树形结构的数据 返回给前端 , 废话不多说,开撸! --------------------- 步骤: 1. 建 Menu实体结构 public class Menu { /// <summary> /// ID /// </summary> public int ID { get; set; } /// <summary> /// 菜单名 /// </summary> publi
1.主要思想:根据已有数据,规则性的造数据 select * FROM(select lId,strName,lId as lParentId,-1 as orderIdx from tbClassify WHERE lParentId = 0 UNION ALL(select t1.* from tbClassify t1 join(select lId from tbClassify where lParentId=0 order by orderIdx) t2 ont1.lParentI
jsp代码 var rows =$('#findAllRolestable').datagrid('getSelections'); var result = JSON.stringify(rows); if(rows){ //去除两边的中括号 result=result.substring(1,result.length-1) //alert(result) $.ajax({ url: '<%=basePath%>user/addRoleAllRoles.do?user_no='+user_
1.一个表中根据以父子级别关系查询显示出来(如图) select t.* from department t CONNECT BY PRIOR t.depid=t.supdepid ; --这样也可以,但查出来的结果会有重复select t.* from department t start with supdepid=0 CONNECT BY PRIOR t.depid=t.supdepid ;--这样就不会了select t.* from department t start with