comparison artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadFactory.java @ 7184:73d7886fa59e

SedimentLoadFactory: Fix query, added comment about correctness of fraction_type -> measurementstation assignment.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Fri, 27 Sep 2013 14:35:42 +0200
parents 805021c04861
children 963b8bd54a63
comparison
equal deleted inserted replaced
7183:0fe00824bd96 7184:73d7886fa59e
89 public static final String SQL_SELECT_SINGLES_DATA_BY_ID = 89 public static final String SQL_SELECT_SINGLES_DATA_BY_ID =
90 "SELECT" + 90 "SELECT" +
91 " sy.description AS description, " + 91 " sy.description AS description, " +
92 " syv.value AS load, " + 92 " syv.value AS load, " +
93 " syv.station AS km, " + 93 " syv.station AS km, " +
94 " u.name AS unit " + 94 " u.name AS unit, " +
95 " gf.name AS fraction " + 95 " gf.name AS fraction " +
96 " FROM sediment_yield sy " + 96 " FROM sediment_yield sy " +
97 " JOIN sediment_yield_values syv ON sy.id = syv.sediment_yield_id " + 97 " JOIN sediment_yield_values syv ON sy.id = syv.sediment_yield_id " +
98 " JOIN units u ON u.id = sy.unit_id" + 98 " JOIN units u ON u.id = sy.unit_id" +
99 " JOIN grain_fraction gf ON sy.grain_fraction_id = gf.id " + 99 " JOIN grain_fraction gf ON sy.grain_fraction_id = gf.id " +
422 (String) row[4]); //unit 422 (String) row[4]); //unit
423 423
424 String fraction = (String) row[3]; 424 String fraction = (String) row[3];
425 425
426 TreeMap<Double,MeasurementStation> relevantStations = 426 TreeMap<Double,MeasurementStation> relevantStations =
427 fraction.equals("suspended_sediment") 427 fraction.equals("suspended_sediment") /* || TODO clarify: fraction.equals("susp_sand") */
428 ? suspStations 428 ? suspStations
429 : floatStations; 429 : floatStations;
430 430
431 for (int i = 0; i < results.size(); i++) { 431 for (int i = 0; i < results.size(); i++) {
432 row = results.get(i); 432 row = results.get(i);

http://dive4elements.wald.intevation.org