From 2d3bf470b10a406530d19b9535c9c14232e9f2a5 Mon Sep 17 00:00:00 2001 From: Daniel Quathamer Date: Tue, 30 Apr 2024 14:15:44 +0200 Subject: [PATCH] Tabellenabgleich amt. Statistik Stud.#7 --- src-modules/module/qa/conf/qa.xml | 120 +++++- .../module/qa/datentabellen/vacuum_pg.sql | 3 +- .../qa_sos_stg_aggr_astat_fuellen.sql | 355 ++++++++++++++++++ .../qa_sos_stg_aggr_int_fuellen.sql | 63 ++++ .../module/qa/masken/37060_felderinfo.unl | 24 +- .../module/qa/masken/37060_maskeninfo.unl | 336 ++++++++++++----- .../module/qa/masken/37180_felderinfo.unl | 11 + .../qa/masken/37180_maske_system_bez.unl | 1 + .../qa/masken/37180_masken_felder_bez.unl | 9 + .../module/qa/masken/37180_maskeninfo.unl | 75 ++++ .../qa/masken/37180_sachgeb_maske_bez.unl | 1 + ...blecomp_profile_sos_stud_astat_fuellen.sql | 141 +++++++ ...d_astat_nach_fach_abschluss_s0_fuellen.sql | 141 +++++++ ...d_astat_nach_fach_abschluss_s1_fuellen.sql | 141 +++++++ .../module/qa/upgrade/qa_upgrade_man.sql | 5 + 15 files changed, 1318 insertions(+), 108 deletions(-) create mode 100644 src-modules/module/qa/hilfstabellen/qa_sos_stg_aggr_astat_fuellen.sql create mode 100644 src-modules/module/qa/hilfstabellen/qa_sos_stg_aggr_int_fuellen.sql create mode 100644 src-modules/module/qa/masken/37180_felderinfo.unl create mode 100644 src-modules/module/qa/masken/37180_maske_system_bez.unl create mode 100644 src-modules/module/qa/masken/37180_masken_felder_bez.unl create mode 100644 src-modules/module/qa/masken/37180_maskeninfo.unl create mode 100644 src-modules/module/qa/masken/37180_sachgeb_maske_bez.unl create mode 100644 src-modules/module/qa/schluesseltabellen/qa_tablecomp_profile_sos_stud_astat_fuellen.sql create mode 100644 src-modules/module/qa/schluesseltabellen/qa_tablecomp_profile_sos_stud_astat_nach_fach_abschluss_s0_fuellen.sql create mode 100644 src-modules/module/qa/schluesseltabellen/qa_tablecomp_profile_sos_stud_astat_nach_fach_abschluss_s1_fuellen.sql diff --git a/src-modules/module/qa/conf/qa.xml b/src-modules/module/qa/conf/qa.xml index ee97b79..908ee14 100644 --- a/src-modules/module/qa/conf/qa.xml +++ b/src-modules/module/qa/conf/qa.xml @@ -1,6 +1,6 @@ - @@ -98,6 +98,8 @@ notnull="false" currentlyUsed="false"> notnull="true" > + + @@ -401,6 +403,14 @@ notnull="true"> + +Zusätzlicher Filter für Tabelle 1 + + +Zusätzlicher Filter für Tabelle 2 + @@ -476,6 +486,9 @@ notnull="false"> Feldname + +Feldbezeichnung + @@ -504,12 +517,15 @@ notnull="false"> ID +notnull="false" isKey="true"> Interner Name + +Interner Name + @@ -537,6 +553,8 @@ notnull="false"> Interner Name + + @@ -644,6 +662,7 @@ notnull="false"> formuliert als SQL-where-Ausdruck + @@ -744,7 +763,78 @@ notnull="false"> - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
View PO-Version @@ -814,6 +904,12 @@ parent="Qualitätssicherung">Abfragen zur Administration $QA_PFAD/masken + + Detailabfrage zur Anzeige von Differenzen + + $QA_PFAD/masken + + @@ -979,6 +1075,10 @@ format="%s"> + + + + database=""/> - + + + + + + @@ -1004,7 +1111,8 @@ format="%s"> - + + @@ -1016,6 +1124,8 @@ format="%s"> + + diff --git a/src-modules/module/qa/datentabellen/vacuum_pg.sql b/src-modules/module/qa/datentabellen/vacuum_pg.sql index c10df98..709e62f 100644 --- a/src-modules/module/qa/datentabellen/vacuum_pg.sql +++ b/src-modules/module/qa/datentabellen/vacuum_pg.sql @@ -8,4 +8,5 @@ commit; vacuum qa_mask_execution_result; vacuum qa_mask_execution_assert_result; - +vacuum qa_sos_stg_aggr_int; +vacuum qa_sos_stg_aggr_astat; diff --git a/src-modules/module/qa/hilfstabellen/qa_sos_stg_aggr_astat_fuellen.sql b/src-modules/module/qa/hilfstabellen/qa_sos_stg_aggr_astat_fuellen.sql new file mode 100644 index 0000000..5b51806 --- /dev/null +++ b/src-modules/module/qa/hilfstabellen/qa_sos_stg_aggr_astat_fuellen.sql @@ -0,0 +1,355 @@ +--(c) 2024 Daniel Quathamer +--freemarker template + + +select sp_table_exists('sos_stg_aggr') from xdummy + + + + + + + +<#if qa_tablecomp_profile_is_active==1 && sos_stg_aggr_exists==1> +--zuerst bereinigen:es darf nur 2015er oder 2016er Lieferung geben. +--2016 hat Priorität: + + +create temp table tmp_sem +( +semester integer, +format integer +); +insert into tmp_sem +select distinct semester,2015 +from kenn_sos_astat_2015 +; +insert into tmp_sem +select distinct semester,2016 +from kenn_sos_astat +; + +insert into kenn_pruefrout (datum,tabelle_quelle,problem,aktion) +select distinct today(),'kenn_sos_astat'::char(18),'Semester '|| semester || ' liegt in 2015er und 2016er Format vor, 2015 wird gelöscht', 'Info'::char(10) +from kenn_sos_astat_2015 +where semester in (select T.semester +from tmp_sem T +where T.format=2016) ; + + +delete from kenn_sos_astat_2015 +where semester in (select T.semester +from tmp_sem T +where T.format=2016); + +drop table tmp_sem; + + +--Unplausible Werte korrigieren: +update kenn_sos_astat set ef010=null where substring(ef010 from 1 for 1) not in ('0','1','2','3','4','5','6','7','8','9'); + + +create temp table tmp_stg_aggr_astat( + hs_nr INTEGER , +studiengang_nr SMALLINT , +fach_nr SMALLINT , +matrikel_nr integer, +geschlecht SMALLINT , +ca12_staat SMALLINT , +sem_rueck_beur_ein SMALLINT , +stg CHAR(4) , +sb char(19), +fgr char(10), +abschluss CHAR(2) , +abschlussart char(10), +abgrp char(255), +regel SMALLINT , +kz_rueck_beur_ein SMALLINT , +fach_sem_zahl SMALLINT , +hssem SMALLINT , +kz_fach CHAR(1) , +stort CHAR(10) , +stuart CHAR(10) , +stufrm CHAR(10) , +hzbart_astat CHAR(10) , +hzbkfzkz CHAR(2) , +hrst integer , +letzte_pruefung_stort CHAR(10) , +letzte_pruefung_staat SMALLINT , +letzte_pruefung_abschluss CHAR(2) , +letzte_pruefung_ergebnis SMALLINT , +vorletzte_pruefung_stort CHAR(10) , +vorletzte_pruefung_staat SMALLINT , +vorletzte_pruefung_abschluss CHAR(2) , +vorletzte_pruefung_ergebnis SMALLINT , +datum date , +summe INTEGER +) +; + + +<#assign studiengang_nr_fach_nr = [ + {"studiengang_nr":"1", "fach_nr":"1", "fach":"ef036","abschluss":"ef033u2","stufrm":"ef033u1", "regel":"ef035", "kz_rueck_beur_ein":"ef028", "fach_sem_zahl":"ef032","stuart":"ef030"}, + {"studiengang_nr":"1", "fach_nr":"2", "fach":"ef037","abschluss":"ef033u2","stufrm":"ef033u1", "regel":"ef035", "kz_rueck_beur_ein":"ef028", "fach_sem_zahl":"ef032","stuart":"ef030"}, + {"studiengang_nr":"1", "fach_nr":"3", "fach":"ef039","abschluss":"ef033u2","stufrm":"ef033u1", "regel":"ef035", "kz_rueck_beur_ein":"ef028", "fach_sem_zahl":"ef032","stuart":"ef030"}, + {"studiengang_nr":"2", "fach_nr":"1", "fach":"ef052","abschluss":"ef049u2","stufrm":"ef049u1", "regel":"ef051", "kz_rueck_beur_ein":"ef044", "fach_sem_zahl":"ef048","stuart":"ef046"}, + {"studiengang_nr":"2", "fach_nr":"2", "fach":"ef053","abschluss":"ef049u2","stufrm":"ef049u1", "regel":"ef051", "kz_rueck_beur_ein":"ef044", "fach_sem_zahl":"ef048","stuart":"ef046"}, + {"studiengang_nr":"2", "fach_nr":"3", "fach":"ef055","abschluss":"ef049u2","stufrm":"ef049u1", "regel":"ef051", "kz_rueck_beur_ein":"ef044", "fach_sem_zahl":"ef048","stuart":"ef046"} + ] /> + +<#assign studiengang_nr_fach_nr_2015 = [ + {"studiengang_nr":"1", "fach_nr":"1", "fach":"ef032","abschluss":"ef031u2","stufrm":"ef031u1", "regel":"null::char(1)", "kz_rueck_beur_ein":"ef026", "fach_sem_zahl":"ef030","stuart":"ef028"}, + {"studiengang_nr":"1", "fach_nr":"2", "fach":"ef034","abschluss":"ef031u2","stufrm":"ef031u1", "regel":"null::char(1)", "kz_rueck_beur_ein":"ef026", "fach_sem_zahl":"ef030","stuart":"ef028"}, + {"studiengang_nr":"1", "fach_nr":"3", "fach":"ef036","abschluss":"ef031u2","stufrm":"ef031u1", "regel":"null::char(1)", "kz_rueck_beur_ein":"ef026", "fach_sem_zahl":"ef030","stuart":"ef028"}, + {"studiengang_nr":"2", "fach_nr":"1", "fach":"ef047","abschluss":"ef046u2","stufrm":"ef046u1", "regel":"null::char(1)", "kz_rueck_beur_ein":"ef041", "fach_sem_zahl":"ef045","stuart":"ef043"}, + {"studiengang_nr":"2", "fach_nr":"2", "fach":"ef049","abschluss":"ef046u2","stufrm":"ef046u1", "regel":"null::char(1)", "kz_rueck_beur_ein":"ef041", "fach_sem_zahl":"ef045","stuart":"ef043"}, + {"studiengang_nr":"2", "fach_nr":"3", "fach":"ef050","abschluss":"ef046u2","stufrm":"ef046u1", "regel":"null::char(1)", "kz_rueck_beur_ein":"ef041", "fach_sem_zahl":"ef045","stuart":"ef043"} + ] /> +<#assign vorherige_pruefungen=[ + +{"art":"letzte", "pruefung_stort":"ef089", "pruefung_staat":"ef090", "pruefung_abschluss":"substring(ef091 from 2 for 2)", "pruefung_ergebnis":"ef097"}, +{"art":"vorletzte", "pruefung_stort":"ef103", "pruefung_staat":"ef104", "pruefung_abschluss":"substring(ef105 from 2 for 2)", "pruefung_ergebnis":"ef111"} + ] /> + +<#assign vorherige_pruefungen_2015=[ + +{"art":"letzte", "pruefung_stort":"null::char(1)", "pruefung_staat":"null::char(1)", "pruefung_abschluss":"ef091u2", "pruefung_ergebnis":"ef098"}, +{"art":"vorletzte", "pruefung_stort":"null::char(1)", "pruefung_staat":"null::char(1)", "pruefung_abschluss":"ef100u2", "pruefung_ergebnis":"ef107"} + ] /> + +<#foreach stgnr in studiengang_nr_fach_nr> +--${stgnr.studiengang_nr}. Studiengang, ${stgnr.fach_nr}. Fach: +insert into tmp_stg_aggr_astat( +hs_nr, + studiengang_nr, + fach_nr, + matrikel_nr, + geschlecht, + ca12_staat, + sem_rueck_beur_ein, + stg, + abschluss, + regel, + kz_rueck_beur_ein, + fach_sem_zahl, + hssem, + stort, + stuart, + stufrm, + hzbart_astat, + hzbkfzkz, + hrst, +<#if stgnr.studiengang_nr=="1" && stgnr.fach_nr=="1"> +<#foreach vorherige_pruefung in vorherige_pruefungen> +${vorherige_pruefung.art}_pruefung_stort, +${vorherige_pruefung.art}_pruefung_staat, +${vorherige_pruefung.art}_pruefung_abschluss, +${vorherige_pruefung.art}_pruefung_ergebnis, + + + datum, + summe) + select + hs_nr, +${stgnr.studiengang_nr} as studiengang_nr, +${stgnr.fach_nr} as fach_nr, +val(ef006) as matrikel_nr, +val(ef007) as geschlecht, +val(ef010) as ca12_staat, +semester as sem_rueck_beur_ein, +${stgnr.fach} as stg, +${stgnr.abschluss} as abschluss, +val(${stgnr.regel}) as regel, +val(${stgnr.kz_rueck_beur_ein}) as kz_rueck_beur_ein, +val(${stgnr.fach_sem_zahl}) as fach_sem_zahl, +val(ef021) as hssem, +ef004 as stort, +val(${stgnr.stuart}) as stuart, +${stgnr.stufrm} as stufrm, +ef118 as hzbart_astat, +ef119u1 as hzbkfzkz, +val(ef014) as hrst, +<#if stgnr.studiengang_nr=="1" && stgnr.fach_nr=="1"> +<#foreach vorherige_pruefung in vorherige_pruefungen> +${vorherige_pruefung.pruefung_stort}, +val(${vorherige_pruefung.pruefung_staat}), +${vorherige_pruefung.pruefung_abschluss}, +val(${vorherige_pruefung.pruefung_ergebnis}), + + + today(), + count(*) as summe +FROM kenn_sos_astat +where ${stgnr.abschluss} is not null --keine im Vorsemester exmatrikulierte +and ${stgnr.fach} is not null +group by 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20 +<#if stgnr.studiengang_nr=="1" && stgnr.fach_nr=="1"> +,21,22,23,24,25,26,27,28 + + ; + + +--nun 2015, wenn vorhanden: +<#foreach stgnr in studiengang_nr_fach_nr_2015> +--${stgnr.studiengang_nr}. Studiengang, ${stgnr.fach_nr}. Fach: +insert into tmp_stg_aggr_astat( +hs_nr, + studiengang_nr, + fach_nr, + matrikel_nr, + geschlecht, + ca12_staat, + sem_rueck_beur_ein, + stg, + abschluss, + regel, + kz_rueck_beur_ein, + fach_sem_zahl, + hssem, + stort, + stuart, + stufrm, + hzbart_astat, + hzbkfzkz, + hrst, +<#if stgnr.studiengang_nr=="1" && stgnr.fach_nr=="1"> +<#foreach vorherige_pruefung in vorherige_pruefungen_2015> +${vorherige_pruefung.art}_pruefung_stort, +${vorherige_pruefung.art}_pruefung_staat, +${vorherige_pruefung.art}_pruefung_abschluss, +${vorherige_pruefung.art}_pruefung_ergebnis, + + + datum, + summe) + select + hs_nr, +${stgnr.studiengang_nr} as studiengang_nr, +${stgnr.fach_nr} as fach_nr, +val(ef006) as matrikel_nr, +val(ef007) as geschlecht, +val(ef009) as ca12_staat, +semester as sem_rueck_beur_ein, +${stgnr.fach} as stg, +${stgnr.abschluss} as abschluss, +val(${stgnr.regel}) as regel, +val(${stgnr.kz_rueck_beur_ein}) as kz_rueck_beur_ein, +val(${stgnr.fach_sem_zahl}) as fach_sem_zahl, +(case when ef026='1' then 1 +else val(ef019) end ) as hssem, +ef004 as stort, +val(${stgnr.stuart}) as stuart, +${stgnr.stufrm} as stufrm, +ef110 as hzbart_astat, +ef111u1 as hzbkfzkz, +val(ef012) as hrst, +<#if stgnr.studiengang_nr=="1" && stgnr.fach_nr=="1"> +<#foreach vorherige_pruefung in vorherige_pruefungen_2015> +${vorherige_pruefung.pruefung_stort}, +val(${vorherige_pruefung.pruefung_staat}), +${vorherige_pruefung.pruefung_abschluss}, +val(${vorherige_pruefung.pruefung_ergebnis}), + + + today(), + count(*) as summe +FROM kenn_sos_astat_2015 +where ${stgnr.abschluss} is not null +and ${stgnr.fach} is not null +and ${stgnr.kz_rueck_beur_ein} !='5' --keine im Vorsemester exmatrikulierte +group by 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20 +<#if stgnr.studiengang_nr=="1" && stgnr.fach_nr=="1"> +,21,22,23,24,25,26,27,28 + + ; + + + +update tmp_stg_aggr_astat set stg='0' || stg +where length(trim(stg))=3; + +delete from qa_sos_stg_aggr_astat +where sem_rueck_beur_ein in (select distinct K.sem_rueck_beur_ein +from tmp_stg_aggr_astat K) +; + + +insert into qa_sos_stg_aggr_astat(hs_nr, + studiengang_nr, + fach_nr, + matrikel_nr, + geschlecht, + ca12_staat, + sem_rueck_beur_ein, + stg, + abschluss, + fgr, + abgrp, + regel, + kz_rueck_beur_ein, + fach_sem_zahl, + hssem, + -- kz_fach, + stort, + stuart, + stufrm, + hzbart_astat, + hzbkfzkz, + hrst, + letzte_pruefung_stort, + letzte_pruefung_staat, + letzte_pruefung_abschluss, + letzte_pruefung_ergebnis, + vorletzte_pruefung_stort, + vorletzte_pruefung_staat, + vorletzte_pruefung_abschluss, + vorletzte_pruefung_ergebnis, + datum, + summe) + select hs_nr, + studiengang_nr, + fach_nr, + matrikel_nr, + geschlecht, + ca12_staat, + sem_rueck_beur_ein, + stg, + abschluss, + fgr, + abgrp, + regel, + kz_rueck_beur_ein, + fach_sem_zahl, + hssem, +-- kz_fach, + stort, + stuart, + stufrm, + hzbart_astat, + hzbkfzkz, + hrst, + letzte_pruefung_stort, + letzte_pruefung_staat, + letzte_pruefung_abschluss, + letzte_pruefung_ergebnis, + vorletzte_pruefung_stort, + vorletzte_pruefung_staat, + vorletzte_pruefung_abschluss, + vorletzte_pruefung_ergebnis, + datum, + sum(summe) + from tmp_stg_aggr_astat + 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 + ; +update qa_sos_stg_aggr_astat set stg='0'||stg where length(stg)=3 +and substring(stg from 1 for 1) in ('0','1','2','3','4','5','6','7','8','9') +; + +drop table tmp_stg_aggr_astat; + + diff --git a/src-modules/module/qa/hilfstabellen/qa_sos_stg_aggr_int_fuellen.sql b/src-modules/module/qa/hilfstabellen/qa_sos_stg_aggr_int_fuellen.sql new file mode 100644 index 0000000..bdee6e8 --- /dev/null +++ b/src-modules/module/qa/hilfstabellen/qa_sos_stg_aggr_int_fuellen.sql @@ -0,0 +1,63 @@ +--(c) 2024 Daniel Quathamer +--freemarker template + + +select sp_table_exists('sos_stg_aggr') from xdummy + + + + +<#if qa_tablecomp_profile_is_active==1 && sos_stg_aggr_exists==1> + +truncate table qa_sos_stg_aggr_int; + +insert into qa_sos_stg_aggr_int( +ca12_staat, +geschlecht, +hrst, +studiengang_nr, +fach_nr, +fach_sem_zahl, +sem_rueck_beur_ein, +kz_rueck_beur_ein, +hssem, +stuart, +stutyp, +stufrm, +summe, +matrikel_nr, +stg, +abschluss, +stichtag) +SELECT +S.ca12_staat, +S.geschlecht, +val(H.astat) as hrst, +S.studiengang_nr, +S.fach_nr, +S.fach_sem_zahl, +S.sem_rueck_beur_ein, +S.kz_rueck_beur_ein, +S.hssem, +S.stuart, +S.stutyp, +S.stufrm, +S.summe, +S.matrikel_nr, +D.stg_astat as stg, +D.abschluss_astat as abschluss, +S.stichtag +FROM dim_studiengang D, sos_stg_aggr S left outer join sos_k_hrst H +on (H.apnr=S.hrst) +where S.tid_stg=D.tid +and S.stichtag in (select I.tid from sos_stichtag I where appl_key in ('0','1')) +--and S.kz_rueck_beur_ein !=5 +; + + + diff --git a/src-modules/module/qa/masken/37060_felderinfo.unl b/src-modules/module/qa/masken/37060_felderinfo.unl index abf6367..bf460bc 100644 --- a/src-modules/module/qa/masken/37060_felderinfo.unl +++ b/src-modules/module/qa/masken/37060_felderinfo.unl @@ -1,17 +1,17 @@ -37060^Benutzer/in^60^0^0^150^200^1^integer^200^0^1^<> select tid,nvl(name,benutzer) from userinfo order by 2;^hidden^^ -37061^Ausführungs-Status^0^0^0^150^80^1^integer^200^0^1^<> select 0,'Erfolgreich' from xdummy union select 1,'Warnung' from xdummy order by 1^^^ -37062^Aggregation des Vergleichs^20^0^0^150^80^1^integer^200^1^1^<> select 1,'Nur Summen' from xdummy\ -union select 2,'Felder' from xdummy\ ---union select 3,'Matrikelnr.' from xdummy\ - order by 1;^^<> select 1,'Nur Summen' from xdummy^ -37063^Testfall-Name (Stichwort)^50^0^0^150^150^1^sql^50^0^0^^ ^^ -37064^Priorität^10^0^0^150^200^1^char^200^0^1^<> select 'A','A (höchste Priorität)' from xdummy union \ +37060^Zeitraum^60^0^0^150^200^1^integer^200^0^0^^ ^ ^ +37061^Ausführungs-Status^0^0^0^150^80^1^integer^200^0^1^<> select 0,'Erfolgreich' from xdummy union select 1,'Warnung' from xdummy order by 1^ ^ ^ +37062^Aggregation des Vergleichs^10^0^0^150^80^1^integer^200^1^1^<> select 1,'Summen' from xdummy\ +union select 2,'Datensätze' from xdummy\ +union select 3,'Felder' from xdummy\ + order by 1;^ ^<> select 1,'Summen' from xdummy^ +37063^Testfall-Name (Stichwort)^50^0^0^150^150^1^sql^50^0^0^^ ^ ^ +37064^Priorität beim Feldabgleich^20^0^0^150^200^1^char^200^0^1^<> select 'A','A (höchste Priorität)' from xdummy union \ select 'B','B (mittlere Priorität)' from xdummy union \ select 'C','C (niedrige Priorität)' from xdummy\ -order by 1^^^ +order by 1^ ^ ^ 37065^Nur aktive^30^0^0^150^80^1^integer^200^0^1^<> select 1,'Ja' from xdummy union select 0,'nein' from xdummy order by 1 desc;^hidden^<>select 1,'Ja' from xdummy^ -37066^Ab Datum^40^0^0^150^80^1^date^200^0^0^ ^hidden^<> select today()-3 from xdummy^ -37067^Profil^5^0^0^150^80^1^integer^200^1^1^<> select tid,name from qa_tablecomp_profile where is_active=1 order by 2^^^ -37068^Tabellen-Abgleiche planen^100^0^0^150^300^1^char^30^0^18^^^<>\ +37066^Zeitraum für Semester 5stellig für Jahr 4stellig^61^0^0^150^80^1^char^200^0^8^^ ^ ^ +37067^Profil^5^0^0^150^80^1^integer^200^1^1^<> select tid,name from qa_tablecomp_profile where is_active=1 order by 2^ ^ ^ +37068^Tabellen-Abgleiche planen^100^0^0^150^300^1^char^30^0^18^^ ^<>\ --freemarker template \ <#if UserIsAdmin> select '../edit/qa/qa_tablecomp_profile_list.jsp' from xdummy ;<#else> select '../not_authorized.htm' from xdummy;^ diff --git a/src-modules/module/qa/masken/37060_maskeninfo.unl b/src-modules/module/qa/masken/37060_maskeninfo.unl index 0cac334..77f6bba 100644 --- a/src-modules/module/qa/masken/37060_maskeninfo.unl +++ b/src-modules/module/qa/masken/37060_maskeninfo.unl @@ -1,7 +1,7 @@ 37060^Tabellen-Abgleich^--Freemarker Template\ \ \ -\ +\ \ select name,\ uniquename,\ @@ -10,7 +10,10 @@ select name,\ table_2,\ table_2_caption,\ is_active,\ - systeminfo_id\ + systeminfo_id,\ + table_1_filter,\ + table_2_filter\ +\ FROM qa_tablecomp_profile \ where tid=<> \ \ @@ -30,22 +33,24 @@ select name,\ \ select name,\ priority,\ - sortnr\ + sortnr,\ + caption\ FROM qa_tablecomp_field \ where qa_tablecomp_profile_id=<>\ order by sortnr\ \ -\ -\ -SELECT fieldname\ +-- Darf nur 1 Spalte sein!\ +\ +SELECT fieldname,\ +fieldcaption\ FROM qa_tablecomp_groupby \ where qa_tablecomp_profile_id=<>\ -\ \ -\ \ +\ SELECT \ - fieldname\ + fieldname,\ + fieldcaption\ FROM qa_tablecomp_idcol \ where qa_tablecomp_profile_id=<>\ \ @@ -56,41 +61,73 @@ where qa_tablecomp_profile_id=<>\ \ \ <#assign prio_filter="" />\ -/* <#assign prio_filter=<> /> */\ +/* <#assign prio_filter=<> /> */\ \ \ <#assign aggregation="<>" />\ \ create temp table tmp_abgleich\ -(semester integer,\ +(zeitraum integer,\ prio char(1),\ ord smallint,\ pruefung varchar(255),\ comparison varchar(255),\ fieldname varchar(255),\ +fieldcaption varchar(255),\ result_table_1 varchar(255),\ result_table_2 varchar(255),\ result_code smallint,\ -result_code_str varchar(255)\ +result_code_str varchar(255),\ +hidden_summe text -- Link zu Detailbericht falls Differenz gefunden\ );\ \ create temp table tmp_abgleich_summen\ -(semester integer,\ -prio char(1),\ +(zeitraum integer,\ ord smallint,\ pruefung varchar(255),\ comparison varchar(255),\ fieldname varchar(255),\ +fieldcaption varchar(255),\ result_table_1 varchar(255),\ result_table_2 varchar(255),\ result_code smallint\ );\ \ +create temp table tmp_abgleich_ds\ +(zeitraum integer,\ +ord smallint,\ +pruefung varchar(255),\ +comparison varchar(255),\ +<#foreach idcol in idcols>\ +${idcol.fieldname} varchar(255),\ +\ +result_table_1 varchar(255),\ +result_table_2 varchar(255),\ +result_code smallint,\ +result_code_str varchar(255)\ +);\ +\ <#assign ord=0 />\ \ -<#foreach profile in profiles>\ +select * into temp tmp_table_1\ +from ${profile.table_1} \ +where 1=1\ +<#if profile.table_1_filter !=""> and ${profile.table_1_filter} \ +<#if "<>"!="">\ +and ${groupbycol.fieldname}=<>\ +\ +;\ +select * into temp tmp_table_2\ +from ${profile.table_2} \ +where 1=1\ +<#if profile.table_2_filter !=""> and ${profile.table_2_filter} \ +<#if "<>"!="">\ +and ${groupbycol.fieldname}=<>\ +\ +;\ \ <#if aggregation=="1">\ +--summen:\ <#foreach pruefung in pruefungen>\ <#if pruefung.priority!="P" && (pruefung.priority==prio_filter || prio_filter=="")>\ \ @@ -98,62 +135,51 @@ result_code smallint\ \ \ insert into tmp_abgleich_summen\ -(semester,\ -prio,\ +(zeitraum,\ ord,\ pruefung,\ comparison,\ result_table_1,\ result_table_2\ )\ -select <#foreach groupbycol in groupbycols>\ -${groupbycol.fieldname},\ -\ -'${pruefung.priority}',\ +select ${groupbycol.fieldname},\ ${ord},\ '${pruefung.name}',\ '${pruefung.aggregationfunction}',\ ${pruefung.aggregationfunction}(${pruefung.aggregationfield})::integer,\ 0\ -from ${profile.table_1}\ -where ${pruefung.whereclause}\ -group by <#foreach groupbycol in groupbycols>\ -${groupbycol.fieldname},\ -\ -null::char(1)\ +from tmp_table_1\ +where 1=1\ +<#if pruefung.whereclause !=""> and ${pruefung.whereclause} \ +group by ${groupbycol.fieldname}\ ;\ \ insert into tmp_abgleich_summen\ -(semester,\ -prio,\ +(zeitraum,\ ord,\ pruefung,\ comparison,\ result_table_1,\ result_table_2\ )\ -select <#foreach groupbycol in groupbycols>\ -${groupbycol.fieldname},\ -\ -'${pruefung.priority}',\ +select ${groupbycol.fieldname},\ ${ord},\ '${pruefung.name}',\ '${pruefung.aggregationfunction}',\ 0,\ ${pruefung.aggregationfunction}(${pruefung.aggregationfield})::integer\ -from ${profile.table_2}\ -where ${pruefung.whereclause}\ -group by <#foreach groupbycol in groupbycols>\ -${groupbycol.fieldname},\ -\ -null::char(1);\ +from tmp_table_2\ +where 1=1\ +<#if pruefung.whereclause !=""> and ${pruefung.whereclause} \ +group by ${groupbycol.fieldname}\ +;\ \ --vom prio-Filter\ \ \ insert into tmp_abgleich\ -(semester,\ -prio,\ +(zeitraum,\ +--prio,\ ord,\ pruefung,\ comparison,\ @@ -161,8 +187,7 @@ result_table_1,\ result_table_2,\ result_code\ )\ -select semester,\ -prio,\ +select zeitraum,\ ord,\ pruefung,\ comparison,\ @@ -171,7 +196,7 @@ sum(val(result_table_2)),\ 1\ from tmp_abgleich_summen\ --where comparison='Summe'\ -group by 1,2,3,4,5;\ +group by 1,2,3,4;\ \ update tmp_abgleich set result_code=0\ where val(result_table_2) =val(result_table_1);\ @@ -179,44 +204,133 @@ where val(result_table_2) =val(result_table_1);\ \ --wenn aggregation=Summen\ \ -drop table tmp_abgleich_summen;\ -\ \ <#if aggregation=="2">\ +--Datensätze:\ +\ +\ +--nur in Tabelle 1, fehlt in Tabelle 2:\ +insert into tmp_abgleich_ds\ +(zeitraum ,\ +pruefung,\ +comparison,\ +<#foreach idcol in idcols>\ +${idcol.fieldname} ,\ +\ +result_table_1 ,\ +--result_table_2 ,\ +result_code )\ +select T1.${groupbycol.fieldname},\ +'Datensatz-Abgleich',\ +'Existenz',\ +<#foreach idcol in idcols>\ +T1.${idcol.fieldname} ,\ +\ +'x',\ +1 --Fehlt\ +from tmp_table_1 T1 left outer join tmp_table_2 T2\ +on (1=1 <#foreach idcol in idcols>\ +and T1.${idcol.fieldname}=T2.${idcol.fieldname}\ +\ +)\ +where T2.${groupbycol.fieldname} is null\ +;\ +--nur in Tabelle 2, fehlt in Tabelle 1:\ +insert into tmp_abgleich_ds\ +(zeitraum ,\ +pruefung,\ +comparison,\ +<#foreach idcol in idcols>\ +${idcol.fieldname} ,\ +\ +--result_table_1 ,\ +result_table_2 ,\ +result_code )\ +select T1.${groupbycol.fieldname},\ +'Datensatz-Abgleich',\ +'Existenz',\ +<#foreach idcol in idcols>\ +T1.${idcol.fieldname} ,\ +\ +'x',\ +1 --Fehlt\ +from tmp_table_2 T1 left outer join tmp_table_1 T2\ +on (1=1 <#foreach idcol in idcols>\ +and T1.${idcol.fieldname}=T2.${idcol.fieldname}\ +\ +)\ +where T2.${groupbycol.fieldname} is null\ +;\ +\ +--in beiden Tabellen vorhanden:\ +insert into tmp_abgleich_ds\ +(zeitraum ,\ +pruefung,\ +comparison,\ +<#foreach idcol in idcols>\ +${idcol.fieldname} ,\ +\ +result_table_1 ,\ +result_table_2 ,\ +result_code )\ +select T1.${groupbycol.fieldname},\ +'Datensatz-Abgleich',\ +'Existenz',\ +<#foreach idcol in idcols>\ +T1.${idcol.fieldname} ,\ +\ +'x',\ +'x',\ +0 --vorhanden -> erfolgreich\ +from tmp_table_1 T1 inner join tmp_table_2 T2\ +on (1=1 <#foreach idcol in idcols>\ +and T1.${idcol.fieldname}=T2.${idcol.fieldname}\ +\ +)\ +;\ +\ +\ + --von Aggregation=2\ +\ +<#if aggregation=="3">\ +--felder:\ <#foreach field in fields>\ <#if field.priority!="P" && (field.priority==prio_filter || prio_filter=="")>\ \ <#assign ord=ord+1 />\ \ insert into tmp_abgleich\ -(semester,\ +(zeitraum,\ prio,\ ord,\ pruefung,\ comparison,\ fieldname,\ +fieldcaption,\ result_table_1,\ result_table_2,\ result_code\ )\ -select <#foreach groupbycol in groupbycols>\ -T1.${groupbycol.fieldname},\ -\ +select T1.${groupbycol.fieldname},\ '${field.priority}',\ ${ord},\ 'Feld-Abgleich',\ 'Gleichheit',\ '${field.name}',\ +'${field.caption}',\ T1.${field.name},\ T2.${field.name},\ -(case when T1.${field.name}=T2.${field.name} then 0 \ +(case when T1.${field.name}=T2.${field.name} or (T1.${field.name} is null and T2.${field.name} is null) then 0 \ else 1 end) as result_code\ -from ${profile.table_1} T1 left outer join ${profile.table_2} T2\ +from tmp_table_1 T1 left outer join tmp_table_2 T2\ on (1=1 <#foreach idcol in idcols>\ and T1.${idcol.fieldname}=T2.${idcol.fieldname}\ \ )\ where 1=1\ +<#if "<>"!="">\ +and T1.${groupbycol.fieldname}=<>\ +\ ;\ \ --vom prio-Filter\ @@ -224,74 +338,84 @@ where 1=1\ \ --wenn aggregation=Felder\ \ - --Ende Profil-Schleife\ \ -update tmp_abgleich set result_code_str='Differenz'\ +\ +\ +update tmp_abgleich set result_code_str='Differenz',\ +hidden_summe='SuperXmlTabelle?tid=37180&Profil=<>&Zeitraum='||zeitraum||'&Feld='||fieldname||'&cachingcontrol=clearmask&navi=true' \ where result_code!=0;\ \ update tmp_abgleich set result_code_str='Erfolg'\ where result_code=0;\ \ +drop table tmp_table_1;\ +drop table tmp_table_2;\ +\ <#if aggregation="1">\ select ord,\ -prio,\ pruefung,\ -semester,\ +zeitraum,\ comparison,\ result_table_1,\ result_table_2,\ -result_code_str\ +result_code_str,\ +hidden_summe\ from tmp_abgleich\ where 1=1\ /* and <>=result_code */\ order by 1;\ -\ <#elseif aggregation=="2">\ -select ord,prio,pruefung,\ -semester,\ -null::integer as matrikel_nr,\ -fieldname,result_code_str,count(*)\ +\ +update tmp_abgleich_ds set result_code_str='Differenz'\ +where result_code!=0 or result_code is null;\ +update tmp_abgleich_ds set result_code_str='Erfolg'\ +where result_code=0;\ +\ +\ +select \ +pruefung,\ +zeitraum,\ +<#foreach idcol in idcols>\ +${idcol.fieldname} ,\ +\ +result_table_1,\ +result_table_2,\ +result_code_str\ +from tmp_abgleich_ds\ + where 1=1\ +/* and <>=result_code */\ +order by 1,2,3,4,5;\ +\ +<#elseif aggregation=="3">\ +select ord,\ +prio,\ +pruefung,\ +zeitraum,\ +fieldname,\ +fieldcaption,\ +result_code_str,hidden_summe,count(*) as summe\ from tmp_abgleich\ where 1=1\ /* and <>=result_code */\ -group by 1,2,3,4,5,6,7\ +group by 1,2,3,4,5,6,7,8\ order by 1,2,3,4;\ ^--Freemarker Template\ -\ -\ -\ \ -select name,\ - uniquename,\ - table_1,\ - table_1_caption,\ - table_2,\ - table_2_caption,\ - is_active,\ - systeminfo_id\ -FROM qa_tablecomp_profile \ -where tid=<> \ -\ -\ -\ <#assign aggregation="<>" />\ XIL List\ drop_and_delete movable_columns sizable_columns horizontal_scrolling\ white_space_color=COLOR_WHITE fixed_columns=2\ min_heading_height=35\ +<#if aggregation="1">\ Column CID=0 heading_text="Nr." center_heading\ row_selectable col_selectable heading_platform readonly\ width=20 text_size=100\ -Column CID=1 heading_text="Priorität" center_heading\ - row_selectable col_selectable heading_platform readonly\ - width=50 text_size=200\ Column CID=1 heading_text="Testfall" center_heading\ row_selectable col_selectable heading_platform readonly\ width=50 text_size=200\ -Column CID=1 heading_text="Semester" center_heading\ +Column CID=1 heading_text="${groupbycol.fieldcaption}" center_heading\ row_selectable col_selectable heading_platform readonly\ width=50 text_size=200\ -<#if aggregation="1">\ Column CID=1 heading_text="Vergleich" center_heading\ row_selectable col_selectable heading_platform readonly\ width=50 text_size=200\ @@ -304,18 +428,50 @@ Column CID=1 heading_text="Wert ${profile.table_2_caption}" center_heading\ Column CID=1 heading_text="Status" center_heading\ row_selectable col_selectable heading_platform readonly\ width=10 text_size=200\ -<#elseif aggregation=="2">\ -Column CID=1 heading_text="Matrikelnr." center_heading\ +<#elseif aggregation="2">\ +Column CID=1 heading_text="Testfall" center_heading\ + row_selectable col_selectable heading_platform readonly\ + width=50 text_size=200\ +Column CID=1 heading_text="Zeitraum: ${groupbycol.fieldcaption}" center_heading\ + row_selectable col_selectable heading_platform readonly\ + width=50 text_size=200\ +<#foreach idcol in idcols>\ +Column CID=1 heading_text="Datensatz-ID\\000${idcol.fieldcaption}" center_heading\ row_selectable col_selectable heading_platform readonly\ width=10 text_size=200\ -Column CID=1 heading_text="Feldname" center_heading\ +\ +Column CID=1 heading_text="Vorhanden ${profile.table_1_caption}" center_heading\ row_selectable col_selectable heading_platform readonly\ width=10 text_size=200\ -Column CID=1 heading_text="Ergebnis" center_heading\ +Column CID=1 heading_text="Vorhanden ${profile.table_2_caption}" center_heading\ + row_selectable col_selectable heading_platform readonly\ + width=10 text_size=200\ +Column CID=1 heading_text="Status" center_heading\ + row_selectable col_selectable heading_platform readonly\ + width=10 text_size=200\ +<#elseif aggregation="3">\ +Column CID=0 heading_text="Nr." center_heading\ + row_selectable col_selectable heading_platform readonly\ + width=20 text_size=100\ +Column CID=1 heading_text="Priorität" center_heading\ + row_selectable col_selectable heading_platform readonly\ + width=50 text_size=200\ +Column CID=1 heading_text="Testfall" center_heading\ + row_selectable col_selectable heading_platform readonly\ + width=50 text_size=200\ +Column CID=1 heading_text="${groupbycol.fieldcaption}" center_heading\ + row_selectable col_selectable heading_platform readonly\ + width=50 text_size=200\ +Column CID=1 heading_text="Feldname" center_heading\ row_selectable col_selectable heading_platform readonly\ width=10 text_size=200\ -Column CID=1 heading_text="Summe" center_heading\ +Column CID=1 heading_text="Feldbezeichnung" center_heading\ row_selectable col_selectable heading_platform readonly\ width=10 text_size=200\ +Column CID=1 heading_text="Ergebnis" center_heading row_selectable col_selectable heading_platform readonly width=10 text_size=20\ +Column CID=1 heading_text="hidden_Summe" center_heading row_selectable col_selectableh eading_platform readonly width=10 text_size=20\ +Column CID=1 heading_text="Summe" center_heading row_selectable col_selectableh eading_platform readonly width=1 text_size=1\ \ -@@@^^^Generische Auswertung eines Tabellenabgleichs^drop table tmp_abgleich;^^1^440^360^0^1^^ +@@@^ ^ ^Generische Auswertung eines Tabellenabgleichs mit Link zu Details bei Auswertung mit Aggregation des Vergleichs=Felder^drop table tmp_abgleich; \ +drop table tmp_abgleich_ds; \ +drop table tmp_abgleich_summen;^^1^440^360^^1^^ diff --git a/src-modules/module/qa/masken/37180_felderinfo.unl b/src-modules/module/qa/masken/37180_felderinfo.unl new file mode 100644 index 0000000..a305b34 --- /dev/null +++ b/src-modules/module/qa/masken/37180_felderinfo.unl @@ -0,0 +1,11 @@ +37180^Benutzer/in^60^0^0^150^200^1^integer^200^0^999^<> select tid,nvl(name,benutzer) from userinfo order by 2;^hidden^ ^ +37181^Ausführungs-Status^0^0^0^150^80^1^integer^200^0^999^<> select 0,'Erfolgreich' from xdummy union select 1,'Warnung' from xdummy order by 1^ ^ ^ +37182^Feld^20^0^0^150^80^1^char^200^1^1^<> select name,caption from qa_tablecomp_field where qa_tablecomp_profile_id=<> order by 1;^ ^ ^ +37183^Testfall-Name (Stichwort)^50^0^0^150^150^1^sql^50^0^999^^ ^ ^ +37184^Zeitraum^10^0^0^150^200^1^integer^200^0^0^^ ^ ^ +37185^Nur aktive^30^0^0^150^80^1^integer^200^0^999^<> select 1,'Ja' from xdummy union select 0,'nein' from xdummy order by 1 desc;^hidden^<>select 1,'Ja' from xdummy^ +37186^Ab Datum^40^0^0^150^80^1^date^200^0^999^^hidden^<> select today()-3 from xdummy^ +37187^Profil^0^0^0^150^80^1^integer^200^1^1^<> select tid,name from qa_tablecomp_profile where is_active=1 order by 2^ ^ ^ +37188^Tabellen-Abgleiche planen^100^0^0^150^300^1^char^30^0^999^^ ^<>\ +--freemarker template \ +<#if UserIsAdmin> select '../edit/qa/qa_tablecomp_profile_list.jsp' from xdummy ;<#else> select '../not_authorized.htm' from xdummy;^ diff --git a/src-modules/module/qa/masken/37180_maske_system_bez.unl b/src-modules/module/qa/masken/37180_maske_system_bez.unl new file mode 100644 index 0000000..4f5fce1 --- /dev/null +++ b/src-modules/module/qa/masken/37180_maske_system_bez.unl @@ -0,0 +1 @@ +37180^260^ diff --git a/src-modules/module/qa/masken/37180_masken_felder_bez.unl b/src-modules/module/qa/masken/37180_masken_felder_bez.unl new file mode 100644 index 0000000..b59f940 --- /dev/null +++ b/src-modules/module/qa/masken/37180_masken_felder_bez.unl @@ -0,0 +1,9 @@ +37180^37180^ +37180^37181^ +37180^37182^ +37180^37183^ +37180^37184^ +37180^37185^ +37180^37186^ +37180^37187^ +37180^37188^ diff --git a/src-modules/module/qa/masken/37180_maskeninfo.unl b/src-modules/module/qa/masken/37180_maskeninfo.unl new file mode 100644 index 0000000..935ffc8 --- /dev/null +++ b/src-modules/module/qa/masken/37180_maskeninfo.unl @@ -0,0 +1,75 @@ +37180^Tabellen-Abgleich Differenzen^--Freemarker Template\ +\ +\ +\ +select name,\ + uniquename,\ + table_1,\ + table_1_caption,\ + table_2,\ + table_2_caption,\ + is_active,\ + systeminfo_id\ +FROM qa_tablecomp_profile \ +where tid=<> \ +\ +\ +\ +\ +SELECT \ + fieldname,\ + fieldcaption\ +FROM qa_tablecomp_idcol \ +where qa_tablecomp_profile_id=<>\ +\ + \ +\ +SELECT fieldname\ +FROM qa_tablecomp_groupby \ +where qa_tablecomp_profile_id=<>\ + \ +\ +SELECT name,\ +caption\ +FROM qa_tablecomp_field\ +where qa_tablecomp_profile_id=<>\ +and name=<>;\ +\ + \ +\ +\ +\ +select distinct <#foreach idcol in idcols>T1.${idcol.fieldname},\ +T1.${vergleichsfeld.name},\ +T2.${vergleichsfeld.name}\ +from ${profile.table_1} T1 left outer join ${profile.table_2} T2\ +on (1=1 <#foreach idcol in idcols>\ +and T1.${idcol.fieldname}=T2.${idcol.fieldname}\ +\ +)\ +where (T1.${vergleichsfeld.name}!=T2.${vergleichsfeld.name} or (T1.${vergleichsfeld.name} is not null and T2.${vergleichsfeld.name} is null) or (T1.${vergleichsfeld.name} is null and T2.${vergleichsfeld.name} is not null))\ +<#if "<>"!="">\ +<#foreach groupbycol in groupbycols>\ +and T1.${groupbycol.fieldname}=<>\ +\ +\ +order by <#list 1..idcols?size as i>${i}, ${idcols?size}\ +;^--Freemarker Template\ +\ +XIL List\ + drop_and_delete movable_columns sizable_columns horizontal_scrolling\ + white_space_color=COLOR_WHITE fixed_columns=1\ + min_heading_height=35\ +<#foreach idcol in idcols>\ +Column CID=0 heading_text="${idcol.fieldcaption}" center_heading\ + row_selectable col_selectable heading_platform readonly\ + width=20 text_size=14\ +\ +Column CID=1 heading_text="${profile.table_1_caption}.${vergleichsfeld.caption}" center_heading\ + row_selectable col_selectable heading_platform readonly\ + width=50 text_size=14\ +Column CID=1 heading_text="${profile.table_2_caption}.${vergleichsfeld.caption}" center_heading\ + row_selectable col_selectable heading_platform readonly\ + width=50 text_size=14\ +\ +@@@^ ^ ^Anzeige von Differenzen beim Tabellenabgleich^ ^^1^440^360^^1^^ diff --git a/src-modules/module/qa/masken/37180_sachgeb_maske_bez.unl b/src-modules/module/qa/masken/37180_sachgeb_maske_bez.unl new file mode 100644 index 0000000..4572190 --- /dev/null +++ b/src-modules/module/qa/masken/37180_sachgeb_maske_bez.unl @@ -0,0 +1 @@ +260^37180^ diff --git a/src-modules/module/qa/schluesseltabellen/qa_tablecomp_profile_sos_stud_astat_fuellen.sql b/src-modules/module/qa/schluesseltabellen/qa_tablecomp_profile_sos_stud_astat_fuellen.sql new file mode 100644 index 0000000..2eaba01 --- /dev/null +++ b/src-modules/module/qa/schluesseltabellen/qa_tablecomp_profile_sos_stud_astat_fuellen.sql @@ -0,0 +1,141 @@ +-- Profil für Vergleich ASTAT +-- kann per Hilfsmaske eingespielt werden, wenn QA-Modul installiert +--freemarker template +<#assign profiles = [ +{"name":"Vergleich Studierende ASTAT (STGNR)", +"uniquename":"sos_stud_astat_stgnr_stichtag_0", +"table_1":"qa_sos_stg_aggr_astat", +"table_1_caption":"Studierende ASTAT (ohne Exmatr.)", +"table_1_filter":"kz_rueck_beur_ein !=5", +"table_2":"qa_sos_stg_aggr_int", +"table_2_caption":"Studierende (intern) tagesaktuell", +"table_2_filter":"stichtag in (select I.tid from sos_stichtag I where appl_key in (''0''))", +"systeminfo_id":"7"} +] /> +<#assign pruefungen = [ +{"name":"Gesamtzahl der Fälle","whereclause":"1=1","priority":"A","aggregationfield":"matrikel_nr","aggregationfunction":"count"}, +{"name":"Gesamtzahl der Köpfe","whereclause":"studiengang_nr=1 and fach_nr=1","priority":"A","aggregationfield":"matrikel_nr","aggregationfunction":"count"} +] /> +<#assign groupbycol = {"name":"sem_rueck_beur_ein","caption":"Semester"} /> +<#assign idcols = [ +{"name":"sem_rueck_beur_ein","caption":"Semester"}, +{"name":"matrikel_nr","caption":"Matrikel-Nr."}, +{"name":"studiengang_nr","caption":"Studiengang-Nr."}, +{"name":"fach_nr","caption":"Fachnr."} +] /> +<#assign ord=0 /> +<#assign fields = [ +{"name":"geschlecht","priority":"A","caption":"Geschlecht" }, +{"name":"ca12_staat","priority":"A","caption":"Staatsangehörigkeit" }, +{"name":"kz_rueck_beur_ein","priority":"A","caption":"Status" }, +{"name":"hrst","priority":"A","caption":"Hörerstatus" }, +{"name":"fach_sem_zahl","priority":"A","caption":"Fachsemester" }, + {"name":"stg","priority":"A","caption":"Fach" }, + {"name":"abschluss","priority":"A","caption":"Abschluss" } + + ] /> + +--Der folgende Code ist generisch: +<#foreach profile in profiles> +delete from qa_tablecomp_aggregation +where qa_tablecomp_profile_id in (select P.tid from qa_tablecomp_profile P + where P.uniquename='${profile.uniquename}') + ; +delete from qa_tablecomp_groupby +where qa_tablecomp_profile_id in (select P.tid from qa_tablecomp_profile P + where P.uniquename='${profile.uniquename}') + ; +delete from qa_tablecomp_idcol +where qa_tablecomp_profile_id in (select P.tid from qa_tablecomp_profile P + where P.uniquename='${profile.uniquename}') + ; +delete from qa_tablecomp_field +where qa_tablecomp_profile_id in (select P.tid from qa_tablecomp_profile P + where P.uniquename='${profile.uniquename}') + ; +delete from qa_tablecomp_profile +where uniquename='${profile.uniquename}' + ; +insert into qa_tablecomp_profile( name, + uniquename, + table_1, + table_1_caption, + table_1_filter, + table_2, + table_2_caption, + table_2_filter, + is_active, + systeminfo_id) + select '${profile.name}', + '${profile.uniquename}', + '${profile.table_1}', + '${profile.table_1_caption}', + '${profile.table_1_filter}', + '${profile.table_2}', + '${profile.table_2_caption}', + '${profile.table_2_filter}', + 1, + ${profile.systeminfo_id} + from xdummy; + +<#assign ord=0 /> +<#foreach pruefung in pruefungen> +insert into qa_tablecomp_aggregation( +qa_tablecomp_profile_id, + name, + whereclause, + is_active, + priority, + aggregationfield, + aggregationfunction +) +select tid, +'${pruefung.name}', + '${pruefung.whereclause}', + 1, + '${pruefung.priority}', + '${pruefung.aggregationfield}', + '${pruefung.aggregationfunction}' + from qa_tablecomp_profile + where uniquename='${profile.uniquename}'; + +insert into qa_tablecomp_groupby( qa_tablecomp_profile_id, + fieldname, + fieldcaption +) +select tid, +'${groupbycol.name}', +'${groupbycol.caption}' + from qa_tablecomp_profile + where uniquename='${profile.uniquename}'; + +<#foreach idcol in idcols> +insert into qa_tablecomp_idcol( qa_tablecomp_profile_id, + fieldname, + fieldcaption +) +select tid, +'${idcol.name}', +'${idcol.caption}' + from qa_tablecomp_profile + where uniquename='${profile.uniquename}'; + +<#foreach field in fields> +<#assign ord=ord+1 /> +insert into qa_tablecomp_field( + qa_tablecomp_profile_id, + name, + caption, + priority, + sortnr +) +select tid, +'${field.name}', +'${field.caption}', + '${field.priority}', + ${ord} + from qa_tablecomp_profile + where uniquename='${profile.uniquename}'; + +--Ende Profil + \ No newline at end of file diff --git a/src-modules/module/qa/schluesseltabellen/qa_tablecomp_profile_sos_stud_astat_nach_fach_abschluss_s0_fuellen.sql b/src-modules/module/qa/schluesseltabellen/qa_tablecomp_profile_sos_stud_astat_nach_fach_abschluss_s0_fuellen.sql new file mode 100644 index 0000000..08c071b --- /dev/null +++ b/src-modules/module/qa/schluesseltabellen/qa_tablecomp_profile_sos_stud_astat_nach_fach_abschluss_s0_fuellen.sql @@ -0,0 +1,141 @@ +-- Profil für Vergleich ASTAT +-- kann per Hilfsmaske eingespielt werden, wenn QA-Modul installiert +--freemarker template +<#assign profiles = [ +{"name":"Vergleich Studierende ASTAT (Fach/Abschluss) Stichtag tagesakt.", +"uniquename":"sos_stud_astat_stg_abschluss_s0", +"table_1":"qa_sos_stg_aggr_astat", +"table_1_caption":"Studierende ASTAT (ohne Exmatr.)", +"table_1_filter":"kz_rueck_beur_ein !=5", +"table_2":"qa_sos_stg_aggr_int", +"table_2_caption":"Studierende (intern) tagesaktuell", +"table_2_filter":"hrst !=4 and stichtag in (select I.tid from sos_stichtag I where appl_key in (''0''))", +"systeminfo_id":"7"} +] /> +<#assign pruefungen = [ +{"name":"Gesamtzahl der Fälle","whereclause":"","priority":"A","aggregationfield":"matrikel_nr","aggregationfunction":"count"}, +{"name":"Gesamtzahl der Köpfe","whereclause":"studiengang_nr=1 and fach_nr=1","priority":"A","aggregationfield":"matrikel_nr","aggregationfunction":"count"} +] /> +<#assign groupbycol = {"name":"sem_rueck_beur_ein","caption":"Semester"} /> +<#assign idcols = [ +{"name":"sem_rueck_beur_ein","caption":"Semester"}, +{"name":"matrikel_nr","caption":"Matrikel-Nr."}, + {"name":"stg","caption":"Fach" }, + {"name":"abschluss","caption":"Abschluss" } +] /> +<#assign ord=0 /> +<#assign fields = [ +{"name":"geschlecht","priority":"A","caption":"Geschlecht" }, +{"name":"ca12_staat","priority":"A","caption":"Staatsangehörigkeit" }, +{"name":"kz_rueck_beur_ein","priority":"A","caption":"Status" }, +{"name":"hrst","priority":"A","caption":"Hörerstatus" }, +{"name":"fach_sem_zahl","priority":"A","caption":"Fachsemester" }, +{"name":"studiengang_nr","priority":"A","caption":"Studiengang-Nr."}, +{"name":"fach_nr","priority":"A","caption":"Fachnr."} + + ] /> + +--Der folgende Code ist generisch: +<#foreach profile in profiles> +delete from qa_tablecomp_aggregation +where qa_tablecomp_profile_id in (select P.tid from qa_tablecomp_profile P + where P.uniquename='${profile.uniquename}') + ; +delete from qa_tablecomp_groupby +where qa_tablecomp_profile_id in (select P.tid from qa_tablecomp_profile P + where P.uniquename='${profile.uniquename}') + ; +delete from qa_tablecomp_idcol +where qa_tablecomp_profile_id in (select P.tid from qa_tablecomp_profile P + where P.uniquename='${profile.uniquename}') + ; +delete from qa_tablecomp_field +where qa_tablecomp_profile_id in (select P.tid from qa_tablecomp_profile P + where P.uniquename='${profile.uniquename}') + ; +delete from qa_tablecomp_profile +where uniquename='${profile.uniquename}' + ; +insert into qa_tablecomp_profile( name, + uniquename, + table_1, + table_1_caption, + table_1_filter, + table_2, + table_2_caption, + table_2_filter, + is_active, + systeminfo_id) + select '${profile.name}', + '${profile.uniquename}', + '${profile.table_1}', + '${profile.table_1_caption}', + '${profile.table_1_filter}', + '${profile.table_2}', + '${profile.table_2_caption}', + '${profile.table_2_filter}', + 1, + ${profile.systeminfo_id} + from xdummy; + +<#assign ord=0 /> +<#foreach pruefung in pruefungen> +insert into qa_tablecomp_aggregation( +qa_tablecomp_profile_id, + name, + whereclause, + is_active, + priority, + aggregationfield, + aggregationfunction +) +select tid, +'${pruefung.name}', + '${pruefung.whereclause}', + 1, + '${pruefung.priority}', + '${pruefung.aggregationfield}', + '${pruefung.aggregationfunction}' + from qa_tablecomp_profile + where uniquename='${profile.uniquename}'; + +insert into qa_tablecomp_groupby( qa_tablecomp_profile_id, + fieldname, + fieldcaption +) +select tid, +'${groupbycol.name}', +'${groupbycol.caption}' + from qa_tablecomp_profile + where uniquename='${profile.uniquename}'; + +<#foreach idcol in idcols> +insert into qa_tablecomp_idcol( qa_tablecomp_profile_id, + fieldname, + fieldcaption +) +select tid, +'${idcol.name}', +'${idcol.caption}' + from qa_tablecomp_profile + where uniquename='${profile.uniquename}'; + +<#foreach field in fields> +<#assign ord=ord+1 /> +insert into qa_tablecomp_field( + qa_tablecomp_profile_id, + name, + caption, + priority, + sortnr +) +select tid, +'${field.name}', +'${field.caption}', + '${field.priority}', + ${ord} + from qa_tablecomp_profile + where uniquename='${profile.uniquename}'; + +--Ende Profil + \ No newline at end of file diff --git a/src-modules/module/qa/schluesseltabellen/qa_tablecomp_profile_sos_stud_astat_nach_fach_abschluss_s1_fuellen.sql b/src-modules/module/qa/schluesseltabellen/qa_tablecomp_profile_sos_stud_astat_nach_fach_abschluss_s1_fuellen.sql new file mode 100644 index 0000000..de248b5 --- /dev/null +++ b/src-modules/module/qa/schluesseltabellen/qa_tablecomp_profile_sos_stud_astat_nach_fach_abschluss_s1_fuellen.sql @@ -0,0 +1,141 @@ +-- Profil für Vergleich ASTAT +-- kann per Hilfsmaske eingespielt werden, wenn QA-Modul installiert +--freemarker template +<#assign profiles = [ +{"name":"Vergleich Studierende ASTAT (Fach/Abschluss) Stichtag amtl. Stat.", +"uniquename":"sos_stud_astat_stg_abschluss_s1", +"table_1":"qa_sos_stg_aggr_astat", +"table_1_caption":"Studierende ASTAT (ohne Exmatr.)", +"table_1_filter":"kz_rueck_beur_ein !=5", +"table_2":"qa_sos_stg_aggr_int", +"table_2_caption":"Studierende (intern) amtl. Stat.", +"table_2_filter":"hrst !=4 and kz_rueck_beur_ein !=5 and stichtag in (select I.tid from sos_stichtag I where appl_key in (''1''))", +"systeminfo_id":"7"} +] /> +<#assign pruefungen = [ +{"name":"Gesamtzahl der Fälle","whereclause":"","priority":"A","aggregationfield":"matrikel_nr","aggregationfunction":"count"}, +{"name":"Gesamtzahl der Köpfe","whereclause":"studiengang_nr=1 and fach_nr=1","priority":"A","aggregationfield":"matrikel_nr","aggregationfunction":"count"} +] /> +<#assign groupbycol = {"name":"sem_rueck_beur_ein","caption":"Semester"} /> +<#assign idcols = [ +{"name":"sem_rueck_beur_ein","caption":"Semester"}, +{"name":"matrikel_nr","caption":"Matrikel-Nr."}, + {"name":"stg","caption":"Fach" }, + {"name":"abschluss","caption":"Abschluss" } +] /> +<#assign ord=0 /> +<#assign fields = [ +{"name":"geschlecht","priority":"A","caption":"Geschlecht" }, +{"name":"ca12_staat","priority":"A","caption":"Staatsangehörigkeit" }, +{"name":"kz_rueck_beur_ein","priority":"A","caption":"Status" }, +{"name":"hrst","priority":"A","caption":"Hörerstatus" }, +{"name":"fach_sem_zahl","priority":"A","caption":"Fachsemester" }, +{"name":"studiengang_nr","priority":"A","caption":"Studiengang-Nr."}, +{"name":"fach_nr","priority":"A","caption":"Fachnr."} + + ] /> + +--Der folgende Code ist generisch: +<#foreach profile in profiles> +delete from qa_tablecomp_aggregation +where qa_tablecomp_profile_id in (select P.tid from qa_tablecomp_profile P + where P.uniquename='${profile.uniquename}') + ; +delete from qa_tablecomp_groupby +where qa_tablecomp_profile_id in (select P.tid from qa_tablecomp_profile P + where P.uniquename='${profile.uniquename}') + ; +delete from qa_tablecomp_idcol +where qa_tablecomp_profile_id in (select P.tid from qa_tablecomp_profile P + where P.uniquename='${profile.uniquename}') + ; +delete from qa_tablecomp_field +where qa_tablecomp_profile_id in (select P.tid from qa_tablecomp_profile P + where P.uniquename='${profile.uniquename}') + ; +delete from qa_tablecomp_profile +where uniquename='${profile.uniquename}' + ; +insert into qa_tablecomp_profile( name, + uniquename, + table_1, + table_1_caption, + table_1_filter, + table_2, + table_2_caption, + table_2_filter, + is_active, + systeminfo_id) + select '${profile.name}', + '${profile.uniquename}', + '${profile.table_1}', + '${profile.table_1_caption}', + '${profile.table_1_filter}', + '${profile.table_2}', + '${profile.table_2_caption}', + '${profile.table_2_filter}', + 1, + ${profile.systeminfo_id} + from xdummy; + +<#assign ord=0 /> +<#foreach pruefung in pruefungen> +insert into qa_tablecomp_aggregation( +qa_tablecomp_profile_id, + name, + whereclause, + is_active, + priority, + aggregationfield, + aggregationfunction +) +select tid, +'${pruefung.name}', + '${pruefung.whereclause}', + 1, + '${pruefung.priority}', + '${pruefung.aggregationfield}', + '${pruefung.aggregationfunction}' + from qa_tablecomp_profile + where uniquename='${profile.uniquename}'; + +insert into qa_tablecomp_groupby( qa_tablecomp_profile_id, + fieldname, + fieldcaption +) +select tid, +'${groupbycol.name}', +'${groupbycol.caption}' + from qa_tablecomp_profile + where uniquename='${profile.uniquename}'; + +<#foreach idcol in idcols> +insert into qa_tablecomp_idcol( qa_tablecomp_profile_id, + fieldname, + fieldcaption +) +select tid, +'${idcol.name}', +'${idcol.caption}' + from qa_tablecomp_profile + where uniquename='${profile.uniquename}'; + +<#foreach field in fields> +<#assign ord=ord+1 /> +insert into qa_tablecomp_field( + qa_tablecomp_profile_id, + name, + caption, + priority, + sortnr +) +select tid, +'${field.name}', +'${field.caption}', + '${field.priority}', + ${ord} + from qa_tablecomp_profile + where uniquename='${profile.uniquename}'; + +--Ende Profil + \ No newline at end of file diff --git a/src-modules/module/qa/upgrade/qa_upgrade_man.sql b/src-modules/module/qa/upgrade/qa_upgrade_man.sql index cf5737e..3006e17 100644 --- a/src-modules/module/qa/upgrade/qa_upgrade_man.sql +++ b/src-modules/module/qa/upgrade/qa_upgrade_man.sql @@ -13,3 +13,8 @@ where assert_result_value_max is null; --Obsolete Maske: delete from themenbaum where maskeninfo_id=37100; +alter table qa_mask_execution alter column created_at set default current_date; +alter table qa_dbtest alter column created_at set default current_date; +alter table qa_project alter column created_at set default current_date; + +