10 changed files with 884 additions and 0 deletions
@ -0,0 +1,30 @@ |
|||||||
|
48310^Spaltenlayout^3000^350^-1^140^180^1^char^30^1^1^<<SQL>>SELECT uniquename,\ |
||||||
|
caption\ |
||||||
|
FROM rpta_column_layout \ |
||||||
|
where resultset_id in (select R.tid from rpta_resultset R where R.uniquename in ('rpta_erfolg_ba_ma_uebergang'))\ |
||||||
|
order by sortnr, caption\ |
||||||
|
;^^<<SQL>>SELECT uniquename,\ |
||||||
|
caption\ |
||||||
|
FROM rpta_column_layout \ |
||||||
|
where resultset_id in (select R.tid from rpta_resultset R where R.uniquename='rpta_erfolg_ba_ma_uebergang') and uniquename='ba_ma_uebergang_nach_abschluss';^ |
||||||
|
48311^Seit Semester^10^0^0^140^80^1^integer^30^0^1^<<SQL>> select tid, eintrag from semester order by tid DESC;^ ^<<SQL>> select tid,eintrag from semester where today() between sem_beginn and sem_ende;^ |
||||||
|
48312^Fächer^30^0^0^130^200^6^integer^1000^0^12^<<SQL>> select tid,name,sortnr from sichten where art='Fächer-Sicht' order by 3,2;^ ^ ^ |
||||||
|
48313^Abschluss^40^0^0^100^200^3^char^1500^0^12^<<SQL>> select tid,name,sortnr from sichten where art='SOS-Abschluss-Sicht' order by 3,2;^ ^ ^ |
||||||
|
48314^bis Fachsemester^1000^300^-1^200^100^1^integer^30^0^0^^ ^ ^ |
||||||
|
48315^Semestertyp^22^350^-1^140^80^1^integer^255^0^1^<<SQL>> select 1,'nur Sommersemester' from xdummy union select 2,'nur Wintersemester' from xdummy^ ^ ^ |
||||||
|
48316^Hochschulzugangsberechtigung^120^300^-1^200^200^1^sql^30^0^1^hs_zugangsber^ ^ ^ |
||||||
|
48317^Bis Semester^20^350^-1^140^80^1^integer^30^0^1^<<SQL>> select tid, eintrag from semester order by tid DESC;^ ^<<SQL>> select tid,eintrag from semester where today() between sem_beginn and sem_ende;^ |
||||||
|
48318^Staatsangehörigkeit^150^0^0^140^150^10^char^30^0^12^<<SQL>> select tid,name,sortnr from sichten where art='SOS-Staaten-Sicht' order by 3,2;^ ^ ^ |
||||||
|
48319^Studiengang^25^0^0^140^150^50^char^1000^0^12^<<SQL>> select tid,name,sortnr from sichten where art in ('SOS-Kostenstellen-Sicht', 'SOS-Studiengang-Sicht') order by 3,2;^ ^ ^ |
||||||
|
48320^Semester^100^0^0^140^80^1^integer^30^0^1^<<SQL>> select tid, eintrag from semester order by tid DESC;^hidden^ ^ |
||||||
|
48321^Richtung^38^0^0^150^190^1^char^30^0^1^<<SQL>>select 'gw','Grundständig zu weiterf.' from xdummy union select 'wg','Weiterf. zu Grundständig' from xdummy order by 1;^ ^ ^ |
||||||
|
48322^Hörerstatus^200^330^-1^140^150^1^sql^30^0^1^<<SQL>> select apnr, eintrag from hoererstatus where apnr like 'hrst%' order by 2^ ^ ^ |
||||||
|
48323^Jahr^110^0^0^140^80^1^integer^30^0^13^ ^ ^ ^ |
||||||
|
48324^Filter Studierende^100^0^0^140^150^1^sql^20^0^1^<<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;^^^ |
||||||
|
48325^Nur Endsemester^21^0^0^140^80^1^integer^30^0^1^<<SQL>> select 1,'ja' from xdummy^Eintrag^ ^ |
||||||
|
48326^Matrikel-Nr.^35^350^-1^140^80^1^char^30^0^13^^^^ |
||||||
|
48328^Köpfe oder Fälle ?^0^0^0^140^150^1^sql^70^0^1^<<SQL>> select apnr, eintrag from koepfe_oder_faelle order by 2^ ^<<SQL>> select apnr, eintrag from koepfe_oder_faelle where eintrag = 'Fälle';^ |
||||||
|
48332^Geschlecht^110^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;^ ^ ^ |
||||||
|
48333^Spalten^3001^0^0^150^190^10^char^30^0^1^<<SQL>>\ |
||||||
|
select C.uniquename, C.caption ,L.layout_id from rpta_column C, rpta_column2layout L where C.tid=L.column_id and layout_id in\ |
||||||
|
(select tid from rpta_column_layout where uniquename=<<Spaltenlayout>>) order by 2;^^^ |
@ -0,0 +1 @@ |
|||||||
|
48310^7^ |
@ -0,0 +1,20 @@ |
|||||||
|
48310^48310^ |
||||||
|
48310^48311^ |
||||||
|
48310^48312^ |
||||||
|
48310^48313^ |
||||||
|
48310^48314^ |
||||||
|
48310^48315^ |
||||||
|
48310^48316^ |
||||||
|
48310^48317^ |
||||||
|
48310^48318^ |
||||||
|
48310^48319^ |
||||||
|
48310^48320^ |
||||||
|
48310^48321^ |
||||||
|
48310^48322^ |
||||||
|
48310^48323^ |
||||||
|
48310^48324^ |
||||||
|
48310^48325^ |
||||||
|
48310^48326^ |
||||||
|
48310^48328^ |
||||||
|
48310^48332^ |
||||||
|
48310^48333^ |
@ -0,0 +1,202 @@ |
|||||||
|
48310^Übergang Bachelor-Master bzw. vorheriger Abschluss bei Master-Studienbeginn^--Freemarker Template\ |
||||||
|
<#include "SQL_lingua_franca"/>\ |
||||||
|
<#include "SuperX_general"/>\ |
||||||
|
--\ |
||||||
|
--Autor D. Quathamer 2024\ |
||||||
|
<sqlvars>\ |
||||||
|
<sqlvar name="my_base_rs"><![CDATA[\ |
||||||
|
select R.uniquename\ |
||||||
|
from rpta_resultset R, rpta_column_layout L\ |
||||||
|
where L.resultset_id=R.tid\ |
||||||
|
and L.uniquename=<<Spaltenlayout>>;]]>\ |
||||||
|
</sqlvar>\ |
||||||
|
<sqlvar name="basetable" type="hash"><![CDATA[\ |
||||||
|
SELECT distinct T.name,\ |
||||||
|
R.is_virtual,\ |
||||||
|
name as runtime_tablename\ |
||||||
|
from sx_tables T, rpta_resultset R \ |
||||||
|
where T.name=R.uniquename\ |
||||||
|
and T.name='${my_base_rs}'\ |
||||||
|
and R.is_virtual=0\ |
||||||
|
\ |
||||||
|
union\ |
||||||
|
select R.uniquename,\ |
||||||
|
R.is_virtual,\ |
||||||
|
'tmp_' || R.uniquename as runtime_tablename\ |
||||||
|
from rpta_resultset R where R.uniquename='${my_base_rs}'\ |
||||||
|
and R.is_virtual=1\ |
||||||
|
;\ |
||||||
|
]]>\ |
||||||
|
</sqlvar>\ |
||||||
|
<sqlvar name="rpta_resultset" type="hash"><![CDATA[\ |
||||||
|
select caption,\ |
||||||
|
uniquename,\ |
||||||
|
fieldclause,\ |
||||||
|
joinclause,\ |
||||||
|
whereclause,\ |
||||||
|
systeminfo_id\ |
||||||
|
from rpta_resultset\ |
||||||
|
where uniquename='${basetable.name}';\ |
||||||
|
\ |
||||||
|
]]></sqlvar>\ |
||||||
|
<sqlvar name="rpta_column_layout" type="hash"><![CDATA[\ |
||||||
|
select L.uniquename,\ |
||||||
|
L.caption,\ |
||||||
|
L.whereclause,\ |
||||||
|
R.is_virtual,\ |
||||||
|
L.sortclause\ |
||||||
|
from rpta_resultset R, rpta_column_layout L\ |
||||||
|
where L.resultset_id=R.tid\ |
||||||
|
and R.uniquename='${basetable.name}'\ |
||||||
|
and L.uniquename=<<Spaltenlayout>>;\ |
||||||
|
\ |
||||||
|
]]></sqlvar>\ |
||||||
|
<sqlvar name="columns" type="hashsequence"><![CDATA[\ |
||||||
|
SELECT C.srcfieldname,\ |
||||||
|
(case when string_not_null(C.targetfieldname)='' then C.srcfieldname else C.targetfieldname end) as targetfieldname,\ |
||||||
|
T.uniquename as coltype,\ |
||||||
|
C.is_aggregate,\ |
||||||
|
(case when string_not_null(CL.caption)='' then C.caption else CL.caption end) as caption,\ |
||||||
|
CL.is_visible,\ |
||||||
|
CL.visible_size as visible_width,\ |
||||||
|
F.sql_code as format_sql,\ |
||||||
|
F.uniquename as format_uniquename,\ |
||||||
|
C.col_function as colfunction,\ |
||||||
|
(case when string_not_null(CL.description)='' then C.description else CL.description end) as description\ |
||||||
|
FROM rpta_column_layout L, rpta_column C, rpta_column_type T,rpta_column2layout CL \ |
||||||
|
left outer join rpta_format_code F on (F.tid=CL.format_code_id)\ |
||||||
|
where L.tid=CL.layout_id\ |
||||||
|
and C.tid=CL.column_id\ |
||||||
|
and T.tid=C.column_type\ |
||||||
|
and L.uniquename=<<Spaltenlayout>>\ |
||||||
|
/* and C.uniquename in (<<Spalten>>) */\ |
||||||
|
order by CL.sortnr\ |
||||||
|
;\ |
||||||
|
]]></sqlvar>\ |
||||||
|
<sqlvar name="endsemester"><![CDATA[\ |
||||||
|
SELECT max(tid)\ |
||||||
|
from semester \ |
||||||
|
where 1=1\ |
||||||
|
/* and tid >= <<Seit Semester>> */\ |
||||||
|
/* and tid <= <<Bis Semester>> */\ |
||||||
|
<#if "<<Semestertyp>>"="1" || "<<Semestertyp>>"="2">\ |
||||||
|
and substring('' || tid from 5 for 1)='<<Semestertyp>>'\ |
||||||
|
</#if>\ |
||||||
|
;\ |
||||||
|
\ |
||||||
|
]]></sqlvar>\ |
||||||
|
<sqlvar name="SOS_MTKNR_EXT">\ |
||||||
|
select 1 from xdummy where 0 != (select \ |
||||||
|
count(*) from konstanten where beschreibung='SOS_MTKNR_EXT'\ |
||||||
|
and apnr=1)\ |
||||||
|
union select 0 from xdummy where 0 = (select \ |
||||||
|
count(*) from konstanten where beschreibung='SOS_MTKNR_EXT'\ |
||||||
|
and apnr=1)\ |
||||||
|
;\ |
||||||
|
</sqlvar>\ |
||||||
|
\ |
||||||
|
</sqlvars>\ |
||||||
|
\ |
||||||
|
<#assign richtung="" />\ |
||||||
|
/* <#assign richtung=<<Richtung>> />*/\ |
||||||
|
<#if richtung="" && rpta_column_layout.whereclause?index_of("gw") != -1>\ |
||||||
|
<#assign richtung="gw" />\ |
||||||
|
<#elseif richtung="" && rpta_column_layout.whereclause?index_of("wg") != -1>\ |
||||||
|
<#assign richtung="wg" />\ |
||||||
|
<#else>\ |
||||||
|
<#assign richtung="gw" />\ |
||||||
|
</#if>\ |
||||||
|
\ |
||||||
|
\ |
||||||
|
<#assign mtknr_filter=basetable.name+".matrikel_nr::varchar(255)" />\ |
||||||
|
<#if SOS_MTKNR_EXT=1>\ |
||||||
|
<#assign mtknr_filter=basetable.name+".pseudonym" />\ |
||||||
|
</#if>\ |
||||||
|
<#if richtung="gw" >\ |
||||||
|
<#assign tid_stg_col="abschluss_vorher_tid_stg" />\ |
||||||
|
<#assign stg_col="abschluss_vorher_stg" />\ |
||||||
|
<#assign abschluss_col="abschluss_vorher_abschluss" />\ |
||||||
|
<#assign semester_col="abschluss_vorher_semester" />\ |
||||||
|
</#if>\ |
||||||
|
<#if richtung="wg" >\ |
||||||
|
<#assign tid_stg_col="einschr_nachher_tid_stg" />\ |
||||||
|
<#assign stg_col="einschr_nachher_stg" />\ |
||||||
|
<#assign abschluss_col="einschr_nachher_abschluss" />\ |
||||||
|
<#assign semester_col="einschr_nachher_semester" />\ |
||||||
|
</#if>\ |
||||||
|
<#assign filter="1=1" />\ |
||||||
|
/* <#assign filter=filter+" and richtung='"+richtung+"'" /> --<<Richtung>> */\ |
||||||
|
\ |
||||||
|
<#assign studiengang_filter = "" />\ |
||||||
|
/* <#assign studiengang_filter = Studiengang.allNeededKeysList /> --<<Studiengang>> */ \ |
||||||
|
<#if studiengang_filter != "" >\ |
||||||
|
<#assign filter=filter + " and ('s_' || erfolg_ba_ma_uebergang."+tid_stg_col+"_1 in "+ studiengang_filter/> \ |
||||||
|
<#list 2..5 as fachnr>\ |
||||||
|
<#assign filter=filter + " or 's_' || erfolg_ba_ma_uebergang."+tid_stg_col+"_"+fachnr+" in "+ studiengang_filter /> \ |
||||||
|
</#list>\ |
||||||
|
<#assign filter=filter + ")" />\ |
||||||
|
</#if>\ |
||||||
|
\ |
||||||
|
<#assign fach_filter = "" />\ |
||||||
|
/* <#assign fach_filter = Fächer.allNeededKeysList /> --<<Fächer>> */ \ |
||||||
|
<#if fach_filter != "" >\ |
||||||
|
<#assign filter=filter + " and (erfolg_ba_ma_uebergang."+stg_col+"_1 in "+ fach_filter/> \ |
||||||
|
<#list 2..5 as fachnr>\ |
||||||
|
<#assign filter=filter + " or erfolg_ba_ma_uebergang."+stg_col+"_"+fachnr+" in "+ fach_filter /> \ |
||||||
|
</#list>\ |
||||||
|
<#assign filter=filter + ")" />\ |
||||||
|
</#if>\ |
||||||
|
\ |
||||||
|
/* \ |
||||||
|
<#assign filter = filter + " and " +abschluss_col+" in "+Studienabschluss.allNeededKeysList /> --<<Studienabschluss>> */\ |
||||||
|
\ |
||||||
|
\ |
||||||
|
/* <#assign filter=filter+" and "+ semester_col+" >=" + "<<Seit Semester>>" /> */\ |
||||||
|
/* <#assign filter=filter+" and "+ semester_col+" <=" + "<<Bis Semester>>" /> */\ |
||||||
|
\ |
||||||
|
<#assign filter=filter+" \ |
||||||
|
/* and geschlecht = <<Geschlecht>> */\ |
||||||
|
/* and einschr_nachher_<<Hörerstatus>>*/\ |
||||||
|
/* and <<Matrikel-Nr.>>=${mtknr_filter} */\ |
||||||
|
" />\ |
||||||
|
\ |
||||||
|
\ |
||||||
|
/* \ |
||||||
|
<#assign filter = filter + " and '' || "+basetable.name+".ca12_staat in "+Staatsangehörigkeit.allNeededKeysList /> --<<Staatsangehörigkeit>> */\ |
||||||
|
\ |
||||||
|
<#if columns?has_content>\ |
||||||
|
\ |
||||||
|
<#if basetable.is_virtual==1>\ |
||||||
|
\ |
||||||
|
create temp table ${basetable.runtime_tablename} as\ |
||||||
|
select ${rpta_resultset.fieldclause} \ |
||||||
|
from ${rpta_resultset.joinclause} \ |
||||||
|
where 1=1\ |
||||||
|
<#if rpta_resultset.whereclause != ""> \ |
||||||
|
${rpta_resultset.whereclause} </#if>\ |
||||||
|
and ${filter}\ |
||||||
|
;\ |
||||||
|
</#if>\ |
||||||
|
\ |
||||||
|
\ |
||||||
|
<@rpta_interpret_column_layout nonvirtualTableFilter=filter />\ |
||||||
|
\ |
||||||
|
</#if> --wenn columns?has_content^--Freemarker Template\ |
||||||
|
XIL List\ |
||||||
|
sizable_columns horizontal_scrolling\ |
||||||
|
drop_and_delete movable_columns \ |
||||||
|
white_space_color=COLOR_WHITE fixed_columns=1\ |
||||||
|
min_heading_height=55\ |
||||||
|
<#foreach column in columns>\ |
||||||
|
<#if column.is_visible!=0>\ |
||||||
|
Column CID=0 heading_text="${column.caption}" center_heading explanation="${column.description}"\ |
||||||
|
row_selectable heading_platform readonly\ |
||||||
|
width=${column.visible_width} text_size=60\ |
||||||
|
</#if>\ |
||||||
|
</#foreach>\ |
||||||
|
<#if 1=0>\ |
||||||
|
Column CID=0 heading_text="sortnr" center_heading explanation=""\ |
||||||
|
row_selectable heading_platform readonly\ |
||||||
|
width=5 text_size=60\ |
||||||
|
</#if>\ |
||||||
|
@@@^Studienfach^Anzahl bzw. Anteil^Übergang nach Abschluss zu einem neuen Studiengang oder vorheriger Abschluss bei Studienbeginn^drop table if exists tmp_stud2; drop table if exists tmp_stud3;^^2^850^540^^1^<<SQL>>SELECT description FROM rpta_column_layout where tid=<<Spaltenlayout>>;^ |
@ -0,0 +1 @@ |
|||||||
|
16^48310^ |
@ -0,0 +1,405 @@ |
|||||||
|
--freemarker template |
||||||
|
<sqlvars> |
||||||
|
<sqlvar name="erfolg_ba_ma_uebergang_exists"> |
||||||
|
select sp_table_exists('erfolg_ba_ma_uebergang') from xdummy; |
||||||
|
</sqlvar> |
||||||
|
<sqlvar name="fact_table_source"> |
||||||
|
select name |
||||||
|
from sx_tables where name ='erfolg_ba_ma_uebergang' |
||||||
|
|
||||||
|
</sqlvar> |
||||||
|
<sqlvar name="added_tables" type="hashsequence"> |
||||||
|
select 1::smallint as sortnr, |
||||||
|
name , |
||||||
|
trim(name) || '_abschluss_vorher_1_' as prefix, |
||||||
|
caption ||' 1 (Abschluss vorher)' as caption, |
||||||
|
'dim_studiengang.tid=erfolg_ba_ma_uebergang.abschluss_vorher_tid_stg_1' as joinclause |
||||||
|
from sx_tables where name in ('dim_studiengang') |
||||||
|
union |
||||||
|
select 20::smallint as sortnr, |
||||||
|
name, |
||||||
|
trim(name) || '_abschlussart_vorher_' as prefix, |
||||||
|
caption ||' 1 (Abschlussart vorher)' as caption, |
||||||
|
'erfolg_ba_ma_uebergang.abschluss_vorher_abschlussart=erfolg_ba_ma_abschlussart.apnr and erfolg_ba_ma_abschlussart.key=1' as joinclause |
||||||
|
from sx_tables where name in ('erfolg_ba_ma_abschlussart') |
||||||
|
union |
||||||
|
select 30::smallint as sortnr, |
||||||
|
name, |
||||||
|
trim(name) || '_abschluss_vorher_' as prefix, |
||||||
|
caption ||' (Abschluss vorher)' as caption, |
||||||
|
'erfolg_ba_ma_uebergang.abschluss_vorher_abschluss=sos_k_abint.apnr' as joinclause |
||||||
|
from sx_tables where name in ('sos_k_abint') |
||||||
|
union |
||||||
|
select 40::smallint as sortnr, |
||||||
|
name, |
||||||
|
trim(name) || '_einschr_nachher_' as prefix, |
||||||
|
caption ||' (Einschr. nachher)' as caption, |
||||||
|
'erfolg_ba_ma_uebergang.einschr_nachher_abschluss=k_abint.abint' as joinclause |
||||||
|
from sx_tables where name in ('k_abint') |
||||||
|
|
||||||
|
</sqlvar> |
||||||
|
<sqlvar name="fields_target" type="hashsequence"><![CDATA[ |
||||||
|
<#if fact_table_source?exists> |
||||||
|
select tid, table_name, |
||||||
|
name, |
||||||
|
name as targetname |
||||||
|
from sx_fields where table_name ='${fact_table_source}' |
||||||
|
and currentlyused=1 |
||||||
|
<#foreach added_table in added_tables> |
||||||
|
union |
||||||
|
select tid,table_name, |
||||||
|
name, |
||||||
|
'${added_table.prefix}' || name as targetname |
||||||
|
from sx_fields where table_name ='${added_table.name}' |
||||||
|
and currentlyused=1 |
||||||
|
|
||||||
|
</#foreach> |
||||||
|
order by 1 |
||||||
|
</#if> |
||||||
|
]]> |
||||||
|
</sqlvar> |
||||||
|
</sqlvars> |
||||||
|
|
||||||
|
<#if erfolg_ba_ma_uebergang_exists==1 && fact_table_source?exists > |
||||||
|
|
||||||
|
<#assign fact_table_target = {"name":"rpta_erfolg_ba_ma_uebergang", "caption":"Übergang Bacherlor - Master"} |
||||||
|
/> |
||||||
|
|
||||||
|
|
||||||
|
CREATE temp table tmp_tables( |
||||||
|
name CHAR(255) , |
||||||
|
caption CHAR(255) , |
||||||
|
description CHAR(255) , |
||||||
|
table_type CHAR(255) , |
||||||
|
systeminfo_id INTEGER , |
||||||
|
systeminfo_orig INTEGER , |
||||||
|
thema CHAR(255) , |
||||||
|
sachgebiete_id CHAR(255) |
||||||
|
); |
||||||
|
CREATE temp TABLE tmp_fields( |
||||||
|
tid serial NOT NULL, |
||||||
|
table_name VARCHAR(255) not null, |
||||||
|
name VARCHAR(255) not null, |
||||||
|
caption VARCHAR(255) , |
||||||
|
description VARCHAR(255) , |
||||||
|
field_type VARCHAR(255) not null, |
||||||
|
field_size VARCHAR(255) , |
||||||
|
field_not_null smallint, |
||||||
|
currentlyused SMALLINT , |
||||||
|
is_primarykey SMALLINT default 0 , |
||||||
|
foreignkey_tab VARCHAR(255) , |
||||||
|
foreignkey_col VARCHAR(255) , |
||||||
|
foreignkey_int VARCHAR(255) , |
||||||
|
foreignkey_cap VARCHAR(255) , |
||||||
|
foreignkey_cond VARCHAR(255) , |
||||||
|
foreignkey_func VARCHAR(255) , |
||||||
|
check_integrity SMALLINT, |
||||||
|
is_sum SMALLINT default 1, |
||||||
|
foreignkey_uniquename VARCHAR(255) |
||||||
|
|
||||||
|
); |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
update sx_fields set |
||||||
|
is_sum=0 |
||||||
|
where table_name='erfolg_ba_ma_uebergang' |
||||||
|
and name!='summe'; |
||||||
|
update sx_fields set |
||||||
|
is_sum=1 |
||||||
|
where table_name='erfolg_ba_ma_uebergang' |
||||||
|
and name='summe'; |
||||||
|
|
||||||
|
|
||||||
|
insert into tmp_tables ( |
||||||
|
name, |
||||||
|
caption, |
||||||
|
description, |
||||||
|
table_type, |
||||||
|
systeminfo_id, |
||||||
|
thema, |
||||||
|
sachgebiete_id |
||||||
|
) |
||||||
|
select |
||||||
|
'${fact_table_target.name}', |
||||||
|
'${fact_table_target.caption}', |
||||||
|
description, |
||||||
|
table_type, |
||||||
|
systeminfo_id, |
||||||
|
thema, |
||||||
|
sachgebiete_id |
||||||
|
from sx_tables where name='${fact_table_source}' |
||||||
|
; |
||||||
|
|
||||||
|
|
||||||
|
insert into tmp_fields (table_name, |
||||||
|
name, |
||||||
|
caption, |
||||||
|
description, |
||||||
|
field_type, |
||||||
|
field_size, |
||||||
|
field_not_null, |
||||||
|
currentlyused, |
||||||
|
is_primarykey, |
||||||
|
foreignkey_tab, |
||||||
|
foreignkey_col, |
||||||
|
foreignkey_int, |
||||||
|
foreignkey_cap, |
||||||
|
foreignkey_cond, |
||||||
|
foreignkey_func, |
||||||
|
check_integrity, |
||||||
|
is_sum, |
||||||
|
foreignkey_uniquename) |
||||||
|
select '${fact_table_target.name}' as table_name, |
||||||
|
name, |
||||||
|
caption, |
||||||
|
description, |
||||||
|
field_type, |
||||||
|
field_size, |
||||||
|
field_not_null, |
||||||
|
currentlyused, |
||||||
|
is_primarykey, |
||||||
|
foreignkey_tab, |
||||||
|
foreignkey_col, |
||||||
|
foreignkey_int, |
||||||
|
foreignkey_cap, |
||||||
|
foreignkey_cond, |
||||||
|
foreignkey_func, |
||||||
|
check_integrity, |
||||||
|
is_sum, |
||||||
|
foreignkey_uniquename |
||||||
|
from sx_fields where table_name ='${fact_table_source}' |
||||||
|
and currentlyused=1; |
||||||
|
<#foreach added_table in added_tables> |
||||||
|
insert into tmp_fields (table_name, |
||||||
|
name, |
||||||
|
caption, |
||||||
|
description, |
||||||
|
field_type, |
||||||
|
field_size, |
||||||
|
field_not_null, |
||||||
|
currentlyused, |
||||||
|
is_primarykey, |
||||||
|
foreignkey_tab, |
||||||
|
foreignkey_col, |
||||||
|
foreignkey_int, |
||||||
|
foreignkey_cap, |
||||||
|
foreignkey_cond, |
||||||
|
foreignkey_func, |
||||||
|
check_integrity, |
||||||
|
is_sum, |
||||||
|
foreignkey_uniquename) |
||||||
|
select '${fact_table_target.name}' as table_name, |
||||||
|
'${added_table.prefix}' || name, |
||||||
|
'${added_table.caption}: ' || caption, |
||||||
|
description, |
||||||
|
field_type, |
||||||
|
field_size, |
||||||
|
field_not_null, |
||||||
|
currentlyused, |
||||||
|
is_primarykey, |
||||||
|
foreignkey_tab, |
||||||
|
foreignkey_col, |
||||||
|
foreignkey_int, |
||||||
|
foreignkey_cap, |
||||||
|
foreignkey_cond, |
||||||
|
foreignkey_func, |
||||||
|
check_integrity, |
||||||
|
is_sum, |
||||||
|
foreignkey_uniquename |
||||||
|
from sx_fields where table_name ='${added_table.name}' |
||||||
|
and currentlyused=1; |
||||||
|
</#foreach> |
||||||
|
|
||||||
|
CREATE temp TABLE tmp_rpta_resultset |
||||||
|
( |
||||||
|
caption varchar(255), |
||||||
|
uniquename varchar(255), |
||||||
|
fieldclause text, |
||||||
|
joinclause text, |
||||||
|
whereclause text, |
||||||
|
systeminfo_id integer |
||||||
|
); |
||||||
|
|
||||||
|
insert into tmp_rpta_resultset(caption, |
||||||
|
uniquename, |
||||||
|
systeminfo_id) |
||||||
|
select '${fact_table_target.caption}', |
||||||
|
'${fact_table_target.name}', |
||||||
|
120 |
||||||
|
; |
||||||
|
|
||||||
|
|
||||||
|
update tmp_rpta_resultset set fieldclause=' |
||||||
|
<#foreach field_target in fields_target> |
||||||
|
${field_target.table_name}.${field_target.name} as ${field_target.targetname}, |
||||||
|
</#foreach> |
||||||
|
null::varchar as dummy', |
||||||
|
joinclause='${fact_table_source} |
||||||
|
<#foreach added_table in added_tables> |
||||||
|
left outer join ${added_table.name} on (${added_table.joinclause}) |
||||||
|
</#foreach>'; |
||||||
|
|
||||||
|
select * into temp tmp_rs1 |
||||||
|
from rpta_resultset |
||||||
|
; |
||||||
|
|
||||||
|
update rpta_resultset set caption=T.caption, |
||||||
|
fieldclause=T.fieldclause, |
||||||
|
joinclause=T.joinclause, |
||||||
|
whereclause=T.whereclause |
||||||
|
from tmp_rpta_resultset T |
||||||
|
where T.systeminfo_id=rpta_resultset.systeminfo_id |
||||||
|
and T.uniquename=rpta_resultset.uniquename |
||||||
|
; |
||||||
|
|
||||||
|
insert into rpta_resultset(caption, |
||||||
|
uniquename, |
||||||
|
fieldclause, |
||||||
|
joinclause, |
||||||
|
whereclause, |
||||||
|
systeminfo_id) |
||||||
|
select caption, |
||||||
|
uniquename, |
||||||
|
fieldclause, |
||||||
|
joinclause, |
||||||
|
whereclause, |
||||||
|
systeminfo_id |
||||||
|
from tmp_rpta_resultset |
||||||
|
where 0=(select count(*) |
||||||
|
from tmp_rs1 T |
||||||
|
where T.systeminfo_id=tmp_rpta_resultset.systeminfo_id |
||||||
|
and T.uniquename=tmp_rpta_resultset.uniquename) |
||||||
|
; |
||||||
|
drop table tmp_rpta_resultset; |
||||||
|
drop table tmp_rs1; |
||||||
|
|
||||||
|
delete from sx_tables where name |
||||||
|
in (select T.name from tmp_tables T); |
||||||
|
|
||||||
|
insert into sx_tables (name,caption,description,table_type,systeminfo_id,systeminfo_orig,thema,sachgebiete_id) |
||||||
|
select name,caption,description,table_type,systeminfo_id,systeminfo_orig,thema,sachgebiete_id |
||||||
|
from tmp_tables; |
||||||
|
|
||||||
|
|
||||||
|
delete from sx_fields where table_name |
||||||
|
in (select T.table_name from tmp_fields T); |
||||||
|
|
||||||
|
insert into sx_fields (table_name,name,caption,description,field_type, |
||||||
|
field_size, |
||||||
|
field_not_null, |
||||||
|
currentlyUsed, |
||||||
|
foreignkey_tab, |
||||||
|
foreignkey_col, |
||||||
|
foreignkey_cap, |
||||||
|
foreignkey_int, |
||||||
|
foreignkey_cond, |
||||||
|
foreignkey_func, |
||||||
|
check_integrity, |
||||||
|
is_sum, |
||||||
|
foreignkey_uniquename |
||||||
|
) |
||||||
|
select |
||||||
|
F.table_name,F.name,F.caption,F.description,F.field_type, |
||||||
|
F.field_size, |
||||||
|
F.field_not_null, |
||||||
|
F.currentlyUsed, |
||||||
|
F.foreignkey_tab, |
||||||
|
F.foreignkey_col, |
||||||
|
F.foreignkey_cap, |
||||||
|
F.foreignkey_int, |
||||||
|
F.foreignkey_cond, |
||||||
|
F.foreignkey_func, |
||||||
|
F.check_integrity, |
||||||
|
F.is_sum, |
||||||
|
F.foreignkey_uniquename |
||||||
|
|
||||||
|
from tmp_fields F; |
||||||
|
|
||||||
|
|
||||||
|
drop table tmp_fields; |
||||||
|
drop table tmp_tables; |
||||||
|
|
||||||
|
|
||||||
|
--rpta_column füllen: |
||||||
|
select * into temp tmp_rc1 |
||||||
|
from rpta_column; |
||||||
|
|
||||||
|
|
||||||
|
create temp table tmp_rpta_column( |
||||||
|
uniquename varchar(255) NOT NULL, |
||||||
|
caption varchar(255), |
||||||
|
srcfieldname varchar(255), |
||||||
|
column_type integer, |
||||||
|
col_function text, |
||||||
|
is_aggregate smallint, |
||||||
|
resultset_id integer, |
||||||
|
description text, |
||||||
|
custom integer default 0 |
||||||
|
); |
||||||
|
|
||||||
|
insert into tmp_rpta_column( uniquename, |
||||||
|
caption, |
||||||
|
srcfieldname, |
||||||
|
column_type, |
||||||
|
col_function, |
||||||
|
is_aggregate, |
||||||
|
resultset_id, |
||||||
|
description) |
||||||
|
select F.name as uniquename, |
||||||
|
coalesce(T.caption,T.name) || ' - ' || F.caption, |
||||||
|
F.name as srcfieldname, |
||||||
|
1 as column_type, |
||||||
|
(case when F.is_sum=1 then 'sum' else null::varchar end) as col_function, |
||||||
|
(case when F.is_sum=1 then 1 else 0 end) as is_aggregate, |
||||||
|
R.tid as resultset_id, |
||||||
|
F.description |
||||||
|
from rpta_resultset R, sx_fields F left outer join sx_tables T on (T.name=F.table_name) |
||||||
|
where F.table_name='${fact_table_target.name}' |
||||||
|
and R.uniquename='${fact_table_target.name}' |
||||||
|
and F.currentlyused=1 |
||||||
|
; |
||||||
|
|
||||||
|
update rpta_column set |
||||||
|
caption=T.caption, |
||||||
|
srcfieldname=T.srcfieldname, |
||||||
|
column_type=T.column_type, |
||||||
|
col_function=T.col_function, |
||||||
|
is_aggregate=T.is_aggregate, |
||||||
|
resultset_id=R.tid, |
||||||
|
description=T.description, |
||||||
|
custom=T.custom |
||||||
|
from tmp_rpta_column T, rpta_resultset R |
||||||
|
where T.uniquename=rpta_column.uniquename |
||||||
|
and rpta_column.resultset_id=R.tid |
||||||
|
and R.uniquename='${fact_table_target.name}' |
||||||
|
; |
||||||
|
insert into rpta_column( uniquename, |
||||||
|
caption, |
||||||
|
srcfieldname, |
||||||
|
column_type, |
||||||
|
col_function, |
||||||
|
is_aggregate, |
||||||
|
resultset_id, |
||||||
|
description, |
||||||
|
custom) |
||||||
|
select T.uniquename, |
||||||
|
T.caption, |
||||||
|
T.srcfieldname, |
||||||
|
T.column_type, |
||||||
|
T.col_function, |
||||||
|
T.is_aggregate, |
||||||
|
R.tid as resultset_id, |
||||||
|
T.description, |
||||||
|
T.custom |
||||||
|
from tmp_rpta_column T, rpta_resultset R |
||||||
|
where R.uniquename='${fact_table_target.name}' |
||||||
|
and 0=(select count(*) from tmp_rc1 C |
||||||
|
where C.uniquename=T.uniquename |
||||||
|
and C.resultset_id=R.tid) |
||||||
|
; |
||||||
|
|
||||||
|
drop table tmp_rpta_column; |
||||||
|
drop table tmp_rc1; |
||||||
|
|
||||||
|
</#if> --wenn erfolg_ba_ma_uebergang_exists=1 |
@ -0,0 +1,78 @@ |
|||||||
|
--freemarker template |
||||||
|
<#include "RPTA-Makros"/> |
||||||
|
<sqlvars> |
||||||
|
<sqlvar name="rpta_erfolg_ba_ma_uebergang_exists"> |
||||||
|
select count(*) from rpta_resultset where uniquename='rpta_erfolg_ba_ma_uebergang'; |
||||||
|
</sqlvar> |
||||||
|
</sqlvars> |
||||||
|
<#assign rpta_column_layout = {"uniquename":"ba_ma_uebergang_nach_abschluss_fach", |
||||||
|
"caption":"Herkunftsstudiengang der Master-Studienanfänger_innen auf Abschlussebene", |
||||||
|
"rpta_resultset":"rpta_erfolg_ba_ma_uebergang", |
||||||
|
"whereclause":"richtung=''wg'' and einschr_nachher_abschlussart=''A37''", |
||||||
|
"description":"Übergang Bachelor-Master mit Aggregierung auf Abschluss und Fach beim vorherigen Abschluss und Abschluss beim nachfolgenden Studiengang" |
||||||
|
} |
||||||
|
/> |
||||||
|
|
||||||
|
<#assign rpta_columns = [ |
||||||
|
|
||||||
|
{"uniquename":"dim_studiengang_abschluss_vorher_1_stg_str", |
||||||
|
"caption_der_spalte":"Vorheriger Abschluss Fach", |
||||||
|
"caption_in_ergebnistabelle":"Fach bei Bachelor Abschluss eigene Hochschule", |
||||||
|
"srcfieldname":"dim_studiengang_abschluss_vorher_1_stg_str", |
||||||
|
"column_type":"physicalColumn", |
||||||
|
"col_function":"", |
||||||
|
"is_visible":"1", |
||||||
|
"visible_size":"10", |
||||||
|
"is_aggregate":"0", |
||||||
|
"description":"Erstes Fach beim Bachelor Abschluss eigene Hochschule" |
||||||
|
}, |
||||||
|
{"uniquename":"sos_k_abint_abschluss_vorher_druck", |
||||||
|
"caption_der_spalte":"Vorheriger Abschluss", |
||||||
|
"caption_in_ergebnistabelle":"Bachelor Abschluss eigene Hochschule", |
||||||
|
"srcfieldname":"sos_k_abint_abschluss_vorher_druck", |
||||||
|
"column_type":"physicalColumn", |
||||||
|
"col_function":"", |
||||||
|
"is_visible":"1", |
||||||
|
"visible_size":"10", |
||||||
|
"is_aggregate":"0", |
||||||
|
"description":"" |
||||||
|
}, |
||||||
|
{"uniquename":"fach_ba_ext", |
||||||
|
"caption_der_spalte":"Vorheriger Studiengang extern", |
||||||
|
"caption_in_ergebnistabelle":"Fach bei Bachelor Abschluss fremde Hochschule", |
||||||
|
"srcfieldname":"", |
||||||
|
"targetfieldname":"fach_ba_ext", |
||||||
|
"column_type":"lookupColumn", |
||||||
|
"col_function":"select coalesce(K.name,F.studienfach) from k_astat_abschl_grp A,sos_pruefungenext F left outer join k_astat_studienfach_land K on (F.studienfach=''0'' || K.schluessel and K.land=5) where F.ang_abschl=A.abschluss_astat_bund and A.abschlussart=''A24'' and F.matrikel_nr=tmp_rpta_erfolg_ba_ma_uebergang.matrikel_nr and F.prfg_sem <= tmp_rpta_erfolg_ba_ma_uebergang.einschr_nachher_semester limit 1", |
||||||
|
"is_visible":"1", |
||||||
|
"visible_size":"10", |
||||||
|
"is_aggregate":"0", |
||||||
|
"description":"" |
||||||
|
}, |
||||||
|
{"uniquename":"k_abint_einschr_nachher_dtxt", |
||||||
|
"caption_der_spalte":"Nachfolgender Studiengang (Abschluss)", |
||||||
|
"caption_in_ergebnistabelle":"Master-Abschluss bei Studienbeginn", |
||||||
|
"srcfieldname":"k_abint_einschr_nachher_dtxt", |
||||||
|
"column_type":"physicalColumn", |
||||||
|
"col_function":"", |
||||||
|
"is_visible":"1", |
||||||
|
"visible_size":"10", |
||||||
|
"is_aggregate":"0", |
||||||
|
"description":"" |
||||||
|
}, |
||||||
|
{"uniquename":"summe", |
||||||
|
"caption":"Summe der Studierenden", |
||||||
|
"srcfieldname":"summe", |
||||||
|
"column_type":"physicalColumn", |
||||||
|
"col_function":"sum", |
||||||
|
"is_visible":"1", |
||||||
|
"visible_size":"5", |
||||||
|
"is_aggregate":"1", |
||||||
|
"description":"Summe der Studierenden" |
||||||
|
} |
||||||
|
] |
||||||
|
/> |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<@rpta_column_layout_fuellen /> |
@ -0,0 +1,52 @@ |
|||||||
|
--freemarker template |
||||||
|
<#include "RPTA-Makros"/> |
||||||
|
<sqlvars> |
||||||
|
<sqlvar name="rpta_erfolg_ba_ma_uebergang_exists"> |
||||||
|
select count(*) from rpta_resultset where uniquename='rpta_erfolg_ba_ma_uebergang'; |
||||||
|
</sqlvar> |
||||||
|
</sqlvars> |
||||||
|
<#assign rpta_column_layout = {"uniquename":"ba_ma_uebergang_nach_abschluss", |
||||||
|
"caption":"Übergang Bachelor-Master auf Abschlussebene", |
||||||
|
"rpta_resultset":"rpta_erfolg_ba_ma_uebergang", |
||||||
|
"whereclause":"richtung=''gw'' and abschluss_vorher_abschlussart=''A24''", |
||||||
|
"description":"Übergang Bachelor-Master mit Aggregierung auf Abschlussart sowohl beim vorherigen Abschluss als auch beim nachfolgenden Studiengang" |
||||||
|
} |
||||||
|
/> |
||||||
|
|
||||||
|
<#assign rpta_columns = [ |
||||||
|
{"uniquename":"sos_k_abint_abschluss_vorher_druck", |
||||||
|
"caption":"Vorheriger Abschluss", |
||||||
|
"srcfieldname":"sos_k_abint_abschluss_vorher_druck", |
||||||
|
"column_type":"physicalColumn", |
||||||
|
"col_function":"", |
||||||
|
"is_visible":"1", |
||||||
|
"visible_size":"10", |
||||||
|
"is_aggregate":"0", |
||||||
|
"description":"" |
||||||
|
}, |
||||||
|
{"uniquename":"k_abint_einschr_nachher_dtxt", |
||||||
|
"caption":"Nachfolgender Studiengang (Abschluss)", |
||||||
|
"srcfieldname":"k_abint_einschr_nachher_dtxt", |
||||||
|
"column_type":"physicalColumn", |
||||||
|
"col_function":"", |
||||||
|
"is_visible":"1", |
||||||
|
"visible_size":"10", |
||||||
|
"is_aggregate":"0", |
||||||
|
"description":"" |
||||||
|
}, |
||||||
|
{"uniquename":"summe", |
||||||
|
"caption":"Summe der Studierenden", |
||||||
|
"srcfieldname":"summe", |
||||||
|
"column_type":"physicalColumn", |
||||||
|
"col_function":"sum", |
||||||
|
"is_visible":"1", |
||||||
|
"visible_size":"5", |
||||||
|
"is_aggregate":"1", |
||||||
|
"description":"Summe der Studierenden" |
||||||
|
} |
||||||
|
] |
||||||
|
/> |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<@rpta_column_layout_fuellen /> |
@ -0,0 +1,81 @@ |
|||||||
|
--freemarker template |
||||||
|
<#include "RPTA-Makros"/> |
||||||
|
<sqlvars> |
||||||
|
<sqlvar name="sos_stud_astat_exists"> |
||||||
|
select count(*) from rpta_resultset where uniquename='sos_stud_astat'; |
||||||
|
</sqlvar> |
||||||
|
</sqlvars> |
||||||
|
<#assign rpta_column_layout = {"uniquename":"internationale_studierende_sicht", |
||||||
|
"caption":"Internationale Studierende (Baum)", |
||||||
|
"rpta_resultset":"sos_stud_astat", |
||||||
|
"whereclause":"", |
||||||
|
"description":"Internationale Studierende mit Baumstruktur nach Studiengang-Sicht", |
||||||
|
"sortclause":"sortnr" |
||||||
|
} |
||||||
|
/> |
||||||
|
|
||||||
|
<#assign rpta_columns = [ |
||||||
|
{"uniquename":"dim_studiengang_s_tid_stg", |
||||||
|
"caption":"Studiengang Sichtelement-ID", |
||||||
|
"srcfieldname":"", |
||||||
|
"targetfieldname":"s_tid_stg", |
||||||
|
"column_type":"logicalColumn", |
||||||
|
"col_function":"(''s_'' || tid_stg)::varchar(255)", |
||||||
|
"is_visible":"0", |
||||||
|
"format_code":"", |
||||||
|
"visible_size":"30", |
||||||
|
"is_aggregate":"0", |
||||||
|
"description":"Studiengang" |
||||||
|
}, |
||||||
|
{"uniquename":"dim_studiengang_s_tid_stg_ebene", |
||||||
|
"caption":"Ebene", |
||||||
|
"srcfieldname":"", |
||||||
|
"targetfieldname":"ebene", |
||||||
|
"column_type":"logicalColumn", |
||||||
|
"col_function":"null::integer", |
||||||
|
"is_visible":"1", |
||||||
|
"format_code":"", |
||||||
|
"visible_size":"5", |
||||||
|
"is_aggregate":"0", |
||||||
|
"description":"Studiengang" |
||||||
|
}, |
||||||
|
{"uniquename":"dim_studiengang_sicht", |
||||||
|
"caption":"Studiengang", |
||||||
|
"srcfieldname":"s_tid_stg", |
||||||
|
"targetfieldname":"studiengang", |
||||||
|
"column_type":"treeColumn", |
||||||
|
"col_function":"Studiengang", |
||||||
|
"is_visible":"1", |
||||||
|
"format_code":"", |
||||||
|
"visible_size":"30", |
||||||
|
"is_aggregate":"0", |
||||||
|
"description":"Studiengang" |
||||||
|
}, |
||||||
|
{"uniquename":"ca12staat_str", |
||||||
|
"caption":"Staatsangehörigkeit (Name des Staates)", |
||||||
|
"srcfieldname":"ca12staat", |
||||||
|
"targetfieldname":"ca12staat_str", |
||||||
|
"column_type":"lookupColumn", |
||||||
|
"col_function":"select C2.druck from cif C2 where C2.key=12 and C2.apnr=ca12_staat", |
||||||
|
"is_visible":"1", |
||||||
|
"format_code":"", |
||||||
|
"visible_size":"5", |
||||||
|
"is_aggregate":"0", |
||||||
|
"description":"Staat (Name)" |
||||||
|
}, |
||||||
|
{"uniquename":"gesamt", |
||||||
|
"caption_der_spalte":"Studierende ohne beurl.", |
||||||
|
"caption_in_ergebnistabelle":"Studierende ohne beurl.", |
||||||
|
"srcfieldname":"summe", |
||||||
|
"column_type":"logicalColumn", |
||||||
|
"col_function":"case when kz_rueck_beur_ein<>4 then summe::integer else 0::integer end", |
||||||
|
"is_visible":"1", |
||||||
|
"visible_size":"5", |
||||||
|
"format_code":"MASK_ZERO_INT", |
||||||
|
"is_aggregate":"1", |
||||||
|
"description":"" |
||||||
|
} |
||||||
|
|
||||||
|
] |
||||||
|
/> |
||||||
|
<@rpta_column_layout_fuellen /> |
Loading…
Reference in new issue