[PATCH] (issue1474) Change order of measurement stations

Wald Commits scm-commit at wald.intevation.org
Fri Dec 6 16:51:28 CET 2013


# HG changeset patch
# User Andre Heinecke <aheinecke at intevation.de>
# Date 1386344822 -3600
# Node ID 691d15750513e76c35ce37ba48f3adcc7bc39417
# Parent  aaefcf391d82e549e186fc8f54b8e0b9b1d138df
(issue1474) Change order of measurement stations

diff -r aaefcf391d82 -r 691d15750513 artifacts/doc/conf/meta-data.xml
--- a/artifacts/doc/conf/meta-data.xml	Fri Dec 06 16:49:43 2013 +0100
+++ b/artifacts/doc/conf/meta-data.xml	Fri Dec 06 16:47:02 2013 +0100
@@ -1915,26 +1915,30 @@
             ti.stop_time         AS stop_time,
             ms.name              AS station_name,
             lower(sqv.parameter) AS parameter,
-            sqv.id               AS sqvid
+            sqv.id               AS sqvid,
+            ra.a                 AS station_km
           FROM sq_relation sq
           JOIN time_intervals ti ON ti.id   = sq.time_interval_id
           JOIN rivers r ON r.id = sq.river_id
           JOIN sq_relation_value sqv ON sqv.sq_relation_id = sq.id
           JOIN measurement_station ms ON sqv.measurement_station_id = ms.id
+          JOIN ranges ra ON ms.range_id = ra.id
           WHERE r.id = ${river_id}
-          ORDER BY start_time, stop_time
+          ORDER BY station_km, start_time, stop_time
         </dc:statement>
         <dc:if test="dc:has-result()">
           <sq_relations>
             <dc:filter expr="$out = concat('sq_relation_', $parameter)">
-              <dc:group expr="$station_name">
-                <station description="{dc:group-key()}">
-                  <dc:for-each>
-                    <dc:variable name="combined_desc" expr="concat(dc:date-format('yyyy', $start_time), ' bis ', dc:date-format('yyyy', $stop_time))"/>
-                    <sqvalue factory="staticsqrelation" target_out="{$out}"
-                      ids="{$sqvid};{$station_name}: {$combined_desc}" description="{$combined_desc}"/>
-                  </dc:for-each>
-                </station>
+              <dc:group expr="$station_km" type="number">
+                <dc:group expr="concat('km ', $station_km, ': ', $station_name)">
+                  <station description="{dc:group-key()}">
+                    <dc:for-each>
+                      <dc:variable name="combined_desc" expr="concat(dc:date-format('yyyy', $start_time), ' bis ', dc:date-format('yyyy', $stop_time))"/>
+                      <sqvalue factory="staticsqrelation" target_out="{$out}"
+                        ids="{$sqvid};{$station_name}: {$combined_desc}" description="{$combined_desc}"/>
+                    </dc:for-each>
+                  </station>
+                </dc:group>
               </dc:group>
             </dc:filter>
           </sq_relations>


More information about the Dive4elements-commits mailing list