- 浏览: 1120796 次
- 性别:
- 来自: 上海
文章分类
- 全部博客 (1055)
- quartz定时任务 (1)
- json (9)
- 接口 (1)
- http (1)
- sccket (2)
- xmlbean (1)
- webservice (1)
- flex (1)
- sitemesh (2)
- json组装 (2)
- 存储过程 (6)
- ajax后台返回前台上下问 (3)
- flect反射机制 (1)
- 页面列表 (1)
- oracal结果集合并 (1)
- lucene (1)
- 读取配置文件工具 (1)
- 框架整合 (1)
- jms (3)
- 断点续传 (1)
- 页面之间的传值 (1)
- jpa (6)
- sql (8)
- jsp跳转 (1)
- jsp (6)
- jquery (2)
- ui (1)
- js与jsp之间的值的交互应用 (1)
- js空值判断 (1)
- Ajax (9)
- web-inf 编译目录 (1)
- 多线程 (9)
- 资料 (0)
- oracal (4)
- 多线程webservice (1)
- ztree (1)
- 加载与内容的变化 (1)
- 页面的公用变量 (1)
- web-inf目录结构 (1)
- 登陆系列 (1)
- jass应用于webservice认证 (2)
- 路径问题 (1)
- list合并 (1)
- list map中的value获取 (2)
- 标签tag (4)
- 方法 (1)
- 树形数据及其渲染 (1)
- require js 回调 (1)
- tab 页面切换 (2)
- 计时获取验证码 (1)
- 模式 (6)
- easyui (3)
- dialog (2)
- 乱码问题 (1)
- spring (29)
- sqlserver (1)
- iis,netframework (0)
- iis (1)
- netframework (1)
- 处理乱码问题 (1)
- struts-ajax (0)
- ,理论,了;,; (0)
- 排错方法 (1)
- hibernate (1)
- 二级缓存 (1)
- portal (1)
- date类型 (0)
- jvm out of memery StackOverflowError (1)
- echart数据填充 (0)
- echart (1)
- jmv (1)
- 学习 (0)
- java基础 (1)
- oracle性能优化 (1)
- 数据库三范式 (1)
- easy UI (1)
- oracle11g (1)
- form (3)
- servlet (2)
- spring mvc (1)
- htm5 (0)
- ibatise (1)
- 序列化 (1)
- tomcat双认证 (1)
- maven Lib (1)
- tomcat eclipse (2)
- ehcache (1)
- http 代替 ajax (2)
- rest (6)
- script脚本占位模板 (1)
- strust 标签 el表达式 (1)
- js bo (1)
- 公司资料 (0)
- js return (1)
- spring 第三方插件的工具类 (1)
- linux (10)
- linux 克隆 (1)
- linux xshell连接 (1)
- yum expect (1)
- linux 应用命令 (1)
- yum 缓存rmp包 (1)
- yum 本地库离线安装 (2)
- yum错误 (1)
- jsp页面用定时调用 (1)
- ajax setup (2)
- Exception,RuntimeException (1)
- 对话框 dialog (1)
- maven (17)
- PropertyPlaceholderConfigurer properties文件 (1)
- 错误集 (1)
- mybatise (0)
- 拦截器filter (1)
- http get post 区别 (1)
- rest 客户端两种返回的数据处理方式 (1)
- listener (2)
- maven工程 (1)
- ContainerResponseFilter (1)
- ajax action 打印任意实体类jsp (1)
- yum svn mvn (1)
- 分页 (1)
- angularjs (1)
- memcached (1)
- git (12)
- yyyyyyyy (0)
- oracal安装 (4)
- jaxwswebservice (1)
- spring bean (1)
- 排方法 (0)
- java 生成pdf (2)
- 创建目录 (1)
- 下载与生产pdf文件 (1)
- base64 (2)
- 配置文件 (2)
- blob (1)
- pdf (1)
- yum linux 安装Oracle (1)
- excl 插入数据库 (1)
- 搭建框架 (1)
- .classpath和jdk jre (1)
- mybatise 配置文件通配 (1)
- 用Maven插件生成Mybatis代码 (2)
- springmvc值的传递 (1)
- js jsp html (1)
- ajax跨域 (1)
- javamail (0)
- 提交复杂格式json数据 (1)
- get中文乱码/post (1)
- 弹出框,承载弹出链接----页面,显示大图 (1)
- @RequestBody list bean (1)
- 隐藏域 (1)
- 多页保存 (1)
- form 校验 (1)
- 注册,上传图片 (1)
- 登录验证 (1)
- 全局的异常处理 (0)
- 异常捕获,显示在页面 (0)
- mybatise事物配置 (1)
- maven compile (1)
- 时间格式 (1)
- js 跳转页面 (1)
- pringsecurity 角色授资源要重启服务 (0)
- Retrofi restfull (1)
- session过期推出,直接点击退出,退出 (0)
- 参数放于requestbody (1)
- maven本地仓库jar包 (1)
- 编译环境出错jdk1.6 1,7 (1)
- jsonarray ---json数组格式 (1)
- java后台文件上传,接受的2种方式 (0)
- 生成保存图片 (1)
- 权限mysql数据库Md5加密sql (1)
- mysql一对多关联查询 (1)
- mysql批量更新 (0)
- oracle in exists 区别 (1)
- https (1)
- linux发布脚本 (1)
- dubbo zookeepr (1)
- request.getParameter() (1)
- request.setAttribute() (1)
- @RequestMapping @ResponseBody (1)
- @RequestMapping @responsebody src控件 后台如何写入src值 (1)
- dwz (8)
- lib jar maven (1)
- web服务访问名称 (1)
- mvc返回内容设置,拦截 (1)
- @ResponseBody 返回json处理 (1)
- 视图,函数,存储过程 (1)
- <context:annotation-config/> (1)
- <context:component-scan/> (1)
- xml路劲通配 (2)
- 杂项 (1)
- dubbo (34)
- redis (25)
- mybatis (34)
- springmvc (15)
- js (7)
- sprinvmvc (1)
- 设计理念 (1)
- 工程 (1)
- 其他 (149)
- 导出,下载 (1)
- session (4)
- token (1)
- Exception处理 (2)
- 注解 (2)
- 框架 (3)
- shrio (1)
- login (1)
- 项目结构设计 (1)
- mybatis两种关联查询 (1)
- mybaits (2)
- 迭代模式 (1)
- oralce树形数据结构构建 (2)
- 树形结构的jsp展现 (1)
- filter intecept(Struts) (1)
- 树形结构数据的提交 (1)
- @RequestBody @RequestParam (1)
- div (1)
- equals重写 (1)
- 程序设计 (1)
- f多层for循环跳出 (1)
- 看源码 (0)
- 权限系统普遍通性 (1)
- 设计程序 (1)
- 动态拼接元素样式问题 (1)
- sql迭代 (1)
- debug断点 (1)
- spring mvc 扫描注解(ioc (1)
- di) (1)
- jdk (2)
- cglib (1)
- mybatis 多层括号(超过三层)解析不了 (1)
- tiles (2)
- cacheManager缓存的切换 (1)
- jsp,xml中el表达式等占位符中的数据操作 (1)
- jpa 及spring data jpa开发 (1)
- compareTo equals toString (1)
- 子页面用父页面js (1)
- jsp相对路径自加问题 (1)
- bean之间的相互拷贝 (1)
- DECODE (2)
- 泛型 (2)
- NVL (1)
- jsp jstl函数 用标签声明页面变量,供jstl使用,时间格式问题 (1)
- form表单切换action值 (1)
- response.getWriter().write()功能优于springMvc的返回 (1)
- 快速复制构建项目 (1)
- activeMq (15)
- cache (2)
- sql获取序列号 (1)
- 上传 (2)
- tfs (1)
- jsp标签 (2)
- qita (1)
- 触发器 (1)
- Exception (1)
- mybais (1)
- 标签 (1)
- connect by (1)
- for ... in (1)
- map转化为list (1)
- 树形结构list构建(树形实体) (1)
- 左侧菜单的设计 (1)
- response.getWriter().write() (1)
- eclipse打断点之后断无效 (1)
- 直接访问/web-inf/下的页面 (1)
- clob (1)
- freemark (1)
- 框架的设计 (1)
- get方式处理乱码 (1)
- Request的getParameter和getAttribute方法的区别 (1)
- cas (9)
- 时间格式问题 (1)
- ResponseUtil.writeToResponse (1)
- 树形数据的反选 (1)
- spring data jpa (1)
- jsp异常提示 (1)
- jquery js (1)
- eclipse (1)
- 乱码 (1)
- Json OBJETC (1)
- PROCEDURE (1)
- pl/sql oracle (1)
- 设计 (1)
- el表达式 (3)
- iframe (1)
- map (1)
- jsp中调用Java (1)
- response.getWriter().write() ajax (1)
- mybatis xml 传入参数 (0)
- response与request在返回时作用区别 (1)
- spring cache (1)
- 模型驱动 (1)
- 关于mybatis传空值的处理 (1)
- 日志配置 (1)
- mapper (1)
- mapper mybatis (1)
- mapper mybatis-spring spring-data-jpa (1)
- js插件 (1)
- spring-data-jpa (2)
- 字节流转化过程 (1)
- 数据库 (11)
- jsp页面 (1)
- 局域网络访问问题 (1)
- plsql (2)
- response (1)
- plsq (1)
- Proxool (1)
- cas security (1)
- 系统配置化 (1)
- 集群 (4)
- springboot (24)
- 设计模式 (5)
- 通知 (1)
- 架构 (48)
- zookeeper (5)
- mvc框架 (1)
- 事物隔离策略 (1)
- jvm (8)
- 调研 (1)
- Java工具类 (1)
- 并发容器 (3)
- 多线程管理器 (4)
- 简历 (0)
- 查询 (1)
- 集群工具 (1)
- springMcv (1)
- ConcurrentHashMap (1)
- hashtable (1)
- cac (1)
- 树形结构 (1)
- 定时任务 (1)
- tortoiseGit (2)
- struts (11)
- shiro (31)
- log4j (3)
- struts2 (2)
- 编码 (1)
- request (3)
- Nginx (14)
- tomcat (1)
- idea (12)
- mvc (2)
- BeanUtils (2)
- image (1)
- mino (1)
- httpClient (1)
- volecity (1)
- swagger (3)
- 调错 (0)
- data (1)
- log (1)
- shell (1)
- 事物 (3)
- junit (1)
- RestTemplate (2)
- 线程 (0)
- Exception异常处理 (1)
- Exception异常注解 (1)
- lock (1)
- HashMap (1)
- 面试 (0)
- rabbitMq (1)
- rainCat (1)
- 其它 (1)
- activemq消息传送机制以及ACK机制详解 (0)
- mysql (7)
- fildder (1)
- UML (1)
- 校验 (1)
- 反射 (1)
- 切面 (1)
- springioc (1)
- urule2 (0)
- skywalking (1)
- urule (2)
- docker (2)
- 前端 (1)
- bootstrap (1)
- eureka (2)
- springcloud (16)
- jenkins (2)
- springsecurity (1)
- 数据结构 (4)
- gradle (1)
- mycat (3)
- nacos (1)
- canary (1)
- 线程池 (1)
- solr (1)
- resteasy (2)
- BI (1)
- dfs (2)
- elasticsearch (1)
- ruby (1)
- logstash (1)
- clickhouse (2)
- davinci (15)
- java (1)
- davinvi (1)
- fastdfs (1)
- vue (1)
- 《将博客搬至CSDN》 (1)
最新评论
-
nizhipeng123:
private SessionFactory sessio ...
用map接收参数的几个注意的问题
//用对象是方式组装
//json组装(只要符合控件要求的格式即可,可以比控件要求的字段多)
//树形控件要树形json,其他控件,其他格式json都可以通过实体方式构建
样品:[
{ id:1,name:"上海市", open:true,
children: [
{ id:11,name:"徐汇",children: [{ id:111,name:"建国"},{ id:112,name:"沪闵"},{ id:113,name:"陇南"}]
},
{ id:12,name:"市中",
children: [{ id:121,name:"昌平"},{ id:122,name:"永寿"},{ id:123,name:"尚文"},{ id:124,name:"卢湾"}
]
}
]
}
]
用多了字段的实体:也可以用,结构一样下,字段可多,不可少。
[{"busip":"","id":1,"name":"徐汇","children":[{"busip":"","id":10,"name":"建国","children":[{"busip":"10.1.240.2","id":47,"name":"建国本地1","children":[],"mask":"","type":"3"},{"busip":"10.1.240.5","id":48,"name":"建国本地2","children":[],"mask":"","type":"3"},{"busip":"10.1.240.11","id":49,"name":"枫林街道站","children":[],"mask":"","type":"3"},{"busip":"10.1.240.12","id":50,"name":"汇闲居街道站","children":[],"mask":"","type":"3"},{"busip":"10.1.240.13","id":51,"name":"天平街道站","children":[],"mask":"","type":"3"},{"busip":"10.1.240.15","id":52,"name":"瑞嘉街道站","children":[],"mask":"","type":"3"},{"busip":"10.1.240.16","id":53,"name":"莱诗邸街道站","children":[],"mask":"","type":"3"},{"busip":"10.1.240.17","id":54,"name":"徐虹街道站","children":[],"mask":"","type":"3"},{"busip":"10.1.240.18","id":55,"name":"永嘉街道站","children":[],"mask":"","type":"3"},{"busip":"10.1.240.20","id":56,"name":"徐镇街道站","children":[],"mask":"","type":"3"},{"busip":"10.1.240.21","id":57,"name":"天平街道站2","children":[],"mask":"","type":"3"}],"mask":"10.1.240","type":"2"},{"busip":"","id":11,"name":"沪闵","children":[{"busip":"","id":58,"name":"沪闵本地","children":[],"mask":"","type":"3"},{"busip":"","id":59,"name":"漕河泾街道站","children":[],"mask":"","type":"3"},{"busip":"","id":60,"name":"田林街道站","children":[],"mask":"","type":"3"},{"busip":"","id":61,"name":"虹梅街道站","children":[],"mask":"","type":"3"},{"busip":"","id":62,"name":"康健街道站","children":[],"mask":"","type":"3"},{"busip":"","id":63,"name":"南宁街道站","children":[],"mask":"","type":"3"}],"mask":"10.2.240","type":"2"},{"busip":"","id":12,"name":"陇南","children":[{"busip":"","id":64,"name":"陇南本地","children":[],"mask":"","type":"3"},{"busip":"","id":65,"name":"凌云街道站","children":[],"mask":"","type":"3"},{"busip":"","id":66,"name":"长桥街道站","children":[],"mask":"","type":"3"},{"busip":"","id":67,"name":"龙华街道站","children":[],"mask":"","type":"3"},{"busip":"","id":68,"name":"中海瀛台街道站","children":[],"mask":"","type":"3"},{"busip":"","id":69,"name":"华泾街道站","children":[],"mask":"","type":"3"}],"mask":"10.4.240","type":"2"}],"mask":"","type":"1"},{"busip":"","id":2,"name":"虹口","children":[{"busip":"","id":13,"name":"广灵","children":[{"busip":"","id":70,"name":"广灵本地","children":[],"mask":"","type":"3"},{"busip":"","id":71,"name":"复城街道站","children":[],"mask":"","type":"3"},{"busip":"","id":72,"name":"乍浦街道站","children":[],"mask":"","type":"3"},{"busip":"","id":73,"name":"广中街道站","children":[],"mask":"","type":"3"},{"busip":"","id":74,"name":"欧阳街道站","children":[],"mask":"","type":"3"},{"busip":"","id":75,"name":"提篮桥街道站","children":[],"mask":"","type":"3"},{"busip":"","id":76,"name":"嘉兴街道站","children":[],"mask":"","type":"3"},{"busip":"","id":77,"name":"凉城街道站","children":[],"mask":"","type":"3"},{"busip":"","id":78,"name":"新港街道站","children":[],"mask":"","type":"3"},{"busip":"","id":79,"name":"曲阳街道站","children":[],"mask":"","type":"3"}],"mask":"10.14.240","type":"2"},{"busip":"","id":14,"name":"北外滩","children":[{"busip":"","id":80,"name":"北外滩本地","children":[],"mask":"","type":"3"}],"mask":"10.12.240","type":"2"}],"mask":"","type":"1"},{"busip":"","id":3,"name":"市中","children":[{"busip":"","id":15,"name":"昌平","children":[{"busip":"","id":81,"name":"昌平本地","children":[],"mask":"","type":"3"},{"busip":"","id":82,"name":"华山街道站","children":[],"mask":"","type":"3"},{"busip":"","id":83,"name":"宁街道站","children":[],"mask":"","type":"3"},{"busip":"","id":84,"name":"康定街道站","children":[],"mask":"","type":"3"},{"busip":"","id":85,"name":"石二街道站","children":[],"mask":"","type":"3"},{"busip":"","id":86,"name":"威海街道站","children":[],"mask":"","type":"3"},{"busip":"","id":87,"name":"延中街道站","children":[],"mask":"","type":"3"},{"busip":"","id":88,"name":"愚园街道站","children":[],"mask":"","type":"3"},{"busip":"","id":89,"name":"万航街道站","children":[],"mask":"","type":"3"},{"busip":"","id":90,"name":"广电街道站","children":[],"mask":"","type":"3"}],"mask":"10.10.240","type":"2"},{"busip":"","id":16,"name":"永寿","children":[{"busip":"","id":91,"name":"永寿本地","children":[],"mask":"","type":"3"},{"busip":"","id":92,"name":"金陵街道站","children":[],"mask":"","type":"3"},{"busip":"","id":93,"name":"金色家园街道站","children":[],"mask":"","type":"3"},{"busip":"","id":94,"name":"金色家园街道站2","children":[],"mask":"","type":"3"},{"busip":"","id":95,"name":"外滩街道站","children":[],"mask":"","type":"3"},{"busip":"","id":96,"name":"外滩街道站2","children":[],"mask":"","type":"3"},{"busip":"","id":97,"name":"市政府200号1","children":[],"mask":"","type":"3"},{"busip":"","id":98,"name":"市政府200号2","children":[],"mask":"","type":"3"}],"mask":"10.21.240","type":"2"},{"busip":"","id":17,"name":"尚文","children":[{"busip":"","id":99,"name":"南市本地","children":[],"mask":"","type":"3"},{"busip":"","id":100,"name":"半凇园街道站","children":[],"mask":"","type":"3"},{"busip":"","id":101,"name":"陈家桥街道站","children":[],"mask":"","type":"3"},{"busip":"","id":102,"name":"小东门街道站","children":[],"mask":"","type":"3"},{"busip":"","id":103,"name":"豫园街道站","children":[],"mask":"","type":"3"},{"busip":"","id":104,"name":"唐家湾街道站","children":[],"mask":"","type":"3"}],"mask":"10.22.240","type":"2"},{"busip":"","id":18,"name":"卢湾","children":[{"busip":"","id":105,"name":"卢湾本地","children":[],"mask":"","type":"3"},{"busip":"","id":106,"name":"打浦街道站","children":[],"mask":"","type":"3"},{"busip":"","id":107,"name":"皋兰街道站","children":[],"mask":"","type":"3"},{"busip":"","id":108,"name":"汇龙街道站","children":[],"mask":"","type":"3"},{"busip":"","id":109,"name":"马当街道站","children":[],"mask":"","type":"3"},{"busip":"","id":110,"name":"瑞金街道站","children":[],"mask":"","type":"3"},{"busip":"","id":111,"name":"五里街道站","children":[],"mask":"","type":"3"}],"mask":"10.23.240","type":"2"}],"mask":"","type":"1"},{"busip":"","id":4,"name":"杨浦","children":[{"busip":"","id":19,"name":"开鲁","children":[{"busip":"","id":112,"name":"开鲁本地","children":[],"mask":"","type":"3"},{"busip":"","id":113,"name":"工农三村街道站","children":[],"mask":"","type":"3"},{"busip":"","id":114,"name":"五角场镇(老)街道站","children":[],"mask":"","type":"3"},{"busip":"","id":115,"name":"五角场镇(新)街道站","children":[],"mask":"","type":"3"},{"busip":"","id":116,"name":"国和一村街道站","children":[],"mask":"","type":"3"},{"busip":"","id":117,"name":"五角场(老)街道站","children":[],"mask":"","type":"3"},{"busip":"","id":118,"name":"五角场(新)街道站","children":[],"mask":"","type":"3"},{"busip":"","id":119,"name":"新 湾城街道站","children":[],"mask":"","type":"3"},{"busip":"","id":120,"name":"东方国际水产中心街道站","children":[],"mask":"","type":"3"}],"mask":"10.15.240","type":"2"},{"busip":"","id":20,"name":"黄兴","children":[{"busip":"","id":121,"name":"黄兴本地","children":[],"mask":"","type":"3"},{"busip":"","id":122,"name":"延吉街道站","children":[],"mask":"","type":"3"},{"busip":"","id":123,"name":"长白街道站","children":[],"mask":"","type":"3"},{"busip":"","id":124,"name":"控 街道站","children":[],"mask":"","type":"3"},{"busip":"","id":125,"name":"四平街道站","children":[],"mask":"","type":"3"},{"busip":"","id":126,"name":" 浦街道站","children":[],"mask":"","type":"3"},{"busip":"","id":127,"name":"平凉街道站","children":[],"mask":"","type":"3"},{"busip":"","id":128,"name":"定海街道站","children":[],"mask":"","type":"3"}],"mask":"10.16.240","type":"2"}],"mask":"","type":"1"},{"busip":"","id":5,"name":"普陀","children":[{"busip":"","id":21,"name":"桂巷","children":[{"busip":"","id":129,"name":"桂巷本地","children":[],"mask":"","type":"3"},{"busip":"","id":130,"name":"白玉街道站","children":[],"mask":"","type":"3"},{"busip":"","id":131,"name":"真如街道站","children":[],"mask":"","type":"3"},{"busip":"","id":132,"name":"长风街道站","children":[],"mask":"","type":"3"},{"busip":"","id":133,"name":"曹杨街道站","children":[],"mask":"","type":"3"},{"busip":"","id":134,"name":"长征街道站","children":[],"mask":"","type":"3"},{"busip":"","id":135,"name":"桃浦街道站","children":[],"mask":"","type":"3"},{"busip":"","id":136,"name":"真光街道站","children":[],"mask":"","type":"3"},{"busip":"","id":137,"name":"星河世纪街道站","children":[],"mask":"","type":"3"}],"mask":"10.8.240","type":"2"},{"busip":"","id":22,"name":"中北","children":[{"busip":"","id":138,"name":"中北本地","children":[],"mask":"","type":"3"},{"busip":"","id":139,"name":"长寿街道站","children":[],"mask":"","type":"3"},{"busip":"","id":140,"name":"石泉街道站","children":[],"mask":"","type":"3"},{"busip":"","id":141,"name":"宜川街道站","children":[],"mask":"","type":"3"},{"busip":"","id":142,"name":"甘泉街道站","children":[],"mask":"","type":"3"},{"busip":"","id":143,"name":"捷城国际街道站","children":[],"mask":"","type":"3"}],"mask":"10.9.240","type":"2"},{"busip":"","id":23,"name":"靖边","children":[],"mask":"10.11.240","type":"2"}],"mask":"","type":"1"},{"busip":"","id":6,"name":"浦东","children":[{"busip":"","id":24,"name":"浦南","children":[{"busip":"","id":144,"name":"浦南本地","children":[],"mask":"","type":"3"},{"busip":"","id":145,"name":"东园街道站","children":[],"mask":"","type":"3"},{"busip":"","id":146,"name":"潍坊街道站","children":[],"mask":"","type":"3"},{"busip":"","id":147,"name":"塘桥街道站","children":[],"mask":"","type":"3"}],"mask":"10.19.240","type":"2"},{"busip":"","id":25,"name":"崮山","children":[{"busip":"","id":148,"name":"崮山本地","children":[],"mask":"","type":"3"},{"busip":"","id":149,"name":"龙威名邸街道站","children":[],"mask":"","type":"3"},{"busip":"","id":150,"name":"洋泾街道站","children":[],"mask":"","type":"3"},{"busip":"","id":151,"name":"梅园街道站","children":[],"mask":"","type":"3"},{"busip":"","id":152,"name":"沪东街道站","children":[],"mask":"","type":"3"}],"mask":"10.20.240","type":"2"},{"busip":"","id":26,"name":"上南","children":[{"busip":"","id":153,"name":"上南本地","children":[],"mask":"","type":"3"},{"busip":"","id":154,"name":"南码头街道站","children":[],"mask":"","type":"3"},{"busip":"","id":155,"name":"周家渡街道站","children":[],"mask":"","type":"3"},{"busip":"","id":156,"name":"上钢街道站","children":[],"mask":"","type":"3"},{"busip":"","id":157,"name":"世博中心街道站","children":[],"mask":"","type":"3"},{"busip":"","id":158,"name":"两会_世博用户交换机","children":[],"mask":"","type":"3"},{"busip":"","id":159,"name":"两会_南码头用户交换机","children":[],"mask":"","type":"3"}],"mask":"10.24.240","type":"2"}],"mask":"","type":"1"},{"busip":"","id":7,"name":"闸北","children":[{"busip":"","id":27,"name":"南山","children":[{"busip":"","id":160,"name":"南山本地","children":[],"mask":"","type":"3"},{"busip":"","id":161,"name":"宝山街道站","children":[],"mask":"","type":"3"},{"busip":"","id":162,"name":"大宁街道站","children":[],"mask":"","type":"3"},{"busip":"","id":163,"name":"天目西街道站","children":[],"mask":"","type":"3"},{"busip":"","id":164,"name":"共和新街道站","children":[],"mask":"","type":"3"},{"busip":"","id":165,"name":"虬 街道站","children":[],"mask":"","type":"3"},{"busip":"","id":167,"name":"芷西街道站","children":[],"mask":"","type":"3"},{"busip":"","id":168,"name":"中兴街道站","children":[],"mask":"","type":"3"},{"busip":"","id":169,"name":"北站街道站","children":[],"mask":"","type":"3"},{"busip":"","id":170,"name":"青云街道站","children":[],"mask":"","type":"3"},{"busip":"","id":171,"name":"西藏北街道站","children":[],"mask":"","type":"3"}],"mask":"10.13.240","type":"2"},{"busip":"","id":28,"name":"闻喜","children":[{"busip":"","id":172,"name":"闻喜本地","children":[],"mask":"","type":"3"},{"busip":"","id":173,"name":"彭浦镇街道站","children":[],"mask":"","type":"3"},{"busip":"","id":174,"name":"临汾街道站","children":[],"mask":"","type":"3"},{"busip":"","id":175,"name":"彭浦新村街道站","children":[],"mask":"","type":"3"}],"mask":"10.17.240","type":"2"}],"mask":"","type":"1"},{"busip":"","id":8,"name":"长宁","children":[{"busip":"","id":29,"name":"水城","children":[{"busip":"","id":176,"name":"水城本地","children":[],"mask":"","type":"3"},{"busip":"","id":177,"name":"仙霞街道站","children":[],"mask":"","type":"3"},{"busip":"","id":178,"name":"新世纪地下车库街道站","children":[],"mask":"","type":"3"},{"busip":"","id":179,"name":"天山街道站","children":[],"mask":"","type":"3"}],"mask":"10.3.240","type":"2"},{"busip":"","id":30,"name":"定西","children":[{"busip":"","id":180,"name":"定西本地","children":[],"mask":"","type":"3"},{"busip":"","id":181,"name":"虹桥街道站","children":[],"mask":"","type":"3"},{"busip":"","id":182,"name":"新华街道站","children":[],"mask":"","type":"3"},{"busip":"","id":183,"name":" 苏街道站","children":[],"mask":"","type":"3"},{"busip":"","id":184,"name":"华阳街道站","children":[],"mask":"","type":"3"}],"mask":"10.7.240","type":"2"},{"busip":"","id":31,"name":"临空","children":[{"busip":"","id":185,"name":"临空本地","children":[],"mask":"","type":"3"},{"busip":"","id":186,"name":"北新泾街道站","children":[],"mask":"","type":"3"},{"busip":"","id":187,"name":"新泾镇街道站","children":[],"mask":"","type":"3"},{"busip":"","id":188,"name":"程桥街道站","children":[],"mask":"","type":"3"},{"busip":"","id":189,"name":"虹桥机场街道站","children":[],"mask":"","type":"3"}],"mask":"10.5.240","type":"2"}],"mask":"","type":"1"},{"busip":"","id":9,"name":"郊县","children":[{"busip":"","id":32,"name":"奉贤","children":[{"busip":"","id":190,"name":"奉贤本地","children":[],"mask":"","type":"3"},{"busip":"","id":191,"name":"海湾街道站","children":[],"mask":"","type":"3"},{"busip":"","id":192,"name":"洪庙街道站","children":[],"mask":"","type":"3"},{"busip":"","id":193,"name":"邬桥街道站","children":[],"mask":"","type":"3"},{"busip":"","id":194,"name":"肖塘街道站","children":[],"mask":"","type":"3"},{"busip":"","id":195,"name":"庄行街道站","children":[],"mask":"","type":"3"},{"busip":"","id":196,"name":"玫瑰园街道站","children":[],"mask":"","type":"3"}],"mask":"10.32.240","type":"2"},{"busip":"","id":33,"name":"金山","children":[{"busip":"","id":197,"name":"金山本地","children":[],"mask":"","type":"3"},{"busip":"","id":198,"name":"兴塔街道站","children":[],"mask":"","type":"3"},{"busip":"","id":199,"name":"亭林街道站","children":[],"mask":"","type":"3"},{"busip":"","id":200,"name":"金山卫街道站","children":[],"mask":"","type":"3"},{"busip":"","id":201,"name":"枫泾街道站","children":[],"mask":"","type":"3"},{"busip":"","id":202,"name":"石化街道站","children":[],"mask":"","type":"3"},{"busip":"","id":203,"name":"化工区街道站","children":[],"mask":"","type":"3"},{"busip":"","id":204,"name":"新城区街道站","children":[],"mask":"","type":"3"},{"busip":"","id":205,"name":"吕巷街道站","children":[],"mask":"","type":"3"}],"mask":"10.33.240","type":"2"},{"busip":"","id":34,"name":"闵行","children":[{"busip":"","id":206,"name":"闵行本地","children":[],"mask":"","type":"3"},{"busip":"","id":207,"name":"古美街道站","children":[],"mask":"","type":"3"},{"busip":"","id":208,"name":"龙柏街道站","children":[],"mask":"","type":"3"},{"busip":"","id":209,"name":"诸翟街道站","children":[],"mask":"","type":"3"},{"busip":"","id":210,"name":" 川街道站","children":[],"mask":"","type":"3"},{"busip":"","id":211,"name":"七宝街道站","children":[],"mask":"","type":"3"},{"busip":"","id":212,"name":"虹桥街道站","children":[],"mask":"","type":"3"},{"busip":"","id":213,"name":"颛桥街道站","children":[],"mask":"","type":"3"},{"busip":"","id":214,"name":"吴泾街道站","children":[],"mask":"","type":"3"},{"busip":"","id":215,"name":"曹行街道站","children":[],"mask":"","type":"3"},{"busip":"","id":216,"name":"杜行街道站","children":[],"mask":"","type":"3"},{"busip":"","id":217,"name":"鲁汇街道站","children":[],"mask":"","type":"3"},{"busip":"","id":218,"name":"马桥街道站","children":[],"mask":"","type":"3"},{"busip":"","id":219,"name":"陈行街道站","children":[],"mask":"","type":"3"},{"busip":"","id":220,"name":"新曹行街道站","children":[],"mask":"","type":"3"}],"mask":"10.36.240","type":"2"},{"busip":"","id":35,"name":"松 ","children":[{"busip":"","id":221,"name":"松 本地","children":[],"mask":"","type":"3"},{"busip":"","id":222,"name":"佘山街道站","children":[],"mask":"","type":"3"},{"busip":"","id":223,"name":"图书馆街道站","children":[],"mask":"","type":"3"},{"busip":"","id":224,"name":"九亭街道站","children":[],"mask":"","type":"3"},{"busip":"","id":225,"name":"叶榭街道站","children":[],"mask":"","type":"3"},{"busip":"","id":226,"name":"泗泾镇街道站","children":[],"mask":"","type":"3"},{"busip":"","id":227,"name":"石湖荡街道站","children":[],"mask":"","type":"3"},{"busip":"","id":228,"name":"车墩镇街道站","children":[],"mask":"","type":"3"}],"mask":"10.34.240","type":"2"},{"busip":"","id":36,"name":"青浦","children":[{"busip":"","id":229,"name":"青浦本地","children":[],"mask":"","type":"3"},{"busip":"","id":230,"name":"金泽街道站","children":[],"mask":"","type":"3"},{"busip":"","id":231,"name":"赵屯街道站","children":[],"mask":"","type":"3"},{"busip":"","id":232,"name":"朱家角街道站","children":[],"mask":"","type":"3"},{"busip":"","id":233,"name":"练塘街道站","children":[],"mask":"","type":"3"},{"busip":"","id":234,"name":"徐泾街道站","children":[],"mask":"","type":"3"},{"busip":"","id":235,"name":"赵巷街道站","children":[],"mask":"","type":"3"},{"busip":"","id":236,"name":"大盈街道站","children":[],"mask":"","type":"3"},{"busip":"","id":237,"name":"西岑街道站","children":[],"mask":"","type":"3"},{"busip":"","id":238,"name":"商塌街道站","children":[],"mask":"","type":"3"},{"busip":"","id":239,"name":"白鹤街道站","children":[],"mask":"","type":"3"}],"mask":"10.35.240","type":"2"},{"busip":"","id":37,"name":"嘉定","children":[{"busip":"","id":240,"name":"嘉定本地","children":[],"mask":"","type":"3"},{"busip":"","id":241,"name":"南翔街道站","children":[],"mask":"","type":"3"},{"busip":"","id":242,"name":"安亭街道站","children":[],"mask":"","type":"3"},{"busip":"","id":243,"name":"外冈街道站","children":[],"mask":"","type":"3"},{"busip":"","id":244,"name":" 桥街道站","children":[],"mask":"","type":"3"},{"busip":"","id":245,"name":"黄渡街道站","children":[],"mask":"","type":"3"},{"busip":"","id":246,"name":"娄塘街道站","children":[],"mask":"","type":"3"},{"busip":"","id":247,"name":"朱桥街道站","children":[],"mask":"","type":"3"},{"busip":"","id":248,"name":"菊园街道站","children":[],"mask":"","type":"3"}],"mask":"10.37.240","type":"2"},{"busip":"","id":38,"name":"宝山","children":[{"busip":"","id":249,"name":"宝山本地","children":[],"mask":"","type":"3"},{"busip":"","id":250,"name":"泗溏街道站","children":[],"mask":"","type":"3"},{"busip":"","id":251,"name":"顾村街道站","children":[],"mask":"","type":"3"},{"busip":"","id":252,"name":"罗店街道站","children":[],"mask":"","type":"3"},{"busip":"","id":253,"name":"罗泾街道站","children":[],"mask":"","type":"3"},{"busip":"","id":254,"name":"大场街道站","children":[],"mask":"","type":"3"},{"busip":"","id":255,"name":"盛桥街道站","children":[],"mask":"","type":"3"},{"busip":"","id":256,"name":"杨行街道站","children":[],"mask":"","type":"3"}],"mask":"10.39.240","type":"2"},{"busip":"","id":39,"name":"南汇","children":[{"busip":"","id":257,"name":"南汇本地","children":[],"mask":"","type":"3"},{"busip":"","id":258,"name":"航头街道站","children":[],"mask":"","type":"3"},{"busip":"","id":259,"name":"横沔街道站","children":[],"mask":"","type":"3"},{"busip":"","id":260,"name":"书院街道站","children":[],"mask":"","type":"3"},{"busip":"","id":261,"name":"新场街道站","children":[],"mask":"","type":"3"},{"busip":"","id":262,"name":"周浦街道站","children":[],"mask":"","type":"3"},{"busip":"","id":263,"name":"泥城街道站","children":[],"mask":"","type":"3"}],"mask":"10.42.240","type":"2"},{"busip":"","id":40,"name":"崇明","children":[{"busip":"","id":264,"name":"崇明本地","children":[],"mask":"","type":"3"},{"busip":"","id":265,"name":"新河街道站","children":[],"mask":"","type":"3"},{"busip":"","id":266,"name":"堡镇街道站","children":[],"mask":"","type":"3"},{"busip":"","id":267,"name":"庙镇街道站","children":[],"mask":"","type":"3"},{"busip":"","id":268,"name":"绿华街道站","children":[],"mask":"","type":"3"},{"busip":"","id":269,"name":"港沿街道站","children":[],"mask":"","type":"3"},{"busip":"","id":270,"name":"前哨街道站","children":[],"mask":"","type":"3"},{"busip":"","id":271,"name":"五效街道站","children":[],"mask":"","type":"3"},{"busip":"","id":272,"name":"陈家镇街道站","children":[],"mask":"","type":"3"},{"busip":"","id":273,"name":"长兴街道站","children":[],"mask":"","type":"3"}],"mask":"10.44.240","type":"2"},{"busip":"","id":41,"name":"临港","children":[{"busip":"","id":274,"name":"临港本地","children":[],"mask":"","type":"3"}],"mask":"10.45.240","type":"2"},{"busip":"","id":42,"name":"张 ","children":[{"busip":"","id":275,"name":"张 本地","children":[],"mask":"","type":"3"}],"mask":"10.41.240","type":"2"},{"busip":"","id":43,"name":"花木","children":[{"busip":"","id":276,"name":"花木本地","children":[],"mask":"","type":"3"},{"busip":"","id":277,"name":"北蔡街道站","children":[],"mask":"","type":"3"},{"busip":"","id":278,"name":"张 镇街道站","children":[],"mask":"","type":"3"}],"mask":"10.29.240","type":"2"},{"busip":"","id":44,"name":"高行","children":[{"busip":"","id":279,"name":"高行本地","children":[],"mask":"","type":"3"},{"busip":"","id":280,"name":"高东街道站","children":[],"mask":"","type":"3"},{"busip":"","id":281,"name":"高桥街道站","children":[],"mask":"","type":"3"},{"busip":"","id":282,"name":"外高桥街道站","children":[],"mask":"","type":"3"}],"mask":"10.46.240","type":"2"},{"busip":"","id":45,"name":"三林","children":[{"busip":"","id":283,"name":"三林本地","children":[],"mask":"","type":"3"},{"busip":"","id":284,"name":"云莲街道站","children":[],"mask":"","type":"3"}],"mask":"10.47.240","type":"2"},{"busip":"","id":46,"name":"唐镇","children":[{"busip":"","id":285,"name":"唐镇本地","children":[],"mask":"","type":"3"},{"busip":"","id":286,"name":"浦东机场街道站","children":[],"mask":"","type":"3"},{"busip":"","id":287,"name":"曹路街道站","children":[],"mask":"","type":"3"},{"busip":"","id":288,"name":"浦东机场镇街道站","children":[],"mask":"","type":"3"}],"mask":"10.48.240","type":"2"}],"mask":"","type":"1"}]
实体类用了个内部类:
/**
*
*/
package com.ces.zwww.entity;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import com.ces.xarch.core.entity.LongIDEntity;
@Entity
@Table(name = "T_B_AREA")
public class Area extends LongIDEntity {
/** serialVersionUID(long):. */
private static final long serialVersionUID = -5967350210592855795L;
private String name;
private String mask;
private String remark;
private String address;
@Column(name="business_ip")
private String businessIp;
@Column(name="source_type")
private String sourceType;
@Column(name="parent_name")
private String parentName;
@Column(name="parent_id")
private Long parentId;
@Column(name="start_ip")
private String startIp;
@Column(name="end_ip")
private String endIp;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getMask() {
return mask;
}
public void setMask(String mask) {
this.mask = mask;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getBusinessIp() {
return businessIp;
}
public void setBusinessIp(String businessIp) {
this.businessIp = businessIp;
}
public String getSourceType() {
return sourceType;
}
public void setSourceType(String sourceType) {
this.sourceType = sourceType;
}
public String getParentName() {
return parentName;
}
public void setParentName(String parentName) {
this.parentName = parentName;
}
public Long getParentId() {
return parentId;
}
public void setParentId(Long parentId) {
this.parentId = parentId;
}
public String getStartIp() {
return startIp;
}
public void setStartIp(String startIp) {
this.startIp = startIp;
}
public String getEndIp() {
return endIp;
}
public void setEndIp(String endIp) {
this.endIp = endIp;
}
public class Tree {
private Long id;
private String name;
private String type;
private String mask;
private String busip;
private List<Tree> children;
public Tree(){
}
public Tree(Long id, String name, String type, String mask, String busip){
this.id = id;
this.name = name;
this.type = type;
this.mask = mask;
this.busip = busip;
this.children = new ArrayList<Area.Tree>();
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getMask() {
return mask;
}
public void setMask(String mask) {
this.mask = mask;
}
public String getBusip() {
return busip;
}
public void setBusip(String busip) {
this.busip = busip;
}
public List<Area.Tree> getChildren() {
return children;
}
public void setChildren(List<Area.Tree> children) {
this.children = children;
}
public void addChildren(Area.Tree tree) {
children.add(tree);
}
}
}
//用sql将查询结果树形化
select * from t_b_area t start with t.source_type = 1 connect by t.parent_id = prior t.id
//树形化之后用这个实体组装:
public List<Area.Tree> findByTree(){
List<Area.Tree> trees = new ArrayList<Area.Tree>();
List<Area> results = getDao().findByTree();
for (Area area : results) {
Area.Tree node = null;
if("1".equals(area.getSourceType())){
//内部类的应用方法
node = area.new Tree(area.getId(), area.getName(), area.getSourceType(), area.getMask(), area.getBusinessIp());
trees.add(node);
}else if("2".equals(area.getSourceType())){
node = getTreeNode(trees);
node.addChildren(area.new Tree(area.getId(), area.getName(), area.getSourceType(), area.getMask(), area.getBusinessIp()));
}else if("3".equals(area.getSourceType())){
node = getTreeNode(getTreeNode(trees).getChildren());
node.addChildren(area.new Tree(area.getId(), area.getName(), area.getSourceType(), area.getMask(), area.getBusinessIp()));
}
}
return trees;
}
//返回前台就是符合格式的树形json
public Object treeJs() throws FatalException {
Object result = getService().findByTreeAddSh();
this.setReturnData(result);
System.out.println(JsonUtil.objectToJsonStr(result));
return SUCCESS;
}
//此树形json放入树形结构的控件即可被数别,前面的树形控件也一样
<td style="width: 100px;padding-top: 10px;" align="right">
<label>告警区域:</label>
</td>
<td >
<cui:combotree id="area" name="area" width="160" multiple="true" cascadeCheck="true" url="${ctx}/area!treeJs.json"></cui:combotree>
</td>
//json组装(只要符合控件要求的格式即可,可以比控件要求的字段多)
//树形控件要树形json,其他控件,其他格式json都可以通过实体方式构建
样品:[
{ id:1,name:"上海市", open:true,
children: [
{ id:11,name:"徐汇",children: [{ id:111,name:"建国"},{ id:112,name:"沪闵"},{ id:113,name:"陇南"}]
},
{ id:12,name:"市中",
children: [{ id:121,name:"昌平"},{ id:122,name:"永寿"},{ id:123,name:"尚文"},{ id:124,name:"卢湾"}
]
}
]
}
]
用多了字段的实体:也可以用,结构一样下,字段可多,不可少。
[{"busip":"","id":1,"name":"徐汇","children":[{"busip":"","id":10,"name":"建国","children":[{"busip":"10.1.240.2","id":47,"name":"建国本地1","children":[],"mask":"","type":"3"},{"busip":"10.1.240.5","id":48,"name":"建国本地2","children":[],"mask":"","type":"3"},{"busip":"10.1.240.11","id":49,"name":"枫林街道站","children":[],"mask":"","type":"3"},{"busip":"10.1.240.12","id":50,"name":"汇闲居街道站","children":[],"mask":"","type":"3"},{"busip":"10.1.240.13","id":51,"name":"天平街道站","children":[],"mask":"","type":"3"},{"busip":"10.1.240.15","id":52,"name":"瑞嘉街道站","children":[],"mask":"","type":"3"},{"busip":"10.1.240.16","id":53,"name":"莱诗邸街道站","children":[],"mask":"","type":"3"},{"busip":"10.1.240.17","id":54,"name":"徐虹街道站","children":[],"mask":"","type":"3"},{"busip":"10.1.240.18","id":55,"name":"永嘉街道站","children":[],"mask":"","type":"3"},{"busip":"10.1.240.20","id":56,"name":"徐镇街道站","children":[],"mask":"","type":"3"},{"busip":"10.1.240.21","id":57,"name":"天平街道站2","children":[],"mask":"","type":"3"}],"mask":"10.1.240","type":"2"},{"busip":"","id":11,"name":"沪闵","children":[{"busip":"","id":58,"name":"沪闵本地","children":[],"mask":"","type":"3"},{"busip":"","id":59,"name":"漕河泾街道站","children":[],"mask":"","type":"3"},{"busip":"","id":60,"name":"田林街道站","children":[],"mask":"","type":"3"},{"busip":"","id":61,"name":"虹梅街道站","children":[],"mask":"","type":"3"},{"busip":"","id":62,"name":"康健街道站","children":[],"mask":"","type":"3"},{"busip":"","id":63,"name":"南宁街道站","children":[],"mask":"","type":"3"}],"mask":"10.2.240","type":"2"},{"busip":"","id":12,"name":"陇南","children":[{"busip":"","id":64,"name":"陇南本地","children":[],"mask":"","type":"3"},{"busip":"","id":65,"name":"凌云街道站","children":[],"mask":"","type":"3"},{"busip":"","id":66,"name":"长桥街道站","children":[],"mask":"","type":"3"},{"busip":"","id":67,"name":"龙华街道站","children":[],"mask":"","type":"3"},{"busip":"","id":68,"name":"中海瀛台街道站","children":[],"mask":"","type":"3"},{"busip":"","id":69,"name":"华泾街道站","children":[],"mask":"","type":"3"}],"mask":"10.4.240","type":"2"}],"mask":"","type":"1"},{"busip":"","id":2,"name":"虹口","children":[{"busip":"","id":13,"name":"广灵","children":[{"busip":"","id":70,"name":"广灵本地","children":[],"mask":"","type":"3"},{"busip":"","id":71,"name":"复城街道站","children":[],"mask":"","type":"3"},{"busip":"","id":72,"name":"乍浦街道站","children":[],"mask":"","type":"3"},{"busip":"","id":73,"name":"广中街道站","children":[],"mask":"","type":"3"},{"busip":"","id":74,"name":"欧阳街道站","children":[],"mask":"","type":"3"},{"busip":"","id":75,"name":"提篮桥街道站","children":[],"mask":"","type":"3"},{"busip":"","id":76,"name":"嘉兴街道站","children":[],"mask":"","type":"3"},{"busip":"","id":77,"name":"凉城街道站","children":[],"mask":"","type":"3"},{"busip":"","id":78,"name":"新港街道站","children":[],"mask":"","type":"3"},{"busip":"","id":79,"name":"曲阳街道站","children":[],"mask":"","type":"3"}],"mask":"10.14.240","type":"2"},{"busip":"","id":14,"name":"北外滩","children":[{"busip":"","id":80,"name":"北外滩本地","children":[],"mask":"","type":"3"}],"mask":"10.12.240","type":"2"}],"mask":"","type":"1"},{"busip":"","id":3,"name":"市中","children":[{"busip":"","id":15,"name":"昌平","children":[{"busip":"","id":81,"name":"昌平本地","children":[],"mask":"","type":"3"},{"busip":"","id":82,"name":"华山街道站","children":[],"mask":"","type":"3"},{"busip":"","id":83,"name":"宁街道站","children":[],"mask":"","type":"3"},{"busip":"","id":84,"name":"康定街道站","children":[],"mask":"","type":"3"},{"busip":"","id":85,"name":"石二街道站","children":[],"mask":"","type":"3"},{"busip":"","id":86,"name":"威海街道站","children":[],"mask":"","type":"3"},{"busip":"","id":87,"name":"延中街道站","children":[],"mask":"","type":"3"},{"busip":"","id":88,"name":"愚园街道站","children":[],"mask":"","type":"3"},{"busip":"","id":89,"name":"万航街道站","children":[],"mask":"","type":"3"},{"busip":"","id":90,"name":"广电街道站","children":[],"mask":"","type":"3"}],"mask":"10.10.240","type":"2"},{"busip":"","id":16,"name":"永寿","children":[{"busip":"","id":91,"name":"永寿本地","children":[],"mask":"","type":"3"},{"busip":"","id":92,"name":"金陵街道站","children":[],"mask":"","type":"3"},{"busip":"","id":93,"name":"金色家园街道站","children":[],"mask":"","type":"3"},{"busip":"","id":94,"name":"金色家园街道站2","children":[],"mask":"","type":"3"},{"busip":"","id":95,"name":"外滩街道站","children":[],"mask":"","type":"3"},{"busip":"","id":96,"name":"外滩街道站2","children":[],"mask":"","type":"3"},{"busip":"","id":97,"name":"市政府200号1","children":[],"mask":"","type":"3"},{"busip":"","id":98,"name":"市政府200号2","children":[],"mask":"","type":"3"}],"mask":"10.21.240","type":"2"},{"busip":"","id":17,"name":"尚文","children":[{"busip":"","id":99,"name":"南市本地","children":[],"mask":"","type":"3"},{"busip":"","id":100,"name":"半凇园街道站","children":[],"mask":"","type":"3"},{"busip":"","id":101,"name":"陈家桥街道站","children":[],"mask":"","type":"3"},{"busip":"","id":102,"name":"小东门街道站","children":[],"mask":"","type":"3"},{"busip":"","id":103,"name":"豫园街道站","children":[],"mask":"","type":"3"},{"busip":"","id":104,"name":"唐家湾街道站","children":[],"mask":"","type":"3"}],"mask":"10.22.240","type":"2"},{"busip":"","id":18,"name":"卢湾","children":[{"busip":"","id":105,"name":"卢湾本地","children":[],"mask":"","type":"3"},{"busip":"","id":106,"name":"打浦街道站","children":[],"mask":"","type":"3"},{"busip":"","id":107,"name":"皋兰街道站","children":[],"mask":"","type":"3"},{"busip":"","id":108,"name":"汇龙街道站","children":[],"mask":"","type":"3"},{"busip":"","id":109,"name":"马当街道站","children":[],"mask":"","type":"3"},{"busip":"","id":110,"name":"瑞金街道站","children":[],"mask":"","type":"3"},{"busip":"","id":111,"name":"五里街道站","children":[],"mask":"","type":"3"}],"mask":"10.23.240","type":"2"}],"mask":"","type":"1"},{"busip":"","id":4,"name":"杨浦","children":[{"busip":"","id":19,"name":"开鲁","children":[{"busip":"","id":112,"name":"开鲁本地","children":[],"mask":"","type":"3"},{"busip":"","id":113,"name":"工农三村街道站","children":[],"mask":"","type":"3"},{"busip":"","id":114,"name":"五角场镇(老)街道站","children":[],"mask":"","type":"3"},{"busip":"","id":115,"name":"五角场镇(新)街道站","children":[],"mask":"","type":"3"},{"busip":"","id":116,"name":"国和一村街道站","children":[],"mask":"","type":"3"},{"busip":"","id":117,"name":"五角场(老)街道站","children":[],"mask":"","type":"3"},{"busip":"","id":118,"name":"五角场(新)街道站","children":[],"mask":"","type":"3"},{"busip":"","id":119,"name":"新 湾城街道站","children":[],"mask":"","type":"3"},{"busip":"","id":120,"name":"东方国际水产中心街道站","children":[],"mask":"","type":"3"}],"mask":"10.15.240","type":"2"},{"busip":"","id":20,"name":"黄兴","children":[{"busip":"","id":121,"name":"黄兴本地","children":[],"mask":"","type":"3"},{"busip":"","id":122,"name":"延吉街道站","children":[],"mask":"","type":"3"},{"busip":"","id":123,"name":"长白街道站","children":[],"mask":"","type":"3"},{"busip":"","id":124,"name":"控 街道站","children":[],"mask":"","type":"3"},{"busip":"","id":125,"name":"四平街道站","children":[],"mask":"","type":"3"},{"busip":"","id":126,"name":" 浦街道站","children":[],"mask":"","type":"3"},{"busip":"","id":127,"name":"平凉街道站","children":[],"mask":"","type":"3"},{"busip":"","id":128,"name":"定海街道站","children":[],"mask":"","type":"3"}],"mask":"10.16.240","type":"2"}],"mask":"","type":"1"},{"busip":"","id":5,"name":"普陀","children":[{"busip":"","id":21,"name":"桂巷","children":[{"busip":"","id":129,"name":"桂巷本地","children":[],"mask":"","type":"3"},{"busip":"","id":130,"name":"白玉街道站","children":[],"mask":"","type":"3"},{"busip":"","id":131,"name":"真如街道站","children":[],"mask":"","type":"3"},{"busip":"","id":132,"name":"长风街道站","children":[],"mask":"","type":"3"},{"busip":"","id":133,"name":"曹杨街道站","children":[],"mask":"","type":"3"},{"busip":"","id":134,"name":"长征街道站","children":[],"mask":"","type":"3"},{"busip":"","id":135,"name":"桃浦街道站","children":[],"mask":"","type":"3"},{"busip":"","id":136,"name":"真光街道站","children":[],"mask":"","type":"3"},{"busip":"","id":137,"name":"星河世纪街道站","children":[],"mask":"","type":"3"}],"mask":"10.8.240","type":"2"},{"busip":"","id":22,"name":"中北","children":[{"busip":"","id":138,"name":"中北本地","children":[],"mask":"","type":"3"},{"busip":"","id":139,"name":"长寿街道站","children":[],"mask":"","type":"3"},{"busip":"","id":140,"name":"石泉街道站","children":[],"mask":"","type":"3"},{"busip":"","id":141,"name":"宜川街道站","children":[],"mask":"","type":"3"},{"busip":"","id":142,"name":"甘泉街道站","children":[],"mask":"","type":"3"},{"busip":"","id":143,"name":"捷城国际街道站","children":[],"mask":"","type":"3"}],"mask":"10.9.240","type":"2"},{"busip":"","id":23,"name":"靖边","children":[],"mask":"10.11.240","type":"2"}],"mask":"","type":"1"},{"busip":"","id":6,"name":"浦东","children":[{"busip":"","id":24,"name":"浦南","children":[{"busip":"","id":144,"name":"浦南本地","children":[],"mask":"","type":"3"},{"busip":"","id":145,"name":"东园街道站","children":[],"mask":"","type":"3"},{"busip":"","id":146,"name":"潍坊街道站","children":[],"mask":"","type":"3"},{"busip":"","id":147,"name":"塘桥街道站","children":[],"mask":"","type":"3"}],"mask":"10.19.240","type":"2"},{"busip":"","id":25,"name":"崮山","children":[{"busip":"","id":148,"name":"崮山本地","children":[],"mask":"","type":"3"},{"busip":"","id":149,"name":"龙威名邸街道站","children":[],"mask":"","type":"3"},{"busip":"","id":150,"name":"洋泾街道站","children":[],"mask":"","type":"3"},{"busip":"","id":151,"name":"梅园街道站","children":[],"mask":"","type":"3"},{"busip":"","id":152,"name":"沪东街道站","children":[],"mask":"","type":"3"}],"mask":"10.20.240","type":"2"},{"busip":"","id":26,"name":"上南","children":[{"busip":"","id":153,"name":"上南本地","children":[],"mask":"","type":"3"},{"busip":"","id":154,"name":"南码头街道站","children":[],"mask":"","type":"3"},{"busip":"","id":155,"name":"周家渡街道站","children":[],"mask":"","type":"3"},{"busip":"","id":156,"name":"上钢街道站","children":[],"mask":"","type":"3"},{"busip":"","id":157,"name":"世博中心街道站","children":[],"mask":"","type":"3"},{"busip":"","id":158,"name":"两会_世博用户交换机","children":[],"mask":"","type":"3"},{"busip":"","id":159,"name":"两会_南码头用户交换机","children":[],"mask":"","type":"3"}],"mask":"10.24.240","type":"2"}],"mask":"","type":"1"},{"busip":"","id":7,"name":"闸北","children":[{"busip":"","id":27,"name":"南山","children":[{"busip":"","id":160,"name":"南山本地","children":[],"mask":"","type":"3"},{"busip":"","id":161,"name":"宝山街道站","children":[],"mask":"","type":"3"},{"busip":"","id":162,"name":"大宁街道站","children":[],"mask":"","type":"3"},{"busip":"","id":163,"name":"天目西街道站","children":[],"mask":"","type":"3"},{"busip":"","id":164,"name":"共和新街道站","children":[],"mask":"","type":"3"},{"busip":"","id":165,"name":"虬 街道站","children":[],"mask":"","type":"3"},{"busip":"","id":167,"name":"芷西街道站","children":[],"mask":"","type":"3"},{"busip":"","id":168,"name":"中兴街道站","children":[],"mask":"","type":"3"},{"busip":"","id":169,"name":"北站街道站","children":[],"mask":"","type":"3"},{"busip":"","id":170,"name":"青云街道站","children":[],"mask":"","type":"3"},{"busip":"","id":171,"name":"西藏北街道站","children":[],"mask":"","type":"3"}],"mask":"10.13.240","type":"2"},{"busip":"","id":28,"name":"闻喜","children":[{"busip":"","id":172,"name":"闻喜本地","children":[],"mask":"","type":"3"},{"busip":"","id":173,"name":"彭浦镇街道站","children":[],"mask":"","type":"3"},{"busip":"","id":174,"name":"临汾街道站","children":[],"mask":"","type":"3"},{"busip":"","id":175,"name":"彭浦新村街道站","children":[],"mask":"","type":"3"}],"mask":"10.17.240","type":"2"}],"mask":"","type":"1"},{"busip":"","id":8,"name":"长宁","children":[{"busip":"","id":29,"name":"水城","children":[{"busip":"","id":176,"name":"水城本地","children":[],"mask":"","type":"3"},{"busip":"","id":177,"name":"仙霞街道站","children":[],"mask":"","type":"3"},{"busip":"","id":178,"name":"新世纪地下车库街道站","children":[],"mask":"","type":"3"},{"busip":"","id":179,"name":"天山街道站","children":[],"mask":"","type":"3"}],"mask":"10.3.240","type":"2"},{"busip":"","id":30,"name":"定西","children":[{"busip":"","id":180,"name":"定西本地","children":[],"mask":"","type":"3"},{"busip":"","id":181,"name":"虹桥街道站","children":[],"mask":"","type":"3"},{"busip":"","id":182,"name":"新华街道站","children":[],"mask":"","type":"3"},{"busip":"","id":183,"name":" 苏街道站","children":[],"mask":"","type":"3"},{"busip":"","id":184,"name":"华阳街道站","children":[],"mask":"","type":"3"}],"mask":"10.7.240","type":"2"},{"busip":"","id":31,"name":"临空","children":[{"busip":"","id":185,"name":"临空本地","children":[],"mask":"","type":"3"},{"busip":"","id":186,"name":"北新泾街道站","children":[],"mask":"","type":"3"},{"busip":"","id":187,"name":"新泾镇街道站","children":[],"mask":"","type":"3"},{"busip":"","id":188,"name":"程桥街道站","children":[],"mask":"","type":"3"},{"busip":"","id":189,"name":"虹桥机场街道站","children":[],"mask":"","type":"3"}],"mask":"10.5.240","type":"2"}],"mask":"","type":"1"},{"busip":"","id":9,"name":"郊县","children":[{"busip":"","id":32,"name":"奉贤","children":[{"busip":"","id":190,"name":"奉贤本地","children":[],"mask":"","type":"3"},{"busip":"","id":191,"name":"海湾街道站","children":[],"mask":"","type":"3"},{"busip":"","id":192,"name":"洪庙街道站","children":[],"mask":"","type":"3"},{"busip":"","id":193,"name":"邬桥街道站","children":[],"mask":"","type":"3"},{"busip":"","id":194,"name":"肖塘街道站","children":[],"mask":"","type":"3"},{"busip":"","id":195,"name":"庄行街道站","children":[],"mask":"","type":"3"},{"busip":"","id":196,"name":"玫瑰园街道站","children":[],"mask":"","type":"3"}],"mask":"10.32.240","type":"2"},{"busip":"","id":33,"name":"金山","children":[{"busip":"","id":197,"name":"金山本地","children":[],"mask":"","type":"3"},{"busip":"","id":198,"name":"兴塔街道站","children":[],"mask":"","type":"3"},{"busip":"","id":199,"name":"亭林街道站","children":[],"mask":"","type":"3"},{"busip":"","id":200,"name":"金山卫街道站","children":[],"mask":"","type":"3"},{"busip":"","id":201,"name":"枫泾街道站","children":[],"mask":"","type":"3"},{"busip":"","id":202,"name":"石化街道站","children":[],"mask":"","type":"3"},{"busip":"","id":203,"name":"化工区街道站","children":[],"mask":"","type":"3"},{"busip":"","id":204,"name":"新城区街道站","children":[],"mask":"","type":"3"},{"busip":"","id":205,"name":"吕巷街道站","children":[],"mask":"","type":"3"}],"mask":"10.33.240","type":"2"},{"busip":"","id":34,"name":"闵行","children":[{"busip":"","id":206,"name":"闵行本地","children":[],"mask":"","type":"3"},{"busip":"","id":207,"name":"古美街道站","children":[],"mask":"","type":"3"},{"busip":"","id":208,"name":"龙柏街道站","children":[],"mask":"","type":"3"},{"busip":"","id":209,"name":"诸翟街道站","children":[],"mask":"","type":"3"},{"busip":"","id":210,"name":" 川街道站","children":[],"mask":"","type":"3"},{"busip":"","id":211,"name":"七宝街道站","children":[],"mask":"","type":"3"},{"busip":"","id":212,"name":"虹桥街道站","children":[],"mask":"","type":"3"},{"busip":"","id":213,"name":"颛桥街道站","children":[],"mask":"","type":"3"},{"busip":"","id":214,"name":"吴泾街道站","children":[],"mask":"","type":"3"},{"busip":"","id":215,"name":"曹行街道站","children":[],"mask":"","type":"3"},{"busip":"","id":216,"name":"杜行街道站","children":[],"mask":"","type":"3"},{"busip":"","id":217,"name":"鲁汇街道站","children":[],"mask":"","type":"3"},{"busip":"","id":218,"name":"马桥街道站","children":[],"mask":"","type":"3"},{"busip":"","id":219,"name":"陈行街道站","children":[],"mask":"","type":"3"},{"busip":"","id":220,"name":"新曹行街道站","children":[],"mask":"","type":"3"}],"mask":"10.36.240","type":"2"},{"busip":"","id":35,"name":"松 ","children":[{"busip":"","id":221,"name":"松 本地","children":[],"mask":"","type":"3"},{"busip":"","id":222,"name":"佘山街道站","children":[],"mask":"","type":"3"},{"busip":"","id":223,"name":"图书馆街道站","children":[],"mask":"","type":"3"},{"busip":"","id":224,"name":"九亭街道站","children":[],"mask":"","type":"3"},{"busip":"","id":225,"name":"叶榭街道站","children":[],"mask":"","type":"3"},{"busip":"","id":226,"name":"泗泾镇街道站","children":[],"mask":"","type":"3"},{"busip":"","id":227,"name":"石湖荡街道站","children":[],"mask":"","type":"3"},{"busip":"","id":228,"name":"车墩镇街道站","children":[],"mask":"","type":"3"}],"mask":"10.34.240","type":"2"},{"busip":"","id":36,"name":"青浦","children":[{"busip":"","id":229,"name":"青浦本地","children":[],"mask":"","type":"3"},{"busip":"","id":230,"name":"金泽街道站","children":[],"mask":"","type":"3"},{"busip":"","id":231,"name":"赵屯街道站","children":[],"mask":"","type":"3"},{"busip":"","id":232,"name":"朱家角街道站","children":[],"mask":"","type":"3"},{"busip":"","id":233,"name":"练塘街道站","children":[],"mask":"","type":"3"},{"busip":"","id":234,"name":"徐泾街道站","children":[],"mask":"","type":"3"},{"busip":"","id":235,"name":"赵巷街道站","children":[],"mask":"","type":"3"},{"busip":"","id":236,"name":"大盈街道站","children":[],"mask":"","type":"3"},{"busip":"","id":237,"name":"西岑街道站","children":[],"mask":"","type":"3"},{"busip":"","id":238,"name":"商塌街道站","children":[],"mask":"","type":"3"},{"busip":"","id":239,"name":"白鹤街道站","children":[],"mask":"","type":"3"}],"mask":"10.35.240","type":"2"},{"busip":"","id":37,"name":"嘉定","children":[{"busip":"","id":240,"name":"嘉定本地","children":[],"mask":"","type":"3"},{"busip":"","id":241,"name":"南翔街道站","children":[],"mask":"","type":"3"},{"busip":"","id":242,"name":"安亭街道站","children":[],"mask":"","type":"3"},{"busip":"","id":243,"name":"外冈街道站","children":[],"mask":"","type":"3"},{"busip":"","id":244,"name":" 桥街道站","children":[],"mask":"","type":"3"},{"busip":"","id":245,"name":"黄渡街道站","children":[],"mask":"","type":"3"},{"busip":"","id":246,"name":"娄塘街道站","children":[],"mask":"","type":"3"},{"busip":"","id":247,"name":"朱桥街道站","children":[],"mask":"","type":"3"},{"busip":"","id":248,"name":"菊园街道站","children":[],"mask":"","type":"3"}],"mask":"10.37.240","type":"2"},{"busip":"","id":38,"name":"宝山","children":[{"busip":"","id":249,"name":"宝山本地","children":[],"mask":"","type":"3"},{"busip":"","id":250,"name":"泗溏街道站","children":[],"mask":"","type":"3"},{"busip":"","id":251,"name":"顾村街道站","children":[],"mask":"","type":"3"},{"busip":"","id":252,"name":"罗店街道站","children":[],"mask":"","type":"3"},{"busip":"","id":253,"name":"罗泾街道站","children":[],"mask":"","type":"3"},{"busip":"","id":254,"name":"大场街道站","children":[],"mask":"","type":"3"},{"busip":"","id":255,"name":"盛桥街道站","children":[],"mask":"","type":"3"},{"busip":"","id":256,"name":"杨行街道站","children":[],"mask":"","type":"3"}],"mask":"10.39.240","type":"2"},{"busip":"","id":39,"name":"南汇","children":[{"busip":"","id":257,"name":"南汇本地","children":[],"mask":"","type":"3"},{"busip":"","id":258,"name":"航头街道站","children":[],"mask":"","type":"3"},{"busip":"","id":259,"name":"横沔街道站","children":[],"mask":"","type":"3"},{"busip":"","id":260,"name":"书院街道站","children":[],"mask":"","type":"3"},{"busip":"","id":261,"name":"新场街道站","children":[],"mask":"","type":"3"},{"busip":"","id":262,"name":"周浦街道站","children":[],"mask":"","type":"3"},{"busip":"","id":263,"name":"泥城街道站","children":[],"mask":"","type":"3"}],"mask":"10.42.240","type":"2"},{"busip":"","id":40,"name":"崇明","children":[{"busip":"","id":264,"name":"崇明本地","children":[],"mask":"","type":"3"},{"busip":"","id":265,"name":"新河街道站","children":[],"mask":"","type":"3"},{"busip":"","id":266,"name":"堡镇街道站","children":[],"mask":"","type":"3"},{"busip":"","id":267,"name":"庙镇街道站","children":[],"mask":"","type":"3"},{"busip":"","id":268,"name":"绿华街道站","children":[],"mask":"","type":"3"},{"busip":"","id":269,"name":"港沿街道站","children":[],"mask":"","type":"3"},{"busip":"","id":270,"name":"前哨街道站","children":[],"mask":"","type":"3"},{"busip":"","id":271,"name":"五效街道站","children":[],"mask":"","type":"3"},{"busip":"","id":272,"name":"陈家镇街道站","children":[],"mask":"","type":"3"},{"busip":"","id":273,"name":"长兴街道站","children":[],"mask":"","type":"3"}],"mask":"10.44.240","type":"2"},{"busip":"","id":41,"name":"临港","children":[{"busip":"","id":274,"name":"临港本地","children":[],"mask":"","type":"3"}],"mask":"10.45.240","type":"2"},{"busip":"","id":42,"name":"张 ","children":[{"busip":"","id":275,"name":"张 本地","children":[],"mask":"","type":"3"}],"mask":"10.41.240","type":"2"},{"busip":"","id":43,"name":"花木","children":[{"busip":"","id":276,"name":"花木本地","children":[],"mask":"","type":"3"},{"busip":"","id":277,"name":"北蔡街道站","children":[],"mask":"","type":"3"},{"busip":"","id":278,"name":"张 镇街道站","children":[],"mask":"","type":"3"}],"mask":"10.29.240","type":"2"},{"busip":"","id":44,"name":"高行","children":[{"busip":"","id":279,"name":"高行本地","children":[],"mask":"","type":"3"},{"busip":"","id":280,"name":"高东街道站","children":[],"mask":"","type":"3"},{"busip":"","id":281,"name":"高桥街道站","children":[],"mask":"","type":"3"},{"busip":"","id":282,"name":"外高桥街道站","children":[],"mask":"","type":"3"}],"mask":"10.46.240","type":"2"},{"busip":"","id":45,"name":"三林","children":[{"busip":"","id":283,"name":"三林本地","children":[],"mask":"","type":"3"},{"busip":"","id":284,"name":"云莲街道站","children":[],"mask":"","type":"3"}],"mask":"10.47.240","type":"2"},{"busip":"","id":46,"name":"唐镇","children":[{"busip":"","id":285,"name":"唐镇本地","children":[],"mask":"","type":"3"},{"busip":"","id":286,"name":"浦东机场街道站","children":[],"mask":"","type":"3"},{"busip":"","id":287,"name":"曹路街道站","children":[],"mask":"","type":"3"},{"busip":"","id":288,"name":"浦东机场镇街道站","children":[],"mask":"","type":"3"}],"mask":"10.48.240","type":"2"}],"mask":"","type":"1"}]
实体类用了个内部类:
/**
*
*/
package com.ces.zwww.entity;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import com.ces.xarch.core.entity.LongIDEntity;
@Entity
@Table(name = "T_B_AREA")
public class Area extends LongIDEntity {
/** serialVersionUID(long):. */
private static final long serialVersionUID = -5967350210592855795L;
private String name;
private String mask;
private String remark;
private String address;
@Column(name="business_ip")
private String businessIp;
@Column(name="source_type")
private String sourceType;
@Column(name="parent_name")
private String parentName;
@Column(name="parent_id")
private Long parentId;
@Column(name="start_ip")
private String startIp;
@Column(name="end_ip")
private String endIp;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getMask() {
return mask;
}
public void setMask(String mask) {
this.mask = mask;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getBusinessIp() {
return businessIp;
}
public void setBusinessIp(String businessIp) {
this.businessIp = businessIp;
}
public String getSourceType() {
return sourceType;
}
public void setSourceType(String sourceType) {
this.sourceType = sourceType;
}
public String getParentName() {
return parentName;
}
public void setParentName(String parentName) {
this.parentName = parentName;
}
public Long getParentId() {
return parentId;
}
public void setParentId(Long parentId) {
this.parentId = parentId;
}
public String getStartIp() {
return startIp;
}
public void setStartIp(String startIp) {
this.startIp = startIp;
}
public String getEndIp() {
return endIp;
}
public void setEndIp(String endIp) {
this.endIp = endIp;
}
public class Tree {
private Long id;
private String name;
private String type;
private String mask;
private String busip;
private List<Tree> children;
public Tree(){
}
public Tree(Long id, String name, String type, String mask, String busip){
this.id = id;
this.name = name;
this.type = type;
this.mask = mask;
this.busip = busip;
this.children = new ArrayList<Area.Tree>();
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getMask() {
return mask;
}
public void setMask(String mask) {
this.mask = mask;
}
public String getBusip() {
return busip;
}
public void setBusip(String busip) {
this.busip = busip;
}
public List<Area.Tree> getChildren() {
return children;
}
public void setChildren(List<Area.Tree> children) {
this.children = children;
}
public void addChildren(Area.Tree tree) {
children.add(tree);
}
}
}
//用sql将查询结果树形化
select * from t_b_area t start with t.source_type = 1 connect by t.parent_id = prior t.id
//树形化之后用这个实体组装:
public List<Area.Tree> findByTree(){
List<Area.Tree> trees = new ArrayList<Area.Tree>();
List<Area> results = getDao().findByTree();
for (Area area : results) {
Area.Tree node = null;
if("1".equals(area.getSourceType())){
//内部类的应用方法
node = area.new Tree(area.getId(), area.getName(), area.getSourceType(), area.getMask(), area.getBusinessIp());
trees.add(node);
}else if("2".equals(area.getSourceType())){
node = getTreeNode(trees);
node.addChildren(area.new Tree(area.getId(), area.getName(), area.getSourceType(), area.getMask(), area.getBusinessIp()));
}else if("3".equals(area.getSourceType())){
node = getTreeNode(getTreeNode(trees).getChildren());
node.addChildren(area.new Tree(area.getId(), area.getName(), area.getSourceType(), area.getMask(), area.getBusinessIp()));
}
}
return trees;
}
//返回前台就是符合格式的树形json
public Object treeJs() throws FatalException {
Object result = getService().findByTreeAddSh();
this.setReturnData(result);
System.out.println(JsonUtil.objectToJsonStr(result));
return SUCCESS;
}
//此树形json放入树形结构的控件即可被数别,前面的树形控件也一样
<td style="width: 100px;padding-top: 10px;" align="right">
<label>告警区域:</label>
</td>
<td >
<cui:combotree id="area" name="area" width="160" multiple="true" cascadeCheck="true" url="${ctx}/area!treeJs.json"></cui:combotree>
</td>
相关推荐
本文将深入探讨如何在Delphi中使用JSON控件以及相关的实例应用。 首先,我们要了解在Delphi中处理JSON的主要库:Indy的TIdJSON和System.JSON中的TJSONParser和TJSONObject等组件。这两个库提供了解析、生成和操作...
JSON(JavaScript Object Notation)是一种轻量级的数据交换格式,被广泛用于Web应用程序之间传递数据。它基于JavaScript的一个子集,具有易于人阅读和编写,同时也易于机器解析和生成的特点。JSON格式通常由键值对...
在IT行业中,MFC(Microsoft Foundation Classes)是一个由微软...总的来说,通过将json11库集成到MFC项目中,你可以轻松地实现JSON数据的解析和序列化,这对于与Web服务交互或处理本地存储的JSON格式数据非常有用。
症状:后台返回给页面的数据是Json格式的,其中的日期字段,在后台是“2012-11-10 12:18:00”这样的格式,json序列化后返回到前台页面就被转换成一个像 /Date(1419264000000)/ 的格式,导致easyUI无法解析这个字段。
【Ajax自动填充和字段验证器控件】是Web开发中的一种技术实现,主要涉及Ajax、数据交换格式和数据模型的设计。Ajax(Asynchronous JavaScript and XML)允许网页在不重新加载整个页面的情况下与服务器交换数据并更新...
综上所述,.NET日期控件的使用涵盖了日期的格式化、事件处理、数据库交互等多个方面,理解并熟练运用这些知识点能够帮助开发者构建功能完善的日期选择功能。通过不断实践和学习,你可以更高效地处理日期相关的任务。
对于xtree,可能还需要熟悉JSON格式,因为树的数据通常以JSON形式传递。在实际项目中,可以将这两者与后端框架(如jQuery、AngularJS、React等)结合,实现更复杂的功能。 总的来说,jscalendar和xtree是JavaScript...
在Web开发中,动态生成表单页面是一种常见的需求,特别是在数据驱动的...通过查看源码,你可以更深入地了解如何将JSON数据与动态生成的表单页面相结合,这将有助于提升你在JavaScript开发中处理表单输入控件的能力。
JSON(JavaScript Object Notation)是一种轻量级的数据交换格式,常用于Web服务和应用程序之间的数据传输,因为它易于阅读和编写,同时也易于机器解析和生成。SQL Server是一个强大的关系型数据库管理系统,广泛...
在Vue.js框架中,Element UI库提供了一套丰富的UI组件,其中包括Tree树形控件。这个控件在数据展示和管理中非常常见,比如组织结构、文件目录等场景。本项目是一个基于Vue和Element UI的工程,专注于演示如何在Tree...
而"jquery时间控件时分秒"是jQuery的一个扩展插件,用于创建用户友好的时间选择器,帮助用户方便地输入或选择时间,通常用于表单中的时间输入字段。这种控件在许多场合都非常实用,比如预订系统、日程安排或时间跟踪...
这可以是SQL数据库、XML文件、Web服务或其他任何能返回JSON或XML格式数据的源。在ASP.NET中,可以通过使用SqlDataSource、XmlDataSource或WebServiceDataSource等控件来指定数据源。 2. 提供者:控件需要一个...
这里我们主要关注的是"微信开发日期控件",它通常用于提高用户体验,让用户能方便地设定预约时间、创建日程或者填写表单中的日期相关字段。 微信并没有直接提供内置的日期控件,但开发者可以借助第三方库来实现这一...
网上看了一些转的方法都有漏洞下面直接上代码
1. 构建 JSON 数据源:树形控件需要将数据库中的层次数据转换成 JSON 格式的字符串,以便在客户端动态生成树形结构。 2. Ext JS 框架:这是一种富客户端开发框架,其 TreePanel 组件常用于实现树形视图,支持 ...
在IT行业中,ZTree是一款广泛使用的JavaScript树形控件,尤其在数据展示和管理界面中。这个场景中提到的“Ztree后台拼接Json”主要指的是如何在服务器端(后台)处理并组合JSON数据,以便于ZTree前端组件能够正确...
4. **分页和布局管理**:为了适应不同的输出需求,报表控件会提供分页功能,确保长报表可以适当地分布在多页上。同时,布局管理功能允许调整各元素的相对位置,以适应不同的打印和屏幕显示环境。 5. **图表集成**:...
在本项目中,我们看到这个控件被用来显示日程事件,通过结合jQuery、AJAX以及JSON技术,实现了动态地获取和更新日程信息。下面我们将详细探讨这些知识点。 1. **ASP.NET Calendar控件** ASP.NET Calendar控件是一...
JavaScript树形控件,如JQuery、Dojo、Yahoo UI、Ext JS等,通常利用AJAX技术从服务器获取数据,数据源通常是JSON或XML格式。本文以Ext JS为例,探讨如何构建无限级树形菜单,即处理数据库中无限层级的数据,并将其...
Store可以配置远程数据源,支持JSON、XML、CSV等多种格式。 2. **模板配置**:用户可以自定义显示模板,以决定在下拉列表中如何呈现每一行数据,比如显示多个字段的组合或者添加图标等。 3. **筛选搜索**:...