[PATCH] Q-symmetry: SQ-relations should not be filtered for specific outs (and optimised statement a bit)

Wald Commits scm-commit at wald.intevation.org
Tue Sep 23 12:56:26 CEST 2014


# HG changeset patch
# User "Tom Gottfried <tom at intevation.de>"
# Date 1411469783 -7200
# Node ID b5e63ad6d30738ec45f21497f90bacb0cea1f3f0
# Parent  60212ed5602331720ac26aab1564d8e619dfc24a
Q-symmetry: SQ-relations should not be filtered for specific outs (and optimised statement a bit).

diff -r 60212ed56023 -r b5e63ad6d307 artifacts/doc/conf/meta-data.xml
--- a/artifacts/doc/conf/meta-data.xml	Tue Sep 23 10:11:52 2014 +0200
+++ b/artifacts/doc/conf/meta-data.xml	Tue Sep 23 12:56:23 2014 +0200
@@ -1457,7 +1457,6 @@
 
     <!-- prototypes -->
 
-    <!-- discharge curve prototype -->
     <dc:macro name="discharge-curve-prototype">
         <computed_discharge_curve>
           <dc:call-macro name="discharge_table_gauge"/>
@@ -2128,7 +2127,7 @@
     <dc:macro name="sqrelations">
       <dc:context>
         <dc:statement>
-          SELECT sq.description  AS description,
+          SELECT
             ti.start_time        AS start_time,
             ti.stop_time         AS stop_time,
             ms.name              AS station_name,
@@ -2136,43 +2135,38 @@
             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 time_intervals ti ON ti.id = sq.time_interval_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
+          JOIN rivers r ON r.id = ra.river_id
           WHERE r.id = ${river_id}
-          ORDER BY station_km, start_time, stop_time
+          ORDER BY start_time, stop_time
         </dc:statement>
         <dc:if test="dc:has-result()">
           <sq_relations>
-            <dc:filter expr="$out = concat('sq_relation_', $parameter) or
-                             $out = 'sq_overview'">
-              <dc:group expr="concat('Parameter ', dc:uppercase($parameter))">
-                <parameter description="{dc:group-key()}">
-                  <dc:for-each>
-                    <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};{dc:uppercase($parameter)} - {$station_name}: {$combined_desc}"
-                                     description="{$combined_desc}"/>
-                          </dc:for-each>
-                        </station>
-                      </dc:group>
-                    </dc:group>
-                  </dc:for-each>
-                </parameter>
-              </dc:group>
-            </dc:filter>
+            <dc:group expr="concat('Parameter ', dc:uppercase($parameter))">
+              <parameter description="{dc:group-key()}">
+                <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};{dc:uppercase($parameter)} - {$station_name}: {$combined_desc}"
+                                 description="{$combined_desc}"/>
+                      </dc:for-each>
+                    </station>
+                  </dc:group>
+                </dc:group>
+              </parameter>
+            </dc:group>
           </sq_relations>
         </dc:if>
       </dc:context>


More information about the Dive4Elements-commits mailing list