changeset 7709:0737573aa9ac

S/Q relation removed false COALSCE from SQL statement. Removed misplaced sieve adjustment.
author Sascha L. Teichmann <teichmann@intevation.de>
date Wed, 18 Dec 2013 19:51:23 +0100
parents a4cef1b17b2b
children a8fd76b15d41
files artifacts/src/main/java/org/dive4elements/river/artifacts/model/sq/Measurement.java artifacts/src/main/java/org/dive4elements/river/artifacts/model/sq/MeasurementFactory.java artifacts/src/main/java/org/dive4elements/river/artifacts/model/sq/SieveArray.java
diffstat 3 files changed, 27 insertions(+), 23 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/sq/Measurement.java	Wed Dec 18 15:37:53 2013 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/sq/Measurement.java	Wed Dec 18 19:51:23 2013 +0100
@@ -191,6 +191,7 @@
         deleteSieve(4.0);
         sieves.add(new Sieve(8d, eightValue));
         sieves.add(new Sieve(4d, newFourValue));
+        /*
         sieveArray.adjust(
             eightValue/sieveArray.totalLoad(),
             newFourValue/sieveArray.totalLoad());
@@ -199,6 +200,7 @@
             log.debug("Adjusted loads: " + Arrays.toString(sieveArray.getLoads()));
             log.debug("Adjusted norm loads:" + Arrays.toString(sieveArray.getNormLoads()));
         }
+        */
     }
 
     protected SieveArray calculateSieveArray() {
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/sq/MeasurementFactory.java	Wed Dec 18 15:37:53 2013 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/sq/MeasurementFactory.java	Wed Dec 18 19:51:23 2013 +0100
@@ -69,28 +69,28 @@
             "COALESCE(m.TSAND, 0)      AS TSAND," +
             "COALESCE(gp.GTRIEB_F, 0)  AS GTRIEB," +
             "COALESCE(m.TGESCHIEBE, 0) AS TGESCHIEBE," +
-            "COALESCE(si.SIEB01, 0) AS SIEB01, COALESCE(si.SIEB02, 0) AS SIEB02," +
-            "COALESCE(si.SIEB03, 0) AS SIEB03, COALESCE(si.SIEB04, 0) AS SIEB04," +
-            "COALESCE(si.SIEB05, 0) AS SIEB05, COALESCE(si.SIEB06, 0) AS SIEB06," +
-            "COALESCE(si.SIEB07, 0) AS SIEB07, COALESCE(si.SIEB08, 0) AS SIEB08," +
-            "COALESCE(si.SIEB09, 0) AS SIEB09, COALESCE(si.SIEB10, 0) AS SIEB10," +
-            "COALESCE(si.SIEB11, 0) AS SIEB11, COALESCE(si.SIEB12, 0) AS SIEB12," +
-            "COALESCE(si.SIEB13, 0) AS SIEB13, COALESCE(si.SIEB14, 0) AS SIEB14," +
-            "COALESCE(si.SIEB15, 0) AS SIEB15, COALESCE(si.SIEB16, 0) AS SIEB16," +
-            "COALESCE(si.SIEB17, 0) AS SIEB17, COALESCE(si.SIEB18, 0) AS SIEB18," +
-            "COALESCE(si.SIEB19, 0) AS SIEB19, COALESCE(si.SIEB20, 0) AS SIEB20," +
-            "COALESCE(si.SIEB21, 0) AS SIEB21," +
-            "COALESCE(gs.RSIEB01, 0) AS RSIEB01, COALESCE(gs.RSIEB02, 0) AS RSIEB02," +
-            "COALESCE(gs.RSIEB03, 0) AS RSIEB03, COALESCE(gs.RSIEB04, 0) AS RSIEB04," +
-            "COALESCE(gs.RSIEB05, 0) AS RSIEB05, COALESCE(gs.RSIEB06, 0) AS RSIEB06," +
-            "COALESCE(gs.RSIEB07, 0) AS RSIEB07, COALESCE(gs.RSIEB08, 0) AS RSIEB08," +
-            "COALESCE(gs.RSIEB09, 0) AS RSIEB09, COALESCE(gs.RSIEB10, 0) AS RSIEB10," +
-            "COALESCE(gs.RSIEB11, 0) AS RSIEB11, COALESCE(gs.RSIEB12, 0) AS RSIEB12," +
-            "COALESCE(gs.RSIEB13, 0) AS RSIEB13, COALESCE(gs.RSIEB14, 0) AS RSIEB14," +
-            "COALESCE(gs.RSIEB15, 0) AS RSIEB15, COALESCE(gs.RSIEB16, 0) AS RSIEB16," +
-            "COALESCE(gs.RSIEB17, 0) AS RSIEB17, COALESCE(gs.RSIEB18, 0) AS RSIEB18," +
-            "COALESCE(gs.RSIEB19, 0) AS RSIEB19, COALESCE(gs.RSIEB20, 0) AS RSIEB20," +
-            "COALESCE(gs.RSIEB21, 0) AS RSIEB21, COALESCE(gs.REST   , 0) AS REST " +
+            "si.SIEB01 AS SIEB01, si.SIEB02 AS SIEB02," +
+            "si.SIEB03 AS SIEB03, si.SIEB04 AS SIEB04," +
+            "si.SIEB05 AS SIEB05, si.SIEB06 AS SIEB06," +
+            "si.SIEB07 AS SIEB07, si.SIEB08 AS SIEB08," +
+            "si.SIEB09 AS SIEB09, si.SIEB10 AS SIEB10," +
+            "si.SIEB11 AS SIEB11, si.SIEB12 AS SIEB12," +
+            "si.SIEB13 AS SIEB13, si.SIEB14 AS SIEB14," +
+            "si.SIEB15 AS SIEB15, si.SIEB16 AS SIEB16," +
+            "si.SIEB17 AS SIEB17, si.SIEB18 AS SIEB18," +
+            "si.SIEB19 AS SIEB19, si.SIEB20 AS SIEB20," +
+            "si.SIEB21 AS SIEB21," +
+            "gs.RSIEB01 AS RSIEB01, gs.RSIEB02 AS RSIEB02," +
+            "gs.RSIEB03 AS RSIEB03, gs.RSIEB04 AS RSIEB04," +
+            "gs.RSIEB05 AS RSIEB05, gs.RSIEB06 AS RSIEB06," +
+            "gs.RSIEB07 AS RSIEB07, gs.RSIEB08 AS RSIEB08," +
+            "gs.RSIEB09 AS RSIEB09, gs.RSIEB10 AS RSIEB10," +
+            "gs.RSIEB11 AS RSIEB11, gs.RSIEB12 AS RSIEB12," +
+            "gs.RSIEB13 AS RSIEB13, gs.RSIEB14 AS RSIEB14," +
+            "gs.RSIEB15 AS RSIEB15, gs.RSIEB16 AS RSIEB16," +
+            "gs.RSIEB17 AS RSIEB17, gs.RSIEB18 AS RSIEB18," +
+            "gs.RSIEB19 AS RSIEB19, gs.RSIEB20 AS RSIEB20," +
+            "gs.RSIEB21 AS RSIEB21, gs.REST    AS REST " +
         "FROM MESSUNG m " +
             "JOIN STATION    s ON m.STATIONID    = s.STATIONID " +
             "JOIN GEWAESSER  r ON s.GEWAESSERID  = r.GEWAESSERID " +
@@ -211,7 +211,7 @@
 
             }
             for (Sieve s: sieves) {
-                if (s != null) {
+                if (s != null && !Double.isNaN(s.getLoad())) {
                     validSieves.add(s);
                 }
             }
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/sq/SieveArray.java	Wed Dec 18 15:37:53 2013 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/sq/SieveArray.java	Wed Dec 18 19:51:23 2013 +0100
@@ -67,10 +67,12 @@
         log.debug("calculated norm loads: " + Arrays.toString(normLoads));
     }
 
+    /*
     public void adjust(double eight, double four) {
         this.normLoads[4] = eight;
         this.normLoads[5] = four;
     }
+    */
 
     /**
      * Gets the loads for this instance.

http://dive4elements.wald.intevation.org