返回数据有层级关系,且层级不固定,要求经过处理以树形层级关系返回。 从数据库中返回的数据如下,解析肯定要从第一层开始,所以从数据库中查询时按层级递增排序返回,先找出
从数据库中返回的数据如下,解析肯定要从第一层开始,所以从数据库中查询时按层级递增排序返回,先找出第一级,然后拼各节点的叶子结点。 其中:SERIESNO为层级字段,UPPERROLE为上级节点的id。 Columns: SUBJECTID, SUBJECTNUM, SUBJECTNAME, FULLNAME, UPPERROLE, SUBJECTTYPE, HASSUBROLE, MNEMONICCODE, SERIESNO <== Row: 7259055, 01, 营业收入, null, 0, null, 00, YYSR, 1 <== Row: 7259056, 02, 营业成本, null, 0, null, 00, YYCB, 1 <== Row: 7259057, 03, 税金及附加, null, 0, null, 00, SJJFJ, 1 <== Row: 7259058, 04, 人工成本, null, 0, null, 01, RGCB, 1 <== Row: 7259066, 05, 可控费用, null, 0, null, 01, KKFY, 1 <== Row: 7259078, 06, 固定资产折旧, null, 0, null, 00, GDZCZJ, 1 <== Row: 7259079, 07, 专项, null, 0, null, 01, ZX, 1 <== Row: 7258605, 08, 绩效工资, null, 0, null, 01, JXGZ, 1 <== Row: 7258608, 09, 职能部门费用, null, 0, null, 01, ZNBMFY, 1 <== Row: 7259059, 0401, 岗位工资, null, 04, null, 00, GWGZ, 2 <== Row: 7259060, 0402, 津贴, null, 04, null, 00, JT, 2 <== Row: 7259061, 0403, 五险一金, null, 04, null, 00, WXYJ, 2 <== Row: 7259062, 0404, 年金, null, 04, null, 00, NJ, 2 <== Row: 7259063, 0405, 线路考察费, null, 04, null, 00, XLKCF, 2 <== Row: 7259064, 0406, 劳务派遣人员工资, null, 04, null, 00, LWPQRYGZ, 2 <== Row: 7259065, 0407, 福利费(分摊), null, 04, null, 00, FLFFT, 2 <== Row: 7259080, 0701, 办公场所费用, null, 07, null, 01, BGCSFY, 2 <== Row: 7259088, 0702, IT技术费, null, 07, null, 01, ITJSF, 2 <== Row: 7259104, 0703, 公共办公费用, null, 07, null, 01, GGBGFY, <== Row: 7258604, 0712, 综合收益-投资收益, null, 07, null, 00, ZHSY-TZSY, 2 <== Row: 7259081, 070101, 房租, null, 0701, null, 00, FZ, 3 <== Row: 7259082, 070102, 房屋折旧, null, 0701, null, 00, FWZJ, 3 <== Row: 7259083, 070103, 房屋装修及维护, null, 0701, null, 00, FWZXJWH, 3 <== Row: 7259089, 070201, 维保费用, null, 0702, null, 01, WBFY, 3 <== Row: 7259092, 070202, 宽带使用费及运维费, null, 0702, null, 01, KDSYFJYWF, 3 <== Row: 7259096, 070203, 软件年费, null, 0702, null, 01, RJNF, 3 <== Row: 7259105, 070301, 办公设备耗材及维修, null, 0703, null, 00, BGSBHCJWX, 3 <== Row: 7259106, 070302, 办公设备租赁, null, 0703, null, 00, BGSBZL, 3 <== Row: 7259107, 070303, 制作物, null, 0703, null, 00, ZZW, 3 <== Row: 7259120, 070601, 福利经费, null, 0706, null, 01, FLJF, 3 <== Row: 7259132, 070602, 党工团活动费, null, 0706, null, 01, DGTHDF, 3 <== Row: 7259135, 070603, 保险费用及其他, null, 0706, null, 01, BXFYJQT, 3 <== Row: 7259143, 070701, 折旧费用, null, 0707, null, 01, ZJFY, 3 <== Row: 7259146, 070702, 培训费(日常及管理培训), null, 0707, null, 01, PXFRCJGLPX, 3 <== Row: 7259150, 070703, 招聘费用, null, 0707, null, 01, ZPFY, 3 <== Row: 7258568, 070704, 市场费用, null, 0707, null, 01, SCFY, 3 <== Row: 7258581, 070705, 税金, null, 0707, null, 01, SJ, 3 <== Row: 7258585, 070706, 旅行社责任险, null, 0707, null, 00, LXSZRX, 3 <== Row: 7258586, 070707, 属地平台管理费用分摊, null, 0707, null, 00, SDPTGLFYFT, 3 <== Row: 7258588, 070801, 汇兑损益, null, 0708, null, 00, HDSY, 3 <== Row: 7258589, 070802, 利息收入, null, 0708, null, 00, LXSR, 3 <== Row: 7258590, 070803, 其他财务费用, null, 0708, null, 00, QTCWFY, 3 <== Row: 7258592, 070901, 酒店佣金, null, 0709, null, 00, JDYJ, 3 <== Row: 7258593, 070902, 银联佣金, null, 0709, null, 00, YLYJ, 3 <== Row: 7258594, 070903, 机票佣金, null, 0709, null, 00, JPYJ, 3 <== Row: 7258595, 070904, 地接社佣金, null, 0709, null, 00, DJSYJ, 3 <== Row: 7258596, 070905, 租金收入, null, 0709, null, 00, ZJSR, 3 <== Row: 7258597, 070906, 其他业务, null, 0709, null, 00, QTYW, 3 <== Row: 7258599, 071001, 政府补助收入, null, 0710, null, 00, ZFBZSR, 3 <== Row: 7258600, 071002, 固定资产处置净收益, null, 0710, null, 00, GDZCCZJSY, 3 <== Row: 7258601, 071003, 罚款净收益, null, 0710, null, 00, FKJSY, 3 <== Row: 7258602, 071004, 其他营业外, null, 0710, null, 00, QTYYW, 3 <== Row: 7259090, 07020101, 公司单独使用软件维保费用, null, 070201, null, 00, GSDDSYRJWBFY, 4 <== Row: 7259121, 07060101, 三八妇女节, null, 070601, null, 00, SFNJ, 4 <== Row: 7259122, 07060102, 儿童节, null, 070601, null, 00, ETJ, 4 <== Row: 7259133, 07060201, 文体娱乐活动, null, 070602, null, 00, WTYLHD, <== Row: 7259148, 07070202, 集团培训费分摊, null, 070702, null, 00, JTPXFFT, 4 <== Row: 7259149, 07070203, 培训资助, null, 070702, null, 00, PXZZ, 4 <== Row: 7259151, 07070301, 网络招聘费用, null, 070703, null, 00, WLZPFY, 4 <== Row: 7258565, 07070302, 猎头服务费用, null, 070703, null, 00, LTFWFY, 4 <== Row: 7258566, 07070303, 内部推荐奖励, null, 070703, null, 00, NBTJJL, 4 <== Row: 7258567, 07070304, 校园招聘费用, null, 070703, null, 00, XYZPFY, 4 <== Row: 7258574, 07070402, 市场推广费, null, 070704, null, 01, SCTGF, 4 <== Row: 7258582, 07070501, 房产税, null, 070705, null, 00, FCS, 4 <== Row: 7258583, 07070502, 土地使用税, null, 070705, null, 00, TDSYS, 4 public List