changeset 6849:863a67e10c0c

(issue1391) Filter by reference_gauge or by KM
author Andre Heinecke <aheinecke@intevation.de>
date Fri, 16 Aug 2013 09:39:27 +0200
parents 9351bc4852a8
children 089b48c3131e
files artifacts/doc/conf/meta-data.xml
diffstat 1 files changed, 11 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/doc/conf/meta-data.xml	Fri Aug 16 09:38:15 2013 +0200
+++ b/artifacts/doc/conf/meta-data.xml	Fri Aug 16 09:39:27 2013 +0200
@@ -487,22 +487,23 @@
 
 
     <dc:macro name="historical_discharge_curve">
+      <dc:variable name="refgauge" type="number" expr="$reference_gauge"/>
       <dc:context>
         <dc:statement>
           SELECT g.id   AS gauge_id,
-                 g.name AS gauge_name,
-                 dt.id AS dt_id,
-                 t.start_time AS start_time,
-                 t.stop_time AS stop_time,
-                 dt.description AS desc,
-                 dt.bfg_id AS bfg_id
+          g.name AS gauge_name,
+          dt.id AS dt_id,
+          t.start_time AS start_time,
+          t.stop_time AS stop_time,
+          dt.description AS desc,
+          dt.bfg_id AS bfg_id
           FROM gauges g
           JOIN discharge_tables dt ON g.id = dt.gauge_id
           LEFT JOIN time_intervals t ON dt.time_interval_id = t.id
           WHERE g.river_id = ${river_id}
           AND dt.kind &lt;&gt; 0
-          AND g.station = ${fromkm}
-          AND g.station = ${tokm}
+          AND ((g.station = ${fromkm} AND g.station = ${tokm})
+          OR g.official_number = ${refgauge})
           ORDER BY start_time
         </dc:statement>
         <dc:if test="dc:has-result()">
@@ -1336,8 +1337,8 @@
           LEFT JOIN time_intervals t ON dt.time_interval_id = t.id
           WHERE g.river_id = ${river_id}
           AND dt.kind = 0
-          AND g.station = ${fromkm}
-          AND g.station = ${tokm}
+          AND ((g.station = ${fromkm} AND g.station = ${tokm})
+          OR g.official_number = ${refgauge})
         </dc:statement>
         <dc:if test="dc:has-result()">
           <current_gauge>

http://dive4elements.wald.intevation.org