|

楼主 |
发表于 2017-11-2 15:58:08
|
显示全部楼层
String KSqlWord="SELECT sxr,sxr.id
,sxr.innerid,sxr.name
,sxr.type,sxr.length,sxr.startLat," +
"sxr.startLng,sxr.startStakeNum,sxr.endStakeNum,sxr.endLat,sxr.endLng,sxr.tax," +
"sxr.taxRate,sxr.sectionOwnerId,sxr.chargeType,sxr.tollRoads,sxr.builtTime," +
"sxr.startTime,sxr.endTime FROM sx_roadinfo sxr Where "+where+" Order by sxr.id
desc limit "+offset+","+limit+"";
System.out.println(KSqlWord);
Table table = KSQL.select(KSqlWord, null, "/sx/roadinfo/data", null);
table.getProperties().put(Table.PROP_NAME_ROWID, "sxr");
String CountKSQL="Select max(a.id) as id, max(a.name
) as name ,Count(a) as cnt From sx_roadinfo a where "+where+"";
System.out.println(CountKSQL);
Table countTable = KSQL.select(CountKSQL, null, "/sx/roadinfo/data", null);
Integer num = countTable.iterator().next().getInteger("cnt");
System.out.println(num);
table.getProperties().put(Table.PROP_DB_COUNT, num);
System.out.println("执行findByIdandName");
return table;
|
|