changeset 7327:55d9c184f58c

issue1345: DC: group bed heights of single years by year.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Tue, 15 Oct 2013 07:06:19 +0200
parents 24023630f693
children f044fe2fa258
files artifacts/doc/conf/meta-data.xml
diffstat 1 files changed, 19 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/doc/conf/meta-data.xml	Mon Oct 14 17:41:19 2013 +0200
+++ b/artifacts/doc/conf/meta-data.xml	Tue Oct 15 07:06:19 2013 +0200
@@ -1619,18 +1619,26 @@
       <single>
         <dc:context>
           <dc:statement>
-            SELECT id          AS bedh_id,
-                   year        AS bedh_year,
-                   description AS bedh_descr
-            FROM bed_height_single
-            WHERE river_id = ${river_id}
-              AND lower(description) NOT LIKE '%epoch%'
+            SELECT bhs.id          AS bedh_id,
+                   bhs.year        AS bedh_year,
+                   bhs.description AS bedh_descr,
+                   bht.id          AS type_id
+            FROM bed_height_single bhs
+               JOIN bed_height_type bht ON bht.id = bhs.type_id
+            WHERE bhs.river_id = ${river_id}
+              AND lower(bhs.description) NOT LIKE '%epoch%'
           </dc:statement>
-          <dc:for-each>
-            <height factory="bedheight" target_out="{$out}"
-                    ids="bedheight-single-{$bedh_id}-{$bedh_year}"
-                    description="{$bedh_descr}"/>
-          </dc:for-each>
+          <dc:if test="dc:has-result()">
+            <dc:group expr="$bedh_year">
+              <cross-sections name="{dc:group-key()}">
+                <dc:for-each>
+                  <height factory="bedheight" target_out="{$out}"
+                      ids="bedheight-single-{$bedh_id}-{$bedh_year}"
+                      description="{$type} {$bedh_descr}"/>
+                </dc:for-each>
+              </cross-sections>
+            </dc:group>
+          <dc:if>
         </dc:context>
       </single>
     </dc:macro>

http://dive4elements.wald.intevation.org