diff artifacts/doc/conf/meta-data.xml @ 5884:11e74ca3229a

datacage: simplified range filtering for wsts.
author Sascha L. Teichmann <teichmann@intevation.de>
date Tue, 30 Apr 2013 17:46:29 +0200
parents 1afeb674381d
children 178a873df7a9
line wrap: on
line diff
--- a/artifacts/doc/conf/meta-data.xml	Tue Apr 30 12:53:10 2013 +0200
+++ b/artifacts/doc/conf/meta-data.xml	Tue Apr 30 17:46:29 2013 +0200
@@ -12,13 +12,10 @@
                wst_columns.description AS info,
                wst_ranges.a            AS deffrom,
                wst_ranges.b            AS defto
-        FROM wst_columns, wst_ranges
+        FROM wst_columns JOIN wst_ranges
+            ON wst_columns.id = wst_ranges.wst_column_id
         WHERE wst_columns.wst_id = ${prot_id}
-           AND wst_ranges.wst_column_id = wst_columns.id
-           AND (${fromkm} BETWEEN wst_ranges.a AND wst_ranges.b
-           OR ${tokm} BETWEEN wst_ranges.a AND wst_ranges.b
-           OR wst_ranges.a BETWEEN ${fromkm} AND ${tokm}
-           OR wst_ranges.b BETWEEN ${fromkm} AND ${tokm})
+            AND NOT((${tokm} &lt; wst_ranges.a) OR (${fromkm} &gt; wst_ranges.b))
         ORDER by wst_columns.position
     </dc:statement>
   </dc:macro>

http://dive4elements.wald.intevation.org