Browse Source

TSG Generierung bei MSG-Wechsel #10

COStage_0.3_Release
Daniel Quathamer 2 years ago
parent
commit
236c7eb55c
  1. 62
      src-modules/module/costage/hilfstabellen/costage_st_studien_aggr_fuellen.sql
  2. 4
      src-modules/module/costage/rohdaten/sos_costage_unload.x

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

@ -123,6 +123,7 @@ on (H.st_studstamm_nr=T.st_studstamm_nr
--Ermittlung msg bei TSG: --Ermittlung msg bei TSG:
update tmp_studien2 set st_studiengang_nr_msg=M.st_studiengang_nr_msg update tmp_studien2 set st_studiengang_nr_msg=M.st_studiengang_nr_msg
from costage_st_studiengaenge_mtsg M, costage_st_studien ST from costage_st_studiengaenge_mtsg M, costage_st_studien ST
where ST.st_studiengang_nr=M.st_studiengang_nr_msg where ST.st_studiengang_nr=M.st_studiengang_nr_msg
@ -130,7 +131,6 @@ and ST.st_studstamm_nr=tmp_studien2.st_studstamm_nr
and M.st_studiengang_nr_tsg=tmp_studien2.st_studiengang_nr and M.st_studiengang_nr_tsg=tmp_studien2.st_studiengang_nr
and tmp_studien2.studiengangs_typ_kb ='TSG' and tmp_studien2.studiengangs_typ_kb ='TSG'
; ;
--statustyp bei TSG aus MSG nachladen: --statustyp bei TSG aus MSG nachladen:
update tmp_studien2 set studienstatustyp=S.studienstatustyp update tmp_studien2 set studienstatustyp=S.studienstatustyp
from tmp_studien S from tmp_studien S
@ -146,6 +146,17 @@ and S.status_historie=1
<#if K_COSTAGE_TSG_GENERATE == 1> <#if K_COSTAGE_TSG_GENERATE == 1>
--alle möglichen TSG/MSG-Kombinationen laden:
select T.*,M.st_studiengang_nr_msg as st_studiengang_nr_msg_possible,ST.st_studium_nr as st_studium_nr_msg_possible
into temp tmp_studien3
from tmp_studien2 T, costage_st_studiengaenge_mtsg M, costage_st_studien ST
where ST.st_studiengang_nr=M.st_studiengang_nr_msg
and ST.st_studstamm_nr=T.st_studstamm_nr
and M.st_studiengang_nr_tsg=T.st_studiengang_nr
and T.studiengangs_typ_kb ='TSG'
;
--Start- und Endsemester aller MSG pro Student: --Start- und Endsemester aller MSG pro Student:
drop table if exists tmp_studien_msg; drop table if exists tmp_studien_msg;
select T.st_studiengang_nr as st_studiengang_nr_msg, select T.st_studiengang_nr as st_studiengang_nr_msg,
@ -170,10 +181,10 @@ E.st_sem_nr,
M.startsemester, M.startsemester,
M.endsemester M.endsemester
into temp tmp_studien_msg_tsg into temp tmp_studien_msg_tsg
from tmp_studien_msg M, tmp_studien2 T,costage_st_semester E from tmp_studien_msg M, tmp_studien3 T,costage_st_semester E
where M.st_studiengang_nr_msg=T.st_studiengang_nr_msg where M.st_studiengang_nr_msg=T.st_studiengang_nr_msg_possible
and M.st_studstamm_nr=T.st_studstamm_nr and M.st_studstamm_nr=T.st_studstamm_nr
and T.semester between M.startsemester and M.endsemester --and T.semester between M.startsemester and M.endsemester
and E.semester_tid between M.startsemester and M.endsemester and E.semester_tid between M.startsemester and M.endsemester
and T.studiengangs_typ_kb ='TSG' and T.studiengangs_typ_kb ='TSG'
; ;
@ -182,8 +193,8 @@ drop table if exists tmp_studien_msg_tsg_fehlend;
select T.* select T.*
into temp tmp_studien_msg_tsg_fehlend into temp tmp_studien_msg_tsg_fehlend
from tmp_studien_msg_tsg T --enthält alle möglichen TSG from tmp_studien_msg_tsg T --enthält alle möglichen TSG
left outer join tmp_studien2 T2 --enthält die tatsächlich vorhandenen TSG left outer join tmp_studien3 T2 --enthält die tatsächlich vorhandenen TSG
on (T2.st_studiengang_nr_msg=T.st_studiengang_nr_msg on (T2.st_studiengang_nr_msg_possible=T.st_studiengang_nr_msg
and T2.st_studiengang_nr=T.st_studiengang_nr_tsg and T2.st_studiengang_nr=T.st_studiengang_nr_tsg
and T2.st_studstamm_nr=T.st_studstamm_nr and T2.st_studstamm_nr=T.st_studstamm_nr
and T2.studiengangs_typ_kb ='TSG' and T2.studiengangs_typ_kb ='TSG'
@ -242,7 +253,7 @@ S.ca12_staat,
S.second_nationality, S.second_nationality,
S.fachkennzeichen, S.fachkennzeichen,
S.studienform_statistik_code, S.studienform_statistik_code,
S.st_studiengang_nr_msg, M.st_studiengang_nr_msg,
S.st_studiengang_nr_tsg, S.st_studiengang_nr_tsg,
null::char(10) as hrst,--hrst kann im Studienverlauf wechseln, daher nachher vom MSG nachladen null::char(10) as hrst,--hrst kann im Studienverlauf wechseln, daher nachher vom MSG nachladen
S.hssem, S.hssem,
@ -251,8 +262,8 @@ null::char(10) as statustyp_tsg,
0 as primaerflag, --geschlossene TSG können kein Primärflag haben 0 as primaerflag, --geschlossene TSG können kein Primärflag haben
S.hzb_art, S.hzb_art,
max(S.fachsemester) max(S.fachsemester)
from tmp_studien_msg_tsg_fehlend M, tmp_studien2 S --,costage_st_semester E from tmp_studien_msg_tsg_fehlend M, tmp_studien3 S --,costage_st_semester E
where M.st_studiengang_nr_msg=S.st_studiengang_nr_msg where M.st_studiengang_nr_msg=S.st_studiengang_nr_msg_possible
and M.st_studiengang_nr_tsg=S.st_studiengang_nr and M.st_studiengang_nr_tsg=S.st_studiengang_nr
and M.st_studstamm_nr=S.st_studstamm_nr and M.st_studstamm_nr=S.st_studstamm_nr
and S.studiengangs_typ_kb ='TSG' and S.studiengangs_typ_kb ='TSG'
@ -291,15 +302,12 @@ and tmp_studien2.fachsemester=S.fachsemester
drop table tmp_studien_msg_tsg_fehlend; drop table tmp_studien_msg_tsg_fehlend;
drop table tmp_studien_msg_tsg; drop table tmp_studien_msg_tsg;
drop table tmp_studien_msg; drop table tmp_studien_msg;
drop table tmp_studien3;
</#if> </#if>
-------------------------------------------------------------------- --------------------------------------------------------------------
drop table tmp_studien; drop table tmp_studien;
--Ermittlung fach_nr: --Ermittlung fach_nr:
@ -326,9 +334,9 @@ from cifx where key=400
and apnr=tmp_studien2.studienstatustyp and apnr=tmp_studien2.studienstatustyp
); );
-- update tmp_studien2 set kz_rueck_beur_ein=(select val(astat) -- update tmp_studien3 set kz_rueck_beur_ein=(select val(astat)
-- from cifx where key=400 -- from cifx where key=400
-- and apnr=tmp_studien2.statustyp_tsg -- and apnr=tmp_studien3.statustyp_tsg
-- ) -- )
-- where kz_rueck_beur_ein is null; -- where kz_rueck_beur_ein is null;
@ -421,33 +429,11 @@ select st_studium_nr,
(case when studiengangs_typ_kb='TSG' then st_studiengang_nr_msg else st_studium_nr end ))+1 (case when studiengangs_typ_kb='TSG' then st_studiengang_nr_msg else st_studium_nr end ))+1
end) end)
as studiengang_nr, as studiengang_nr,
--AP Code:
-- (case when studiengangs_typ_kb ='TSG' then
-- (case when primaerflag =1
-- then 1
-- else
-- (case when st_studiengang_nr_msg in (select distinct T2.st_studiengang_nr_msg from temp_tmp_studien2 T2
-- where tmp_studien2.matrikelnummer = T2.matrikelnummer and tmp_studien2.semester = T2.Semester)
-- then 1
-- else
-- dense_rank () over (partition by semester, st_studstamm_nr,studiengang_nr order by(case when studiengangs_typ_kb='TSG' then st_absz_nr else st_studium_nr end ))+1
-- end )end)
-- else
-- (case when primaerflag =1
-- then 1
-- else
-- dense_rank () over (partition by semester, st_studstamm_nr,studiengang_nr order by( case when studiengangs_typ_kb='TSG' then st_absz_nr else st_studium_nr end ))+1
-- end) end )
--as studiengang_nr2,
(case when primaerflag =1 then 1 (case when primaerflag =1 then 1
else else
dense_rank () over (partition by semester, st_studstamm_nr,studiengang_nr dense_rank () over (partition by semester, st_studstamm_nr,studiengang_nr
order by primaerflag desc,fach_nr) order by primaerflag desc,fach_nr)
end) as fach_nr, end) as fach_nr,
--TODO probieren:
-- ROW_NUMBER() over (partition by semester, st_studstamm_nr,studiengang_nr
-- order by primaerflag desc,fach_nr)
-- end)+1 as fach_nr,
unikey, unikey,
beginn_datum as anfdat, beginn_datum as anfdat,
(case when studienstatustyp not in ('Z','X') then null::date (case when studienstatustyp not in ('Z','X') then null::date
@ -602,5 +588,5 @@ and A.st_adresse_typ='H'
drop table tmp_studien2; drop table tmp_studien2;
drop table tmp_primaer_msg; drop table tmp_primaer_msg;
drop table temp_tmp_studien2;

4
src-modules/module/costage/rohdaten/sos_costage_unload.x

@ -31,14 +31,14 @@ date +'%d.%m.%Y' > $SRC_PFAD/superx.datum ##neues Entladedatum
HEUTE=`date +'%d.%m.%Y'` HEUTE=`date +'%d.%m.%Y'`
cd $SRC_PFAD >>$ERR 2>&1
echo "Letztes Update-Datum: " $DATUM >$ERR echo "Letztes Update-Datum: " $DATUM >$ERR
echo "DATABASE: $DATABASE" >>$ERR echo "DATABASE: $DATABASE" >>$ERR
echo "VERSION: $VERSION" >>$ERR echo "VERSION: $VERSION" >>$ERR
echo "SX_CLIENT: $SX_CLIENT" >>$ERR echo "SX_CLIENT: $SX_CLIENT" >>$ERR
echo "1.2b^"$HEUTE"^" >$SRC_PFAD/unl/superx_unload_version.unl echo "1.2b^"$HEUTE"^" >$SRC_PFAD/unl/superx_unload_version.unl
cd $SRC_PFAD >>$ERR 2>&1
CP=".:$JDBC_CLASSPATH:$XML_CLASSPATH" CP=".:$JDBC_CLASSPATH:$XML_CLASSPATH"

Loading…
Cancel
Save