Browse Source

Finalize Version 0.2 COSTAGE

COStage_0.2_Release
Daniel Quathamer 3 years ago
parent
commit
f35e012b18
  1. 12
      src-modules/module/costage/conf/costage.xml
  2. 28
      src-modules/module/costage/datentabellen/trans_costage_st_studierendenstammdaten.sql
  3. 12
      src-modules/module/costage/hilfstabellen/costage_st_studien_aggr_fuellen.sql
  4. 14
      src-modules/module/costage/masken/43020_felderinfo.unl
  5. 11
      src-modules/module/costage/masken/43020_masken_felder_bez.unl
  6. 19
      src-modules/module/costage/masken/43040_felderinfo.unl
  7. 11
      src-modules/module/costage/masken/43040_maskeninfo.unl
  8. 109
      src-modules/module/costage/schluesseltabellen/cif_fuellen.sql
  9. 35
      src-modules/module/costage/schluesseltabellen/cifx_fuellen.sql
  10. 70
      src-modules/module/sos/rohdaten/sos_costage_unload.xml

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

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--<!DOCTYPE module SYSTEM "../../../conf/superx-module.dtd"> -->
<module name="costage" version="0.2b" sachgebiet_id="310"
<module name="costage" version="0.2" sachgebiet_id="310"
sachgebiet="CO Basisdaten" systeminfo_id="310"
system="CO Basisdaten" thema="CO Basisdaten" thema_parent="Studierende, Prüfungen">
<database name="superx" system="superx">
@ -405,6 +405,7 @@ rightname="CS_BIA_STANDARDREPORTS_ADMIN[CO]" /> @@ -405,6 +405,7 @@ rightname="CS_BIA_STANDARDREPORTS_ADMIN[CO]" />
<column name="ca12_staat" type ="INTEGER" size ="8" default ="" notnull ="false" description="Staatsangehörigkeit (erste)" />
<column name="second_nationality" type ="INTEGER" size ="4" default ="" notnull ="false" description="Amtl. Schluessel fuer zweite Staatsangehoerigkeit" currentlyUsed="false"/>
<column name="d_exmatr" type ="DATE" size ="4" default ="" notnull ="false" description="Datum der Exmatr. (obsolet)"/>
<column name="semester_max" type ="INTEGER" size ="4" default ="" notnull ="false" description="Letztes eingeschriebenes Semester" currentlyUsed=""/>
</columns>
<indexes></indexes>
<primaryKeys><rs>
@ -435,6 +436,7 @@ rightname="CS_BIA_STANDARDREPORTS_ADMIN[CO]" /> @@ -435,6 +436,7 @@ rightname="CS_BIA_STANDARDREPORTS_ADMIN[CO]" />
<column name="endedat" type ="DATE" size ="4" default ="" notnull ="false" description="Datum der Exmatr."/>
<column name="stufrm" type ="CHAR" size ="10" default ="" notnull ="false" description="Studienform"/>
<column name="kz_rueck_beur_ein" type ="SMALLINT" size ="2" default ="" notnull ="false" description="Rückmeldestatus (amtlich)" />
<column name="summe" type ="INTEGER" size ="2" default ="" notnull ="false" description="Summe" />
</columns>
<indexes></indexes>
@ -457,14 +459,14 @@ parent="CO Basisdaten">Abfragen zur Administration CO Basisdaten</thema> @@ -457,14 +459,14 @@ parent="CO Basisdaten">Abfragen zur Administration CO Basisdaten</thema>
</themen>
<masken>
<maske tid="43000" name="Studierende (Zeitreihe)" thema="CO Basisdaten">
<maske tid="43000" name="Studierende (Zeitreihe)" thema="">
<description>Studierende Zeitreihe</description>
<src>
<path>$COSTAGE_PFAD/masken</path>
</src>
</maske>
<maske tid="43020" name="Studierende (Zeitreihe)" thema="CO Basisdaten">
<description>Studierende Zeitreihe</description>
<maske tid="43020" name="Studierende CO Basisdaten" thema="CO Basisdaten">
<description>CO Basisdaten</description>
<src>
<path>$COSTAGE_PFAD/masken</path>
</src>
@ -644,6 +646,7 @@ gueltig_bis DATE @@ -644,6 +646,7 @@ gueltig_bis DATE
<nativeaction sql="" scriptfile="$COSTAGE_PFAD/schluesseltabellen/sx_repository_fuellen.sql" database=""/>
<nativeaction sql="" scriptfile="$COSTAGE_PFAD/schluesseltabellen/sachgebiete_fuellen.sql" database=""/>
<nativeaction sql="" scriptfile="$COSTAGE_PFAD/schluesseltabellen/sx_stylesheets_einfuegen.sql" database=""/>
<nativeaction sql="" scriptfile="$COSTAGE_PFAD/schluesseltabellen/cif_fuellen.sql" database=""/>
</action>
</install-step>
@ -681,6 +684,7 @@ gueltig_bis DATE @@ -681,6 +684,7 @@ gueltig_bis DATE
<nativeaction sql="" scriptfile="$COSTAGE_PFAD/schluesseltabellen/sx_repository_fuellen.sql" database=""/>
<nativeaction sql="" scriptfile="$COSTAGE_PFAD/schluesseltabellen/sachgebiete_fuellen.sql" database=""/>
<nativeaction sql="" scriptfile="$COSTAGE_PFAD/schluesseltabellen/sx_stylesheets_einfuegen.sql" database=""/>
<nativeaction sql="" scriptfile="$COSTAGE_PFAD/schluesseltabellen/cif_fuellen.sql" database=""/>
</action>
</upgrade-step>

28
src-modules/module/costage/datentabellen/trans_costage_st_studierendenstammdaten.sql

@ -1,6 +1,22 @@ @@ -1,6 +1,22 @@
delete from costage_st_studierendenstammdaten;
--zuerst Ermittlung max. Semester
select S.st_studstamm_nr,max(SM.semester_tid)::integer as semester_max
into temp tmp_max
from costage_st_studierendenstammdaten_neu S,
costage_st_studien ST,
costage_st_semester SM,
costage_st_studienstatus SA
where S.st_studstamm_nr = ST.st_studstamm_nr
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 S.matrikelnummer is not null
group by 1
;
insert into costage_st_studierendenstammdaten(
st_studstamm_nr,
matrikelnummer,
@ -18,7 +34,8 @@ insert into costage_st_studierendenstammdaten( @@ -18,7 +34,8 @@ insert into costage_st_studierendenstammdaten(
ca12_staat,
second_nationality,
d_geburt,
d_exmatr)
d_exmatr,
semester_max)
select
S.st_studstamm_nr,
val(S.matrikelnummer),
@ -39,8 +56,10 @@ else 4 end)::smallint as geschlecht, @@ -39,8 +56,10 @@ else 4 end)::smallint as geschlecht,
val(L.statistik_code) as ca12_staat,
S.st_land2_nr,
date(S.geburtsdatum) as d_geburt,
date(S.abmeldungsdatum) as d_exmatr
FROM costage_st_studierendenstammdaten_neu S, costage_st_laender L
date(S.abmeldungsdatum) as d_exmatr,
M.semester_max
FROM costage_st_laender L, costage_st_studierendenstammdaten_neu S left outer join tmp_max M
on (M.st_studstamm_nr=S.st_studstamm_nr)
where L.st_land_nr=S.st_land1_nr
and S.matrikelnummer is not null
;
@ -49,3 +68,6 @@ update costage_st_studierendenstammdaten set second_nationality=val(L.statistik_ @@ -49,3 +68,6 @@ update costage_st_studierendenstammdaten set second_nationality=val(L.statistik_
from costage_st_laender L
where L.st_land_nr=costage_st_studierendenstammdaten.st_land2_nr;
drop table tmp_max;

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

@ -210,7 +210,8 @@ st_studium_nr, @@ -210,7 +210,8 @@ st_studium_nr,
ruebeudat,
endedat,
stufrm,
kz_rueck_beur_ein
kz_rueck_beur_ein,
summe
)
select st_studium_nr,
@ -261,7 +262,8 @@ select st_studium_nr, @@ -261,7 +262,8 @@ select st_studium_nr,
(case when studienstatustyp in ('Z','X') then gueltig_ab
else null::date end) as endedat,
studienform_statistik_code as stufrm,
kz_rueck_beur_ein
kz_rueck_beur_ein,
1 as summe
from tmp_studien2
-- where semester = 20202
--and matrikelnummer = '5545242'
@ -289,7 +291,8 @@ st_studium_nr, @@ -289,7 +291,8 @@ st_studium_nr,
ruebeudat,
endedat,
stufrm,
kz_rueck_beur_ein
kz_rueck_beur_ein,
summe
)
select st_studium_nr,
@ -323,7 +326,8 @@ cast (NULL as int) as studiengang_nr2, @@ -323,7 +326,8 @@ cast (NULL as int) as studiengang_nr2,
(case when studienstatustyp in ('Z','X') then gueltig_ab
else null::date end) as endedat,
studienform_statistik_code as stufrm,
kz_rueck_beur_ein
kz_rueck_beur_ein,
1 as summe
from tmp_studien2
--where semester = 20202
-- and matrikelnummer = '5847370'

14
src-modules/module/costage/masken/43020_felderinfo.unl

@ -1,24 +1,10 @@ @@ -1,24 +1,10 @@
43020^Köpfe oder Fälle ?^-3^0^0^130^150^1^sql^30^1^1^<<SQL>> select apnr, eintrag from koepfe_oder_faelle;^hidden^<<SQL>> select apnr, eintrag from koepfe_oder_faelle where eintrag = 'Fälle';^
43021^Seit Semester^1^0^0^130^80^1^integer^30^1^1^<<SQL>> select val('20' || replace(replace(semester_id,'S','1'),'W','2')) as semester_tid,semester_bezeichnung FROM costage_st_semester\
order by 1 DESC;^^<<SQL>> select val('20' || replace(replace(semester_id,'S','1'),'W','2')) as semester_tid,semester_bezeichnung FROM costage_st_semester\
where today()-(5*365) between semester_anfang and semester_ende;^
43022^Fächer^3^0^0^130^200^6^char^30^0^12^<<SQL>> select tid,name,sortnr from sichten where art='Fächer-Sicht' order by 3,2;^hidden^^
43023^bis Fachsemester^23^330^-1^130^100^1^integer^30^0^0^^hidden^^
43024^Hörerstatus^18^0^0^130^150^1^sql^30^0^1^<<SQL>> select apnr, eintrag from hoererstatus order by 2^hidden^<<SQL>> select apnr, eintrag from hoererstatus where eintrag='alle';^
43025^Matrikelnr.^100^330^-1^130^100^1^char^30^0^0^ ^ ^ ^
43026^Status^19^330^-1^130^180^1^sql^30^0^1^<<SQL>> select apnr,eintrag from sos_status order by 2^ ^<<SQL>> select apnr,eintrag from sos_status where eintrag='Alle ohne Beurl.';^
43027^Bis Semester^2^330^-1^130^100^1^integer^30^0^1^<<SQL>> select val('20' || replace(replace(semester_id,'S','1'),'W','2')) as semester_tid,semester_bezeichnung FROM costage_st_semester\
order by 1 DESC;^Eintrag^<<SQL>> select val('20' || replace(replace(semester_id,'S','1'),'W','2')) as semester_tid,semester_bezeichnung FROM costage_st_semester\
where today() between semester_anfang and semester_ende;^
43028^Abschluss^8^0^0^130^150^5^char^30^0^1^<<SQL>> select apnr, trim(druck) || ' (' || trim(apnr) || ')' from cifx where key = 35 order by 2;^hidden^^
43029^Fachkennz.^9^330^-1^130^150^1^char^30^0^1^<<SQL>> select apnr,druck from sos_k_kzfa order by 2^hidden^^
43030^Vertiefung^4^330^-1^130^100^1^char^30^0^1^<<SQL>> select apnr,druck from cifx where key=39 order by 2;^hidden^^
43031^ab Fachsemester^22^0^0^130^100^1^integer^30^0^0^^hidden^^
43032^Studiengangstyp^120^0^0^130^150^1^char^20^0^1^<<SQL>> select 'ETSG','Einfach- und Teilstudiengänge' from xdummy\
union select 'EMSG','Einfach- und Mehrfachstudiengänge' from xdummy\
order by 2;^ ^<<SQL>> select 'ETSG','Einfach- und Teilstudiengänge' from xdummy^
43033^Trennen nach^121^330^-1^130^100^1^char^20^0^1^<<SQL>> \
select 'Fach' from xdummy \
union \
select 'Abschluss' from xdummy^hidden^^
43034^Studiengang^6^0^0^130^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;^hidden^^

11
src-modules/module/costage/masken/43020_masken_felder_bez.unl

@ -1,15 +1,4 @@ @@ -1,15 +1,4 @@
43020^43020^
43020^43021^
43020^43022^
43020^43023^
43020^43024^
43020^43025^
43020^43026^
43020^43027^
43020^43028^
43020^43029^
43020^43030^
43020^43031^
43020^43032^
43020^43033^
43020^43034^

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

@ -5,9 +5,9 @@ @@ -5,9 +5,9 @@
</#list>\
order by 1^ ^^
43041^Seit Semester^3^0^0^140^80^1^integer^30^0^1^<<SQL>> select semester_tid, semester_bezeichnung from costage_st_semester order by 1 DESC;^ ^<<SQL>> select semester_tid, semester_bezeichnung from costage_st_semester where today()-(4*365) between date(semester_anfang) and date(semester_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^ ^ ^
43043^Staatsangehörigkeit^36^0^0^130^150^10^sql^30^0^1^<<SQL>> SELECT st_land_nr, name from costage_st_laender order by 2;^^^
43044^Status^14^350^-1^140^180^1^char^30^0^1^<<SQL>> select apnr,druck from cifx where key=400 order by 2^^ ^
43045^Hörerstatus^33^0^0^140^170^1^char^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','costage_st_studiengaenge')\
@ -23,7 +23,7 @@ order by 2^^^ @@ -23,7 +23,7 @@ order by 2^^^
<#if i_has_next> union </#if>\
</#list>\
order by 1^ ^^
43051^Geschlecht^37^0^0^140^80^1^integer^30^0^1^<<SQL>> select apnr,beschreibung from konstanten where tid=1 or tid=2;^^^
43051^Geschlecht^37^0^0^140^80^1^integer^30^0^1^<<SQL>> SELECT apnr,druck FROM cif WHERE cif.key = 9003 order by 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,\
@ -45,16 +45,17 @@ SELECT \ @@ -45,16 +45,17 @@ SELECT \
skz_key,\
skz_name\
FROM costage_st_studienkennzahlen\
/* where unikey='<<Hochschule>>' */\
/* 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^
43059^Hochschule^5^350^-1^140^80^1^char^255^0^1^<<SQL>>select distinct K.unikey,K.unikey\
from costage_st_studienkennzahlen K\
order by 2;^ ^<<SQL>> select distinct K.unikey,K.unikey\
from costage_st_studienkennzahlen K, hochschulinfo H\
where K.unikey=H.hs_nr::char(10)^
43060^##line##^10^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,\

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

@ -59,7 +59,7 @@ SELECT name,\ @@ -59,7 +59,7 @@ SELECT name,\
</sqlvars>\
\
<@generate_multitable_list />\
<@generate_field_list_multitable aggregationsfeld="*" aggregatfunktion="count(" />\
<@generate_field_list_multitable aggregationsfeld="summe" aggregatfunktion="sum(" />\
<@generate_foreign_fields_multitable />\
\
\
@ -69,11 +69,12 @@ SELECT name,\ @@ -69,11 +69,12 @@ SELECT name,\
/* 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>>)) */\
/* and costage_st_studien_aggr.st_studiengang_nr in (select G.st_studiengang_nr from costage_st_studiengaenge G where G.abschluss in (<<Abschluss>>)) */\
/* and costage_st_studien_aggr.st_studiengang_nr in (select G.st_studiengang_nr from costage_st_studiengaenge G where G.stg in (<<Fach>>)) */\
/* and studiengang_nr =<<Studiengang-Nr.>> */\
/* and fach_nr =<<Fach-Nr.>> */\
/* and costage_st_studien_aggr.st_studstamm_nr in (select S.st_studstamm_nr from costage_st_studierendenstammdaten S where S.st_land1_nr in (<<Staatsangehörigkeit>>) ) */\
/* and costage_st_studien_aggr.st_studstamm_nr in (select S2.st_studstamm_nr from costage_st_studierendenstammdaten S2 where S2.geschlecht = <<Geschlecht>> ) */\
" />\
\
\
@ -81,8 +82,6 @@ SELECT name,\ @@ -81,8 +82,6 @@ SELECT name,\
<#assign filter=filter+" and costage_st_studien_aggr.matrikelnummer in (<<Matrikel-Nr.>>)"?replace("'","")/>\
</#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\

109
src-modules/module/costage/schluesseltabellen/cif_fuellen.sql

@ -0,0 +1,109 @@ @@ -0,0 +1,109 @@
-- Die cif wird um ICE-Schlüssel erweitert
--freemarker template
--(c) 2010 Daniel Quathamer
--Liste der cif-Schlüssel des Moduls:
--Wird in cif mit key=1 eingefügt
<#assign dimension_levels_man = [
{"key":"9003","apnr":"1", "druck":"Männlich", "kurz":"M"},
{"key":"9003","apnr":"2", "druck":"Weiblich", "kurz":"W"},
{"key":"9003","apnr":"3", "druck":"Divers", "kurz":"D"},
{"key":"9003","apnr":"4", "druck":"Unbekannt", "kurz":"U"}
] />
<#assign cif_keys_list = [
{"name":"Geschlecht (Amtl.)", "key":"9003"}
] />
--Liste der cifx-Schlüssel des Moduls:
--Wird in cifx mit key=2 eingefügt
create temp table tmp_cif2
(
tid serial,
key smallint not null ,
hs integer not null,
apnr integer not null ,
kurz char(10),
druck varchar(100),
lang_1 char(50),
astat INTEGER ,
parent INTEGER ,
sortc1 CHAR(10) ,
bund_apnr CHAR(10) ,
sprache CHAR(3)
);
create temp table tmp_hilf(tid integer);
--zuerst Metadaten cif:
<#list cif_keys_list as cif_key>
select 'cif-Schlüssel ${cif_key.name} key= ${cif_key.key} einfügen '::varchar(255) from xdummy;
insert into tmp_cif2(key,hs,apnr,kurz,druck,lang_1
)
select 1,0,${cif_key.key},substring('${cif_key.name}' from 1 for 10),'${cif_key.name}','${cif_key.name}'
from xdummy
;
</#list>
<#foreach dimension_level in dimension_levels_man>
insert into tmp_cif2(key,hs,apnr,kurz,druck,lang_1
)
select ${dimension_level.key},
0,
${dimension_level.apnr},
'${dimension_level.kurz}',
'${dimension_level.druck}',
'${dimension_level.druck}'
from xdummy
;
</#foreach>
--Vorhandene Schlüssel werden ersetzt, nicht vorhandene Schlüssel bleiben:
delete from cif where '' || key || '_' || apnr in
(select '' || key || '_' || apnr from tmp_cif2 )
;
insert into tmp_hilf select max(tid) from cif;
update tmp_hilf set tid=1 where tid is null;
insert into cif(tid,key,hs,apnr,kurz,druck,lang_1
-- ,
-- parent,
-- astat,
-- bund_apnr,
-- sortc1,
-- sprache
)
select C.tid+H.tid,key,hs,apnr,kurz,druck,lang_1
-- ,
-- parent,
-- astat,
-- bund_apnr,
-- sortc1,
-- sprache
from tmp_cif2 C, tmp_hilf H
where apnr is not null;
drop table tmp_cif2;
drop table tmp_hilf;
update cif set kurz=substring(druck from 1 for 10)
where kurz is null and druck is not null;
--Damit die Hochschulnummern in der CIF und in der Hochschulinfo-Tabelle
-- uebereinstimmen, ist folgender UPDATE notwendig:
update cif
set hs = (select hs_nr from hochschulinfo)
where hs != 0;

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

@ -4,7 +4,9 @@ @@ -4,7 +4,9 @@
<#assign dimensions = [
{"key":"400", "name":"Statustyp (CO)"},
{"key":"401", "name":"Hörerstatus (CO)"},
{"key":"30", "name":"Studienfächer"}
{"key":"30", "name":"Studienfächer"},
{"key":"35", "name":"Abschlüsse"},
{"key":"90", "name":"Fakultät/Fachbereich"}
] />
<#assign dimension_levels_man = [
@ -26,11 +28,15 @@ @@ -26,11 +28,15 @@
{"key":"30","apnr":"skz_key", "druck":"skz_name", "srctable":"costage_st_studienkennzahlen",
"astat":"(select distinct F.statistik_code from costage_st_studienfaecher F where F.st_stdfach_nr=costage_st_studienkennzahlen.st_stdfach_nr)",
"struktur_c":"fakultaet_key",
"hs":"val(unikey)"},
"hs":"unikey"},
{"key":"35","apnr":"code", "druck":"name", "srctable":"costage_st_abschlussziele_lokal",
"astat":"(select distinct F.statistik_code from costage_st_abschlussziele_amtstat F where F.st_absz_amtstat_nr=costage_st_abschlussziele_lokal.costage_st_abschlussziele_lokal)",
"struktur_c":"(select A.kurzbezeichnung from costage_st_studienarten A where A.st_std_art_nr=costage_st_abschlussziele_lokal.st_std_art_nr)",
"hs":""}
"astat":"(select distinct F.statistik_code from costage_st_abschlussziele_amtstat F where F.st_absz_amtstat_nr=costage_st_abschlussziele_lokal.st_absz_amtstat_nr)",
"struktur_c":"(select A.kurzbezeichnung from costage_st_abschlussziele_amtstat F, costage_st_studienarten A where F.st_absz_amtstat_nr=costage_st_abschlussziele_lokal.st_absz_amtstat_nr and A.st_std_art_nr=F.st_std_art_nr)",
"hs":""},
{"key":"90","apnr":"fakultaet_key", "druck":"fakultaet_bezeichnung", "srctable":"costage_st_fakultaeten",
"astat":"",
"struktur_c":"",
"hs":"unikey"}
] />
@ -61,6 +67,7 @@ create temp table tmp_hilf(tid integer); @@ -61,6 +67,7 @@ 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 >
@ -135,11 +142,7 @@ lid , @@ -135,11 +142,7 @@ lid ,
)
select distinct
${dimension_level.key} ,
<#if dimension_level.hs=="">
0
<#else>
${dimension_level.hs}
</#if> as hs,
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,
@ -163,12 +166,22 @@ NULL::char(10) as hiskey_id , @@ -163,12 +166,22 @@ NULL::char(10) as hiskey_id ,
${dimension_level.struktur_c}
</#if> as struktur_c
from ${dimension_level.srctable}
<#if dimension_level.hs!="">
where ${dimension_level.hs}=(select hs_nr::char(4) from hochschulinfo)
</#if>
;
</#if>
</#foreach>
</#foreach>
--Duplikate raus:
select T.key,T.apnr
from tmp_cifx T
group by 1,2
having count(*)>1;
--Künstliche Schlüssel aus CO:
@ -248,7 +261,7 @@ insert into cifx @@ -248,7 +261,7 @@ insert into cifx
lid,
parent_lid
from tmp_cifx T, tmp_hilf H
where druck is not null
;
insert into trans_cifx(

70
src-modules/module/sos/rohdaten/sos_costage_unload.xml

@ -1241,7 +1241,7 @@ d_geburt as gebdat, @@ -1241,7 +1241,7 @@ d_geburt as gebdat,
geschlecht,
d_exmatr as exmdat,
null::integer as status,
null::integer as semester,
semester_max as semester,
null::integer ,--poplz,
null::integer ,--poort,
date(aufnahmedatum) as immdat,
@ -1293,7 +1293,7 @@ null::integer AS ersthzbnote @@ -1293,7 +1293,7 @@ null::integer AS ersthzbnote
FROM superx_sos,costage_st_studierendenstammdaten
where
val(costage_st_studierendenstammdaten.matrikelnummer) = superx_sos.mtknr
--and sos.semester >= $start_stud_sem
and semester_max >= $start_stud_sem
;
]]>
@ -1676,6 +1676,8 @@ FROM costage_st_studiengaenge G, costage_st_studien_aggr F, superx_sos S @@ -1676,6 +1676,8 @@ FROM costage_st_studiengaenge G, costage_st_studien_aggr F, superx_sos S
WHERE F.matrikelnummer = S.mtknr
and G.st_studiengang_nr=F.st_studiengang_nr
and F.statustyp is not null
and F.fachsemester is not null
and F.kz_rueck_beur_ein is not null
AND F.semester >= $start_stud_sem
;
]]>
@ -3730,6 +3732,22 @@ SELECT distinct @@ -3730,6 +3732,22 @@ SELECT distinct
null,
'' --sprache
FROM costage_st_studien_spoversionen
union
select 9003,
-1,
apnr,
kurz,
druck,
druck,
null , --astat
null,
'' ,--sortc1
null,
'' --sprache
from cif
where key=9003
and apnr != -999990
]]>
</extraction-sql>
@ -5383,29 +5401,7 @@ null as parent_lid, @@ -5383,29 +5401,7 @@ null as parent_lid,
null as sortorder
FROM costage_st_laender
WHERE statistik_code is not null
--and aikz='A'
-- union
-- SELECT
-- 12,
-- 0,
-- akfz,
-- akfz as ktxt,
-- dtxt,
-- ltxt,
-- astat,
-- '',
-- akfz,--bei staaten ist astat=uniqename
-- erdteil,
-- '' ,
--null as gueltig_von,
-- '01.01.2009', --gültig bis
-- akfz , --sourcesystem_id
-- '' , --hiskey_id
-- '' --struktur_c
-- FROM k_akfz
-- WHERE akfz is not null
-- and (aikz='I' or aikz is null)
union
union
SELECT
8,
0,
@ -5540,29 +5536,7 @@ null as lid, @@ -5540,29 +5536,7 @@ null as lid,
null as parent_lid,
null as sortorder
FROM xdummy
union
SELECT
90,
-1,
fakultaet_key, -- reffb,
substring(fakultaet_bezeichnung from 1 for 10),-- ktxt,
fakultaet_name as dtxt,
fakultaet_name as ltxt,
'',
'',
'' ,
'',
'',--sprache,
null as gueltig_von,
null as gueltig_bis,
fakultaet_key , --sourcesystem_id
'', --hiskey_id
'' , --struktur_c
null as lid,
null as parent_lid,
null as sortorder
FROM costage_st_fakultaeten
;
;
]]>
</extraction-sql>

Loading…
Cancel
Save