将两个表中查出的两列信息放在同一个表中
String sql_gd = "select * from TAX_INFO_GD where ID='"+gdid+"'"; Record gdRecord = Db.findFirst(sql_gd); String sql_sy = "select * from TAX_INFO where ID='"+syid+"'"; Record syRecord = Db.findFirst(sql_sy); String[] heardArr = {"纳税人识别号:","纳税人名称:","法定代表人:","法人身份证:","注册地址:","经营地址:","经营范围:","从业人数:","注册登记类型:","行业明细:","企业电话:","注册资本:","投资总额:"}; String[] gdArr = {"SH_ID","NAME","FANREN","FR_ID","ZXDZ","SCJYDZ","JYFW","CYRS","DJZCLX","HANGYE","SCJY_TEL","ZCZB","TZZE"}; String[] syArr = {"SHXYDM","NSR","FAREN","FRSFZ","ADDRESS","经营地址","JYFW","CYGR_NUM","ZCDJLX","TRADE","企业电话","ZCZB","投资总额"}; //需要经过处理和填充的新List List<Record> newList = new ArrayList<>(); for(int i=0;i<13;i++){ Record record = new Record(); record.set("HEARD",heardArr[i]); record.set("GD",gdRecord.get(gdArr[i])); record.set("SY",syRecord.get(syArr[i])); newList.add(record); } renderJson(newList);
使每一行均是 HEARD、GD、SY一一对应
产生如图所示