[PATCH] Fixed km order in d50 query
Wald Commits
scm-commit at wald.intevation.org
Fri May 25 11:49:50 CEST 2018
# HG changeset patch
# User mschaefer
# Date 1527241771 -7200
# Node ID e07a2b4606c11729236e03655ae360b8a8eb548e
# Parent 8c15c3c23ecc12e4056d92db435e2db392e34c55
Fixed km order in d50 query
diff -r 8c15c3c23ecc -r e07a2b4606c1 artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/tkhcalculation/BedQualityD50KmValueFinder.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/tkhcalculation/BedQualityD50KmValueFinder.java Fri May 25 11:14:57 2018 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/tkhcalculation/BedQualityD50KmValueFinder.java Fri May 25 11:49:31 2018 +0200
@@ -57,15 +57,15 @@
* query.
*/
private static final String SQL_BED_D50_SUBLAYER_MEASUREMENT = //
- "SELECT s.km, t.datum, p.tiefevon, p.tiefebis, a.d50" //
- + " FROM sohltest t INNER JOIN station s ON t.stationid = s.stationid" //
- + " INNER JOIN gewaesser g ON s.gewaesserid = g.gewaesserid" //
- + " INNER JOIN sohlprobe p ON t.sohltestid = p.sohltestid" //
- + " INNER JOIN siebanalyse a ON p.sohlprobeid = a.sohlprobeid" //
- + " WHERE (g.name = :name) AND (s.km BETWEEN :fromkm - 0.0001 AND :tokm + 0.0001)" //
- + " AND (p.tiefevon > 0.0) AND (p.tiefebis <= 0.5)" //
- + " AND (t.datum BETWEEN :fromdate AND :todate)" //
- + " ORDER BY t.km ASC, a.d50 ASC";
+ "SELECT s.km, t.datum, p.tiefevon, p.tiefebis, a.d50"
+ + " FROM sohltest t INNER JOIN station s ON t.stationid = s.stationid"
+ + " INNER JOIN gewaesser g ON s.gewaesserid = g.gewaesserid"
+ + " INNER JOIN sohlprobe p ON t.sohltestid = p.sohltestid"
+ + " INNER JOIN siebanalyse a ON p.sohlprobeid = a.sohlprobeid"
+ + " WHERE (g.name = :name) AND (s.km BETWEEN :fromkm - 0.0001 AND :tokm + 0.0001)"
+ + " AND (p.tiefevon > 0.0) AND (p.tiefebis <= 0.5)"
+ + " AND (t.datum BETWEEN :fromdate AND :todate)"
+ + " ORDER BY s.km ASC, a.d50 ASC";
private Calculation problems;
@@ -103,12 +103,13 @@
cal.set(soundingYear + validYears, 11, 31);
final Date endTime = cal.getTime();
- log.debug(String.format("loadValues km %.3f - %.3f %tF - %tF", kmRange.getMinimumDouble(), kmRange.getMaximumDouble(), startTime, endTime));
+ final String seddbRiver = river.nameForSeddb();
+ log.debug(String.format("loadValues '%s' km %.3f - %.3f %tF - %tF", seddbRiver, kmRange.getMinimumDouble(), kmRange.getMaximumDouble(), startTime,
+ endTime));
final Session session = SedDBSessionHolder.HOLDER.get();
final SQLQuery sqlQuery = session.createSQLQuery(SQL_BED_D50_SUBLAYER_MEASUREMENT).addScalar("km", StandardBasicTypes.DOUBLE)
.addScalar("datum", StandardBasicTypes.DATE).addScalar("tiefevon", StandardBasicTypes.DOUBLE).addScalar("tiefebis", StandardBasicTypes.DOUBLE)
.addScalar("d50", StandardBasicTypes.DOUBLE);
- final String seddbRiver = river.nameForSeddb();
sqlQuery.setString("name", seddbRiver);
sqlQuery.setDouble("fromkm", kmRange.getMinimumDouble());
sqlQuery.setDouble("tokm", kmRange.getMaximumDouble());
More information about the Dive4Elements-commits
mailing list