Marlies Winterstein
2 years ago
5 changed files with 469 additions and 0 deletions
@ -0,0 +1,48 @@ |
|||||||
|
21100^Köpfe oder Fälle ?^0^0^0^140^150^1^sql^70^0^1^<<SQL>> select apnr, eintrag from koepfe_oder_faelle where eintrag not like 'gewichtet nach%' order by 2^apnr, eintrag^<<SQL>> select apnr, eintrag from koepfe_oder_faelle where eintrag='Köpfe';^ |
||||||
|
21101^Seit Semester^3^0^0^140^80^1^integer^30^0^1^<<SQL>> select tid, eintrag from semester order by tid DESC;^Eintrag^<<SQL>> select tid,eintrag from semester where today() between sem_beginn and sem_ende;^ |
||||||
|
21102^Stichtag^1^350^-1^140^100^1^sql^30^0^1^<<SQL>> select tid, name from sos_stichtag where stichtagsart='Prüfungen';^^<<SQL>> select tid, name from sos_stichtag where stichtagsart='Prüfungen' and appl_key='2';^ |
||||||
|
21103^Staatsangehörigkeit^36^0^0^130^150^10^char^30^0^12^<<SQL>> select tid,name,sortnr from sichten where art='SOS-Staaten-Sicht' order by 3,2;^^^ |
||||||
|
21104^Status^14^350^-1^140^180^1^sql^30^0^999^<<SQL>> select apnr,eintrag from sos_status order by 2^^<<SQL>> select apnr,eintrag from sos_status where eintrag='Alle ohne Beurl.';^ |
||||||
|
21105^Hörerstatus^33^0^0^140^170^1^sql^30^0^999^<<SQL>> select apnr, eintrag from hoererstatus order by 2^apnr, eintrag^<<SQL>> select apnr, eintrag from hoererstatus where eintrag='alle';^ |
||||||
|
21106^Weitere Tabellen^123^0^0^140^140^10^char^30^0^999^<<SQL>> \ |
||||||
|
--freemarker template\ |
||||||
|
select name,string_not_null(caption) || ' - ' || name from sx_tables where name in (<#if "<<Köpfe oder Fälle ?>>"?index_of("S.gewichtung")==-1>'dim_studiengang'<#else>'dim_studiengang_gew'</#if>,'ikfz_bland_sem','ikfz_bland_hm','ikfz_bland_hzb','dim_staat', 'dim_person_attribute_aggr', 'semester')\ |
||||||
|
<#if <<tablestylesheet>>!='tabelle_html_datenblatt.xsl'>\ |
||||||
|
and name in (select distinct tablename from stylesheet_field where stylesheet_id in (select tid from sx_stylesheets where filename=<<tablestylesheet>>)) \ |
||||||
|
</#if>\ |
||||||
|
order by 2^^^ |
||||||
|
21107^bis Fachsemester^35^350^-1^140^100^1^integer^30^0^999^^^^ |
||||||
|
21109^Bis Semester^4^350^-1^140^80^1^integer^30^0^1^<<SQL>> select tid, eintrag from semester order by tid DESC;^Eintrag^<<SQL>> select tid,eintrag from semester where today() between sem_beginn and sem_ende;^ |
||||||
|
21110^Filter Studierende^119^0^0^140^150^1^sql^20^0^999^<<SQL>> SELECT id,caption from sx_repository where aktiv =1 and today() between gueltig_seit and gueltig_bis and art='SOS_STUD_FILTER' order by 2;^^^ |
||||||
|
21111^Geschlecht^37^0^0^140^80^1^integer^30^0^1^<<SQL>> SELECT apnr,druck FROM cif where key = 9003 and apnr between 1 and 4 order by 1;^^^ |
||||||
|
21112^Felder^125^0^0^150^190^10^char^30^0^999^<<SQL>>\ |
||||||
|
--freemarker template\ |
||||||
|
select trim(F.table_name) || '.' || F.name,trim(T.caption) || ':' || trim(F.caption) || ' - ' || trim(F.name) from sx_fields F,\ |
||||||
|
sx_tables T where F.table_name=T.name and F.currentlyused=1\ |
||||||
|
--Pseudonyme eingeschaltet:\ |
||||||
|
and (F.name != 'matrikel_nr' or 0=(select \ |
||||||
|
count(*) from konstanten where beschreibung='SOS_MTKNR_EXT'\ |
||||||
|
and apnr=1)) \ |
||||||
|
<#if <<tablestylesheet>>='tabelle_html_datenblatt.xsl'>\ |
||||||
|
and (F.table_name ='sos_stg_aggr'\ |
||||||
|
/* or F.table_name in (<<Weitere Tabellen>>) */) \ |
||||||
|
<#else>\ |
||||||
|
and trim(F.table_name) || '.' || F.name in (select trim(tablename)||'.'||trim(fieldname) from stylesheet_field where stylesheet_id in \ |
||||||
|
(select tid from sx_stylesheets where filename=<<tablestylesheet>>))\ |
||||||
|
</#if>\ |
||||||
|
order by 2;^^^ |
||||||
|
21113^Studiengang^6^0^0^140^150^50^char^30^0^12^<<SQL>> select tid,name,sortnr from sichten where art in ('SOS-Kostenstellen-Sicht', 'SOS-Studiengang-Sicht') order by 3,2;^^^ |
||||||
|
21114^Schlüssel anzeigen^150^0^0^100^100^1^integer^30^1^999^<<SQL>> select 1,'Ja' from xdummy union select 0,'Nein' from xdummy^^<<SQL>> select 1,'Ja' from xdummy^ |
||||||
|
21115^Ansicht in Ergebniszeilen^121^0^0^100^200^1^char^200^1^1^<<SQL>> select name,caption from xcube_dimconfig where maskeninfo_id=${Maskennummer} and is_rowdim=1 order by 2^^<<SQL>> select name,caption from xcube_dimconfig where maskeninfo_id=${Maskennummer} and is_rowdefault=1^ |
||||||
|
21116^Ansicht in Ergebnisspalten^2001^0^0^100^150^1^char^200^1^1^<<SQL>> select name,caption from xcube_dimconfig where maskeninfo_id=${Maskennummer} and is_coldim=1 order by 2^^<<SQL>> select name,caption from xcube_dimconfig where maskeninfo_id=${Maskennummer} and is_coldefault=1^ |
||||||
|
21117^Zivilstatus^41^350^-1^140^180^1^sql^30^0^13^<<SQL>> select attributevalue from personattribute_value_list where personattributetype_id = (select personattributetype_id from personattributetype where attributevalue = 'Status');^^^ |
||||||
|
21118^Jahrgang^42^350^-1^140^180^1^sql^30^0^13^<<SQL>> select attributevalue from personattribute_value_list where personattributetype_id = (select personattributetype_id from personattributetype where attributevalue = 'Jahrgang');^^^ |
||||||
|
21119^Leere Zeilen ausblenden^130^350^-1^140^80^1^char^30^0^1^<<SQL>> select 'ja','ja' from xdummy union select 'nein','nein' from xdummy^ ^<<SQL>> select 'ja','ja' from xdummy^ |
||||||
|
21120^Leere Spalten ausblenden^2020^0^0^100^100^1^char^30^0^1^<<SQL>> select 'ja','ja' from xdummy union select 'nein','nein' from xdummy^^<<SQL>> select 'ja','ja' from xdummy^ |
||||||
|
21121^Abschluss^7^0^0^140^170^5^char^30^0^12^<<SQL>> select tid,name,sortnr from sichten where art in ('SOS-Abschluss-Sicht') order by 3,2;^^^ |
||||||
|
21122^Kennzahl^3000^350^-1^150^180^1^integer^200^1^1^<<SQL>> select tid,name from xcube_kennzahl where maskeninfo_id=${Maskennummer} order by sortnr,name;^hidden^<<SQL>> select tid,name from xcube_kennzahl where maskeninfo_id=${Maskennummer} and is_default=1^ |
||||||
|
21123^2.Ansicht in Zeilen^125^0^0^100^100^1^char^50^0^999^<<SQL>> select name,caption from xcube_dimconfig where maskeninfo_id=${Maskennummer} and is_secondrowdim=1 order by 1^hidden^1^ |
||||||
|
21124^Wohnort^38^0^0^140^80^1^char^30^0^999^<<SQL>> select tid,name,sortnr from sichten where art in ('XCUBE-Wohnort-Sicht') order by 3,2;^^^ |
||||||
|
21125^Alter^39^0^0^140^80^1^char^30^0^12^<<SQL>> select tid,name,sortnr from sichten where art in ('XCUBE-Alter-Sicht') order by 3,2;^^^ |
||||||
|
21126^Note^40^0^0^140^80^1^char^30^0^12^<<SQL>> select tid,name,sortnr from sichten where art in ('XCUBE-Note-Sicht') order by 3,2;^^^ |
||||||
|
21127^Hörerstatus (intern)^43^0^0^140^80^1^char^30^0^999^<<SQL>> select tid,name,sortnr from sichten where art in ('XCUBE-Hörerstatus-Sicht') order by 3,2;^^^ |
@ -0,0 +1 @@ |
|||||||
|
21100^7^ |
@ -0,0 +1,28 @@ |
|||||||
|
21100^21100^ |
||||||
|
21100^21101^ |
||||||
|
21100^21102^ |
||||||
|
21100^21103^ |
||||||
|
21100^21104^ |
||||||
|
21100^21105^ |
||||||
|
21100^21106^ |
||||||
|
21100^21107^ |
||||||
|
21100^21108^ |
||||||
|
21100^21109^ |
||||||
|
21100^21110^ |
||||||
|
21100^21111^ |
||||||
|
21100^21112^ |
||||||
|
21100^21113^ |
||||||
|
21100^21114^ |
||||||
|
21100^21115^ |
||||||
|
21100^21116^ |
||||||
|
21100^21117^ |
||||||
|
21100^21118^ |
||||||
|
21100^21119^ |
||||||
|
21100^21120^ |
||||||
|
21100^21121^ |
||||||
|
21100^21122^ |
||||||
|
21100^21123^ |
||||||
|
21100^21124^ |
||||||
|
21100^21125^ |
||||||
|
21100^21126^ |
||||||
|
21100^21127^ |
@ -0,0 +1,391 @@ |
|||||||
|
21100^Abschlussprüfungen XCUBE^--freemarker template\ |
||||||
|
<sqlvars>\ |
||||||
|
<sqlvar name="table_name">select table_name from xcube where maskeninfo_id=${Maskennummer}</sqlvar>\ |
||||||
|
<sqlvar name="aggrfunction">select aggrfunction from xcube_kennzahl where maskeninfo_id=${Maskennummer} and tid=<<Kennzahl>></sqlvar>\ |
||||||
|
<sqlvar name="aggrfunction_restriction">select nvl(restriction,''::char(1)) from xcube_kennzahl \ |
||||||
|
where maskeninfo_id=${Maskennummer} and tid=<<Kennzahl>>\ |
||||||
|
</sqlvar>\ |
||||||
|
<sqlvar name="datatype">select nvl(datatype,'decimal(17,2)'::varchar(30)) from xcube_kennzahl \ |
||||||
|
where maskeninfo_id=${Maskennummer} and tid=<<Kennzahl>></sqlvar>\ |
||||||
|
--benoetigt falls Kennzahlen in Zeilen oder Spalten\ |
||||||
|
<sqlvar name="kennzahlen" type="hashsequence">select apnr,aggrfunction,\ |
||||||
|
nvl(restriction,''::char(1)) as restriction \ |
||||||
|
from xcube_kennzahl where maskeninfo_id=${Maskennummer}</sqlvar>\ |
||||||
|
<sqlvar name="restriction" type="string"><![CDATA[<sximport>select restriction from xcube where maskeninfo_id=<<Maskennummer>></sximport>]]></sqlvar>\ |
||||||
|
<sqlvar name="coldef" type="hash"><![CDATA[select name,\ |
||||||
|
caption,\ |
||||||
|
foreignkey_tab,\ |
||||||
|
foreignkey_col,\ |
||||||
|
foreignkey_cap,\ |
||||||
|
nvl(foreignkey_cond,''::varchar(1))\ |
||||||
|
as foreignkey_cond,\ |
||||||
|
--nvl(C.specific_restriction,''::varchar(1)) as specific_restriction,\ |
||||||
|
sortfield,\ |
||||||
|
is_sicht,\ |
||||||
|
calc_gesamt,\ |
||||||
|
is_virtual,\ |
||||||
|
vcsql,\ |
||||||
|
nvl(attrib_nachbearbeitung,''::char(1)) as attrib_nachbearbeitung\ |
||||||
|
from xcube_dimconfig where \ |
||||||
|
maskeninfo_id=${Maskennummer} \ |
||||||
|
and name=<<Ansicht in Ergebnisspalten>>]]>\ |
||||||
|
</sqlvar>\ |
||||||
|
<sqlvar name="nichtsicht_ergspalten" type='hashsequence'><![CDATA[\ |
||||||
|
<#if coldef.is_sicht=0>\ |
||||||
|
select distinct ${coldef.foreignkey_col}::varchar(255) as apnr,\ |
||||||
|
${coldef.foreignkey_cap} as name,\ |
||||||
|
1::smallint as detailgesamtsort,\ |
||||||
|
${coldef.sortfield} as tmp_sortfield\ |
||||||
|
from ${coldef.foreignkey_tab} where \ |
||||||
|
1=1 \ |
||||||
|
<#if coldef.foreignkey_cond!=''> and ${coldef.foreignkey_cond} </#if>\ |
||||||
|
--{coldef.specific_restriction} \ |
||||||
|
--ausblenden von Spalten, die gar nicht in konkretem Teilergebnis vorkommen, geht derzeit nicht für virtuelle Spalten und nachbearbeitung, -> Kernmodul\ |
||||||
|
<#if coldef.is_virtual?number=0&&coldef.attrib_nachbearbeitung=''&&"<<Leere Spalten ausblenden>>"="'ja'">\ |
||||||
|
and ${coldef.foreignkey_col}::varchar(255) in (select distinct ${coldef.name}::varchar(255) from ${table_name} where \ |
||||||
|
${restriction} \ |
||||||
|
)\ |
||||||
|
</#if>\ |
||||||
|
<#if coldef.calc_gesamt?number=1> \ |
||||||
|
union\ |
||||||
|
select 'gesamt','Gesamt',\ |
||||||
|
2::smallint as detailgesamtsort,\ |
||||||
|
null as tmp_sortfield from xdummy\ |
||||||
|
</#if>\ |
||||||
|
order by detailgesamtsort,\ |
||||||
|
tmp_sortfield,\ |
||||||
|
name;\ |
||||||
|
<#else>\ |
||||||
|
select 'Sichtspalten aktiv' from xdummy;\ |
||||||
|
</#if>\ |
||||||
|
]]>\ |
||||||
|
</sqlvar>\ |
||||||
|
\ |
||||||
|
\ |
||||||
|
\ |
||||||
|
<sqlvar name="rowdef" type="hash"><![CDATA[select name,caption,is_sicht,calc_gesamt,foreignkey_tab,foreignkey_col,foreignkey_cap,\ |
||||||
|
nvl(foreignkey_cond,''::varchar(1)) as foreignkey_cond,\ |
||||||
|
--nvl(C.specific_restriction,''::varchar(1)) as specific_restriction,\ |
||||||
|
sortfield,is_virtual,vcsql,nvl(attrib_nachbearbeitung,''::char(1)) as attrib_nachbearbeitung\ |
||||||
|
from xcube_dimconfig C where maskeninfo_id=${Maskennummer} and name=<<Ansicht in Ergebniszeilen>>]]>\ |
||||||
|
</sqlvar>\ |
||||||
|
--nur bei wenn Ergzeilen_def nicht vom Typ Sicht relevant\ |
||||||
|
<sqlvar name="nichtsicht_ergzeilen" type='hashsequence'><![CDATA[\ |
||||||
|
<#if rowdef.is_sicht=0>\ |
||||||
|
select 1::smallint as level, \ |
||||||
|
${rowdef.foreignkey_col}::varchar(255) as key,--hier wird zur Vereinheitlichung mit Sichten Bezeichung "key" für eigentlichen Schluessel benoetigt\ |
||||||
|
${rowdef.foreignkey_cap} as name,\ |
||||||
|
${rowdef.sortfield} as tmp_sortfield \ |
||||||
|
from ${rowdef.foreignkey_tab}\ |
||||||
|
where 1=1\ |
||||||
|
<#if rowdef.foreignkey_cond!=''> and ${rowdef.foreignkey_cond} </#if>\ |
||||||
|
--{rowdef.specific_restriction} \ |
||||||
|
<#if rowdef.calc_gesamt?number=1>\ |
||||||
|
union\ |
||||||
|
select 2,'gesamt','Gesamt',null as ${rowdef.sortfield} from xdummy\ |
||||||
|
</#if>\ |
||||||
|
order by level,tmp_sortfield; \ |
||||||
|
<#else>\ |
||||||
|
select 'nicht relevant' from xdummy;</#if>\ |
||||||
|
]]>\ |
||||||
|
</sqlvar>\ |
||||||
|
\ |
||||||
|
<sqlvar name="zweiteRowDef" type="hash"><![CDATA[\ |
||||||
|
<#if "<<2.Ansicht in Zeilen>>"!=""&&"<<2.Ansicht in Zeilen>>"!="<<2.Ansicht in Zeilen>>">\ |
||||||
|
select name,caption,\ |
||||||
|
is_sicht,\ |
||||||
|
calc_gesamt,\ |
||||||
|
foreignkey_tab,\ |
||||||
|
foreignkey_col,\ |
||||||
|
foreignkey_cap,\ |
||||||
|
nvl(foreignkey_cond,''::varchar(1)) as foreignkey_cond,\ |
||||||
|
--nvl(C.specific_restriction,''::varchar(1)) as specific_restriction,\ |
||||||
|
C.sortfield\ |
||||||
|
from xcube_dimconfig where maskeninfo_id=${Maskennummer} and name=<<2.Ansicht in Zeilen>>\ |
||||||
|
<#else>\ |
||||||
|
select 'keine zweite RowDef' from xdummy;\ |
||||||
|
</#if>\ |
||||||
|
]]>\ |
||||||
|
</sqlvar>\ |
||||||
|
--nur bei wenn Ergzeilen_def nicht vom Typ Sicht relevant\ |
||||||
|
<sqlvar name="zweiteRow_nichtsicht_ergzeilen" type='hashsequence'><![CDATA[\ |
||||||
|
<#if "<<2.Ansicht in Zeilen>>"!=""&&"<<2.Ansicht in Zeilen>>"!="<<2.Ansicht in Zeilen>>"&&zweiteRowDef.is_sicht=0>\ |
||||||
|
select 1::smallint as level, \ |
||||||
|
${zweiteRowDef.foreignkey_col}::varchar(255) as key,--hier wird zur Vereinheitlichung mit Sichten Bezeichung "key" für eigentlichen Schluessel benoetigt\ |
||||||
|
${zweiteRowDef.foreignkey_cap} as name,\ |
||||||
|
${zweiteRowDef.sortfield} as tmp_sortfield \ |
||||||
|
from ${zweiteRowDef.foreignkey_tab}\ |
||||||
|
where 1=1\ |
||||||
|
<#if zweiteRowDef.foreignkey_cond!=''> and ${zweiteRowDef.foreignkey_cond} </#if>\ |
||||||
|
--{zweiteRowDef.specific_restriction} \ |
||||||
|
<#if zweiteRowDef.calc_gesamt?number=1>\ |
||||||
|
union\ |
||||||
|
select 2,'gesamt','Gesamt',null as ${zweiteRowDef.sortfield} from xdummy\ |
||||||
|
</#if>\ |
||||||
|
order by level,tmp_sortfield; \ |
||||||
|
<#else>\ |
||||||
|
select 'nicht relevant' from xdummy;</#if>\ |
||||||
|
]]>\ |
||||||
|
</sqlvar>\ |
||||||
|
\ |
||||||
|
\ |
||||||
|
</sqlvars>\ |
||||||
|
\ |
||||||
|
<#function kennzahlInRowOrCol>\ |
||||||
|
--TODO auch 2. Dimension in Zeilen/Spalten\ |
||||||
|
<#if coldef.name="xckennzahl"||rowdef.name="xckennzahl"> <#return 1><#else> return <#return 0> </#if>\ |
||||||
|
</#function>\ |
||||||
|
\ |
||||||
|
<#function hasVirtualColumns>\ |
||||||
|
--TODO auch 2. Dimension in Zeilen/Spalten\ |
||||||
|
<#if coldef.is_virtual?number=1||rowdef.is_virtual?number=1> <#return 1><#else> return <#return 0> </#if>\ |
||||||
|
</#function>\ |
||||||
|
\ |
||||||
|
\ |
||||||
|
<#if hasVirtualColumns()=1||kennzahlInRowOrCol()=1>\ |
||||||
|
select * into temp tmp_rohdaten from \ |
||||||
|
${table_name}\ |
||||||
|
where \ |
||||||
|
${restriction};\ |
||||||
|
<#if coldef.is_virtual?number=1> alter table tmp_rohdaten add column ${coldef.name} varchar(255); ${coldef.vcsql}; </#if>\ |
||||||
|
<#if rowdef.is_virtual?number=1> alter table tmp_rohdaten add column ${rowdef.name} varchar(255); ${rowdef.vcsql}; </#if>\ |
||||||
|
--create index ix_tmp_r1 on tmp_rohdaten(${coldef.name},${rowdef.name}); --Todo nicht xckennzahl ggfs. für 2. Dimension in Spalten\ |
||||||
|
</#if>\ |
||||||
|
\ |
||||||
|
\ |
||||||
|
<#if kennzahlInRowOrCol()=0>\ |
||||||
|
create temp table tmp_cache (\ |
||||||
|
colattrib varchar(255), <@addcomment comment=coldef.caption/>\ |
||||||
|
rowattrib varchar(255), <@addcomment comment=rowdef.caption/>\ |
||||||
|
row2attrib varchar(255),\ |
||||||
|
value decimal(17,5));\ |
||||||
|
insert into tmp_cache (colattrib,rowattrib,<#if "<<2.Ansicht in Zeilen>>"!=""&&"<<2.Ansicht in Zeilen>>"!="<<2.Ansicht in Zeilen>>">row2attrib, </#if> value)\ |
||||||
|
select ${coldef.name}::varchar(255), \ |
||||||
|
${rowdef.name}::varchar(255),\ |
||||||
|
<#if "<<2.Ansicht in Zeilen>>"!=""&&"<<2.Ansicht in Zeilen>>"!="<<2.Ansicht in Zeilen>>">${zweiteRowDef.name}::varchar(255),</#if>\ |
||||||
|
${aggrfunction}\ |
||||||
|
\ |
||||||
|
<#if hasVirtualColumns()=0> \ |
||||||
|
from ${table_name} where \ |
||||||
|
${restriction}\ |
||||||
|
<#if (aggrfunction_restriction?length>0)> and ${aggrfunction_restriction} </#if>\ |
||||||
|
<#else>\ |
||||||
|
from tmp_rohdaten\ |
||||||
|
</#if>\ |
||||||
|
\ |
||||||
|
group by 1,2 <#if "<<2.Ansicht in Zeilen>>"!=""&&"<<2.Ansicht in Zeilen>>"!="<<2.Ansicht in Zeilen>>">,${zweiteRowDef.name}</#if> ;\ |
||||||
|
create index ix_tmp_roh1 on tmp_cache (colattrib,rowattrib,row2attrib);\ |
||||||
|
</#if>\ |
||||||
|
\ |
||||||
|
--moegliche attrib_nachbearbeitung\ |
||||||
|
<#if kennzahlInRowOrCol()=0> \ |
||||||
|
<#assign tmp_table="tmp_cache"/> <#assign rowfield="rowattrib"/> <#assign colfield="colattrib"/> \ |
||||||
|
<#else>\ |
||||||
|
<#assign tmp_table="tmp_rohdaten"/> <#assign rowfield=rowdef.name/> <#assign colfield=coldef.name/> \ |
||||||
|
</#if>\ |
||||||
|
\ |
||||||
|
<#if (rowdef.attrib_nachbearbeitung?length>1)>\ |
||||||
|
${rowdef.attrib_nachbearbeitung?replace("<<tmp_table>>",tmp_table)?replace("<<col>>",rowfield)};\ |
||||||
|
-- z.B. update tmp_cache R set rowattrib='s_'||rowattrib;\ |
||||||
|
</#if>\ |
||||||
|
<#if (coldef.attrib_nachbearbeitung?length>1)>\ |
||||||
|
${coldef.attrib_nachbearbeitung?replace("<<tmp_table>>",tmp_table)?replace("<<col>>",colfield)};\ |
||||||
|
-- z.B. update tmp_cache R set rowattrib='s_'||rowattrib;\ |
||||||
|
</#if>\ |
||||||
|
\ |
||||||
|
\ |
||||||
|
\ |
||||||
|
\ |
||||||
|
<#if coldef.is_sicht>0>\ |
||||||
|
<#assign ergspalten=.vars[coldef.caption].elements/>\ |
||||||
|
<#else>\ |
||||||
|
<#assign ergspalten=nichtsicht_ergspalten/>\ |
||||||
|
</#if>\ |
||||||
|
create temp table tmp_erg (\ |
||||||
|
ebene integer,\ |
||||||
|
col1 varchar(255),\ |
||||||
|
name varchar(255),\ |
||||||
|
<#if "<<2.Ansicht in Zeilen>>"!=""&&"<<2.Ansicht in Zeilen>>"!="<<2.Ansicht in Zeilen>>">col2 varchar(255),</#if>\ |
||||||
|
<#assign i=0/>\ |
||||||
|
<#foreach spalte in ergspalten>\ |
||||||
|
<#assign i=i+1/>\ |
||||||
|
c${i} decimal(17,5) default 0, <@addcomment comment=spalte.name/>\ |
||||||
|
\ |
||||||
|
</#foreach>\ |
||||||
|
sortnr integer\ |
||||||
|
) <@informixnolog/>;\ |
||||||
|
\ |
||||||
|
create index ix_tmp_erg on tmp_erg (sortnr);\ |
||||||
|
\ |
||||||
|
<#if rowdef.is_sicht>0> \ |
||||||
|
<#assign zeilendef=.vars[rowdef.caption].elements/> --ermittelt des SichtObjekts anhand des Feldnames (aus felderinfo)\ |
||||||
|
<#else>\ |
||||||
|
<#assign zeilendef=nichtsicht_ergzeilen/>\ |
||||||
|
</#if>\ |
||||||
|
<#assign sortnr=0/>\ |
||||||
|
<#foreach zeile in zeilendef>\ |
||||||
|
<#if "<<2.Ansicht in Zeilen>>"!=""&&"<<2.Ansicht in Zeilen>>"!="<<2.Ansicht in Zeilen>>">\ |
||||||
|
<#foreach zeile2 in zweiteRow_nichtsicht_ergzeilen>\ |
||||||
|
<#assign sortnr=sortnr+1/>\ |
||||||
|
insert into tmp_erg (ebene,col1,name,col2,sortnr)\ |
||||||
|
values (${zeile.level},'${zeile.key}','${zeile.name}','${zeile2.name}',${sortnr});\ |
||||||
|
<#assign i=0/>\ |
||||||
|
<#foreach spalte in ergspalten>\ |
||||||
|
<#assign i=i+1/>\ |
||||||
|
<@updateval i=i col=spalte row=zeile row2=zeile2 sortnr=sortnr/>\ |
||||||
|
</#foreach>\ |
||||||
|
</#foreach>\ |
||||||
|
<#else>\ |
||||||
|
<#assign sortnr=sortnr+1/>\ |
||||||
|
insert into tmp_erg (ebene,col1,name,sortnr)\ |
||||||
|
values (${zeile.level},'${zeile.key}','${zeile.name}',${sortnr});\ |
||||||
|
<#assign i=0/>\ |
||||||
|
<#foreach spalte in ergspalten>\ |
||||||
|
<#assign i=i+1/>\ |
||||||
|
<@updateval i=i col=spalte row=zeile row2='' sortnr=sortnr/>\ |
||||||
|
</#foreach>\ |
||||||
|
</#if> \ |
||||||
|
</#foreach>\ |
||||||
|
\ |
||||||
|
<#macro updateval i col row row2 sortnr>\ |
||||||
|
update tmp_erg T set c${i}=\ |
||||||
|
<#if kennzahlInRowOrCol()=0>\ |
||||||
|
(select nvl(sum(value),0) from tmp_cache R where 1=1 \ |
||||||
|
<@colrestriction col=col/>\ |
||||||
|
<@rowrestriction row=row row2=row2/>\ |
||||||
|
) \ |
||||||
|
<#else> -- Kennzahl ist in Zeile oder Spalte\ |
||||||
|
(select <@kennzahlSelect row=row col=col/>\ |
||||||
|
from tmp_rohdaten R where 1=1 \ |
||||||
|
<#if rowdef.name="xckennzahl"> <@kennzahlrestrict row=row col=col/> <#else> <@rowrestriction row=row row2=row2 rowattribname=rowdef.name/></#if>\ |
||||||
|
<#if coldef.name="xckennzahl"> <@kennzahlrestrict row=row col=col/> <#else> <@colrestriction col=col colattribname=coldef.name/></#if>\ |
||||||
|
\ |
||||||
|
)\ |
||||||
|
</#if>\ |
||||||
|
where T.sortnr='${sortnr}'\ |
||||||
|
;\ |
||||||
|
</#macro>\ |
||||||
|
\ |
||||||
|
<#macro kennzahlrestrict row col>\ |
||||||
|
<#if coldef.name="xckennzahl">\ |
||||||
|
<#foreach k in kennzahlen>\ |
||||||
|
<#if (col.apnr=k.apnr&&k.restriction?length>0)> and ${k.restriction} </#if>\ |
||||||
|
</#foreach>\ |
||||||
|
</#if>\ |
||||||
|
<#if rowdef.name="xckennzahl">\ |
||||||
|
<#foreach k in kennzahlen>\ |
||||||
|
<#if (row.key=k.apnr&&k.restriction?length>0)> and ${k.restriction} </#if>\ |
||||||
|
</#foreach>\ |
||||||
|
</#if>\ |
||||||
|
</#macro>\ |
||||||
|
\ |
||||||
|
<#macro kennzahlSelect row col>\ |
||||||
|
<#if coldef.name="xckennzahl">\ |
||||||
|
<#foreach k in kennzahlen>\ |
||||||
|
<#if col.apnr=k.apnr> ${k.aggrfunction} </#if>\ |
||||||
|
</#foreach>\ |
||||||
|
</#if>\ |
||||||
|
<#if rowdef.name="xckennzahl">\ |
||||||
|
<#foreach k in kennzahlen>\ |
||||||
|
<#if row.key=k.apnr> ${k.aggrfunction} </#if>\ |
||||||
|
</#foreach>\ |
||||||
|
</#if>\ |
||||||
|
\ |
||||||
|
\ |
||||||
|
</#macro>\ |
||||||
|
\ |
||||||
|
\ |
||||||
|
\ |
||||||
|
<#macro colrestriction col colattribname='R.colattrib'>\ |
||||||
|
<#if coldef.is_sicht==1>\ |
||||||
|
and ${colattribname}::varchar(255) in ${col.subkeys}\ |
||||||
|
<#elseif coldef.is_sicht=2>\ |
||||||
|
and (${col.strukturStr?replace('$1',' '+colattribname+"::varchar(255)")}) \ |
||||||
|
<#else>\ |
||||||
|
<#if col.apnr!='gesamt'>\ |
||||||
|
and ${colattribname}::varchar(255)='${col.apnr}' \ |
||||||
|
</#if>\ |
||||||
|
</#if>\ |
||||||
|
</#macro>\ |
||||||
|
\ |
||||||
|
<#macro rowrestriction row row2 rowattribname='R.rowattrib' >\ |
||||||
|
<#if rowdef.is_sicht==1>\ |
||||||
|
and ${rowattribname}::varchar(255) in ${row.subkeys}\ |
||||||
|
<#elseif rowdef.is_sicht==2>\ |
||||||
|
and ( ${row.strukturStr?replace('$1',' '+rowattribname+"::varchar(255)")} ) \ |
||||||
|
<#else>\ |
||||||
|
<#if row.key!='gesamt'> and ${rowattribname}::varchar(255)='${row.key}' </#if>\ |
||||||
|
</#if>\ |
||||||
|
<#if row2?is_hash> and R.row2attrib='${row2.key}' </#if> \ |
||||||
|
</#macro>\ |
||||||
|
\ |
||||||
|
drop table if exists tmp_cache;\ |
||||||
|
\ |
||||||
|
drop table if exists tmp_rohdaten;\ |
||||||
|
\ |
||||||
|
-- Kennzahl in Spalten/Zeilen ggfs. null\ |
||||||
|
<#assign i=0/>\ |
||||||
|
<#foreach spalte in ergspalten>\ |
||||||
|
<#assign i=i+1/>\ |
||||||
|
update tmp_erg set c${i}=0 where c${i} is null; \ |
||||||
|
</#foreach>\ |
||||||
|
\ |
||||||
|
<#if "<<Leere Zeilen ausblenden>>"="'ja'">\ |
||||||
|
delete from tmp_erg where\ |
||||||
|
<#assign i=0/>\ |
||||||
|
<#foreach spalte in ergspalten>\ |
||||||
|
<#assign i=i+1/>\ |
||||||
|
c${i}=0 <#if spalte_has_next> and </#if>\ |
||||||
|
</#foreach>;\ |
||||||
|
</#if>\ |
||||||
|
<#if "<<Ansicht in Ergebniszeilen>>"="'institution'">\ |
||||||
|
update tmp_erg set name=replace(name,col1||' - ','');\ |
||||||
|
update tmp_erg set col1=(select max(uniquename) from organigramm where col1=trim(key_apnr))\ |
||||||
|
where substring(col1 from 1 for 1)='_';\ |
||||||
|
--vorher war ggfs _3 zu O005030, auch O005030 in Namen ersetzen\ |
||||||
|
update tmp_erg set name=replace(name,col1||' - ','');\ |
||||||
|
</#if> \ |
||||||
|
\ |
||||||
|
\ |
||||||
|
\ |
||||||
|
\ |
||||||
|
select \ |
||||||
|
<#if rowdef.is_sicht>0>ebene,</#if>\ |
||||||
|
name,\ |
||||||
|
<#if "<<2.Ansicht in Zeilen>>"!=""&&"<<2.Ansicht in Zeilen>>"!="<<2.Ansicht in Zeilen>>">col2,</#if>\ |
||||||
|
<#assign i=0/>\ |
||||||
|
<#foreach spalte in ergspalten>\ |
||||||
|
<#assign i=i+1/>\ |
||||||
|
c${i}::${datatype} <#if spalte_has_next>,</#if>\ |
||||||
|
</#foreach>\ |
||||||
|
\ |
||||||
|
from tmp_erg order by sortnr;^--freemarker Template\ |
||||||
|
XIL List\ |
||||||
|
sizable_columns horizontal_scrolling\ |
||||||
|
drop_and_delete movable_columns\ |
||||||
|
white_space_color=COLOR_WHITE fixed_columns=1\ |
||||||
|
min_heading_height=35\ |
||||||
|
<#if rowdef.is_sicht>0>\ |
||||||
|
Column CID=0 heading_text="Ebene" center_heading\ |
||||||
|
row_selectable heading_platform readonly explanation="Hierarchieebene"\ |
||||||
|
width=5 text_size=8\ |
||||||
|
</#if>\ |
||||||
|
Column CID=20 heading_text="${.vars["Ansicht in ErgebniszeilenObject"].selectedItems[0].name}" center_heading\ |
||||||
|
row_selectable heading_platform readonly explanation="Schlüssel: ${.vars["Ansicht in ErgebniszeilenObject"].selectedItems[0].name}Nr"\ |
||||||
|
width=30 text_size=30\ |
||||||
|
<#if "<<2.Ansicht in Zeilen>>"!=""&&"<<2.Ansicht in Zeilen>>"!="<<2.Ansicht in Zeilen>>">\ |
||||||
|
Column CID=20 heading_text="${.vars["2.Ansicht in ZeilenObject"].selectedItems[0].name}" center_heading\ |
||||||
|
row_selectable heading_platform readonly\ |
||||||
|
width=20 text_size=10 explanation="${.vars["2.Ansicht in ZeilenObject"].selectedItems[0].name}"\ |
||||||
|
</#if>\ |
||||||
|
<#if coldef.is_sicht>0>\ |
||||||
|
<#assign ergspalten=.vars[coldef.caption].elements/>\ |
||||||
|
<#else>\ |
||||||
|
<#assign ergspalten=nichtsicht_ergspalten/>\ |
||||||
|
</#if>\ |
||||||
|
<#foreach spalte in ergspalten>\ |
||||||
|
Column CID=1 heading_text="${spalte.name}" center_heading\ |
||||||
|
row_selectable heading_platform readonly explanation="Ausprägung ${spalte.name}"\ |
||||||
|
width=12\ |
||||||
|
</#foreach>\ |
||||||
|
@@@^Altersgruppe^Anzahl^Dynamische Darstellung von Studierendenzahlen^drop table tmp_erg;^^3^700^360^0^1^^ |
Loading…
Reference in new issue