[PATCH 1 of 4] issue1345: DC: group bed heights of single years by year
Wald Commits
scm-commit at wald.intevation.org
Tue Oct 15 14:55:25 CEST 2013
# HG changeset patch
# User Felix Wolfsteller <felix.wolfsteller at intevation.de>
# Date 1381813579 -7200
# Node ID 55d9c184f58c08c8e9882fa6adfe17bd53d0fda8
# Parent 24023630f693ddc653e1fbc662bb5e2de062e9e2
issue1345: DC: group bed heights of single years by year.
diff -r 24023630f693 -r 55d9c184f58c artifacts/doc/conf/meta-data.xml
--- 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>
More information about the Dive4elements-commits
mailing list