|
|
|
@ -401,89 +401,89 @@ drop TABLE tmp_rpta_column2layout;\ |
|
|
|
\ |
|
|
|
\ |
|
|
|
--zuerst Summenzeile:\ |
|
|
|
--zuerst Summenzeile:\ |
|
|
|
<#if einElement.level != maxEbene || maxEbenePlusEins=1>\ |
|
|
|
<#if einElement.level != maxEbene || maxEbenePlusEins=1>\ |
|
|
|
<#assign sortnr=sortnr+1>\ |
|
|
|
<#assign sortnr=sortnr+1>\ |
|
|
|
insert into tmp_stud3(\ |
|
|
|
insert into tmp_stud3(\ |
|
|
|
<#foreach column in columns>\ |
|
|
|
<#foreach column in columns>\ |
|
|
|
<#if column.coltype!="preparingColumn">\ |
|
|
|
<#if column.coltype!="preparingColumn">\ |
|
|
|
${column.targetfieldname},\ |
|
|
|
${column.targetfieldname},\ |
|
|
|
</#if>\ |
|
|
|
</#if>\ |
|
|
|
</#foreach>\ |
|
|
|
</#foreach>\ |
|
|
|
sortnr)\ |
|
|
|
sortnr)\ |
|
|
|
select\ |
|
|
|
select\ |
|
|
|
<#foreach column in columns>\ |
|
|
|
<#foreach column in columns>\ |
|
|
|
<#if column.coltype!="preparingColumn">\ |
|
|
|
<#if column.coltype!="preparingColumn">\ |
|
|
|
<#if column.targetfieldname=treeColumnTargetFieldname>\ |
|
|
|
<#if column.targetfieldname=treeColumnTargetFieldname>\ |
|
|
|
'${einElement.name}',\ |
|
|
|
'${einElement.name}',\ |
|
|
|
<#elseif column.targetfieldname="ebene">\ |
|
|
|
<#elseif column.targetfieldname="ebene">\ |
|
|
|
${einElement.level},\ |
|
|
|
${einElement.level},\ |
|
|
|
<#elseif column.targetfieldname=treeColumnSrcFieldname>\ |
|
|
|
<#elseif column.targetfieldname=treeColumnSrcFieldname>\ |
|
|
|
null::char(1),\ |
|
|
|
null::char(1),\ |
|
|
|
<#elseif column.is_aggregate==1 \ |
|
|
|
<#elseif column.is_aggregate==1 \ |
|
|
|
&& column.colfunction?has_content \ |
|
|
|
&& column.colfunction?has_content \ |
|
|
|
&& column.coltype=="processingColumn"> \ |
|
|
|
&& column.coltype=="processingColumn"> \ |
|
|
|
${column.colfunction} as ${column.targetfieldname},\ |
|
|
|
${column.colfunction} as ${column.targetfieldname},\ |
|
|
|
<#elseif column.is_aggregate==1 \ |
|
|
|
<#elseif column.is_aggregate==1 \ |
|
|
|
&& (column.coltype == "logicalColumn" || column.coltype == "lookupColumn" || column.coltype == "physicalColumn")> \ |
|
|
|
&& (column.coltype == "logicalColumn" || column.coltype == "lookupColumn" || column.coltype == "physicalColumn")> \ |
|
|
|
sum(${column.targetfieldname}) as ${column.targetfieldname},\ |
|
|
|
sum(${column.targetfieldname}) as ${column.targetfieldname},\ |
|
|
|
<#else>\ |
|
|
|
<#else>\ |
|
|
|
null,\ |
|
|
|
null,\ |
|
|
|
</#if>\ |
|
|
|
</#if>\ |
|
|
|
</#if>\ |
|
|
|
</#if>\ |
|
|
|
</#foreach>\ |
|
|
|
</#foreach>\ |
|
|
|
--(${einElement.level}*10000) + ${sortnr} as sortnr\ |
|
|
|
--(${einElement.level}*10000) + ${sortnr} as sortnr\ |
|
|
|
${sortnr} *10000 as sortnr\ |
|
|
|
${sortnr} *10000 as sortnr\ |
|
|
|
from tmp_stud\ |
|
|
|
from tmp_stud\ |
|
|
|
where ${treeColumnSrcFieldname} in ${einElement.subkeys}\ |
|
|
|
where ${treeColumnSrcFieldname} in ${einElement.subkeys}\ |
|
|
|
\ |
|
|
|
\ |
|
|
|
;\ |
|
|
|
;\ |
|
|
|
</#if>\ |
|
|
|
</#if>\ |
|
|
|
\ |
|
|
|
\ |
|
|
|
--Unterste Ebene die Werte:\ |
|
|
|
--Unterste Ebene die Werte:\ |
|
|
|
<#if einElement.level == maxEbene>\ |
|
|
|
<#if einElement.level == maxEbene>\ |
|
|
|
<#assign sortnr=sortnr+1>\ |
|
|
|
<#assign sortnr=sortnr+1>\ |
|
|
|
insert into tmp_stud3(\ |
|
|
|
insert into tmp_stud3(\ |
|
|
|
<#foreach column in columns>\ |
|
|
|
<#foreach column in columns>\ |
|
|
|
<#if column.coltype!="preparingColumn">\ |
|
|
|
<#if column.coltype!="preparingColumn">\ |
|
|
|
${column.targetfieldname},\ |
|
|
|
${column.targetfieldname},\ |
|
|
|
</#if>\ |
|
|
|
</#if>\ |
|
|
|
</#foreach>\ |
|
|
|
</#foreach>\ |
|
|
|
sortnr)\ |
|
|
|
sortnr)\ |
|
|
|
select\ |
|
|
|
select\ |
|
|
|
<#foreach column in columns>\ |
|
|
|
<#foreach column in columns>\ |
|
|
|
<#if column.targetfieldname=treeColumnTargetFieldname>\ |
|
|
|
<#if column.targetfieldname=treeColumnTargetFieldname>\ |
|
|
|
'${einElement.name}',\ |
|
|
|
'${einElement.name}',\ |
|
|
|
<#elseif column.targetfieldname="ebene">\ |
|
|
|
<#elseif column.targetfieldname="ebene">\ |
|
|
|
<#if maxEbenePlusEins=1>\ |
|
|
|
<#if maxEbenePlusEins=1>\ |
|
|
|
${einElement.level+ 1},\ |
|
|
|
${einElement.level+ 1},\ |
|
|
|
<#else>\ |
|
|
|
<#else>\ |
|
|
|
${einElement.level},\ |
|
|
|
${einElement.level},\ |
|
|
|
</#if>\ |
|
|
|
</#if>\ |
|
|
|
<#elseif column.targetfieldname=treeColumnSrcFieldname>\ |
|
|
|
<#elseif column.targetfieldname=treeColumnSrcFieldname>\ |
|
|
|
null::char(1),\ |
|
|
|
null::char(1),\ |
|
|
|
<#elseif column.is_aggregate==1 \ |
|
|
|
<#elseif column.is_aggregate==1 \ |
|
|
|
&& column.colfunction?has_content \ |
|
|
|
&& column.colfunction?has_content \ |
|
|
|
&& column.coltype=="processingColumn"> \ |
|
|
|
&& column.coltype=="processingColumn"> \ |
|
|
|
${column.colfunction} as ${column.targetfieldname},\ |
|
|
|
${column.colfunction} as ${column.targetfieldname},\ |
|
|
|
<#elseif column.is_aggregate==1 \ |
|
|
|
<#elseif column.is_aggregate==1 \ |
|
|
|
&& (column.coltype == "logicalColumn" || column.coltype == "lookupColumn" || column.coltype == "physicalColumn")> \ |
|
|
|
&& (column.coltype == "logicalColumn" || column.coltype == "lookupColumn" || column.coltype == "physicalColumn")> \ |
|
|
|
sum(${column.targetfieldname}) as ${column.targetfieldname},\ |
|
|
|
sum(${column.targetfieldname}) as ${column.targetfieldname},\ |
|
|
|
<#else>\ |
|
|
|
|
|
|
|
<#if (column.is_aggregate==0 && column.coltype!="preparingColumn" && column.coltype!="processingColumn") || column.coltype=="computedColumn"> \ |
|
|
|
|
|
|
|
${column.targetfieldname},\ |
|
|
|
|
|
|
|
<#elseif column.is_aggregate==0 && column.coltype=="processingColumn"> \ |
|
|
|
|
|
|
|
<#if column.colfunction?has_content>\ |
|
|
|
|
|
|
|
${column.colfunction} as ${column.targetfieldname},\ |
|
|
|
|
|
|
|
<#else>\ |
|
|
|
<#else>\ |
|
|
|
${column.srcfieldname} as ${column.targetfieldname},\ |
|
|
|
<#if (column.is_aggregate==0 && column.coltype!="preparingColumn" && column.coltype!="processingColumn") || column.coltype=="computedColumn"> \ |
|
|
|
|
|
|
|
${column.targetfieldname},\ |
|
|
|
|
|
|
|
<#elseif column.is_aggregate==0 && column.coltype=="processingColumn"> \ |
|
|
|
|
|
|
|
<#if column.colfunction?has_content>\ |
|
|
|
|
|
|
|
${column.colfunction} as ${column.targetfieldname},\ |
|
|
|
|
|
|
|
<#else>\ |
|
|
|
|
|
|
|
${column.srcfieldname} as ${column.targetfieldname},\ |
|
|
|
|
|
|
|
</#if>\ |
|
|
|
|
|
|
|
</#if>\ |
|
|
|
</#if>\ |
|
|
|
</#if>\ |
|
|
|
</#if>\ |
|
|
|
</#foreach>\ |
|
|
|
</#if>\ |
|
|
|
${sortnr} *10000 --(${einElement.level}*10000) + ${sortnr} as sortnr\ |
|
|
|
</#foreach>\ |
|
|
|
from tmp_stud\ |
|
|
|
${sortnr} *10000 --(${einElement.level}*10000) + ${sortnr} as sortnr\ |
|
|
|
where s_tid_stg in ${einElement.subkeys}\ |
|
|
|
from tmp_stud\ |
|
|
|
group by ${columnLayoutWithTreeColumnAdditionalGrouping}\ |
|
|
|
where s_tid_stg in ${einElement.subkeys}\ |
|
|
|
;\ |
|
|
|
group by ${columnLayoutWithTreeColumnAdditionalGrouping}\ |
|
|
|
|
|
|
|
;\ |
|
|
|
|
|
|
|
</#if>\ |
|
|
|
</#if>\ |
|
|
|
</#foreach>\ |
|
|
|
</#foreach>\ |
|
|
|
\ |
|
|
|
\ |
|
|
|
@ -530,9 +530,9 @@ drop TABLE tmp_rpta_column2layout;\ |
|
|
|
${rpta_column_layout.sortclause}\ |
|
|
|
${rpta_column_layout.sortclause}\ |
|
|
|
<#else>\ |
|
|
|
<#else>\ |
|
|
|
<#list 1..number_of_visible_colums as i>${i}\ |
|
|
|
<#list 1..number_of_visible_colums as i>${i}\ |
|
|
|
<#if i != number_of_visible_colums>\ |
|
|
|
<#if i != number_of_visible_colums>\ |
|
|
|
,\ |
|
|
|
,\ |
|
|
|
</#if>\ |
|
|
|
</#if>\ |
|
|
|
</#list>\ |
|
|
|
</#list>\ |
|
|
|
</#if>\ |
|
|
|
</#if>\ |
|
|
|
;\ |
|
|
|
;\ |
|
|
|
|