diff flys-aft/src/main/resources/sql/aft-common.properties @ 5379:61bf64b102bc mapgenfix

Merge with default branch
author Christian Lins <christian.lins@intevation.de>
date Fri, 22 Mar 2013 11:25:54 +0100
parents da1e897c7224
children 7a68967ca72a
line wrap: on
line diff
--- a/flys-aft/src/main/resources/sql/aft-common.properties	Wed Mar 06 14:14:15 2013 +0100
+++ b/flys-aft/src/main/resources/sql/aft-common.properties	Fri Mar 22 11:25:54 2013 +0100
@@ -1,8 +1,9 @@
-select.gewaesser = SELECT GEWAESSER_NR, NAME FROM SL_GEWAESSER
+select.gewaesser = \
+    SELECT GEWAESSER_NR, NAME FROM SL_GEWAESSER
 select.messstelle = \
-    SELECT NAME, MESSSTELLE_NR \
+    SELECT NAME, MESSSTELLE_NR, STATIONIERUNG \
     FROM MESSSTELLE \
-    WHERE GEWAESSER_NR = :GEWAESSER_NR AND STATIONIERUNG BETWEEN :START_KM AND :END_KM
+    WHERE GEWAESSER_NR = :GEWAESSER_NR
 select.abflusstafel = \
     SELECT ABFLUSSTAFEL_NR, \
            ABFLUSSTAFEL_BEZ, \
@@ -12,6 +13,13 @@
            BFG_ID \
     FROM ABFLUSSTAFEL \
     WHERE MESSSTELLE_NR LIKE :number
-select.tafelwert = SELECT TAFELWERT_NR AS id, WASSERSTAND AS w, ABFLUSS AS q FROM TAFELWERT \
-                          WHERE ABFLUSSTAFEL_NR = :number
-
+select.tafelwert = \
+    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 \
+    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

http://dive4elements.wald.intevation.org