From fb9d331375120f8961adcbcf19038b4d1271ea99 Mon Sep 17 00:00:00 2001 From: Daniel Quathamer Date: Sat, 24 Jun 2023 10:09:02 +0200 Subject: [PATCH] =?UTF-8?q?Bewerbungsdaten=20=C3=9Cbergabe=20nach=20SuperX?= =?UTF-8?q?-ZUL=20#3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src-modules/module/costage/conf/costage.xml | 27 +- .../module/costage/costage_update_cron.x.sam | 20 + ...rans_costage_st_studierendenstammdaten.sql | 2 +- .../costage_bw_antr_aggr_fuellen.sql | 40 +- .../rohdaten_sos/sos_costage_unload.xml | 6335 +---------------- .../rohdaten_zul/unl/hierhin_die_rohdaten.txt | 1 + .../costage/rohdaten_zul/zul_costage_unload.x | 115 + .../rohdaten_zul/zul_costage_unload.xml | 633 ++ .../costage/upgrade/costage_upgrade_man.sql | 3 + 9 files changed, 881 insertions(+), 6295 deletions(-) create mode 100755 src-modules/module/costage/costage_update_cron.x.sam create mode 100644 src-modules/module/costage/rohdaten_zul/unl/hierhin_die_rohdaten.txt create mode 100755 src-modules/module/costage/rohdaten_zul/zul_costage_unload.x create mode 100644 src-modules/module/costage/rohdaten_zul/zul_costage_unload.xml diff --git a/src-modules/module/costage/conf/costage.xml b/src-modules/module/costage/conf/costage.xml index 0abcfd5..10bdf1c 100644 --- a/src-modules/module/costage/conf/costage.xml +++ b/src-modules/module/costage/conf/costage.xml @@ -1,5 +1,5 @@ - @@ -461,7 +461,7 @@ rightname="CS_BIA_STANDARDREPORTS_ADMIN[CO]" /> Studierendenstammdaten (CO) - + @@ -714,7 +714,28 @@ rightname="CS_BIA_STANDARDREPORTS_ADMIN[CO]" /> - + + + Lookup via: st_studstamm_nr - costage_bw_bewerbungen.st_studstamm_nr - costage_bw_bewerbungen.nr - costage_bw_bewerb_hzb.bw_bewrbng_nr + + + + Lookup via: st_studstamm_nr - costage_bw_bewerbungen.st_studstamm_nr - costage_bw_bewerbungen.nr - costage_bw_bewerb_hzb.bw_bewrbng_nr - costage_bw_bewerb_hzb.zeugnisdatum + + + + Lookup via: st_studstamm_nr - costage_bw_bewerbungen.st_studstamm_nr - costage_bw_bewerbungen.nr - costage_bw_bewerb_hzb.bw_bewrbng_nr - costage_bw_bewerb_hzb.hzb_note + + + + Lookup via: st_studstamm_nr - costage_bw_bewerbungen.st_studstamm_nr - costage_bw_bewerbungen.nr - costage_bw_bewerb_hzb.bw_bewrbng_nr - costage_bw_bewerb_hzb.land_sub_r_nr - costage_land_subregionen.nr + + + + Lookup via: st_studstamm_nr - costage_bw_bewerbungen.st_studstamm_nr - costage_bw_bewerbungen.nr - costage_bw_bewerb_hzb.bw_bewrbng_nr - costage_bw_bewerb_hzb.st_land_nr - costage_st_laender.land_nr + + +
diff --git a/src-modules/module/costage/costage_update_cron.x.sam b/src-modules/module/costage/costage_update_cron.x.sam new file mode 100755 index 0000000..74a04c8 --- /dev/null +++ b/src-modules/module/costage/costage_update_cron.x.sam @@ -0,0 +1,20 @@ +#!/bin/bash + +#Beispielscript für cronjobs +#Im cronjob ist keine Umgebung vorhanden, deshalb vorher laden. +#Selbstredend als normaler user, nicht als root z.B. +. /home/superx/db/bin/SQL_ENV + + +cd $COSTAGE_LOAD_PFAD +./costage_unload.x + + + +cd $COSTAGE_PFAD +costage_update.x + + +DOQUERY "reindex database $DBNAME" +echo "Ende $COSTAGE_PFAD/costage_update_cron.x" + diff --git a/src-modules/module/costage/datentabellen/trans_costage_st_studierendenstammdaten.sql b/src-modules/module/costage/datentabellen/trans_costage_st_studierendenstammdaten.sql index 1b33cb7..10bf337 100644 --- a/src-modules/module/costage/datentabellen/trans_costage_st_studierendenstammdaten.sql +++ b/src-modules/module/costage/datentabellen/trans_costage_st_studierendenstammdaten.sql @@ -2,7 +2,7 @@ create temp table tmp_st_studierendenstammdaten( st_studstamm_nr INTEGER not null, -matrikelnummer INTEGER not null, +matrikelnummer INTEGER , vorname VARCHAR(255) , familienname VARCHAR(255) , geburtsdatum timestamptz , diff --git a/src-modules/module/costage/hilfstabellen/costage_bw_antr_aggr_fuellen.sql b/src-modules/module/costage/hilfstabellen/costage_bw_antr_aggr_fuellen.sql index 5bde9ec..8b907ef 100644 --- a/src-modules/module/costage/hilfstabellen/costage_bw_antr_aggr_fuellen.sql +++ b/src-modules/module/costage/hilfstabellen/costage_bw_antr_aggr_fuellen.sql @@ -53,7 +53,14 @@ null::integer as bw_bewerbng_nr_msg, null::char(10) as bew_kz, null::char(10) as zul_kz, null::char(10) as annahme_kz, -null::char(10) as einschreib_kz +null::char(10) as einschreib_kz, +null::CHAR(10) as hzb_art , +null::DATE as hzb_datum , +null::FLOAT as hzb_note , +null::INTEGER as hzb_ort , +null::INTEGER as hzb_staat , +null::INTEGER as hzb_st_land_nr + into temp tmp_bew FROM costage_st_semester E, costage_bw_bewerbungen B left outer join costage_st_studierendenstammdaten S @@ -149,6 +156,23 @@ update tmp_bew set annahme_kz='J' where status_stpl='J' update tmp_bew set einschreib_kz='J' where status_evs='J' ; + +--TODO: +update tmp_bew +set hzb_art=H.hzb_art_stla_code, +hzb_datum=H.zeugnisdatum, +hzb_note=H.hzb_note, +hzb_ort=H.land_sub_r_nr, +hzb_st_land_nr=H.land_nr +from costage_bw_bewerb_hzb H, costage_bw_bewerbungen BW +where tmp_bew.st_studstamm_nr = BW.st_studstamm_nr +and BW.nr=H.bw_bewrbng_nr +; +update tmp_bew set hzb_staat=val(L.statistik_code) +from costage_st_laender L +where L.st_land_nr=tmp_bew.hzb_st_land_nr +; + truncate table costage_bw_antr_aggr; insert into costage_bw_antr_aggr( nr, st_studstamm_nr, @@ -172,7 +196,12 @@ bew_kz, zul_kz, annahme_kz, einschreib_kz, - summe +hzb_art, +hzb_datum, +hzb_note, +hzb_ort, +hzb_staat, +summe ) SELECT nr, st_studstamm_nr, @@ -196,9 +225,14 @@ bew_kz, zul_kz, annahme_kz, einschreib_kz, +hzb_art, +hzb_datum, +hzb_note, +hzb_ort, +hzb_staat, count(*) from tmp_bew - group by 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26; + group by 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31; drop table tmp_bew; diff --git a/src-modules/module/costage/rohdaten_sos/sos_costage_unload.xml b/src-modules/module/costage/rohdaten_sos/sos_costage_unload.xml index 5b0d2c4..b46e6d9 100644 --- a/src-modules/module/costage/rohdaten_sos/sos_costage_unload.xml +++ b/src-modules/module/costage/rohdaten_sos/sos_costage_unload.xml @@ -29,196 +29,9 @@ - - - - wichtige Konstanten aus SOS entladen, z.B. HISSOS-Version. - - - - - - - - - - - - wichtige Konstanten aus SOS entladen, z.B. HISSOS-Version. - - - - - - - - - - - - - - PNR Konstanten aus POS entladen - - - - - - - - - - - + PNR Konstanten aus POS entladen - - - - - - - -= tmp_course_of_study.valid_to -or D.valid_to is null -or ( D.valid_from is null and tmp_course_of_study.valid_from is null) -) -); ---wenn degree nicht ermittelt werden kann, dann ohne Historisierung -update tmp_course_of_study set degree_id=(select min(D.id) from degree D -where D.lid=tmp_course_of_study.degree_lid -) -where degree_id is null -; ---subject -update tmp_course_of_study set subject_id=(select D.id from subject D -where D.lid=tmp_course_of_study.subject_lid -and (D.valid_from <= tmp_course_of_study.valid_from -or D.valid_from is null -or ( D.valid_from is null and tmp_course_of_study.valid_from is null) -) -and (D.valid_to >= tmp_course_of_study.valid_to -or D.valid_to is null -or ( D.valid_from is null and tmp_course_of_study.valid_from is null) -) -); ---wenn subject nicht ermittelt werden kann, dann ohne Historisierung -update tmp_course_of_study set subject_id=(select min(D.id) from subject D -where D.lid=tmp_course_of_study.subject_lid -) -where subject_id is null -; ---major_field_of_study -update tmp_course_of_study set major_field_of_study_id=(select D.id from major_field_of_study D -where D.lid=tmp_course_of_study.major_field_of_study_lid -and (D.valid_from <= tmp_course_of_study.valid_from -or D.valid_from is null -or ( D.valid_from is null and tmp_course_of_study.valid_from is null) -) -and (D.valid_to >= tmp_course_of_study.valid_to -or D.valid_to is null -or ( D.valid_from is null and tmp_course_of_study.valid_from is null) -) -); ---course_specialization_lid -update tmp_course_of_study set course_specialization_id=(select D.id from course_specialization D -where D.lid=tmp_course_of_study.course_specialization_lid -and (D.valid_from <= tmp_course_of_study.valid_from -or D.valid_from is null -or ( D.valid_from is null and tmp_course_of_study.valid_from is null) -) -and (D.valid_to >= tmp_course_of_study.valid_to -or D.valid_to is null -or ( D.valid_from is null and tmp_course_of_study.valid_from is null) -) -); ---orgunit -update tmp_course_of_study set orgunit_id=(select D.id from orgunit D -where D.lid=tmp_course_of_study.orgunit_lid -and (D.valid_from <= tmp_course_of_study.valid_from -or D.valid_from is null -or ( D.valid_from is null and tmp_course_of_study.valid_from is null) -) -and (D.valid_to >= tmp_course_of_study.valid_to -or D.valid_to is null -or ( D.valid_from is null and tmp_course_of_study.valid_from is null) -) -); ---wenn Studiengang heute gültig ist und orgunit historisiert, nimmt er den aktuellen FB -update tmp_course_of_study set orgunit_id=(select D.id from orgunit D -where D.lid=tmp_course_of_study.orgunit_lid -and current_date between D.valid_from and D.valid_to) -where current_date between valid_from and valid_to -and orgunit_id is null; - - ---teachingunit_orgunit_lid - -update tmp_course_of_study set teachingunit_orgunit_id=(select D.id from orgunit D -where D.lid=tmp_course_of_study.teachingunit_orgunit_lid -and (D.valid_from <= tmp_course_of_study.valid_from -or D.valid_from is null -or ( D.valid_from is null and tmp_course_of_study.valid_from is null) -) -and (D.valid_to >= tmp_course_of_study.valid_to -or D.valid_to is null -or ( D.valid_from is null and tmp_course_of_study.valid_from is null) -) -) -where teachingunit_orgunit_lid is not null; - ---wenn Studiengang heute gültig ist und orgunit historisiert, nimmt er aktuelle LE -update tmp_course_of_study set teachingunit_orgunit_id=(select D.id from orgunit D -where D.lid=tmp_course_of_study.teachingunit_orgunit_lid -and current_date between D.valid_from and D.valid_to) -where current_date between valid_from and valid_to -and teachingunit_orgunit_id is null; - - ---k_field_of_study -update tmp_course_of_study set k_field_of_study_id=(select S.k_field_of_study_id -from subject S -where S.id=tmp_course_of_study.subject_id) -where k_field_of_study_id is null; ---hochprojizieren auf Fächergruppe -update tmp_course_of_study set k_field_of_study_id=(select K.parent_id -from k_field_of_study K -where K.id=tmp_course_of_study.k_field_of_study_id); - ---is_historized=1 wenn es mehrere Studiengänge pro LID gibt -update tmp_course_of_study set is_historized=1 -where 1 < (select count(*) from course_of_study C -where C.lid=tmp_course_of_study.lid); - -create index i_tc1 on tmp_course_of_study(lid); -]]> - - - - - - - wichtige Konstanten aus SOS entladen, z.B. HISSOS-Version. - -= date("$DATUM") - OR ruebeudat >= date("$DATUM") - OR exmdat >= date("$DATUM")) - ) - --oder pro -or (S.mtknr in (select mtknr -FROM pro -WHERE datum >= date("$DATUM") --- keine Berücksichtigung von archivierten Daten -and fktkz not in ("ARC", "REA", "NER", "AAE")) -) ---oder pprot -or (S.mtknr in (select - DISTINCT mtknr -FROM pprot -WHERE datlae >= date("$DATUM")) ) - -); -]]> - - -= date('"$DATUM"') - OR ruebeudat >= date('"$DATUM"') - OR exmdat >= date('"$DATUM"')) - ) - --oder pro -or (S.mtknr in (select mtknr -FROM pro -WHERE datum >= date('"$DATUM"') --- keine Berücksichtigung von archivierten Daten -and fktkz not in ('ARC', 'REA', 'NER', 'AAE')) -) ---oder pprot -or (S.mtknr in (select - DISTINCT mtknr -FROM pprot -WHERE datlae >= date('"$DATUM"')) ) - -) - - - ; - -]]> - - - '$stu_updated_at') OR (S.updated_at IS NULL AND '$stu_updated_at' = '1900-01-01')) - --keine vorläufigen Studierenden #118453 - --nur Rolle "Student" (hiskey_id=5) - AND 0 < ( - SELECT - count(*) - FROM - orgrole O, - role R - WHERE - R.id = O.role_id - AND S.person_id = O.person_id - AND R.hiskey_id IN (5, 8) - ); - --Promovierende 81 - --Gasthörer 8 - --- Ermittlung semesterwohnsitz --- alle Studierenden id-s aus Tabelle student --- die Postleitzahl der Hinterlegten Adresse des Studierendens (-> welcher Adresstype(n) ist richtig? Ein Studierenden kann verschiedene Adressarten hinterlegen...) --- und die country_lid ueber die der Staat ermittelt werden kann (superx_sos.country_lid->country.country_lid) -UPDATE - superx_sos -SET - semester_postcode = addr.postcode, - semester_country_lid = addr.country_lid -FROM - address AS addr - LEFT JOIN address_k_notificationcategory adnocat ON addr.id = adnocat.address_id - LEFT JOIN k_notificationcategory knocat ON (adnocat.k_notificationcategory_id = knocat.id AND knocat.hiskey_id = 2), -- hiskey_id=2 -> STU - person prs, - k_addresstag atag -WHERE - superx_sos.person_id = prs.id and addr.person_id=prs.id - AND addr.eaddresstype_id IS NULL -- -> address.addresstype = 'Postaddress' - AND atag.id = addr.k_addresstag_id - AND atag.hiskey_id = 2 --semesterwohnsitz -; - - --- Semesterwohnsitz = Heimatwohnsitz falls Semesterwohnsitz nicht gesetzt ist -UPDATE - superx_sos -SET - semester_postcode = substring(addr.postcode FOR 50), - semester_country_lid = addr.country_lid -FROM - address addr - LEFT JOIN address_k_notificationcategory adnocat ON addr.id = adnocat.address_id - LEFT JOIN k_notificationcategory knocat ON adnocat.k_notificationcategory_id = knocat.id AND knocat.hiskey_id = 2, -- hiskey_id=2 -> STU - person prs, - k_addresstag atag -WHERE - superx_sos.person_id = prs.id - AND addr.person_id = prs.id - AND addr.eaddresstype_id IS NULL -- -> address.addresstype = 'Postaddress' - AND atag.id = addr.k_addresstag_id - -- Ab hier Anpassungen - AND atag.hiskey_id = 1 --heimatwohnsitz - AND semester_postcode IS NULL - AND semester_country_lid IS NULL -; - --- für jeden Studierenden mit Postleitzahl den astat-Schlüssel des Landkreises aus k_postcode holen -create index i_tmp_k_postcode1 on k_postcode(postcode,astat); -create index i_tmp_ss1 on superx_sos(semester_postcode); - -UPDATE - superx_sos -SET - semester_astat = ( - SELECT - k_postcode.astat - FROM - k_postcode - WHERE - superx_sos.semester_postcode = k_postcode.postcode - LIMIT 1 - ); - -drop index i_tmp_k_postcode1; -drop index i_tmp_ss1; - - --- Astat-Schlüssel aus Country -UPDATE - superx_sos -SET - semester_country_astat = ( - SELECT - country.astat - FROM - country - WHERE - superx_sos.semester_country_lid = country.lid - AND current_date BETWEEN valid_from AND valid_to - LIMIT 1 - ); - -CREATE index i_ts1 ON superx_sos(mtknr_ldsg); -CREATE index i_ts2 ON superx_sos(person_id); - ---Erstes Studium (erhssembrd etc.) ermitteln -UPDATE - superx_sos -SET - erhssembrd = to_number(('' || STUBE.first_term_year || TETY.termnumber),'99999'), - discontinuationsemester = STUBE.discontinuationsemester, - study_before_university_lid = STUBE.university_lid, - study_before_country_lid = STUBE.country_lid, - k_study_interruption_type_id = STUBE.k_study_interruption_type_id -FROM - term_type TETY, - study_before STUBE -WHERE - STUBE.person_id = superx_sos.person_id - AND STUBE.first_term_type_id = TETY.id; - -UPDATE - superx_sos -SET - study_before_place_of_study = ( - SELECT - UNI.astat - FROM - university UNI - WHERE - UNI.lid = superx_sos.study_before_university_lid - ) -WHERE - study_before_university_lid IS NOT NULL -; - -UPDATE - superx_sos -SET - study_before_country_of_study = ( - SELECT - CNT.astat - FROM - country CNT - WHERE - CNT.lid = superx_sos.study_before_country_lid - ) -WHERE - study_before_country_lid IS NOT NULL -; - -UPDATE - superx_sos -SET - k_study_interruption_type_astat = ( - SELECT - STINTY.astat - FROM - k_study_interruption_type STINTY - WHERE - STINTY.id = superx_sos.k_study_interruption_type_id - ) -WHERE - k_study_interruption_type_id IS NOT NULL -; - -UPDATE - superx_sos -SET - second_nationality_country_lid = prsinf.second_nationality_country_lid, - personinfo_country_id = cnt.id -FROM - personinfo prsinf - LEFT OUTER JOIN country cnt ON cnt.lid = prsinf.country_lid AND current_date between cnt.valid_from and cnt.valid_to -WHERE - prsinf.person_id = superx_sos.person_id -; - -UPDATE - superx_sos -SET - second_nationality_astat = ( - SELECT - cnt.astat - FROM - country cnt - WHERE - cnt.lid = superx_sos.second_nationality_country_lid - AND current_date BETWEEN cnt.valid_from AND cnt.valid_to - ) -WHERE - second_nationality_country_lid IS NOT NULL -; - -UPDATE - superx_sos -SET - orgrole_valid_from = OrgR.valid_from, - orgrole_valid_to = OrgR.valid_to -FROM - orgrole OrgR -WHERE - OrgR.person_id = superx_sos.person_id - AND OrgR.role_id = 5 -; - -CREATE INDEX tmp_i_ts99 ON superx_sos(id); - -]]> - - -= $start_stud_sem - - ; - -]]> - - - - wichtige Konstanten aus SOS entladen, z.B. HISSOS-Version. - - - - -'J' -union -select 32,'1','sos_unload_complete' from hskonst -where '$SOS_UNL_COMPLETE'='true' -union -select 32,'0','sos_unload_complete' from hskonst -where '$SOS_UNL_COMPLETE'!='true' -union -select 33,'5','SOS_Quellsystem' from hskonst -union -select 34,'0','SOS_Trimester' from hskonst -; -]]> - - -0 -union -select 33,'6','SOS_Quellsystem' from tmp_xdummy -union -select 34,'0','SOS_Trimester' from tmp_xdummy -where 0=(SELECT count(*) -FROM k_period_usage K,period_usage U,period P,term_type T -where K.id=U.k_period_usage_id -and K.hiskey_id=7 --Semesterzeitraum -and U.period_id=P.id -and T.id=P.term_type_id -and T.termcategory=3 --Trimester -) -union -select 34,'1','SOS_Trimester' from tmp_xdummy -where 0< (SELECT count(*) -FROM k_period_usage K,period_usage U,period P,term_type T -where K.id=U.k_period_usage_id -and K.hiskey_id=7 --Semesterzeitraum -and U.period_id=P.id -and T.id=P.term_type_id -and T.termcategory=3 --Trimester -) -; -]]> - @@ -933,306 +84,10 @@ select 34,'0','SOS_Trimester' from tmp_xdummy Studi-Sätze aus SOS. Die KFZ-Kennzeichen werden erst in SuperX umgeschlüsselt. - -= $start_stud_sem; -]]> - - -= $start_stud_sem; -]]> - - -= $start_stud_sem -; - -]]> - - -= $start_stud_sem) -; - - -]]> - = $start_stud_sem ; @@ -1299,92 +154,7 @@ and semester_max >= $start_stud_sem - - - - - - - - - - + stg-Sätze aus sos - -= $start_stud_sem {ab hier werden Daten ausgewertet} -; -]]> - - -= $start_stud_sem {ab hier werden Daten ausgewertet} -; -]]> - - -= $start_stud_sem -; -]]> - - -= current_date and DegP.belongs_to='STUDENT') D, -superx_sos S, -student U, -tmp_course_of_study C, -(select tmpSUB.*, tmpFOS.id as fosid -from subject as tmpSUB -left outer join k_field_of_study as tmpFOS -on tmpSUB.k_field_of_study_id = tmpFOS.id) SUB --- district DIS, --- country CNT -WHERE T.id=P.term_type_id -and D.id=DP.degree_program_id -and DP.course_of_study_id=C.id -and DP.period_id=P.id -and S.person_id = U.person_id -and S.person_id = D.person_id -and U.id=S.id -and SUB.id = C.subject_id --- and DIS.id = D.final_exam_district_id --- and CNT.id = D.final_exam_country_lid --- and CNT.valid_from <= current_date and CNT.valid_to >= current_date -AND to_number('' || P.term_year || T.termnumber,'99999') >= $start_stud_sem -; -]]> - - - - - wichtige Konstanten aus SOS entladen, z.B. HISSOS-Version. - - '${exa_updated_at}' - OR ( - E.updated_at IS NULL - AND '${exa_updated_at}' = '1900-01-01') - ) - AND (to_number('' || E.term_year || T.termnumber,'99999') ) >= $start_pruef_sem -; - -UPDATE - tmp_lab -SET - examrelation_id = default_examrelation_id -WHERE - examrelation_id IS NULL -; - -UPDATE - tmp_lab -SET - examrelation_k_workstatus_id = R.k_workstatus_id, - examrelation_malus = R.malus, - examrelation_bonus = R.bonus, - examrelation_parent_examplan_id = R.parent_examplan_id -FROM - examrelation R -WHERE - R.id = tmp_lab.examrelation_id -; - -UPDATE - tmp_lab -SET - type_of_grading = gt.type_of_grading -FROM - examplan exp, - unitrelation unr, - unit u, - grading_type gt -WHERE - exp.id = tmp_lab.examplan_id - AND exp.unit_id = u.id - AND u.default_unitrelation_id = unr.id - AND unr.grading_type_id = gt.id -; - -UPDATE - tmp_lab -SET - official_statistics = ( - SELECT - official_statistics - FROM - unit U - WHERE - U.id = tmp_lab.unit_id - ) -; - -UPDATE - tmp_lab -SET - official_statistics = 3 -WHERE EXISTS ( - SELECT - unit_id - FROM - examination X - WHERE - X.unit_id = tmp_lab.unit_id - AND k_examination_type_id IN ( - SELECT - id - FROM - k_examination_type - WHERE - hiskey_id = 99 - ) - ) -; - -UPDATE - tmp_lab -SET - grade = ( - SELECT - R.grade - FROM - examresult R - WHERE - R.examrelation_id = tmp_lab.examrelation_id - ) -; - ---Studienverlauf ermitteln -UPDATE - tmp_lab -SET - degree_program_progress_id = DP.id, - degree_program_progress_studynumber = DP.studynumber, - degree_program_progress_subjectnumber = DP.subjectnumber, - degree_program_progress_studysemester = DP.studysemester, - degree_program_id = D.id, - course_of_study_id = C.id, - studysemester_acknowledgement_id = DP.studysemester_acknowledgement_id, - type_of_doctorate_id = D.k_type_of_doctorate_id -FROM - degree_program D, - degree_program_progress DP, - period P, - unit_studies US, - tmp_course_of_study C -WHERE - D.id = DP.degree_program_id - AND P.id = DP.period_id - AND C.lid = US.course_of_study_lid - AND DP.course_of_study_id = C.id - AND ( - tmp_lab.date_of_work BETWEEN C.valid_from AND C.valid_to - OR tmp_lab.date_of_work IS NULL - OR C.is_historized = 0 - OR ( - C.valid_from IS NULL - AND tmp_lab.date_of_work <= C.valid_to - ) - OR ( - C.valid_to IS NULL - AND tmp_lab.date_of_work >= C.valid_from - ) - ) - AND tmp_lab.unit_id = US.unit_id - AND tmp_lab.person_id = D.person_id - AND tmp_lab.term_type_id = P.term_type_id - AND tmp_lab.term_year = P.term_year -; - ---evt. früheren Studienverlauf ermitteln -UPDATE - tmp_lab -SET - degree_program_progress_id = DP.id, - degree_program_progress_studynumber = DP.studynumber, - degree_program_progress_subjectnumber = DP.subjectnumber, - degree_program_progress_studysemester = DP.studysemester, - degree_program_id = D.id, - course_of_study_id = C.id, - studysemester_acknowledgement_id = DP.studysemester_acknowledgement_id, - type_of_doctorate_id = D.k_type_of_doctorate_id -FROM - degree_program D, - degree_program_progress DP , - tmp_course_of_study C -WHERE - D.id = DP.degree_program_id - AND DP.id = ( - SELECT - DP.id - FROM - degree_program D, - degree_program_progress DP - WHERE - tmp_lab.person_id = D.person_id - AND DP.degree_program_id = D.id - AND DP.course_of_study_id IN ( - SELECT - cos.id - FROM - unit_studies us, - course_of_study cos - WHERE - us.unit_id = tmp_lab.unit_id - AND us.course_of_study_lid = cos.lid - AND ( - tmp_lab.date_of_work BETWEEN cos.valid_from AND cos.valid_to - OR ( - tmp_lab.date_of_work IS NULL - AND ( - SELECT - startdate - FROM - period P, - period_usage PU, - k_period_usage KPU - WHERE - KPU.hiskey_id = 7 - AND PU.k_period_usage_id = KPU.id - AND PU.period_id = P.id - AND P.term_year = tmp_lab.term_year - AND P.term_type_id = tmp_lab.term_type_id - ) BETWEEN cos.valid_from AND cos.valid_to - ) - ) - ) - ORDER BY - enddate desc - LIMIT - 1 - ) - AND C.id = DP.course_of_study_id - AND tmp_lab.course_of_study_id IS NULL -; - --- zusätzlich schauen nach Sätzen mit abgelaufener Gültigkeit, dabei den aktuellsten Gültigkeitszeitraum wählen -UPDATE - tmp_lab -SET - degree_program_progress_id = DP.id, - degree_program_progress_studynumber = DP.studynumber, - degree_program_progress_subjectnumber = DP.subjectnumber, - degree_program_progress_studysemester = DP.studysemester, - degree_program_id = D.id, - course_of_study_id = C.id, - studysemester_acknowledgement_id = DP.studysemester_acknowledgement_id, - type_of_doctorate_id = D.k_type_of_doctorate_id -FROM - degree_program D, - degree_program_progress DP , - tmp_course_of_study C -WHERE - D.id = DP.degree_program_id - AND DP.id = ( - SELECT - DP.id - FROM - degree_program D, - degree_program_progress DP - WHERE - tmp_lab.person_id = D.person_id - AND DP.degree_program_id = D.id - AND DP.course_of_study_id IN ( - SELECT - cos.id from unit_studies us, - course_of_study cos - WHERE - us.unit_id = tmp_lab.unit_id - AND us.course_of_study_lid = cos.lid - ) - ORDER BY - enddate DESC - LIMIT - 1 - ) - AND C.id = DP.course_of_study_id - AND tmp_lab.course_of_study_id IS NULL -; - --- kein Studienverlauf vorhanden, sehen ob ein Studiengang passt -UPDATE - tmp_lab -SET - course_of_study_id = ( - SELECT - cos.id - FROM - unit_studies us, - course_of_study cos - WHERE - us.unit_id = tmp_lab.unit_id - AND us.course_of_study_lid = cos.lid - AND ( - tmp_lab.date_of_work BETWEEN cos.valid_from AND cos.valid_to - OR tmp_lab.date_of_work IS NULL) - limit 1 -) -WHERE - course_of_study_id IS NULL - AND 0 = ( - SELECT - count(*) - FROM - unit u, - k_elementtype k - WHERE - u.id = tmp_lab.unit_id - AND u.k_elementtype_id = k.id - AND k.hiskey_id NOT IN (2,3) - ) -; - --- Sonderbehandlung Umrechnung Punkte bei Staatsexamen Jura in Noten -UPDATE - tmp_lab -SET - grade = - CASE - WHEN grade BETWEEN 14 AND 18 THEN 1 - WHEN grade BETWEEN 11.5 AND 13.99 THEN 2 - WHEN grade BETWEEN 9 AND 11.49 THEN 7 - WHEN grade BETWEEN 6.5 AND 8.99 THEN 3 - WHEN grade BETWEEN 4 AND 6.49 THEN 4 - WHEN grade BETWEEN 0 AND 3.99 THEN 5 - ELSE - grade - END -WHERE - course_of_study_id IN ( - SELECT - cos.id - FROM - course_of_study cos, - subject s, - degree d - WHERE - cos.subject_lid = s.lid - AND cos.degree_lid = d.lid - AND coalesce(d.astat_bund, d.astat_land) IN ('08','09') -- Staatsexamen - AND coalesce(s.astat_bund, s.astat_land) = '0135' -- Jura (Rechtswissenschaft) - ) - AND type_of_grading IS NULL OR type_of_grading = 1 -- unbekannt oder Punkte -; - -UPDATE - tmp_lab -SET - type_of_doctorate_astat = ( - SELECT - to_number(D.astat,'99999') - FROM - k_type_of_doctorate D - WHERE - D.id = tmp_lab.type_of_doctorate_id - ) -WHERE - type_of_doctorate_id IS NOT NULL -; - ---Anerkennung -UPDATE - tmp_lab -SET - studysemester_acknowledgement_semester_overall = S.semester_overall, - studysemester_acknowledgement_former_degree_program = S.former_degree_program, - studysemester_acknowledgement_practice_semester = S.practice_semester, - studysemester_acknowledgement_semester_abroad = S.semester_abroad -FROM - studysemester_acknowledgement S -WHERE - S.id = tmp_lab.studysemester_acknowledgement_id -; - -UPDATE - tmp_lab -SET - panerk = 'J' -WHERE - examplan_id IN ( - SELECT - examplan_id - FROM - accreditation - ) -; - -CREATE index i_tl1 ON tmp_lab(student_id); - ]]> - - - - - - Externe Abschlussprüfungen - - - - - - - - - Verzeichnis der Prüfungen. - -= $start_pruef_sem {ab hier werden Daten ausgewertet} -and -((lab.pnr in ($POS_PNR) or "0"="$POS_PNR") -or lab.pnr in - ( -select distinct pnr from tmp_hskonst -) -) -; - -]]> - - -= $start_pruef_sem -and -((lab.pnr in ($POS_PNR) or '"0"'='"$POS_PNR"') -or lab.pnr in - ( -select distinct pnr from tmp_hskonst -) -) -; - -]]> - - - - = $start_pruef_sem zusätzliche Merkmale für amtliche Prüfungsstatistik - - - - -= $start_pruef_sem -; - -]]> - @@ -2651,29 +325,6 @@ from tmp_xdummy where 1=0 falls Studenten gelöscht wurden, werden diese durch die obigen Proz. in SuperX nicht berührt - - - - -= date('$DATUM') -and fktkz = 'LOE' -and sos.mtknr is null; -]]> - - - - Vorheriges Studium und Zweitstudiengänge - - - - - 9 then 1 else DP.studynumber end AS studiengang_nr -,DP.subjectnumber AS fach_nr -,DE.astat_land AS ang_abschl -,SU.astat_land AS fach -,DP.number_of_studysemester::INT AS fachsem_zahl -,C.astat AS country_astat -,D.k_form_of_studies_id -FROM studentexternal SE -JOIN student S ON SE.person_id = S.person_id AND S.registrationnumber IS NOT NULL -JOIN superx_sos SS on SS.id=S.id -JOIN degree_program_before D ON D.studentexternal_id = SE.id -JOIN degree_program_progress_before DP ON DP.degree_program_before_id = D.id -JOIN subject SU ON SU.lid = DP.subject_lid AND now() BETWEEN SU.valid_from AND SU.valid_to -JOIN degree DE ON DE.lid = D.degree_lid AND now() BETWEEN DE.valid_from AND DE.valid_to -LEFT JOIN k_studystatus KSS ON KSS.id=DP.k_studystatus_id -LEFT JOIN k_type_of_study KTS ON KTS.id=DP.id -LEFT JOIN k_enrollment KEN ON KEN.id = DP.k_enrollment_id -LEFT JOIN term_type TT ON DP.term_type_id = TT.id -LEFT JOIN university U ON SE.university_lid = U.lid AND now() BETWEEN U.valid_from AND U.valid_to -LEFT JOIN country C ON C.lid = SE.country_lid - -; -]]> - - -= $start_stud_sem -group by stg.semester -order by stg.semester; - -]]> - - - - - -= $start_stud_sem -group by stg.semester -order by stg.semester; - - -]]> - - -= $start_stud_sem -and DP.startdate=date(P.startdate) -and DP.enddate=date(P.enddate) -group by 1 -; - -]]> - - - 'J') ---AND lab.prueck = 0 -AND (S.fehlerkz not in ('F', 'V') or S.fehlerkz is null) -group by lab.psem -; - -]]> - - -= $start_pruef_sem -and lab.pnr in (select distinct pnr from tmp_hskonst) -group by 1,2 -; - -]]> - - -= $start_pruef_sem -and lab.pnr in (select distinct pnr from tmp_hskonst) -group by lab.psem -; - - -]]> - - -= $start_pruef_sem -group by 1,2 -; - - -]]> - Anschriften aus SOS - - - - - - - - - - - - Stichtage für Studiengänge aus POS - - - - - - - - - - - - SuperX-Hochschulnr. - - - - - - - - - - - - - -SuperX-semester - - - - - - - - - - - - - - - -= $start_stud_sem -; - -]]> - - - - - - -cif-Schlüssel - - - - - - - - - - - +SuperX-semester + += $start_stud_sem +; ]]> - -= valid_from - or valid_from is null) - and (current_date <= valid_to - or valid_to is null) + -union -SELECT - 9010, - -1, - '2','VD','Vorprüfung', - 'Vorprüfung', - null::char(1) , --astat - null::char(1), --parent - null::char(1), --sortc1 - null::char(1), --bund_apnr - null::char(1) --sprache -FROM tmp_xdummy -union -SELECT - 9010, --1, - '1','HD','Hauptprüfung', - 'Hauptprüfung', -null::char(1) , --astat -null::char(1), --parent -null::char(1), --sortc1 -null::char(1), --bund_apnr -null::char(1) --sprache -FROM tmp_xdummy -union -SELECT - 9010, --1, - '3','AA','Abschlussarbeit', - 'Abschlussarbeit', -null::char(1) , --astat -null::char(1), --parent -null::char(1), --sortc1 -null::char(1), --bund_apnr -null::char(1) --sprache -FROM tmp_xdummy -union -SELECT - 9003, - 0, - substring('' || astat from 1 for 10),--astat, - substring(shorttext from 1 for 10), - substring(defaulttext from 1 for 100), - substring(longtext from 1 for 150), - substring('' || astat from 1 for 10),--astat, - null::char(1), - null::char(1), - null::char(1), - null::char(1) - FROM k_gender - WHERE astat is not null - union -SELECT - 631, - -1, - '' || id, - substring(shorttext from 1 for 10), - substring(defaulttext from 1 for 100), - substring(longtext from 1 for 150), - null::char(1) , --astat - null::char(1), - '' || sortorder ,--sortc1 - null::char(1), - substring('' || k_language_id from 1 for 3)--sprache - FROM k_examination_type - union -SELECT - 632, --1, - '' || id, - substring(shorttext from 1 for 10), - substring(defaulttext from 1 for 100), - substring(longtext from 1 for 150), -'' || hiskey_id , --astat -null::char(1), --parent -uniquename, -null::char(1),--bund_apnr -substring('' || k_language_id from 1 for 3)--sprache - FROM k_examinationversion; -]]> - + +cif-Schlüssel Schlüsseltabelle cifx - - - - -= current_date or valid_to is null) - union -SELECT - 12, -0, - '' || id, - substring(shorttext from 1 for 10), - substring(defaulttext from 1 for 100), - substring(longtext from 1 for 150), -substring('' || astat from 1 for 10),--astat, -null::char(1),--parent -substring('' || uniquename from 1 for 10), --sortc1 -substring('' || continent from 1 for 10), -- erdteil -substring('' || k_language_id from 1 for 3),--sprache, -valid_from, --gueltig von -valid_to, --gueltig bis -id , --sourcesystem_id -'' || lid, --hiskey_id -'I', --struktur_c -lid::char(255) as lid, -null::char(255) as parent_lid, -sortorder - FROM country - where valid_to < current_date - union -SELECT - 12, -0, - '' || id, - substring(shorttext from 1 for 10), - substring(defaulttext from 1 for 100), - substring(longtext from 1 for 150), -substring('' || astat from 1 for 10),--astat, -null::char(1),--parent -substring('' || uniquename from 1 for 10), --sortc1 -substring('' || continent from 1 for 10), -- erdteil -substring('' || k_language_id from 1 for 3),--sprache, -valid_from, --gueltig von -valid_to, --gueltig bis -id , --sourcesystem_id -'' || lid, --hiskey_id -'A' , --struktur_c -lid::char(255) as lid, -null::char(255) as parent_lid, -sortorder - FROM country - where (valid_to >= current_date or valid_to is null) - union - SELECT - 8, - -1, - uniquename, - substring(shorttext from 1 for 10), - substring(defaulttext from 1 for 100), - substring(longtext from 1 for 150), -substring('' || astat from 1 for 10),--astat, -null::char(1),--parent -uniquename, -null::char(1), --bund_apnr -substring('' || k_language_id from 1 for 3),--sprache, -null::date, --gueltig von -null::date, --gueltig bis -id , --sourcesystem_id -'' ,--hiskey_id, -null::char(1), --struktur_c -null::char(255) as lid, -null::char(255) as parent_lid, -sortorder - FROM k_federal_state - WHERE uniquename not in ('99','BO') --ohne Ausland und Berlin Ost - union -SELECT - 9001, - 0, - '' || id, -- status, -substring(shorttext from 1 for 10), - substring(defaulttext from 1 for 100), - substring(longtext from 1 for 150), -substring(astat from 1 for 10), -- astat, -null::char(1), --parent -uniquename, - null::char(1) ,--bund_apnr -substring('' || k_language_id from 1 for 3),--sprache, -date('01.01.1900'), --gueltig von -date('01.01.2900'), --gueltig bis -id , --sourcesystem_id -'' || hiskey_id, -- his_hrst, -null::char(1), --struktur_c -null::char(255) as lid, -null::char(255) as parent_lid, -sortorder - FROM k_studystatus - union -SELECT - 9013, - 0, - '' || id, -- modulart, -substring(shorttext from 1 for 10), - substring(defaulttext from 1 for 100), - substring(longtext from 1 for 150), -null::char(1) , -- astat, -null::char(1), --parent -substring(uniquename from 1 for 10),--uniquename - null::char(1) ,--bund_apnr -substring('' || k_language_id from 1 for 3),--sprache, -date('01.01.1900'), --gueltig von -date('01.01.2900'), --gueltig bis -id , --sourcesystem_id -'' || hiskey_id , --hiskey_id -null::char(1), --struktur_c -null::char(255) as lid, -null::char(255) as parent_lid, -sortorder -FROM k_elementtype -union - SELECT - 90, --1, - '' || O.id, - substring(O.shorttext from 1 for 10), - substring(O.defaulttext from 1 for 100), - substring(O.longtext from 1 for 150), -substring(O.astat from 1 for 10),--astat, -substring('' || O.parent_lid from 1 for 3),--parent -O.uniquename, -null::char(1), --bund_apnr -substring('' || O.k_language_id from 1 for 3),--sprache, -O.valid_from, --gueltig von -O.valid_to, --gueltig bis -O.id, --sourcesystem_id -'' || T.hiskey_id, -null::char(1), --struktur_c -O.lid::char(255) as lid, -O.parent_lid::char(255) as parent_lid, -O.sortorder - FROM orgunit O,k_orgunittype T - where O.k_orgunittype_id=T.id - and T.hiskey_id=4 --Fachbereich -union - SELECT - 619, --1, - '' || O.id, - substring(O.shorttext from 1 for 10), - substring(O.defaulttext from 1 for 100), - substring(O.longtext from 1 for 150), -substring(O.astat from 1 for 10),--astat, -substring('' || O.parent_lid from 1 for 3),--parent -substring(O.uniquename from 1 for 10), --sortc1 -null::char(1), --bund_apnr -substring('' || O.k_language_id from 1 for 3),--sprache, -O.valid_from, --gueltig von -O.valid_to, --gueltig bis -O.id, --sourcesystem_id -'' || T.hiskey_id, -null::char(1), --struktur_c -O.lid::char(255) as lid, -O.parent_lid::char(255) as parent_lid, -O.sortorder - FROM orgunit O,k_orgunittype T - where O.k_orgunittype_id=T.id - and T.hiskey_id=7 --Lehreinheit - union - --Standorte - SELECT - 9012, - -1, - '' || id, - substring(shorttext from 1 for 10), - substring(defaulttext from 1 for 100), - substring(longtext from 1 for 150), -substring(astat from 1 for 10), --astat, -null::char(1),--parent -uniquename, -substring('' || hiskey_id from 1 for 10), --bund_apnr -substring('' || k_language_id from 1 for 3),--sprache, -date('01.01.1900'), --gueltig von -date('01.01.2900'), --gueltig bis -id, --sourcesystem_id -null::char(1), --hiskey_id -null::char(1), --struktur_c -null::char(255) as lid, -null::char(255) as parent_lid, -sortorder - FROM k_place_of_studies - union - --pstatus - SELECT - 622, - -1, - '' || id, - substring(shorttext from 1 for 10), - substring(defaulttext from 1 for 100), - substring(longtext from 1 for 150), - null::char(1), -null::char(1),--parent -uniquename, -null::char(1), --bund_apnr -substring('' || k_language_id from 1 for 3),--sprache, -date('01.01.1900'), --gueltig von -date('01.01.2900'), --gueltig bis -id, --sourcesystem_id -'' || hiskey_id, -null::char(1), --struktur_c -null::char(255) as lid, -null::char(255) as parent_lid, -sortorder - FROM k_workstatus - - union - --Beurlaubungsgründe -SELECT - 27, - 0, - '' || id, -- gdbu, -substring(shorttext from 1 for 10), - substring(defaulttext from 1 for 100), - substring(longtext from 1 for 150), -substring(astat from 1 for 10), -- astat, -null::char(1), --parent -uniquename, - null::char(1) ,--bund_apnr -substring('' || k_language_id from 1 for 3),--sprache, -valid_from, --gueltig von -valid_to, --gueltig bis -id , --sourcesystem_id -null::char(1) , -- hiskey, -null::char(1), --struktur_c -null::char(255) as lid, -null::char(255) as parent_lid, -sortorder - FROM k_reason_of_leave - -union - -SELECT -- Exmatrikulationsgründe - 62, - 0, - '' || S.id, -- gdbu, - substring(S.shorttext from 1 for 10), - substring(S.defaulttext from 1 for 100), - substring(S.longtext from 1 for 150), - substring(S.astat from 1 for 10), -- astat, - '', --parent - S.uniquename, - substring(S.astat from 1 for 10), --bund_apnr - substring('' || S.k_language_id from 1 for 3),--sprache, - S.valid_from, --gueltig von - S.valid_to, --gueltig bis - S.id , --sourcesystem_id - '' || S.hiskey_id, -- hiskey, - '', --struktur_c -null::char(255) as lid, -null::char(255) as parent_lid, -sortorder -FROM k_reason_of_finishing S - -union - -SELECT - 9002, - 0, - '' || id, -- , - substring(shorttext from 1 for 10), - substring(defaulttext from 1 for 100), - substring(longtext from 1 for 150), - null::char(1),-- astat, - null::char(1), --parent - uniquename, - null::char(1) ,--bund_apnr - substring('' || k_language_id from 1 for 3),--sprache, - date('01.01.1900'), --gueltig von - date('01.01.2900'), --gueltig bis - id , --sourcesystem_id - '' || hiskey_id , -- hiskey, - null::char(1), --struktur_c -null::char(255) as lid, -null::char(255) as parent_lid, -sortorder -FROM k_examination_type - -union - -SELECT - 9014, - 0, - '' || id, -- , -substring(shorttext from 1 for 10), - substring(defaulttext from 1 for 100), - substring(longtext from 1 for 150), -null::char(1),-- astat, -null::char(1), --parent -uniquename, - null::char(1) ,--bund_apnr -substring('' || k_language_id from 1 for 3),--sprache, -date('01.01.1900'), --gueltig von -date('01.01.2900'), --gueltig bis -id , --sourcesystem_id -'' || hiskey_id , -- hiskey, -null::char(1), --struktur_c -null::char(255) as lid, -null::char(255) as parent_lid, -sortorder - FROM k_examform - - union -SELECT - 41, - 0, - '' || id, -- , -substring(shorttext from 1 for 10), - substring(defaulttext from 1 for 100), - substring(longtext from 1 for 150), -null::char(1),-- astat, -null::char(1), --parent -uniquename, - null::char(1) ,--bund_apnr -substring('' || k_language_id from 1 for 3),--sprache, -date('01.01.1900'), --gueltig von -date('01.01.2900'), --gueltig bis -id , --sourcesystem_id -'' || hiskey_id , -- hiskey, -null::char(1), --struktur_c -null::char(255) as lid, -null::char(255) as parent_lid, -sortorder - FROM course_specialization - - union - - SELECT - 9005, - 0, - '' || id, -- , -substring(shorttext from 1 for 10), - substring(defaulttext from 1 for 100), - substring(longtext from 1 for 150), -null::char(1),-- astat, -null::char(1), --parent -uniquename, - null::char(1) ,--bund_apnr -substring('' || k_language_id from 1 for 3),--sprache, -date('01.01.1900'), --gueltig von -date('01.01.2900'), --gueltig bis -id , --sourcesystem_id -'' || hiskey_id , -- hiskey, -null::char(1), --struktur_c -null::char(255) as lid, -null::char(255) as parent_lid, -sortorder - FROM k_accreditationtype - - union - - SELECT - 9006, - 0, - '' || id, -- , -substring(shorttext from 1 for 10), - substring(defaulttext from 1 for 100), - substring(longtext from 1 for 150), - astat, -null::char(1), --parent -uniquename, -astat_guest_auditor ,--bund_apnr -substring('' || k_language_id from 1 for 3),--sprache, -date('01.01.1900'), --gueltig von -date('01.01.2900'), --gueltig bis -id , --sourcesystem_id -'' || hiskey_id , -- hiskey, -null::char(1), --struktur_c -null::char(255) as lid, -null::char(255) as parent_lid, -sortorder - FROM k_field_of_study - - union - - SELECT DISTINCT - 9008, - 0, - '' || examination_office_no, -- , -substring(examination_office_no::varchar from 1 for 10), - substring(examination_office_no::varchar from 1 for 100), - substring(examination_office_no::varchar from 1 for 150), - '', -null::char(1), --parent -examination_office_no, --uniquename -'' ,--bund_apnr -'',--sprache, -date('01.01.1900'), --gueltig von -date('01.01.2900'), --gueltig bis -examination_office_no::int , --sourcesystem_id -'' , -- hiskey, -null::char(1), --struktur_c -null::char(255) as lid, -null::char(255) as parent_lid, -0 - FROM tmp_course_of_study - ; -]]> - - - - -PO-Versionen aus SOS, werden im GANG-Modul gelesen. - - - - - + + +PO-Versionen aus SOS, werden im GANG-Modul gelesen. Fächer aus SOS. - - - - - - Externe Studienfächer aus SOS. - - - - - - - Studiengänge aus SOS. - - - - - - - - - - + - Pruefungsordnungsdaten - - - - - - - -= $start_pruef_sem -; - -]]> - - -= $start_pruef_sem -; - -]]> - - -= $start_stud_sem or minder.vonsem is null) -; - -]]> - - - - - - - - - = $start_stud_sem -and P.id=U.person_id -and U.id=S.id -and S.person_id=P.id -and U.term_type_id = TT.id -and '$STUD_IDENT'='true' -UNION - --- einfache Personendaten --- Beispiel 11200321^20^^Wern^^^^^ - select -S.mtknr_ldsg, -U.id, --identnr (student id) -'', --name -SUBSTRING(COALESCE(P.firstname,P.surname) FROM 1 FOR 4), --vorname, -'',--tel, -'',--artkz, -'',--anschrkz, -'', -- O.res13 -S.person_id --(person_id -FROM student U, superx_sos S, person P, term_type TT -where -U.term_year * 10 + TT.termnumber >= $start_stud_sem -and P.id=U.person_id -and U.id=S.id -and S.person_id=P.id -and U.term_type_id = TT.id -and '$STUD_IDENT'='false' -; - -]]> - - - - - - - - - - - - - - -= $start_pruef_sem -and -((lab.pnr in ($POS_PNR) or "0"="$POS_PNR") -or lab.pnr in - ( -select distinct pnr from tmp_hskonst -) -) - - -]]> - - -= $start_pruef_sem -and -((lab.pnr in ($POS_PNR) or '"0"'='"$POS_PNR"') -or lab.pnr in - ( -select distinct pnr from tmp_hskonst -) -) - - -]]> - - -= $start_pruef_sem - - - -]]> - - - - - - - - - - - - - - - - - - - - - - - - - - -Beendigung - - - - - - - - - - - -Beendigung - - - - - - - - - - - Personenattribute - -select -P.id, -P.person_id, -S.registrationnumber, -10 as systeminfo_id, -P.personattributetype_id, -coalesce(P.attributevalue, (select attributevalue from personattribute_value_list pav where pav.id=P.personattribute_value_list_id) ) attributevalue, -P.valid_from, -P.valid_to, -'' ,--semester_von -'' --semester_bis -from personattribute P, student S where S.person_id= P.person_id and P.personattributetype_id in ($PERSONATTRIBUTE_IDS) order by person_id; - - - - Typ der Personattributen - -select -id, -fieldname -from personattributetype where '$PERSONATTRIBUTE_IDS' != '0'; - - - - Einzelne Ausprägungen der Personenattribute - -select -personattributetype_id, -attributevalue, -shorttext, -defaulttext, -longtext -from personattribute_value_list where '$PERSONATTRIBUTE_IDS' != '0'; - - - - Letzter entladener Protokollsatz (STU) - - - - - - Letzter entladener Protokollsatz (EXA) - - - - - - Summierte ECTS-Punkte - - - - - - - - - - -drop table IF EXISTS tmp_lab; - - - - - - - - - - - - - + + + + + + diff --git a/src-modules/module/costage/rohdaten_zul/unl/hierhin_die_rohdaten.txt b/src-modules/module/costage/rohdaten_zul/unl/hierhin_die_rohdaten.txt new file mode 100644 index 0000000..8d1c8b6 --- /dev/null +++ b/src-modules/module/costage/rohdaten_zul/unl/hierhin_die_rohdaten.txt @@ -0,0 +1 @@ + diff --git a/src-modules/module/costage/rohdaten_zul/zul_costage_unload.x b/src-modules/module/costage/rohdaten_zul/zul_costage_unload.x new file mode 100755 index 0000000..2788dab --- /dev/null +++ b/src-modules/module/costage/rohdaten_zul/zul_costage_unload.x @@ -0,0 +1,115 @@ +#!/bin/bash +#Extraction Script for SuperX. +#Bitte nicht ändern, diese Datei ist automatisch generiert. + +SRC_PFAD=$ZUL_LOAD_PFAD +. $SUPERX_DIR/db/bin/SQL_ENV +if [ "$SRC_PFAD" = "" ] +then +SRC_PFAD=. +fi + +SX_CLIENT=jdbc +export SX_CLIENT + +SOURCESYSTEM=co +export SOURCESYSTEM + +if [ "$outFormat" = "" ] +then +outFormat=txt +fi + +DATUM=`cat $SRC_PFAD/superx.datum` +ERR=zul_unload.err +cp $SRC_PFAD/superx.datum $SRC_PFAD/superx.datum.alt + +##Löschen der alten Dateien +rm $SRC_PFAD/unl/*unl >/dev/null 2>&1 + +date +'%d.%m.%Y' > $SRC_PFAD/superx.datum ##neues Entladedatum + +HEUTE=`date +'%d.%m.%Y'` + +cd $SRC_PFAD >>$ERR 2>&1 + +echo "Letztes Update-Datum: " $DATUM >$ERR +echo "DATABASE: $DATABASE" >>$ERR +echo "VERSION: $VERSION" >>$ERR +echo "SX_CLIENT: $SX_CLIENT" >>$ERR +echo "1.2b^"$HEUTE"^" >$SRC_PFAD/unl/superx_unload_version.unl + +CP=".:$JDBC_CLASSPATH:$XML_CLASSPATH" + + +cat /dev/null >unload_params.txt + + + + +if [ "$VERSION" = "" ] +then +VERSION="13" +export VERSION +fi +echo "Parameter VERSION: $VERSION" >>$ERR +echo "\$VERSION=$VERSION" >>unload_params.txt + + + + +if [ "$EXTERNAL_SUBJECTS" = "" ] +then +EXTERNAL_SUBJECTS="false" +export EXTERNAL_SUBJECTS +fi +echo "Parameter POS_PNR: $EXTERNAL_SUBJECTS" >>$ERR +echo "\$EXTERNAL_SUBJECTS=$EXTERNAL_SUBJECTS" >>unload_params.txt + + +if [ "$SOURCESYSTEM" = "" ] +then +SOURCESYSTEM="co" +export SOURCESYSTEM + +fi +echo "Parameter SOURCESYSTEM: $SOURCESYSTEM" >>$ERR +echo "\$SOURCESYSTEM=$SOURCESYSTEM" >>unload_params.txt + +#jdbc zum Entladen +if [ "$SX_CLIENT" = "jdbc" ] +then +java $JAVA_OPTS -cp $CP de.superx.bin.SxExtractor -logger:$LOGGER_PROPERTIES -dbproperties:$DB_PROPERTIES -xml:zul_costage_unload.xml -outFormat:$outFormat -delim:$DBDELIMITER -header:$header -database:$DATABASE -version:$VERSION -unload_params:unload_params.txt >>$ERR 2>&1 + +exit 0 + +fi + + + +chmod go+r $ERR +chmod go+r $SRC_PFAD/superx.datum +chmod go+r $SRC_PFAD/superx.datum.alt +chmod go+w $SRC_PFAD/superx.datum +chmod go+w $SRC_PFAD/superx.datum.alt + +chmod go+r $SRC_PFAD/unl/* + +##Herstellen altes Entladedatum bei Fehler +fgrep -s "not found" $ERR >/dev/null +FLAG1=$? +fgrep -i -s "nicht gefunden" $ERR >/dev/null +FLAG2=$? +fgrep -i -s "error" $ERR >/dev/null +FLAG3=$? >/dev/null +fgrep -i -s "exception" $ERR >/dev/null +FLAG4=$? >/dev/null + +if [ $FLAG1 -eq 0 -o $FLAG2 -eq 0 -o $FLAG3 -eq 0 -o $FLAG4 -eq 0 ] +then + echo "Fehler beim Entladen. Das Datum wird zurückgesetzt." + echo "---------------------------------------" + echo "Prüfen Sie Fehlerprotokoll: $ERR" + echo "---------------------------------------" + cp $SRC_PFAD/superx.datum.alt $SRC_PFAD/superx.datum +fi diff --git a/src-modules/module/costage/rohdaten_zul/zul_costage_unload.xml b/src-modules/module/costage/rohdaten_zul/zul_costage_unload.xml new file mode 100644 index 0000000..5caa5f2 --- /dev/null +++ b/src-modules/module/costage/rohdaten_zul/zul_costage_unload.xml @@ -0,0 +1,633 @@ + + +ZUL-Modul + + + + + Wird nicht mehr gepflegt, ab ZUL-Version 10 immer auf 10 setzen. Bei HISinOne wird sie automatisch gesetzt. + + + Wenn ja, dann ist der Wert "true", wenn nein, dann ist er "false" + + + + + + + + + wichtige Konstanten aus SOS entladen, z.B. HISSOS-Version. + + + + + + +Bewerber-Stammdaten + + + + + + +antr-Saetze aus zul + + + + + + +hzb-Saetze aus zul + + + + + + + +hzb-Saetze von Bewerbern mit Antraegen ohne HZB-Zuordnung. Explizite Ermittlung + + + + + +Studienplätze + + + + + + + + + k_ncbuch + + + + + + + + + + + + + + + + + + + + + + + + + + + Anschriften aus SOS + + + + + + + + + + + + + + + + + + + + + + + + + + + +Schluesseltabelle cifx + + + + + +Schluesseltabelle cifx + + + + + +SuperX-semester + += $start_stud_sem +; + + +]]> + + + +Letzter entladener Protokollsatz (APP) + + + + + + +Wert Bewerbungsbestandteile + + + + + +Wert Bewerbungsbestandteile + + + + + + + diff --git a/src-modules/module/costage/upgrade/costage_upgrade_man.sql b/src-modules/module/costage/upgrade/costage_upgrade_man.sql index fa2cee6..f350e32 100644 --- a/src-modules/module/costage/upgrade/costage_upgrade_man.sql +++ b/src-modules/module/costage/upgrade/costage_upgrade_man.sql @@ -12,5 +12,8 @@ alter table costage_leistungen alter column note_zahl type float; alter table costage_leistungen alter column credits type float; alter table costage_leistungen alter column semesterstunden type float; +ALTER TABLE costage_st_studierendenstammdaten +ALTER COLUMN matrikelnummer drop not null; +