Mercurial > dive4elements > river
comparison artifacts/doc/conf/meta-data.xml @ 8308:b5e63ad6d307
Q-symmetry: SQ-relations should not be filtered for specific outs (and optimised statement a bit).
author | "Tom Gottfried <tom@intevation.de>" |
---|---|
date | Tue, 23 Sep 2014 12:56:23 +0200 |
parents | 60212ed56023 |
children | 1e4e5ff44aa9 |
comparison
equal
deleted
inserted
replaced
8307:60212ed56023 | 8308:b5e63ad6d307 |
---|---|
1455 </dc:macro> | 1455 </dc:macro> |
1456 | 1456 |
1457 | 1457 |
1458 <!-- prototypes --> | 1458 <!-- prototypes --> |
1459 | 1459 |
1460 <!-- discharge curve prototype --> | |
1461 <dc:macro name="discharge-curve-prototype"> | 1460 <dc:macro name="discharge-curve-prototype"> |
1462 <computed_discharge_curve> | 1461 <computed_discharge_curve> |
1463 <dc:call-macro name="discharge_table_gauge"/> | 1462 <dc:call-macro name="discharge_table_gauge"/> |
1464 <dc:call-macro name="mainvalues"/> | 1463 <dc:call-macro name="mainvalues"/> |
1465 </computed_discharge_curve> | 1464 </computed_discharge_curve> |
2126 </dc:macro> | 2125 </dc:macro> |
2127 | 2126 |
2128 <dc:macro name="sqrelations"> | 2127 <dc:macro name="sqrelations"> |
2129 <dc:context> | 2128 <dc:context> |
2130 <dc:statement> | 2129 <dc:statement> |
2131 SELECT sq.description AS description, | 2130 SELECT |
2132 ti.start_time AS start_time, | 2131 ti.start_time AS start_time, |
2133 ti.stop_time AS stop_time, | 2132 ti.stop_time AS stop_time, |
2134 ms.name AS station_name, | 2133 ms.name AS station_name, |
2135 lower(sqv.parameter) AS parameter, | 2134 lower(sqv.parameter) AS parameter, |
2136 sqv.id AS sqvid, | 2135 sqv.id AS sqvid, |
2137 ra.a AS station_km | 2136 ra.a AS station_km |
2138 FROM sq_relation sq | 2137 FROM sq_relation sq |
2139 JOIN time_intervals ti ON ti.id = sq.time_interval_id | 2138 JOIN time_intervals ti ON ti.id = sq.time_interval_id |
2140 JOIN rivers r ON r.id = sq.river_id | |
2141 JOIN sq_relation_value sqv ON sqv.sq_relation_id = sq.id | 2139 JOIN sq_relation_value sqv ON sqv.sq_relation_id = sq.id |
2142 JOIN measurement_station ms ON sqv.measurement_station_id = ms.id | 2140 JOIN measurement_station ms ON sqv.measurement_station_id = ms.id |
2143 JOIN ranges ra ON ms.range_id = ra.id | 2141 JOIN ranges ra ON ms.range_id = ra.id |
2142 JOIN rivers r ON r.id = ra.river_id | |
2144 WHERE r.id = ${river_id} | 2143 WHERE r.id = ${river_id} |
2145 ORDER BY station_km, start_time, stop_time | 2144 ORDER BY start_time, stop_time |
2146 </dc:statement> | 2145 </dc:statement> |
2147 <dc:if test="dc:has-result()"> | 2146 <dc:if test="dc:has-result()"> |
2148 <sq_relations> | 2147 <sq_relations> |
2149 <dc:filter expr="$out = concat('sq_relation_', $parameter) or | 2148 <dc:group expr="concat('Parameter ', dc:uppercase($parameter))"> |
2150 $out = 'sq_overview'"> | 2149 <parameter description="{dc:group-key()}"> |
2151 <dc:group expr="concat('Parameter ', dc:uppercase($parameter))"> | 2150 <dc:group expr="$station_km" type="number"> |
2152 <parameter description="{dc:group-key()}"> | 2151 <dc:group expr="concat('km ', $station_km, ': ', |
2153 <dc:for-each> | 2152 $station_name)"> |
2154 <dc:group expr="$station_km" type="number"> | 2153 <station description="{dc:group-key()}"> |
2155 <dc:group expr="concat('km ', $station_km, ': ', | 2154 <dc:for-each> |
2156 $station_name)"> | 2155 <dc:variable name="combined_desc" |
2157 <station description="{dc:group-key()}"> | 2156 expr="concat(dc:date-format('yyyy', |
2158 <dc:for-each> | 2157 $start_time), ' bis ', |
2159 <dc:variable name="combined_desc" | 2158 dc:date-format('yyyy', |
2160 expr="concat(dc:date-format('yyyy', | 2159 $stop_time))"/> |
2161 $start_time), ' bis ', | 2160 <sqvalue factory="staticsqrelation" |
2162 dc:date-format('yyyy', | 2161 target_out="{$out}" |
2163 $stop_time))"/> | 2162 ids="{$sqvid};{dc:uppercase($parameter)} - {$station_name}: {$combined_desc}" |
2164 <sqvalue factory="staticsqrelation" | 2163 description="{$combined_desc}"/> |
2165 target_out="{$out}" | 2164 </dc:for-each> |
2166 ids="{$sqvid};{dc:uppercase($parameter)} - {$station_name}: {$combined_desc}" | 2165 </station> |
2167 description="{$combined_desc}"/> | 2166 </dc:group> |
2168 </dc:for-each> | 2167 </dc:group> |
2169 </station> | 2168 </parameter> |
2170 </dc:group> | 2169 </dc:group> |
2171 </dc:group> | |
2172 </dc:for-each> | |
2173 </parameter> | |
2174 </dc:group> | |
2175 </dc:filter> | |
2176 </sq_relations> | 2170 </sq_relations> |
2177 </dc:if> | 2171 </dc:if> |
2178 </dc:context> | 2172 </dc:context> |
2179 </dc:macro> | 2173 </dc:macro> |
2180 | 2174 |