comparison artifacts/doc/conf/meta-data.xml @ 8487:3e5d69e143e9

Datacage config: Oracle has no boolean data type and thus can not handle such CASE-statement in WHERE-clause.
author Tom Gottfried <tom@intevation.de>
date Tue, 02 Dec 2014 12:59:52 +0100
parents 1ba3032cdfe2
children 1314d876a7e5
comparison
equal deleted inserted replaced
8486:d0719e98a9da 8487:3e5d69e143e9
1040 expr="dc:date-format('yyyyMMdd', 1040 expr="dc:date-format('yyyyMMdd',
1041 number(substring-before($year_range, ';')))"/> 1041 number(substring-before($year_range, ';')))"/>
1042 <dc:variable name="stop" type="number" 1042 <dc:variable name="stop" type="number"
1043 expr="dc:date-format('yyyyMMdd', 1043 expr="dc:date-format('yyyyMMdd',
1044 number(substring-after($year_range, ';')))"/> 1044 number(substring-after($year_range, ';')))"/>
1045 <dc:variable name="refgauge" type="number" 1045 <dc:call-macro name="discharge_curve_choose_context">
1046 expr="dc:get('reference_gauge')"/>
1047 <dc:context>
1048 <dc:call-macro name="discharge_curves"/>
1049 <dc:filter expr="$kind = 1 and 1046 <dc:filter expr="$kind = 1 and
1050 number(dc:date-format('yyyyMMdd', $start_time)) 1047 number(dc:date-format('yyyyMMdd', $start_time))
1051 &lt; $stop and 1048 &lt; $stop and
1052 number(dc:date-format('yyyyMMdd', $stop_time)) 1049 number(dc:date-format('yyyyMMdd', $stop_time))
1053 &gt; $start"> 1050 &gt; $start">
1054 <dc:call-macro name="hist_discharge_factory"/> 1051 <dc:call-macro name="hist_discharge_factory"/>
1055 </dc:filter> 1052 </dc:filter>
1056 </dc:context> 1053 </dc:call-macro>
1057 </dc:macro> 1054 </dc:macro>
1058 1055
1059 <dc:macro name="discharge_table_gauge"> 1056 <dc:macro name="discharge_table_gauge">
1060 <dc:variable name="refgauge" type="number" 1057 <dc:call-macro name="discharge_curve_choose_context">
1061 expr="dc:get('reference_gauge')"/>
1062 <dc:context>
1063 <dc:call-macro name="discharge_curves"/>
1064 <dc:filter expr="$kind = 0"> 1058 <dc:filter expr="$kind = 0">
1065 <dc:group expr="$gauge_name"> 1059 <dc:group expr="$gauge_name">
1066 <gauge name="{dc:group-key()}"> 1060 <gauge name="{dc:group-key()}">
1067 <dc:for-each> 1061 <dc:for-each>
1068 <current_gauge factory="gaugedischarge" target_out="{$out}" 1062 <current_gauge factory="gaugedischarge" target_out="{$out}"
1069 ids="{$gauge_name}"/> 1063 ids="{$gauge_name}"/>
1070 </dc:for-each> 1064 </dc:for-each>
1071 </gauge> 1065 </gauge>
1072 </dc:group> 1066 </dc:group>
1073 </dc:filter> 1067 </dc:filter>
1074 </dc:context> 1068 </dc:call-macro>
1075 </dc:macro> 1069 </dc:macro>
1076 1070
1077 <dc:macro name="historical_discharge_curve"> 1071 <dc:macro name="historical_discharge_curve">
1078 <dc:variable name="refgauge" type="number" 1072 <dc:call-macro name="discharge_curve_choose_context">
1079 expr="dc:get('reference_gauge')"/>
1080 <dc:context>
1081 <dc:call-macro name="discharge_curves"/>
1082 <dc:filter expr="$kind = 1"> 1073 <dc:filter expr="$kind = 1">
1083 <historical_discharge_curves> 1074 <historical_discharge_curves>
1084 <dc:group expr="$gauge_name"> 1075 <dc:group expr="$gauge_name">
1085 <gauge name="{dc:group-key()}"> 1076 <gauge name="{dc:group-key()}">
1086 <dc:call-macro name="hist_discharge_factory"/> 1077 <dc:call-macro name="hist_discharge_factory"/>
1087 </gauge> 1078 </gauge>
1088 </dc:group> 1079 </dc:group>
1089 </historical_discharge_curves> 1080 </historical_discharge_curves>
1090 </dc:filter> 1081 </dc:filter>
1091 </dc:context> 1082 </dc:call-macro>
1092 </dc:macro> 1083 </dc:macro>
1093 1084
1094 <dc:macro name="discharge_curves"> 1085 <dc:macro name="discharge_curve_choose_context">
1086 <dc:choose>
1087 <dc:when test="$fromkm &gt; -99999 and $tokm &lt; 99999">
1088 <dc:context>
1089 <dc:call-macro name="discharge_curves_km"/>
1090 <dc:macro-body/>
1091 </dc:context>
1092 </dc:when>
1093 <dc:otherwise>
1094 <dc:variable name="refgauge" type="number"
1095 expr="dc:get('reference_gauge')"/>
1096 <dc:context>
1097 <dc:call-macro name="discharge_curves_refgauge"/>
1098 <dc:macro-body/>
1099 </dc:context>
1100 </dc:otherwise>
1101 </dc:choose>
1102 </dc:macro>
1103
1104 <dc:macro name="discharge_curves_km">
1095 <dc:statement> 1105 <dc:statement>
1096 SELECT g.name AS gauge_name, 1106 SELECT g.name AS gauge_name,
1097 dt.id AS dt_id, 1107 dt.id AS dt_id,
1098 t.start_time AS start_time, 1108 t.start_time AS start_time,
1099 t.stop_time AS stop_time, 1109 t.stop_time AS stop_time,
1101 dt.kind AS kind 1111 dt.kind AS kind
1102 FROM gauges g 1112 FROM gauges g
1103 JOIN discharge_tables dt ON g.id = dt.gauge_id 1113 JOIN discharge_tables dt ON g.id = dt.gauge_id
1104 LEFT JOIN time_intervals t ON dt.time_interval_id = t.id 1114 LEFT JOIN time_intervals t ON dt.time_interval_id = t.id
1105 WHERE g.river_id = ${river_id} 1115 WHERE g.river_id = ${river_id}
1106 AND CASE WHEN ${fromkm} &gt; -99999 AND ${tokm} &lt; 99999 1116 AND g.station BETWEEN ${fromkm} AND ${tokm}
1107 THEN g.station BETWEEN ${fromkm} AND ${tokm}
1108 ELSE g.official_number = ${refgauge} END
1109 ORDER BY start_time 1117 ORDER BY start_time
1110 </dc:statement> 1118 </dc:statement>
1111 </dc:macro> 1119 </dc:macro>
1112 1120
1121 <dc:macro name="discharge_curves_refgauge">
1122 <dc:statement>
1123 SELECT g.name AS gauge_name,
1124 dt.id AS dt_id,
1125 t.start_time AS start_time,
1126 t.stop_time AS stop_time,
1127 dt.bfg_id AS bfg_id,
1128 dt.kind AS kind
1129 FROM gauges g
1130 JOIN discharge_tables dt ON g.id = dt.gauge_id
1131 LEFT JOIN time_intervals t ON dt.time_interval_id = t.id
1132 WHERE g.river_id = ${river_id}
1133 AND g.official_number = ${refgauge}
1134 ORDER BY start_time
1135 </dc:statement>
1136 </dc:macro>
1137
1138 <!-- Cross sections -->
1113 <dc:macro name="cross_sections"> 1139 <dc:macro name="cross_sections">
1114 <cross_sections id="flood-protections-{$river_id}"> 1140 <cross_sections id="flood-protections-{$river_id}">
1115 <dc:context connection="system"> 1141 <dc:context connection="system">
1116 <dc:statement> 1142 <dc:statement>
1117 SELECT DISTINCT 1143 SELECT DISTINCT

http://dive4elements.wald.intevation.org