changeset 8453:1326fc65638c

Recognize the 'no-data value' of fromkm and tokm in datacage statement for discharge curves.
author Tom Gottfried <tom@intevation.de>
date Wed, 29 Oct 2014 16:02:37 +0100
parents b9a8463ac636
children 7003cf5c19ed
files artifacts/doc/conf/meta-data.xml
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/doc/conf/meta-data.xml	Tue Oct 28 18:52:35 2014 +0100
+++ b/artifacts/doc/conf/meta-data.xml	Wed Oct 29 16:02:37 2014 +0100
@@ -1076,8 +1076,9 @@
           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 ((g.station BETWEEN ${fromkm} AND ${tokm})
-              OR g.official_number = ${refgauge})
+            AND CASE WHEN ${fromkm} &gt; -99999 AND ${tokm} &lt; 99999
+              THEN g.station BETWEEN ${fromkm} AND ${tokm}
+              ELSE g.official_number = ${refgauge} END
           ORDER BY start_time
       </dc:statement>
     </dc:macro>

http://dive4elements.wald.intevation.org