changeset 5483:a5bb0a139f19

merge
author Tom Gottfried <tom.gottfried@intevation.de>
date Wed, 27 Mar 2013 20:21:27 +0100
parents 9d11717538ec (current diff) 5187911f5d45 (diff)
children 8f492672d1e5
files
diffstat 5 files changed, 15 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/flys-aft/src/main/java/de/intevation/aft/River.java	Wed Mar 27 20:21:01 2013 +0100
+++ b/flys-aft/src/main/java/de/intevation/aft/River.java	Wed Mar 27 20:21:27 2013 +0100
@@ -196,7 +196,7 @@
         int flysId;
 
         try {
-            if (rs.next()) {
+            if (!rs.next()) {
                 log.error(
                     "FLYS: No master discharge table found for gauge '" +
                     gauge.getAftName() + "'");
--- a/flys-aft/src/main/java/de/intevation/db/SymbolicStatement.java	Wed Mar 27 20:21:01 2013 +0100
+++ b/flys-aft/src/main/java/de/intevation/db/SymbolicStatement.java	Wed Mar 27 20:21:27 2013 +0100
@@ -143,14 +143,23 @@
         }
 
         public boolean execute() throws SQLException {
+            if (log.isDebugEnabled()) {
+                log.debug("execute: " + compiled);
+            }
             return stmnt.execute();
         }
 
         public ResultSet executeQuery() throws SQLException {
+            if (log.isDebugEnabled()) {
+                log.debug("query: " + compiled);
+            }
             return stmnt.executeQuery();
         }
 
         public int executeUpdate() throws SQLException {
+            if (log.isDebugEnabled()) {
+                log.debug("update: " + compiled);
+            }
             return stmnt.executeUpdate();
         }
 
--- a/flys-aft/src/main/resources/sql/aft-common.properties	Wed Mar 27 20:21:01 2013 +0100
+++ b/flys-aft/src/main/resources/sql/aft-common.properties	Wed Mar 27 20:21:27 2013 +0100
@@ -17,9 +17,9 @@
     SELECT TAFELWERT_NR AS id, WASSERSTAND AS w, ABFLUSS AS q FROM TAFELWERT \
     WHERE ABFLUSSTAFEL_NR = :number
 select.bfg.id.current = \
-    SELECT BFG_ID AS BFG_ID FROM ABFLUSSTAFEL \
+    SELECT ABT.BFG_ID AS BFG_ID FROM ABFLUSSTAFEL ABT \
     WHERE GUELTIG_VON IN ( \
         SELECT min(GUELTIG_VON) FROM ABFLUSSTAFEL \
         WHERE GUELTIG_VON IS NOT NULL AND GUELTIG_BIS IS NULL \
         AND MESSSTELLE_NR LIKE :number) \
-    AND MESSSTELLE_NR :number
+    AND MESSSTELLE_NR LIKE :number
--- a/flys-aft/src/main/resources/sql/aft-oracle-jdbc-oracledriver.properties	Wed Mar 27 20:21:01 2013 +0100
+++ b/flys-aft/src/main/resources/sql/aft-oracle-jdbc-oracledriver.properties	Wed Mar 27 20:21:27 2013 +0100
@@ -4,6 +4,6 @@
            GUELTIG_VON, \
            GUELTIG_BIS, \
            PEGELNULLPUNKT, \
-           BFG_ID \
-    FROM ABFLUSSTAFEL \
+           AT.BFG_ID \
+    FROM ABFLUSSTAFEL AT \
     WHERE MESSSTELLE_NR LIKE :number
--- a/flys-aft/src/main/resources/sql/flys-common.properties	Wed Mar 27 20:21:01 2013 +0100
+++ b/flys-aft/src/main/resources/sql/flys-common.properties	Wed Mar 27 20:21:27 2013 +0100
@@ -52,6 +52,6 @@
         dt.id AS id, \
         dt.bfg_id AS bfg_id \
     FROM discharge_tables dt JOIN gauges g ON dt.gauge_id = g.id \
-    WHERE g.id = :gauge_id AND g.kind = 0
+    WHERE g.id = :gauge_id AND dt.kind = 0
 update.bfg.id.discharge.table = \
     UPDATE discharge_tables SET bfg_id = :bfg_id WHERE id = :id

http://dive4elements.wald.intevation.org