Browse Source

Denormalize studysemester (Fachsemester) COSTAGE/issues/2

COStage_0.2_Release
Daniel Quathamer 3 years ago
parent
commit
3ff3b76f2f
  1. 2
      build.xml
  2. 67
      src-modules/module/costage/conf/costage.xml
  3. 25
      src-modules/module/costage/hilfstabellen/costage_st_studien_aggr_fuellen.sql
  4. 55
      src-modules/module/costage/masken/43040_felderinfo.unl
  5. 1
      src-modules/module/costage/masken/43040_maske_system_bez.unl
  6. 20
      src-modules/module/costage/masken/43040_masken_felder_bez.unl
  7. 174
      src-modules/module/costage/masken/43040_maskeninfo.unl
  8. 1
      src-modules/module/costage/masken/43040_sachgeb_maske_bez.unl
  9. 256
      src-modules/module/costage/schluesseltabellen/cifx_fuellen.sql
  10. 2
      src-modules/module/costage/schluesseltabellen/sachgebiete_fuellen.sql
  11. 149
      src-modules/module/costage/schluesseltabellen/sx_stylesheets_einfuegen.sql

2
build.xml

@ -25,8 +25,8 @@ ant -f ../../conf/build.xml -DMODULE=costage -DPFAD=/home/superx/fertige_module @@ -25,8 +25,8 @@ ant -f ../../conf/build.xml -DMODULE=costage -DPFAD=/home/superx/fertige_module
<os family="unix" />
</condition>
<target name="all" description="Gruppe: Kopiere Modul Sourcen in den WEB-INF-Verzeichnisbaum">
<antcall target="call_module_scripts_create_ant" />
<antcall target="module_copy_source" />
<antcall target="call_module_scripts_create_ant" />
</target>
<target name="module_copy_source" description="Gruppe: Kopiere Modul Sourcen in den WEB-INF-Verzeichnisbaum">
<echo message="Start module_copy_sources für Modul ${MODULE} in Pfad ${MODULE_PATH}" />

67
src-modules/module/costage/conf/costage.xml

@ -267,9 +267,9 @@ rightname="CS_BIA_STANDARDREPORTS_ADMIN[CO]" /> @@ -267,9 +267,9 @@ rightname="CS_BIA_STANDARDREPORTS_ADMIN[CO]" />
<column name="studientyp_kb" type ="VARCHAR" size ="10" default ="" notnull ="true" />
<column name="stp_stp_nr" type ="INTEGER" size ="8" default ="" notnull ="false" />
<column name="stg" type ="CHAR" size ="10" default ="" notnull ="false" description="Studienfach"/>
<column name="abschluss" type ="CHAR" size ="10" default ="" notnull ="false" description="Studienfach"/>
<column name="stuart" type ="CHAR" size ="10" default ="" notnull ="false" description="Studienfach"/>
<column name="stufrm" type ="CHAR" size ="10" default ="" notnull ="false" description="Studienfach"/>
<column name="abschluss" type ="CHAR" size ="10" default ="" notnull ="false" description="Abschluss"/>
<column name="stuart" type ="CHAR" size ="10" default ="" notnull ="false" description="Studienart"/>
<column name="stufrm" type ="CHAR" size ="10" default ="" notnull ="false" description="Studienform"/>
</columns>
<indexes></indexes>
@ -394,13 +394,14 @@ rightname="CS_BIA_STANDARDREPORTS_ADMIN[CO]" /> @@ -394,13 +394,14 @@ rightname="CS_BIA_STANDARDREPORTS_ADMIN[CO]" />
</table>
<table name="costage_st_studien_aggr" thema="Studierende" typ="Hilfstabelle" releaseUnload="empty">
<columns><column name="st_studium_nr" type ="INTEGER" size ="8" default ="" notnull ="true" description="Studium (ID)" />
<column name="st_studstamm_nr" type ="INTEGER" size ="8" default ="" notnull ="true" description="Studierendenstammdaten (ID)" />
<column name="matrikelnummer" type ="INTEGER" size ="8" default ="" notnull ="false" description="Matrikelnummer" />
<column name="st_studiengang_nr" type ="INTEGER" size ="8" default ="" notnull ="false" description="Studiengang (ID)" />
<column name="st_studienstatus_nr" type ="INTEGER" size ="8" default ="" notnull ="false" description="Studienstatus (ID)" />
<column name="status" type ="SMALLINT" size ="4" default ="" notnull ="false" description="Studienstatus" />
<column name="statustyp" type ="CHAR" size ="10" default ="" notnull ="false" description="Studienstatus" />
<column name="hrst" type ="CHAR" size ="10" default ="" notnull ="false" description="Hörerstatus" />
<column name="semester" type ="INTEGER" size ="8" default ="" notnull ="true" description="Semester" />
<column name="fachsemester" type ="DECIMAL" size ="(38,0)" default ="" notnull ="false" description="Fachsemester" />
@ -436,7 +437,20 @@ parent="CO Basisdaten">Abfragen zur Administration CO Basisdaten</thema> @@ -436,7 +437,20 @@ parent="CO Basisdaten">Abfragen zur Administration CO Basisdaten</thema>
<path>$COSTAGE_PFAD/masken</path>
</src>
</maske>
</masken>
<maske tid="43020" name="Studierende (Zeitreihe)" thema="CO Basisdaten">
<description>Studierende Zeitreihe</description>
<src>
<path>$COSTAGE_PFAD/masken</path>
</src>
</maske>
<maske tid="43040" name="Studierende Datenblatt (CO)" thema="CO Basisdaten">
<description>Studierende Zeitreihe</description>
<src>
<path>$COSTAGE_PFAD/masken</path>
</src>
</maske>
</masken>
<data-integrity>
<!--costage_st_studierendenstammdaten-->
@ -496,14 +510,22 @@ parent="CO Basisdaten">Abfragen zur Administration CO Basisdaten</thema> @@ -496,14 +510,22 @@ parent="CO Basisdaten">Abfragen zur Administration CO Basisdaten</thema>
<relation-column from="st_absz_nr" to="st_absz_nr" />
</relation>
<relation from="costage_st_studiengaenge" to="costage_st_studien_aggr" delete="FALSE"
displayType="select" visibleFields="studiengangs_identifikator" format="%s">
displayType="select" visibleFields="studiengangs_bezeichnung" format="%s">
<relation-column from="st_studiengang_nr" to="st_studiengang_nr" />
</relation>
<relation from="costage_st_laender" to="costage_st_studien_aggr" delete="FALSE"
displayType="select" visibleFields="name" format="%s">
<relation-column from="st_land_nr" to="st_land1_nr" />
</relation>
<relation from="cifx" to="costage_st_studien_aggr" delete="FALSE" displayType="select" visibleFields="druck" uniquenameField="uniquename" format="%s">
<relation-column from="apnr" to="statustyp" />
<relation-column from="key" to="400" />
</relation>
<relation from="cifx" to="costage_st_studien_aggr" delete="FALSE" displayType="select" visibleFields="druck" uniquenameField="uniquename" format="%s">
<relation-column from="apnr" to="hrst" />
<relation-column from="key" to="401" />
</relation>
</data-integrity>
@ -535,20 +557,21 @@ parent="CO Basisdaten">Abfragen zur Administration CO Basisdaten</thema> @@ -535,20 +557,21 @@ parent="CO Basisdaten">Abfragen zur Administration CO Basisdaten</thema>
<loadtable refresh="true" delimiter="^" header="false" tabname="costage_st_studien_spoversionen"><file path="$COSTAGE_LOAD_PFAD/unl/costage_st_studien_spoversionen.unl"/></loadtable>
<loadtable refresh="true" delimiter="^" header="false" tabname="costage_st_studien"><file path="$COSTAGE_LOAD_PFAD/unl/costage_st_studien.unl"/></loadtable>
<loadtable refresh="true" delimiter="^" header="false" tabname="costage_st_studierendenstammdaten_neu"><file path="$COSTAGE_LOAD_PFAD/unl/costage_st_studierendenstammdaten.unl"/></loadtable>
<nativeaction sql="" scriptfile="$COSTAGE_PFAD/schluesseltabellen/cifx_fuellen.sql" database=""/>
</action>
</etl-step>
<etl-step name="Transformation" type="trans">
<action>
<nativeaction sql="" scriptfile="$ETL_PFAD/schluesseltabellen/trans_costage_st_semester.sql" database=""/>
<nativeaction sql="" scriptfile="$ETL_PFAD/schluesseltabellen/trans_costage_st_studiengaenge.sql" database=""/>
<nativeaction sql="" scriptfile="$ETL_PFAD/datentabellen/trans_costage_st_studierendenstammdaten.sql" database=""/>
<nativeaction sql="" scriptfile="$COSTAGE_PFAD/schluesseltabellen/trans_costage_st_semester.sql" database=""/>
<nativeaction sql="" scriptfile="$COSTAGE_PFAD/schluesseltabellen/trans_costage_st_studiengaenge.sql" database=""/>
<nativeaction sql="" scriptfile="$COSTAGE_PFAD/datentabellen/trans_costage_st_studierendenstammdaten.sql" database=""/>
</action>
</etl-step>
<etl-step name="Aggregation" type="aggr">
<action>
<nativeaction sql="" scriptfile="$COSTAGE_PFAD/hilfstabellen/costage_st_studien_aggr_fuellen.sql" database=""/>
<nativeaction sql="" scriptfile="$COSTAGE_PFAD/schluesseltabellen/semester_bereinigen.sql" database="POSTGRES"/>
<nativeaction sql="" scriptfile="$COSTAGE_PFAD/schluesseltabellen/semester_bereinigen.sql" database=""/>
<nativeaction sql="" scriptfile="$COSTAGE_PFAD/hilfstabellen/vacuum_pg.sql" database="POSTGRES"/>
</action>
@ -558,14 +581,7 @@ parent="CO Basisdaten">Abfragen zur Administration CO Basisdaten</thema> @@ -558,14 +581,7 @@ parent="CO Basisdaten">Abfragen zur Administration CO Basisdaten</thema>
<install>
<install-step name="Füllen der Modul-Tabellen">
<action error="stop">
<nativeaction sql="create table tmp_templates(tid integer,
id char(200) not null,
content text not null,
description char(200) ,
comment char(200) ,
version integer
)
;" database=""/>
<nativeaction sql="create table tmp_repository(
tid SERIAL not null,
id CHAR(200) not null,
@ -587,13 +603,12 @@ gueltig_bis DATE @@ -587,13 +603,12 @@ gueltig_bis DATE
);" scriptfile="" database=""/>
</action>
<action error="stop">
<loadtable refresh="true" delimiter="^" header="false" tabname="tmp_templates"><file path="$COSTAGE_PFAD/schluesseltabellen/fm_templates.unl"/></loadtable>
<loadtable refresh="true" delimiter="^" header="false" tabname="tmp_repository"><file path="$COSTAGE_PFAD/schluesseltabellen/sx_repository.unl"/></loadtable>
</action>
<action>
<nativeaction sql="" scriptfile="$COSTAGE_PFAD/schluesseltabellen/sx_repository_fuellen.sql" database=""/>
<nativeaction sql="" scriptfile="$COSTAGE_PFAD/schluesseltabellen/fm_templates_fuellen.sql" database=""/>
<nativeaction sql="" scriptfile="$COSTAGE_PFAD/schluesseltabellen/sachgebiete_fuellen.sql" database=""/>
<nativeaction sql="" scriptfile="$COSTAGE_PFAD/schluesseltabellen/sx_stylesheets_einfuegen.sql" database=""/>
</action>
</install-step>
@ -603,14 +618,7 @@ gueltig_bis DATE @@ -603,14 +618,7 @@ gueltig_bis DATE
<upgrade>
<upgrade-step>
<action error="stop">
<nativeaction sql="create table tmp_templates(tid integer,
id char(200) not null,
content text not null,
description char(200) ,
comment char(200) ,
version integer
)
;" database=""/>
<nativeaction sql="create table tmp_repository(
tid SERIAL not null,
id CHAR(200) not null,
@ -632,13 +640,12 @@ gueltig_bis DATE @@ -632,13 +640,12 @@ gueltig_bis DATE
);" scriptfile="" database=""/>
</action>
<action error="stop">
<loadtable refresh="true" delimiter="^" header="false" tabname="tmp_templates"><file path="$COSTAGE_PFAD/schluesseltabellen/fm_templates.unl"/></loadtable>
<loadtable refresh="true" delimiter="^" header="false" tabname="tmp_repository"><file path="$COSTAGE_PFAD/schluesseltabellen/sx_repository.unl"/></loadtable>
</action>
<action>
<nativeaction sql="" scriptfile="$COSTAGE_PFAD/schluesseltabellen/sx_repository_fuellen.sql" database=""/>
<nativeaction sql="" scriptfile="$COSTAGE_PFAD/schluesseltabellen/fm_templates_fuellen.sql" database=""/>
<nativeaction sql="" scriptfile="$COSTAGE_PFAD/schluesseltabellen/sachgebiete_fuellen.sql" database=""/>
<nativeaction sql="" scriptfile="$COSTAGE_PFAD/schluesseltabellen/sx_stylesheets_einfuegen.sql" database=""/>
</action>
</upgrade-step>

25
src-modules/module/costage/hilfstabellen/costage_st_studien_aggr_fuellen.sql

@ -22,7 +22,7 @@ SA.studienstatustyp, @@ -22,7 +22,7 @@ SA.studienstatustyp,
SA.st_studienstatus_nr,
SA.beginn_datum,
SA.gueltig_ab,
S.matrikelnummer,
val(S.matrikelnummer) as matrikelnummer,
S.geschlecht,
S.ca12_staat,
S.second_nationality,
@ -33,7 +33,7 @@ null::integer as studienfach_sortierung, @@ -33,7 +33,7 @@ null::integer as studienfach_sortierung,
null::char(10) as hrst,
null::integer as fachsemester,
null::integer as hssem,
null::integer as status,
null::char(10) as statustyp,
0::smallint as primaerflag,
null::integer as studiengang_nr,
null::integer as fach_nr,
@ -51,11 +51,12 @@ and ST.st_studiengang_nr=SG.st_studiengang_nr @@ -51,11 +51,12 @@ and ST.st_studiengang_nr=SG.st_studiengang_nr
and S.matrikelnummer is not null
--and SM.semester_tid >= 20171
-- and SM.semester_tid <= 20171
and S.matrikelnummer =7322871
-- and S.matrikelnummer ='7322871'
and SG.studiengangs_typ_kb in ('ESG','TSG')
and SA.st_studium_nr=ST.st_studium_nr
and SA.st_sem_nr=SM.st_sem_nr
and SA.studienstatustyp not in ('a','o')
and ${COSTAGE_STUDENT_FILTER}
--group by 1,2,3,4,5,6,7,8,9,10,11,12,13,14
;
-- select * from tmp_studien
@ -72,6 +73,15 @@ where tmp_studien.st_studstamm_nr = H.st_studstamm_nr @@ -72,6 +73,15 @@ where tmp_studien.st_studstamm_nr = H.st_studstamm_nr
and tmp_studien.st_sem_nr = H.st_sem_nr
;
update tmp_studien
set fachsemester=F.fachsemester
from costage_st_fachsemester F
where F.st_studium_nr=tmp_studien.st_studium_nr
and F.st_sem_nr=tmp_studien.st_sem_nr
and F.fachsemestertyp='FS'
;
update tmp_studien
set hssem=F.fachsemester
from costage_st_fachsemester F
@ -98,11 +108,6 @@ where M.st_studiengang_nr_tsg=tmp_studien.st_studiengang_nr @@ -98,11 +108,6 @@ where M.st_studiengang_nr_tsg=tmp_studien.st_studiengang_nr
update tmp_studien set fach_nr=1
where fach_nr is null;
update tmp_studien
set status=1
where studienstatustyp='I' --TODO: andere Ausprägungen gem. Doku
;
@ -113,7 +118,7 @@ st_studium_nr, @@ -113,7 +118,7 @@ st_studium_nr,
matrikelnummer,
st_studiengang_nr,
st_studienstatus_nr,
status,
statustyp,
hrst,
semester,
fachsemester,
@ -128,7 +133,7 @@ select st_studium_nr, @@ -128,7 +133,7 @@ select st_studium_nr,
matrikelnummer,
st_studiengang_nr,
st_studienstatus_nr,
status,
studienstatustyp,
hrst,
semester,
fachsemester,

55
src-modules/module/costage/masken/43040_felderinfo.unl

@ -0,0 +1,55 @@ @@ -0,0 +1,55 @@
43040^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^apnr, eintrag^^
43041^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;^
43043^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;^^^
43044^Status^14^350^-1^140^180^1^sql^30^0^1^<<SQL>> select apnr,druck from cifx where key=400 order by 2^^<<SQL>> select apnr,eintrag from sos_status where eintrag='Alle ohne Beurl.';^
43045^Hörerstatus^33^0^0^140^170^1^sql^30^0^1^<<SQL>> select apnr, druck from cifx where key=401 order by 2^ ^ ^
43046^Weitere Tabellen^123^0^0^140^140^10^char^30^0^1^<<SQL>> \
--freemarker template\
select name,string_not_null(caption) || ' - ' || name from sx_tables where name in ('costage_st_studierendenstammdaten')\
<#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^^^
43047^bis Fachsemester^35^350^-1^140^100^1^integer^30^0^0^^^^
43049^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;^
43050^Filter Studierende^119^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;^hidden^^
43051^Geschlecht^37^0^0^140^80^1^integer^30^0^1^<<SQL>> select apnr,beschreibung from konstanten where tid=1 or tid=2;^^^
43052^Felder^125^0^0^150^190^10^char^30^0^1^<<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 ='costage_st_studien_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;^^^
43053^Fach^6^0^0^140^150^50^char^30^0^1^<<SQL>>\
SELECT \
skz_key,\
skz_name\
FROM costage_st_studienkennzahlen\
/* where unikey='<<Hochschule>>' */\
order by 2\
;^^^
43054^Schlüssel anzeigen^150^0^0^100^100^1^integer^30^1^1^<<SQL>> select 1,'Ja' from xdummy union select 0,'Nein' from xdummy^^<<SQL>> select 1,'Ja' from xdummy^
43055^tablestylesheet^121^0^0^100^200^1^char^200^1^1^<<SQL>> select distinct filename,X.caption,ord from sx_stylesheets X,sx_mask_style S where X.tid=S.stylesheet_id and S.maskeninfo_id=43040 order by ord^^<<SQL>> select distinct filename,X.caption from sx_stylesheets X,sx_mask_style S where X.tid=S.stylesheet_id and S.maskeninfo_id=43040 and S.ord=1^
43056^Ausgabeformat^2001^0^0^100^150^1^char^200^1^1^<<SQL>> select element_value,description from menu_element where element='Ausgabeformat' and nature::smallint<100 order by nature::smallint^^<<SQL>> select element_value,description from menu_element where element='Ausgabeformat' and description='HTML'^
43059^Hochschule^5^350^-1^140^80^1^integer^255^0^1^<<SQL>>select hs_nr,name from kenn_hochschulen\
where hs_nr::char(10) in (select distinct unikey from costage_st_studienkennzahlen)\
order by 2;^ ^<<SQL>> select K.hs_nr,K.name from kenn_hochschulen K, hochschulinfo H\
where K.hs_nr=H.hs_nr^
43060^##line##^30^0^0^100^100^1^char^5000^0^8^^^1^
43061^Abschluss^7^0^0^140^170^5^char^30^0^1^<<SQL>> SELECT \
code,\
name\
FROM costage_st_abschlussziele_lokal\
order by 2;^^^
43062^Matrikel-Nr.^20^350^-1^150^180^1^char^200^0^0^^^^
43063^##line##^40^0^0^100^100^1^char^5000^0^8^^^1^

1
src-modules/module/costage/masken/43040_maske_system_bez.unl

@ -0,0 +1 @@ @@ -0,0 +1 @@
43040^7^

20
src-modules/module/costage/masken/43040_masken_felder_bez.unl

@ -0,0 +1,20 @@ @@ -0,0 +1,20 @@
43040^43040^
43040^43041^
43040^43043^
43040^43044^
43040^43045^
43040^43046^
43040^43047^
43040^43049^
43040^43050^
43040^43051^
43040^43052^
43040^43053^
43040^43054^
43040^43055^
43040^43056^
43040^43059^
43040^43060^
43040^43061^
43040^43062^
43040^43063^

174
src-modules/module/costage/masken/43040_maskeninfo.unl

@ -0,0 +1,174 @@ @@ -0,0 +1,174 @@
43040^Studierende Datenblatt (CO)^--Freemarker Template\
<#include "SQL_lingua_franca"/>\
<#include "SuperX_general"/>\
<#include "SQL_multitable_output"/>\
\
--ram excelexport \
<#include "SQL_lingua_franca"/>\
<#include "SuperX_general"/>\
<#include "SQL_multitable_output"/>\
\
<sqlvars>\
<sqlvar name="get_tables"><![CDATA[\
SELECT distinct name,name\
from sx_tables\
where name in ('costage_st_studien_aggr'\
${DatenblattTables(<<tablestylesheet>>,"<<Weitere Tabellen>>",.vars["Weitere TabellenObject"].allKeys)}\
\
)\
order by 2;]]>\
</sqlvar>\
<sqlvar name="get_table_joins"><![CDATA[\
select table_name || '.' || name || '=' || foreignkey_tab || '.' || foreignkey_col,table_name \
from sx_fields where table_name in ('costage_st_studien_aggr'\
${DatenblattTables(<<tablestylesheet>>,"<<Weitere Tabellen>>",.vars["Weitere TabellenObject"].allKeys)} )\
and foreignkey_tab in ('costage_st_studien_aggr'\
${DatenblattTables(<<tablestylesheet>>,"<<Weitere Tabellen>>",.vars["Weitere TabellenObject"].allKeys)})\
;]]>\
</sqlvar>\
<sqlvar name="get_felder"><![CDATA[\
SELECT name,\
caption,\
(trim(field_type) || '#' || is_primarykey || '#' || trim(string_not_null(foreignkey_tab)) || '#' || trim(string_not_null(foreignkey_col))\
|| '#' || trim(string_not_null(foreignkey_cap))\
|| '#' || trim(string_not_null(foreignkey_cond))\
|| '#' || trim(string_not_null(foreignkey_func))\
|| '#' || trim(string_not_null(table_name))\
|| '#' || trim(string_not_null(foreignkey_uniquename)))::char(255) as strukturStr\
from sx_fields\
where table_name in ('costage_st_studien_aggr'\
${DatenblattTables(<<tablestylesheet>>,"<<Weitere Tabellen>>",.vars["Weitere TabellenObject"].allKeys)}\
)\
and currentlyused=1\
${DatenblattFields(<<tablestylesheet>>,"<<Felder>>",FelderObject.allKeys)}\
order by 2,3;]]>\
</sqlvar>\
<sqlvar name="get_felder_fk"><![CDATA[\
SELECT name,\
caption,\
(trim(table_name)\
|| '#' || trim(string_not_null(foreignkey_tab))\
|| '#' || trim(string_not_null(foreignkey_uniquename)))::char(255) as strukturStr\
from sx_fields\
where table_name in ('costage_st_studien_aggr' ${DatenblattTables(<<tablestylesheet>>,"<<Weitere Tabellen>>",.vars["Weitere TabellenObject"].allKeys)}\
)\
and currentlyused=1\
${DatenblattFields(<<tablestylesheet>>,"<<Felder>>",FelderObject.allKeys)}\
order by 2,3;]]>\
</sqlvar>\
</sqlvars>\
\
<@generate_multitable_list />\
<@generate_field_list_multitable aggregationsfeld="*" aggregatfunktion="count(" />\
<@generate_foreign_fields_multitable />\
\
\
<#assign filter="\
/* and hrst in (<<Hörerstatus>>) */\
/* and semester >= <<Seit Semester>> */\
/* and semester <= <<Bis Semester>> */\
/* AND fachsemester <= <<bis Fachsemester>> */\
/* and statustyp in(<<Status>>) */\
/* and geschlecht=<<Geschlecht>> */\
/* and st_studiengang_nr in (select G.st_studiengang_nr from costage_st_studiengaenge G where G.abschluss in (<<Abschluss>>)) */\
/* and st_studiengang_nr in (select G.st_studiengang_nr from costage_st_studiengaenge G where G.stg in (<<Fach>>)) */\
" />\
\
\
<#if "<<Matrikel-Nr.>>"!="">\
<#assign filter=filter+" and " + basetable + ".matrikel_nr in (<<Matrikel-Nr.>>)"?replace("'","")/>\
</#if>\
<#if "<<Köpfe oder Fälle ?>>"?index_of("S.gewichtung_id=")!=-1>\
<#assign filter=filter+" and "+.vars["Köpfe oder Fälle ?"]?replace('S.','sos_stud_gewichtung.')/>\
<#if "<<Weitere Tabellen>>"?index_of("dim_studiengang_gew")&gt;-1>\
<#assign filter=filter+" and (dim_studiengang_gew.gewichtid is null or "+.vars["Köpfe oder Fälle ?"]?replace('S.','dim_studiengang_gew.')?replace("gewichtung_id","gewichtid")+")"/>\
</#if>\
<#elseif "<<Köpfe oder Fälle ?>>"!="">\
<#assign filter=filter+" and "+.vars["Köpfe oder Fälle ?"]/>\
</#if>\
\
/* <#assign filter = filter + " and st_studstamm_nr in (select st_studstamm_nr from costage_st_studierendenstammdaten where '' || ca12_staat in "+Staatsangehörigkeit.allNeededKeysList /> ) --<<Staatsangehörigkeit>> */\
\
\
\
<@generate_resultset_multitable tabellen=table_list\
p_show_keys=<<Schlüssel anzeigen>>\
p_field_list_select=field_list_select\
p_foreign_fields=foreign_fields\
p_filter=filter\
p_field_list_groupby=field_list_groupby\
p_join_clause=join_clause\
/>^--Freemarker Template \
<sqlvars>\
<sqlvar name="basetable"><![CDATA[<#if "<<Köpfe oder Fälle ?>>"?index_of("S.gewichtung_id=")==-1>select 'costage_st_studien_aggr' from xdummy<#else>select 'sos_stud_gewichtung' from xdummy</#if>]]></sqlvar>\
<sqlvar name="restriction"><![CDATA[<#if basetable='costage_st_studien_aggr'>\
<#assign restrict=DatenblattTables(<<tablestylesheet>>,"<<Weitere Tabellen>>",.vars["Weitere TabellenObject"].allKeys)/>;\
<#else>\
<#assign restrict=DatenblattTables(<<tablestylesheet>>,"<<Weitere Tabellen>>",.vars["Weitere TabellenObject"].allKeys)?replace('costage_st_studien_aggr',basetable)?replace("'dim_studiengang'","'dim_studiengang_gew'")/>;\
</#if>\
select '${restrict?replace("\\x0027","\\x0027\\x0027")}' from xdummy;]]>\
</sqlvar>\
<sqlvar name="get_felder"><![CDATA[\
SELECT caption,\
foreignkey_tab,\
description as strukturStr\
from sx_fields\
where table_name in ('${basetable}'\
${restriction}\
)\
and currentlyused=1\
--Pseudonyme eingeschaltet:\
and (name != 'matrikel_nr' or 0=(select \
count(*) from konstanten where beschreibung='SOS_MTKNR_EXT'\
and apnr=1))\
<#if basetable='costage_st_studien_aggr'>\
${DatenblattFields(<<tablestylesheet>>,"<<Felder>>",FelderObject.allKeys)}\
<#else>\
${DatenblattFields(<<tablestylesheet>>,"<<Felder>>"?replace("costage_st_studien_aggr","sos_stud_gewichtung")?replace("dim_studiengang.","dim_studiengang_gew."),\
FelderObject.allKeys?replace("costage_st_studien_aggr","sos_stud_gewichtung")?replace("dim_studiengang.","dim_studiengang_gew."))}\
</#if>\
and table_name !='dim_person_attribute_aggr'\
--hier personattribute:\
union SELECT P.attributevalue , -- F.caption,\
F.foreignkey_tab,\
F.description as strukturStr\
from sx_fields F, personattributetype P\
where F.table_name in ('${basetable}'\
${restriction}\
)\
and currentlyused=1\
--Pseudonyme eingeschaltet:\
and (name != 'matrikel_nr' or 0=(select \
count(*) from konstanten where beschreibung='SOS_MTKNR_EXT'\
and apnr=1))\
<#if basetable='costage_st_studien_aggr'>\
${DatenblattFields(<<tablestylesheet>>,"<<Felder>>",FelderObject.allKeys)}\
<#else>\
${DatenblattFields(<<tablestylesheet>>,"<<Felder>>"?replace("costage_st_studien_aggr","sos_stud_gewichtung")?replace("dim_studiengang.","dim_studiengang_gew.")\
,FelderObject.allKeys?replace("costage_st_studien_aggr","sos_stud_gewichtung")?replace("dim_studiengang.","dim_studiengang_gew."))}\
</#if>\
and table_name ='dim_person_attribute_aggr'\
and F.name='attribute' || P.personattributetype_id\
order by 1;]]>\
</sqlvar>\
</sqlvars>\
XIL List\
sizable_columns horizontal_scrolling\
white_space_color=COLOR_WHITE fixed_columns=1\
min_heading_height=35\
<#assign i=1 />\
<#if get_felder?has_content >\
<#foreach myfield in get_felder>\
<#assign i=i+1 />\
Column CID=${i} heading_text="${myfield.key}" explanation="${myfield.strukturStr}" center_heading\
row_selectable col_selectable rightJust heading_platform readonly\
width=20\
<#if myfield.name != '' && <<Schlüssel anzeigen>>==1>\
<#assign i=i+1 />\
Column CID=${i} heading_text="${myfield.key}\\n(Schlüssel)" explanation="Schlüssel des Feldes ${myfield.key}" center_heading\
row_selectable col_selectable rightJust heading_platform readonly\
width=20\
</#if>\
</#foreach>\
</#if>\
@@@^Altersgruppe^Anzahl^Flexible Ausgabe der Studierendenstatistik, Studiengänge und Lehreinheiten^drop table tmp_tabelle;^^2^700^360^0^1^^

1
src-modules/module/costage/masken/43040_sachgeb_maske_bez.unl

@ -0,0 +1 @@ @@ -0,0 +1 @@
16^43040^

256
src-modules/module/costage/schluesseltabellen/cifx_fuellen.sql

@ -0,0 +1,256 @@ @@ -0,0 +1,256 @@
--Freemarker Template
<#assign dimensions = [
{"key":"400", "name":"Statustyp (CO)"},
{"key":"401", "name":"Hörerstatus (CO)"}
] />
<#assign dimension_levels_man = [
{"key":"400","apnr":"a", "druck":"Studienplatz angenommen", "astat":""},
{"key":"400","apnr":"B", "druck":"Neueinschreibung", "astat":"2"},
{"key":"400","apnr":"E", "druck":"Ersteinschreibung", "astat":"1"},
{"key":"400","apnr":"I", "druck":"gemeldet", "astat":"3"},
{"key":"400","apnr":"U", "druck":"beurlaubt", "astat":"4"},
{"key":"400","apnr":"R", "druck":"Rücktritt von der Immatrikulation", "astat":""},
{"key":"400","apnr":"o", "druck":"Studium offen (noch keine Weitermeldung erfolgt)", "astat":""},
{"key":"400","apnr":"V", "druck":"Verzicht auf Studienplatz", "astat":""},
{"key":"400","apnr":"X", "druck":"geschlossen (Abschluss und/oder keine Fortsetzung möglich)", "astat":"5"},
{"key":"400","apnr":"Z", "druck":"geschlossen", "astat":"5"},
{"key":"400","apnr":"z", "druck":"wieder einzuschreiben", "astat":""}
] />
<#assign dimension_levels_dynamic = [
{"key":"401","apnr":"hoererstatus_kb", "druck":"hoererstatus_name", "astat":"", "srctable":"costage_st_hoererstatus"}
] />
create temp table tmp_cifx
(tid serial,
key smallint not null ,
hs integer not null,
apnr varchar(255) ,
kurz char(10),
druck varchar(200),
lang_1 char(255),
astat char(10) ,
parent varchar(255) ,
uniquename VARCHAR(255) ,
bund_apnr CHAR(10) ,
sort1 integer,
sortc1 char(10),
d_akt_von date,
d_akt_bis date,
sourcesystem_id varchar(255),
sourcesystem integer,
lid varchar(255) ,
parent_lid varchar(255),
hiskey_id varchar(255),
struktur_c CHAR(50)
);
create temp table tmp_hilf(tid integer);
insert into tmp_hilf(tid) select max(tid) from cifx;
<#foreach dimension in dimensions>
<#foreach dimension_level in dimension_levels_man>
<#if dimension_level.key==dimension.key >
insert into tmp_cifx
(
key ,
hs,
apnr ,
kurz ,
druck,
lang_1 ,
astat,
uniquename ,
d_akt_von ,
d_akt_bis ,
sourcesystem_id ,
sourcesystem,
lid ,
--parent_lid,
hiskey_id ,
struktur_c
)
select
${dimension_level.key} ,
0 as hs,
'${dimension_level.apnr}' ,
substring('${dimension_level.druck}' from 1 for 10) as kurz ,
substring('${dimension_level.druck}' from 1 for 200) as druck,
substring('${dimension_level.druck}' from 1 for 255) as lang_1 ,
<#if dimension_level.astat=="">
NULL::char(10)
<#else>
'${dimension_level.astat}'
</#if> as astat,
'${dimension_level.apnr}' as uniquename ,
date_val('01.01.1900') as d_akt_von ,
date_val('01.01.3000')d_akt_bis ,
'${dimension_level.apnr}' as sourcesystem_id ,
15 as sourcesystem,
'${dimension_level.apnr}' as lid ,
--parent_lid,
NULL::char(10) as hiskey_id ,
NULL::char(10) as struktur_c
from xdummy
;
</#if>
</#foreach>
<#foreach dimension_level in dimension_levels_dynamic>
<#if dimension_level.key==dimension.key >
insert into tmp_cifx
(
key ,
hs,
apnr ,
kurz ,
druck,
lang_1 ,
astat,
uniquename ,
d_akt_von ,
d_akt_bis ,
sourcesystem_id ,
sourcesystem,
lid ,
--parent_lid,
hiskey_id ,
struktur_c
)
select distinct
${dimension_level.key} ,
0 as hs,
${dimension_level.apnr} ,
substring(${dimension_level.druck} from 1 for 10) as kurz ,
substring(${dimension_level.druck} from 1 for 200) as druck,
substring(${dimension_level.druck} from 1 for 255) as lang_1 ,
<#if dimension_level.astat=="">
NULL::char(10)
<#else>
${dimension_level.astat}
</#if> as astat,
${dimension_level.apnr} as uniquename ,
date_val('01.01.1900') as d_akt_von ,
date_val('01.01.3000')d_akt_bis ,
${dimension_level.apnr} as sourcesystem_id ,
15 as sourcesystem,
${dimension_level.apnr} as lid ,
--parent_lid,
NULL::char(10) as hiskey_id ,
NULL::char(10) as struktur_c
from ${dimension_level.srctable}
;
</#if>
</#foreach>
</#foreach>
--Künstliche Schlüssel aus CO:
--vorh. Datensätze ändern:
update cifx set hs=T.hs ,
apnr=T.apnr ,
d_akt_von=T.d_akt_von ,
d_akt_bis=T.d_akt_bis ,
kurz=T.kurz ,
druck=T.druck ,
lang_1=T.lang_1 ,
parent=T.parent ,
astat=T.astat ,
hiskey_id=T.hiskey_id ,
uniquename=T.uniquename ,
sort1=T.sort1 ,
sortc1=T.sortc1 ,
sourcesystem=T.sourcesystem ,
sourcesystem_id=T.sourcesystem_id ,
struktur_c=T.struktur_c ,
lid=T.lid ,
parent_lid=T.parent_lid
from tmp_cifx T
where T.key=cifx.key
and T.apnr=cifx.apnr
and T.sourcesystem=cifx.sourcesystem;
delete from tmp_cifx where (key,apnr)
in (select key,apnr
from cifx);
--neue Datensätze:
insert into cifx
(tid ,
hs,
key,
apnr,
d_akt_von,
d_akt_bis,
kurz,
druck,
lang_1,
parent,
astat,
hiskey_id,
uniquename,
sort1,
sortc1,
sourcesystem,
sourcesystem_id,
struktur_c,
lid,
parent_lid
)
select T.tid+H.tid as tid,
hs,
key,
apnr,
d_akt_von,
d_akt_bis,
kurz,
druck,
lang_1,
parent,
astat,
hiskey_id,
uniquename,
sort1,
sortc1,
sourcesystem,
sourcesystem_id,
struktur_c,
lid,
parent_lid
from tmp_cifx T, tmp_hilf H
;
insert into trans_cifx(
key,
apnr,
cifx_tid,
sourcesystem,
sourcesystem_id,
systeminfo_id)
select
T.key,
T.apnr,
C.tid,
T.sourcesystem,
T.sourcesystem_id,
310 as systeminfo_id
FROM tmp_cifx T, cifx C
where C.key=T.key
and T.apnr=C.apnr;
drop table tmp_cifx;
drop table tmp_hilf;

2
src-modules/module/costage/schluesseltabellen/sachgebiete_fuellen.sql

@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
delete from sachgebiete where tid in (311);
insert into sachgebiete(tid,name) values (311,'Laderoutinen Administr.');
insert into sachgebiete(tid,name) values (311,'CO Basisdaten Administr.');
delete from group_sachgeb_bez where sachgebiete_id in (310,311)
and groupinfo_id in (select G.tid from groupinfo G where G.name='Administratoren' or G.name='superx') ;

149
src-modules/module/costage/schluesseltabellen/sx_stylesheets_einfuegen.sql

@ -0,0 +1,149 @@ @@ -0,0 +1,149 @@
--(c) 2011 Andre Knieschewski
--Freemarker Template
--Achtung: Macro fügt Inhalte ein
--Bitte nur Freemarker Variablen füllen
<#assign masken = [
{"mask":"43040", "filename":"tabelle_html_datenblatt.xsl", "ord":"1"}
] />
<#assign stylesheet = [
] />
<#assign stylesheet_field = [
] />
--Hier eventuell notwendige delete's auf die Tabellen sx_mask_style, sx_stylesheets oder stylesheet_field einfügen.
-- die Bewerberstatistiken neu einfuegen
-- dafür erstmal die Verbindung von Bericht zu Stylesheet loeschen
--Achtung: ab hier nicht ändern, Mutterdatei ist $SUPERX_DIR/db/module/sos/schluesseltabellen/sx_stylesheets_fuellen.sql
<@sx_stylesheets_insert
m_masken=masken
m_stylesheet=stylesheet
m_stylesheet_field=stylesheet_field
/>
<#macro sx_stylesheets_insert m_masken m_stylesheet m_stylesheet_field>
--Sicherstellen, dass keine Duplikate vorkommen:
--####################################################################################################
<#foreach column in m_masken>
delete from sx_mask_style where maskeninfo_id=${column.mask} and stylesheet_id=(select tid from sx_stylesheets where filename ='${column.filename}') and ord=${column.ord};
</#foreach>
<#foreach column in m_stylesheet_field>
delete from stylesheet_field where tablename='${column.tablename}' and stylesheet_id=(select tid from sx_stylesheets where filename ='${column.filename}') and fieldname='${column.fieldname}';
</#foreach>
--delete sx_stylesheets raus genommen #ak 06.03.2013
-- Stylesheets füllen
--####################################################################################################
create temp table tmp_stylesheets (
tid serial not null,
filename CHAR(255) ,
caption CHAR(255) ,
description CHAR(255) ,
relation CHAR(10) ,
useragent CHAR(255) ,
contenttype CHAR(200)
);
create temp table tmp_hilf (tid integer);
insert into tmp_hilf select max(tid) from sx_stylesheets;
update tmp_hilf set tid=1 where tid is null;
<#assign couter_tid = 1 />
<#foreach column in m_stylesheet>
insert into tmp_stylesheets (tid,filename,caption,description,relation,contenttype)
select max(tid)+${couter_tid},'${column.filename}','${column.caption}', '${column.description}', '${column.relation}','${column.contenttype}' from tmp_hilf;
<#assign couter_tid = couter_tid + 1 />
</#foreach>
--delete für tml_stylesheets hinzugefügt #ak 06.03.2013
delete from tmp_stylesheets where filename in (select filename from sx_stylesheets);
insert into sx_stylesheets (tid,filename, caption, description, relation, useragent, contenttype)
SELECT tid, filename, caption, description, relation, useragent, contenttype
FROM tmp_stylesheets;
drop table tmp_stylesheets;
-- Mask Style füllen
--####################################################################################################
create temp table tmp_mask_style (
tid serial not null,
maskeninfo_id INTEGER ,
stylesheet_id INTEGER ,
ord SMALLINT,
filename char(255)
);
delete from tmp_hilf;
insert into tmp_hilf select max(tid) from sx_mask_style;
update tmp_hilf set tid=1 where tid is null;
<#assign couter_tid = 1 />
<#foreach column in m_masken>
insert into tmp_mask_style (tid,maskeninfo_id,ord,filename)
select max(tid)+${couter_tid},${column.mask},${column.ord},'${column.filename}' from tmp_hilf;
update tmp_mask_style set stylesheet_id=(select max(tid) from sx_stylesheets where filename='${column.filename}')
where filename='${column.filename}';
<#assign couter_tid = couter_tid + 1 />
</#foreach>
insert into sx_mask_style ( tid, maskeninfo_id, stylesheet_id, ord)
SELECT tid, maskeninfo_id, stylesheet_id, ord
FROM tmp_mask_style;
drop table tmp_mask_style;
--Field zu Stylesheet Zuordnungen:
--####################################################################################################
CREATE temp TABLE tmp_stylesheet_field
(
tid serial NOT NULL,
stylesheet_id INTEGER,
tablename char(255),
fieldname char(255),
filename char(255)
);
delete from tmp_hilf;
insert into tmp_hilf select max(tid) from stylesheet_field;
update tmp_hilf set tid=1 where tid is null;
<#assign couter_tid = 1 />
<#foreach column in m_stylesheet_field>
INSERT INTO tmp_stylesheet_field (tid, filename, tablename, fieldname)
select max(tid)+${couter_tid}, '${column.filename}', '${column.tablename}', '${column.fieldname}' from tmp_hilf;
update tmp_stylesheet_field set stylesheet_id=(select max(tid) from sx_stylesheets where filename='${column.filename}')
where filename='${column.filename}';
<#assign couter_tid = couter_tid + 1 />
</#foreach>
insert into stylesheet_field ( tid, stylesheet_id, tablename, fieldname)
SELECT tid, stylesheet_id, tablename, fieldname
FROM tmp_stylesheet_field;
drop table tmp_stylesheet_field;
drop table tmp_hilf;
<#if SQLdialect='Postgres'>
select sp_update_sequence('sx_stylesheets');
select sp_update_sequence('sx_mask_style');
select sp_update_sequence('stylesheet_field');
</#if>
</#macro>
Loading…
Cancel
Save