--- android/TrainInfoService/src/dk/thoerup/traininfoservice/DumpResultSet.java 2010/06/09 20:16:01 811
+++ android/TrainInfoService/src/dk/thoerup/traininfoservice/DumpResultSet.java 2010/06/10 07:25:47 815
@@ -141,13 +141,25 @@
} else if (dump.equals("updatecoords")) {
res = dumpUpdate("UPDATE trainstations SET earth_coord = ll_to_earth(latitude,longitude)");
} else if (dump.equals("trainstatistics")) {
- res = dumpResultset("SELECT * FROM trainstatistics");
+ res = dumpResultset("SELECT * FROM trainstatistics ORDER BY statisticsdate DESC");
} else if (dump.equals("trainstatistics_avg")) {
- res = dumpResultset("SELECT avg(location), avg(name), avg(favorites), avg(departure), avg(depcache), avg(deperror), avg(timetable), avg(timecache), avg(timeerror) FROM trainstatistics");
+ res = dumpResultset("SELECT round(avg(location),1) as location, round(avg(name),1) as name, round(avg(favorites),1) as favorites, " +
+ "round(avg(departure),1) as departure, round(avg(depcache),1) as depcache, round(avg(deperror),1) as deperror, " +
+ "round(avg(timetable),1) as timetable, round(avg(timecache),1) as timecache, round(avg(timeerror),1) as timeerror " +
+ "FROM trainstatistics");
}
}
if (res == null) {
- res = "All
All with links
Missing coords
Duplicate stations
Disabled stations
No address
Has aliases
update coords";
+ res = "All
" +
+ "All with links
" +
+ "Missing coords
" +
+ "Duplicate stations
" +
+ "Disabled stations
" +
+ "No address
" +
+ "Has aliases
" +
+ "update coords
" +
+ "statistics
" +
+ "stats_avg
";
}
resp.setContentType("text/html");