Browse Source

Tabellenabgleich amt. Statistik Stud.#7

testfallprotokoll_mail
Daniel Quathamer 7 months ago
parent
commit
2d3bf470b1
  1. 120
      src-modules/module/qa/conf/qa.xml
  2. 3
      src-modules/module/qa/datentabellen/vacuum_pg.sql
  3. 355
      src-modules/module/qa/hilfstabellen/qa_sos_stg_aggr_astat_fuellen.sql
  4. 63
      src-modules/module/qa/hilfstabellen/qa_sos_stg_aggr_int_fuellen.sql
  5. 14
      src-modules/module/qa/masken/37060_felderinfo.unl
  6. 336
      src-modules/module/qa/masken/37060_maskeninfo.unl
  7. 11
      src-modules/module/qa/masken/37180_felderinfo.unl
  8. 1
      src-modules/module/qa/masken/37180_maske_system_bez.unl
  9. 9
      src-modules/module/qa/masken/37180_masken_felder_bez.unl
  10. 75
      src-modules/module/qa/masken/37180_maskeninfo.unl
  11. 1
      src-modules/module/qa/masken/37180_sachgeb_maske_bez.unl
  12. 141
      src-modules/module/qa/schluesseltabellen/qa_tablecomp_profile_sos_stud_astat_fuellen.sql
  13. 141
      src-modules/module/qa/schluesseltabellen/qa_tablecomp_profile_sos_stud_astat_nach_fach_abschluss_s0_fuellen.sql
  14. 141
      src-modules/module/qa/schluesseltabellen/qa_tablecomp_profile_sos_stud_astat_nach_fach_abschluss_s1_fuellen.sql
  15. 5
      src-modules/module/qa/upgrade/qa_upgrade_man.sql

120
src-modules/module/qa/conf/qa.xml

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!--<!DOCTYPE module SYSTEM "../../../conf/superx-module.dtd"> --> <!--<!DOCTYPE module SYSTEM "../../../conf/superx-module.dtd"> -->
<module name="qa" version="0.6" sachgebiet_id="260" <module name="qa" version="0.7" sachgebiet_id="260"
sachgebiet="Qualitätssicherung" systeminfo_id="260" sachgebiet="Qualitätssicherung" systeminfo_id="260"
system="Qualitätssicherung" thema="Qualitätssicherung" thema_parent="Abfragen"> system="Qualitätssicherung" thema="Qualitätssicherung" thema_parent="Abfragen">
<database name="superx" version="3.0" system="superx"> <database name="superx" version="3.0" system="superx">
@ -98,6 +98,8 @@ notnull="false" currentlyUsed="false">
notnull="true" > notnull="true" >
<comment></comment> <comment></comment>
</column> </column>
<column name="created_at" type ="DATE" size ="5" default ="" notnull ="false" description="Erzeugt am"/>
</columns> </columns>
<primaryKeys> <primaryKeys>
<rs> <rs>
@ -401,6 +403,14 @@ notnull="true">
<column name="systeminfo_id" type="INTEGER" size="100" default="" notnull="false" description="Komponente"> <column name="systeminfo_id" type="INTEGER" size="100" default="" notnull="false" description="Komponente">
<comment></comment> <comment></comment>
</column> </column>
<column name="table_1_filter" type="TEXT" size="255" default="" description="Tabelle 1 Filter"
notnull="false" >
<comment>Zusätzlicher Filter für Tabelle 1</comment>
</column>
<column name="table_2_filter" type="TEXT" size="255" default="" description="Tabelle 2 Filter"
notnull="false" >
<comment>Zusätzlicher Filter für Tabelle 2</comment>
</column>
</columns> </columns>
<primaryKeys> <primaryKeys>
<rs> <rs>
@ -476,6 +486,9 @@ notnull="false">
<column name="name" type="varchar" size="255" default="" notnull="true" description="Name"> <column name="name" type="varchar" size="255" default="" notnull="true" description="Name">
<comment>Feldname</comment> <comment>Feldname</comment>
</column> </column>
<column name="caption" type="varchar" size="255" default="" notnull="false" description="Feldbezeichnung">
<comment>Feldbezeichnung</comment>
</column>
<column name="priority" type="CHAR" size="10" default="" notnull="false" description="Priorität"> <column name="priority" type="CHAR" size="10" default="" notnull="false" description="Priorität">
<comment></comment> <comment></comment>
</column> </column>
@ -504,12 +517,15 @@ notnull="false">
<comment>ID</comment> <comment>ID</comment>
</column> </column>
<column name="qa_tablecomp_profile_id" type="INTEGER" size="" default="" description="Profil" <column name="qa_tablecomp_profile_id" type="INTEGER" size="" default="" description="Profil"
notnull="false"> notnull="false" isKey="true">
<comment></comment> <comment></comment>
</column> </column>
<column name="fieldname" type="varchar" size="255" default="" notnull="true" description="Name"> <column name="fieldname" type="varchar" size="255" default="" notnull="true" description="Name">
<comment>Interner Name</comment> <comment>Interner Name</comment>
</column> </column>
<column name="fieldcaption" type="varchar" size="255" default="" notnull="false" description="Bezeichnung">
<comment>Interner Name</comment>
</column>
</columns> </columns>
<primaryKeys> <primaryKeys>
<rs> <rs>
@ -537,6 +553,8 @@ notnull="false">
<column name="fieldname" type="varchar" size="255" default="" notnull="true" description="Name"> <column name="fieldname" type="varchar" size="255" default="" notnull="true" description="Name">
<comment>Interner Name</comment> <comment>Interner Name</comment>
</column> </column>
<column name="fieldcaption" type="varchar" size="255" default="" notnull="false" description="Bezeichnung">
</column>
</columns> </columns>
<primaryKeys> <primaryKeys>
<rs> <rs>
@ -644,6 +662,7 @@ notnull="false">
<column name="whereclause" type ="TEXT" size ="2147483647" default ="" notnull ="false" description="Bedingung"><comment>formuliert als SQL-where-Ausdruck</comment></column> <column name="whereclause" type ="TEXT" size ="2147483647" default ="" notnull ="false" description="Bedingung"><comment>formuliert als SQL-where-Ausdruck</comment></column>
<column name="description" type ="TEXT" size ="2147483647" default ="" notnull ="false" description="Beschreibung"><comment></comment></column> <column name="description" type ="TEXT" size ="2147483647" default ="" notnull ="false" description="Beschreibung"><comment></comment></column>
<column name="active" type ="SMALLINT" size ="5" default ="1" notnull ="false" description="Aktiv"/> <column name="active" type ="SMALLINT" size ="5" default ="1" notnull ="false" description="Aktiv"/>
<column name="created_at" type ="DATE" size ="5" default ="" notnull ="false" description="Erzeugt am"/>
</columns> </columns>
<indexes> <indexes>
<index name="ix_qa_dbtest_id" type="unique"> <index name="ix_qa_dbtest_id" type="unique">
@ -744,7 +763,78 @@ notnull="false">
<privileges><rs> <privileges><rs>
</rs></privileges> </rs></privileges>
</table> </table>
<table name="qa_sos_stg_aggr_astat" caption="Amtl. Studierendenstatistik für QA" thema="Qualitätssicherung" typ="Hilfstabelle">
<columns><column name="hs_nr" type ="INTEGER" size ="10" default ="" notnull ="false" />
<column name="studiengang_nr" type ="SMALLINT" size ="5" default ="" notnull ="false" />
<column name="fach_nr" type ="SMALLINT" size ="5" default ="" notnull ="false" />
<column name="matrikel_nr" type ="INTEGER" size ="10" default ="" notnull ="false" />
<column name="geschlecht" type ="SMALLINT" size ="5" default ="" notnull ="false" />
<column name="ca12_staat" type ="SMALLINT" size ="5" default ="" notnull ="false" />
<column name="sem_rueck_beur_ein" type ="SMALLINT" size ="5" default ="" notnull ="false" />
<column name="stg" type ="CHAR" size ="4" default ="" notnull ="false" />
<column name="abschluss" type ="CHAR" size ="2" default ="" notnull ="false" />
<column name="fgr" type ="CHAR" size ="10" default ="" notnull ="false" />
<column name="abgrp" type ="CHAR" size ="255" default ="" notnull ="false" />
<column name="regel" type ="SMALLINT" size ="5" default ="" notnull ="false" />
<column name="kz_rueck_beur_ein" type ="SMALLINT" size ="5" default ="" notnull ="false" />
<column name="fach_sem_zahl" type ="SMALLINT" size ="5" default ="" notnull ="false" />
<column name="hssem" type ="SMALLINT" size ="5" default ="" notnull ="false" />
<column name="stort" type ="CHAR" size ="10" default ="" notnull ="false" />
<column name="stuart" type ="CHAR" size ="10" default ="" notnull ="false" />
<column name="stufrm" type ="CHAR" size ="10" default ="" notnull ="false" />
<column name="hzbart_astat" type ="CHAR" size ="10" default ="" notnull ="false" />
<column name="hzbkfzkz" type ="CHAR" size ="2" default ="" notnull ="false" />
<column name="hrst" type ="INTEGER" size ="10" default ="" notnull ="false" />
<column name="letzte_pruefung_stort" type ="CHAR" size ="10" default ="" notnull ="false" />
<column name="letzte_pruefung_staat" type ="SMALLINT" size ="5" default ="" notnull ="false" />
<column name="letzte_pruefung_abschluss" type ="CHAR" size ="2" default ="" notnull ="false" />
<column name="letzte_pruefung_ergebnis" type ="SMALLINT" size ="5" default ="" notnull ="false" />
<column name="vorletzte_pruefung_stort" type ="CHAR" size ="10" default ="" notnull ="false" />
<column name="vorletzte_pruefung_staat" type ="SMALLINT" size ="5" default ="" notnull ="false" />
<column name="vorletzte_pruefung_abschluss" type ="CHAR" size ="2" default ="" notnull ="false" />
<column name="vorletzte_pruefung_ergebnis" type ="SMALLINT" size ="5" default ="" notnull ="false" />
<column name="datum" type ="DATE" size ="13" default ="" notnull ="false" />
<column name="summe" type ="INTEGER" size ="10" default ="" notnull ="false" />
</columns>
<indexes></indexes>
<primaryKeys><rs>
</rs></primaryKeys>
<foreignKeys><rs>
</rs></foreignKeys>
<importedKeys><rs>
</rs></importedKeys>
<privileges><rs>
</rs></privileges>
</table>
<table name="qa_sos_stg_aggr_int" caption="Interne Studierendenstatistik für QA" thema="Qualitätssicherung" typ="Hilfstabelle">
<columns><column name="ca12_staat" type ="SMALLINT" size ="5" default ="" notnull ="false" />
<column name="geschlecht" type ="SMALLINT" size ="5" default ="" notnull ="false" />
<column name="hrst" type ="INTEGER" size ="10" default ="" notnull ="false" />
<column name="studiengang_nr" type ="SMALLINT" size ="5" default ="" notnull ="false" />
<column name="fach_nr" type ="SMALLINT" size ="5" default ="" notnull ="false" />
<column name="fach_sem_zahl" type ="SMALLINT" size ="5" default ="" notnull ="false" />
<column name="sem_rueck_beur_ein" type ="SMALLINT" size ="5" default ="" notnull ="false" />
<column name="kz_rueck_beur_ein" type ="SMALLINT" size ="5" default ="" notnull ="false" />
<column name="hssem" type ="SMALLINT" size ="5" default ="" notnull ="false" />
<column name="stuart" type ="CHAR" size ="10" default ="" notnull ="false" />
<column name="stutyp" type ="CHAR" size ="10" default ="" notnull ="false" />
<column name="stufrm" type ="CHAR" size ="10" default ="" notnull ="false" />
<column name="summe" type ="NUMERIC" size ="(19,6)" default ="" notnull ="false" />
<column name="matrikel_nr" type ="INTEGER" size ="10" default ="" notnull ="false" />
<column name="stg" type ="CHAR" size ="10" default ="" notnull ="false" />
<column name="abschluss" type ="CHAR" size ="10" default ="" notnull ="false" />
<column name="stichtag" type ="INTEGER" size ="10" default ="" notnull ="false" />
</columns>
<indexes></indexes>
<primaryKeys><rs>
</rs></primaryKeys>
<foreignKeys><rs>
</rs></foreignKeys>
<importedKeys><rs>
</rs></importedKeys>
<privileges><rs>
</rs></privileges>
</table>
<views> <views>
<view name="qa_k_priority" version="0.6"> <view name="qa_k_priority" version="0.6">
<description>View PO-Version</description> <description>View PO-Version</description>
@ -814,6 +904,12 @@ parent="Qualitätssicherung">Abfragen zur Administration</thema>
<path>$QA_PFAD/masken</path> <path>$QA_PFAD/masken</path>
</src> </src>
</maske> </maske>
<maske tid="37180" name="Tabellen-Abgleich Differenzen" thema="Administration Qualitätssicherung">
<description>Detailabfrage zur Anzeige von Differenzen</description>
<src>
<path>$QA_PFAD/masken</path>
</src>
</maske>
</masken> </masken>
<data-integrity> <data-integrity>
<!-- qa_mask_execution --> <!-- qa_mask_execution -->
@ -979,6 +1075,10 @@ format="%s">
<!-- ********************* Liste der ETL-Prozesse ************************** --> <!-- ********************* Liste der ETL-Prozesse ************************** -->
<etl> <etl>
<etl-step name="Load" type="load">
<action>
</action>
</etl-step>
<etl-step name="Transformation" type="trans"> <etl-step name="Transformation" type="trans">
<action> <action>
<nativeaction sql="" scriptfile="$QA_PFAD/schluesseltabellen/qa_mask_execution_update.sql" <nativeaction sql="" scriptfile="$QA_PFAD/schluesseltabellen/qa_mask_execution_update.sql"
@ -991,7 +1091,14 @@ format="%s">
database=""/> database=""/>
<nativeaction sql="update systeminfo set datum=today() where tid in (260);" scriptfile="" database=""/> <nativeaction sql="update systeminfo set datum=today() where tid in (260);" scriptfile="" database=""/>
</action> </action>
<action error="stop"> </etl-step>
<etl-step name="Aggregation" type="aggr">
<action>
<nativeaction sql="" scriptfile="$QA_PFAD/hilfstabellen/qa_sos_stg_aggr_astat_fuellen.sql"
database=""/>
<nativeaction sql="" scriptfile="$QA_PFAD/hilfstabellen/qa_sos_stg_aggr_int_fuellen.sql"
database=""/>
<nativeaction sql="" scriptfile="$QA_PFAD/datentabellen/vacuum_pg.sql" <nativeaction sql="" scriptfile="$QA_PFAD/datentabellen/vacuum_pg.sql"
database="POSTGRES"/> database="POSTGRES"/>
</action> </action>
@ -1004,7 +1111,8 @@ format="%s">
<nativeaction sql="" scriptfile="$QA_PFAD/schluesseltabellen/sx_jobs_fuellen.sql" database=""/> <nativeaction sql="" scriptfile="$QA_PFAD/schluesseltabellen/sx_jobs_fuellen.sql" database=""/>
<nativeaction sql="" scriptfile="$QA_PFAD/schluesseltabellen/sx_stylesheets_einfuegen.sql" database=""/> <nativeaction sql="" scriptfile="$QA_PFAD/schluesseltabellen/sx_stylesheets_einfuegen.sql" database=""/>
<nativeaction sql="" scriptfile="$QA_PFAD/schluesseltabellen/sachgebiete_fuellen.sql" database=""/> <nativeaction sql="" scriptfile="$QA_PFAD/schluesseltabellen/sachgebiete_fuellen.sql" database=""/>
<!--<nativeaction sql="" scriptfile="$QA_PFAD/schluesseltabellen/qa_tablecomp_profile_sos_stud_astat_nach_fach_abschluss_s0_fuellen.sql" database=""/>-->
<nativeaction sql="" scriptfile="$QA_PFAD/schluesseltabellen/qa_tablecomp_profile_sos_stud_astat_nach_fach_abschluss_s1_fuellen.sql" database=""/>
</action> </action>
</install-step> </install-step>
</install> </install>
@ -1016,6 +1124,8 @@ format="%s">
<nativeaction sql="" scriptfile="$QA_PFAD/schluesseltabellen/sx_jobs_fuellen.sql" database=""/> <nativeaction sql="" scriptfile="$QA_PFAD/schluesseltabellen/sx_jobs_fuellen.sql" database=""/>
<nativeaction sql="" scriptfile="$QA_PFAD/schluesseltabellen/sx_stylesheets_einfuegen.sql" database=""/> <nativeaction sql="" scriptfile="$QA_PFAD/schluesseltabellen/sx_stylesheets_einfuegen.sql" database=""/>
<nativeaction sql="" scriptfile="$QA_PFAD/schluesseltabellen/sachgebiete_fuellen.sql" database=""/> <nativeaction sql="" scriptfile="$QA_PFAD/schluesseltabellen/sachgebiete_fuellen.sql" database=""/>
<!--<nativeaction sql="" scriptfile="$QA_PFAD/schluesseltabellen/qa_tablecomp_profile_sos_stud_astat_nach_fach_abschluss_s0_fuellen.sql" database=""/>-->
<nativeaction sql="" scriptfile="$QA_PFAD/schluesseltabellen/qa_tablecomp_profile_sos_stud_astat_nach_fach_abschluss_s1_fuellen.sql" database=""/>
<nativeaction sql="" scriptfile="$QA_PFAD/upgrade/qa_upgrade_man.sql" database=""/> <nativeaction sql="" scriptfile="$QA_PFAD/upgrade/qa_upgrade_man.sql" database=""/>
</action> </action>

3
src-modules/module/qa/datentabellen/vacuum_pg.sql

@ -8,4 +8,5 @@ commit;
vacuum qa_mask_execution_result; vacuum qa_mask_execution_result;
vacuum qa_mask_execution_assert_result; vacuum qa_mask_execution_assert_result;
vacuum qa_sos_stg_aggr_int;
vacuum qa_sos_stg_aggr_astat;

355
src-modules/module/qa/hilfstabellen/qa_sos_stg_aggr_astat_fuellen.sql

@ -0,0 +1,355 @@
--(c) 2024 Daniel Quathamer
--freemarker template
<sqlvars>
<sqlvar name="sos_stg_aggr_exists">
select sp_table_exists('sos_stg_aggr') from xdummy
</sqlvar>
<sqlvar name="qa_tablecomp_profile_is_active"><![CDATA[
select 1 from xdummy where 0 < (select count(*) from qa_tablecomp_profile P where P.uniquename='sos_stud_astat' and is_active=1)
union
select 0 from xdummy where 0 = (select count(*) from qa_tablecomp_profile P where P.uniquename='sos_stud_astat' and is_active=1)
]]></sqlvar>
</sqlvars>
<#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,
</#foreach>
</#if>
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}),
</#foreach>
</#if>
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
</#if>
;
</#foreach>
--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,
</#foreach>
</#if>
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}),
</#foreach>
</#if>
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
</#if>
;
</#foreach>
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;
</#if>

63
src-modules/module/qa/hilfstabellen/qa_sos_stg_aggr_int_fuellen.sql

@ -0,0 +1,63 @@
--(c) 2024 Daniel Quathamer
--freemarker template
<sqlvars>
<sqlvar name="sos_stg_aggr_exists">
select sp_table_exists('sos_stg_aggr') from xdummy
</sqlvar>
<sqlvar name="qa_tablecomp_profile_is_active"><![CDATA[
select 1 from xdummy where 0 < (select count(*) from qa_tablecomp_profile P where P.uniquename='sos_stud_astat' and is_active=1)
union
select 0 from xdummy where 0 = (select count(*) from qa_tablecomp_profile P where P.uniquename='sos_stud_astat' and is_active=1)
]]></sqlvar>
</sqlvars>
<#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
;
</#if>

14
src-modules/module/qa/masken/37060_felderinfo.unl

@ -1,16 +1,16 @@
37060^Benutzer/in^60^0^0^150^200^1^integer^200^0^1^<<SQL>> select tid,nvl(name,benutzer) from userinfo order by 2;^hidden^^ 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^<<SQL>> select 0,'Erfolgreich' from xdummy union select 1,'Warnung' from xdummy order by 1^ ^ ^ 37061^Ausführungs-Status^0^0^0^150^80^1^integer^200^0^1^<<SQL>> 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^<<SQL>> select 1,'Nur Summen' from xdummy\ 37062^Aggregation des Vergleichs^10^0^0^150^80^1^integer^200^1^1^<<SQL>> select 1,'Summen' from xdummy\
union select 2,'Felder' from xdummy\ union select 2,'Datensätze' from xdummy\
--union select 3,'Matrikelnr.' from xdummy\ union select 3,'Felder' from xdummy\
order by 1;^^<<SQL>> select 1,'Nur Summen' from xdummy^ order by 1;^ ^<<SQL>> select 1,'Summen' from xdummy^
37063^Testfall-Name (Stichwort)^50^0^0^150^150^1^sql^50^0^0^^ ^ ^ 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^<<SQL>> select 'A','A (höchste Priorität)' from xdummy union \ 37064^Priorität beim Feldabgleich^20^0^0^150^200^1^char^200^0^1^<<SQL>> select 'A','A (höchste Priorität)' from xdummy union \
select 'B','B (mittlere Priorität)' from xdummy union \ select 'B','B (mittlere Priorität)' from xdummy union \
select 'C','C (niedrige Priorität)' from xdummy\ 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^<<SQL>> select 1,'Ja' from xdummy union select 0,'nein' from xdummy order by 1 desc;^hidden^<<SQL>>select 1,'Ja' from xdummy^ 37065^Nur aktive^30^0^0^150^80^1^integer^200^0^1^<<SQL>> select 1,'Ja' from xdummy union select 0,'nein' from xdummy order by 1 desc;^hidden^<<SQL>>select 1,'Ja' from xdummy^
37066^Ab Datum^40^0^0^150^80^1^date^200^0^0^ ^hidden^<<SQL>> select today()-3 from xdummy^ 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^<<SQL>> select tid,name from qa_tablecomp_profile where is_active=1 order by 2^ ^ ^ 37067^Profil^5^0^0^150^80^1^integer^200^1^1^<<SQL>> 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^^ ^<<SQL>>\ 37068^Tabellen-Abgleiche planen^100^0^0^150^300^1^char^30^0^18^^ ^<<SQL>>\
--freemarker template \ --freemarker template \

336
src-modules/module/qa/masken/37060_maskeninfo.unl

@ -1,7 +1,7 @@
37060^Tabellen-Abgleich^--Freemarker Template\ 37060^Tabellen-Abgleich^--Freemarker Template\
<sqlvars>\ <sqlvars>\
\ \
<sqlvar name="profiles" type="hashsequence">\ <sqlvar name="profile" type="hash">\
\ \
select name,\ select name,\
uniquename,\ uniquename,\
@ -10,7 +10,10 @@ select name,\
table_2,\ table_2,\
table_2_caption,\ table_2_caption,\
is_active,\ is_active,\
systeminfo_id\ systeminfo_id,\
table_1_filter,\
table_2_filter\
\
FROM qa_tablecomp_profile \ FROM qa_tablecomp_profile \
where tid=<<Profil>> \ where tid=<<Profil>> \
\ \
@ -30,22 +33,24 @@ select name,\
\ \
select name,\ select name,\
priority,\ priority,\
sortnr\ sortnr,\
caption\
FROM qa_tablecomp_field \ FROM qa_tablecomp_field \
where qa_tablecomp_profile_id=<<Profil>>\ where qa_tablecomp_profile_id=<<Profil>>\
order by sortnr\ order by sortnr\
</sqlvar> \ </sqlvar> \
<sqlvar name="groupbycols" type="hashsequence">\ -- Darf nur 1 Spalte sein!\
\ <sqlvar name="groupbycol" type="hash">\
SELECT fieldname\ SELECT fieldname,\
fieldcaption\
FROM qa_tablecomp_groupby \ FROM qa_tablecomp_groupby \
where qa_tablecomp_profile_id=<<Profil>>\ where qa_tablecomp_profile_id=<<Profil>>\
\
</sqlvar> \ </sqlvar> \
<sqlvar name="idcols" type="hashsequence">\
\ \
<sqlvar name="idcols" type="hashsequence">\
SELECT \ SELECT \
fieldname\ fieldname,\
fieldcaption\
FROM qa_tablecomp_idcol \ FROM qa_tablecomp_idcol \
where qa_tablecomp_profile_id=<<Profil>>\ where qa_tablecomp_profile_id=<<Profil>>\
\ \
@ -56,41 +61,73 @@ where qa_tablecomp_profile_id=<<Profil>>\
\ \
\ \
<#assign prio_filter="" />\ <#assign prio_filter="" />\
/* <#assign prio_filter=<<Priorität>> /> */\ /* <#assign prio_filter=<<Priorität beim Feldabgleich>> /> */\
\ \
\ \
<#assign aggregation="<<Aggregation des Vergleichs>>" />\ <#assign aggregation="<<Aggregation des Vergleichs>>" />\
\ \
create temp table tmp_abgleich\ create temp table tmp_abgleich\
(semester integer,\ (zeitraum integer,\
prio char(1),\ prio char(1),\
ord smallint,\ ord smallint,\
pruefung varchar(255),\ pruefung varchar(255),\
comparison varchar(255),\ comparison varchar(255),\
fieldname varchar(255),\ fieldname varchar(255),\
fieldcaption varchar(255),\
result_table_1 varchar(255),\ result_table_1 varchar(255),\
result_table_2 varchar(255),\ result_table_2 varchar(255),\
result_code smallint,\ 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\ create temp table tmp_abgleich_summen\
(semester integer,\ (zeitraum integer,\
prio char(1),\
ord smallint,\ ord smallint,\
pruefung varchar(255),\ pruefung varchar(255),\
comparison varchar(255),\ comparison varchar(255),\
fieldname varchar(255),\ fieldname varchar(255),\
fieldcaption varchar(255),\
result_table_1 varchar(255),\ result_table_1 varchar(255),\
result_table_2 varchar(255),\ result_table_2 varchar(255),\
result_code smallint\ 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),\
</#foreach>\
result_table_1 varchar(255),\
result_table_2 varchar(255),\
result_code smallint,\
result_code_str varchar(255)\
);\
\
<#assign ord=0 />\ <#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>\
<#if "<<Zeitraum>>"!="">\
and ${groupbycol.fieldname}=<<Zeitraum>>\
</#if>\
;\
select * into temp tmp_table_2\
from ${profile.table_2} \
where 1=1\
<#if profile.table_2_filter !=""> and ${profile.table_2_filter} </#if>\
<#if "<<Zeitraum>>"!="">\
and ${groupbycol.fieldname}=<<Zeitraum>>\
</#if>\
;\
\ \
<#if aggregation=="1">\ <#if aggregation=="1">\
--summen:\
<#foreach pruefung in pruefungen>\ <#foreach pruefung in pruefungen>\
<#if pruefung.priority!="P" && (pruefung.priority==prio_filter || prio_filter=="")>\ <#if pruefung.priority!="P" && (pruefung.priority==prio_filter || prio_filter=="")>\
\ \
@ -98,62 +135,51 @@ result_code smallint\
\ \
\ \
insert into tmp_abgleich_summen\ insert into tmp_abgleich_summen\
(semester,\ (zeitraum,\
prio,\
ord,\ ord,\
pruefung,\ pruefung,\
comparison,\ comparison,\
result_table_1,\ result_table_1,\
result_table_2\ result_table_2\
)\ )\
select <#foreach groupbycol in groupbycols>\ select ${groupbycol.fieldname},\
${groupbycol.fieldname},\
</#foreach>\
'${pruefung.priority}',\
${ord},\ ${ord},\
'${pruefung.name}',\ '${pruefung.name}',\
'${pruefung.aggregationfunction}',\ '${pruefung.aggregationfunction}',\
${pruefung.aggregationfunction}(${pruefung.aggregationfield})::integer,\ ${pruefung.aggregationfunction}(${pruefung.aggregationfield})::integer,\
0\ 0\
from ${profile.table_1}\ from tmp_table_1\
where ${pruefung.whereclause}\ where 1=1\
group by <#foreach groupbycol in groupbycols>\ <#if pruefung.whereclause !=""> and ${pruefung.whereclause} </#if>\
${groupbycol.fieldname},\ group by ${groupbycol.fieldname}\
</#foreach>\
null::char(1)\
;\ ;\
\ \
insert into tmp_abgleich_summen\ insert into tmp_abgleich_summen\
(semester,\ (zeitraum,\
prio,\
ord,\ ord,\
pruefung,\ pruefung,\
comparison,\ comparison,\
result_table_1,\ result_table_1,\
result_table_2\ result_table_2\
)\ )\
select <#foreach groupbycol in groupbycols>\ select ${groupbycol.fieldname},\
${groupbycol.fieldname},\
</#foreach>\
'${pruefung.priority}',\
${ord},\ ${ord},\
'${pruefung.name}',\ '${pruefung.name}',\
'${pruefung.aggregationfunction}',\ '${pruefung.aggregationfunction}',\
0,\ 0,\
${pruefung.aggregationfunction}(${pruefung.aggregationfield})::integer\ ${pruefung.aggregationfunction}(${pruefung.aggregationfield})::integer\
from ${profile.table_2}\ from tmp_table_2\
where ${pruefung.whereclause}\ where 1=1\
group by <#foreach groupbycol in groupbycols>\ <#if pruefung.whereclause !=""> and ${pruefung.whereclause} </#if>\
${groupbycol.fieldname},\ group by ${groupbycol.fieldname}\
</#foreach>\ ;\
null::char(1);\
\ \
</#if> --vom prio-Filter\ </#if> --vom prio-Filter\
</#foreach>\ </#foreach>\
\ \
insert into tmp_abgleich\ insert into tmp_abgleich\
(semester,\ (zeitraum,\
prio,\ --prio,\
ord,\ ord,\
pruefung,\ pruefung,\
comparison,\ comparison,\
@ -161,8 +187,7 @@ result_table_1,\
result_table_2,\ result_table_2,\
result_code\ result_code\
)\ )\
select semester,\ select zeitraum,\
prio,\
ord,\ ord,\
pruefung,\ pruefung,\
comparison,\ comparison,\
@ -171,7 +196,7 @@ sum(val(result_table_2)),\
1\ 1\
from tmp_abgleich_summen\ from tmp_abgleich_summen\
--where comparison='Summe'\ --where comparison='Summe'\
group by 1,2,3,4,5;\ group by 1,2,3,4;\
\ \
update tmp_abgleich set result_code=0\ update tmp_abgleich set result_code=0\
where val(result_table_2) =val(result_table_1);\ where val(result_table_2) =val(result_table_1);\
@ -179,44 +204,133 @@ where val(result_table_2) =val(result_table_1);\
\ \
</#if> --wenn aggregation=Summen\ </#if> --wenn aggregation=Summen\
\ \
drop table tmp_abgleich_summen;\
\
\ \
<#if aggregation=="2">\ <#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} ,\
</#foreach>\
result_table_1 ,\
--result_table_2 ,\
result_code )\
select T1.${groupbycol.fieldname},\
'Datensatz-Abgleich',\
'Existenz',\
<#foreach idcol in idcols>\
T1.${idcol.fieldname} ,\
</#foreach>\
'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}\
</#foreach>\
)\
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} ,\
</#foreach>\
--result_table_1 ,\
result_table_2 ,\
result_code )\
select T1.${groupbycol.fieldname},\
'Datensatz-Abgleich',\
'Existenz',\
<#foreach idcol in idcols>\
T1.${idcol.fieldname} ,\
</#foreach>\
'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}\
</#foreach>\
)\
where T2.${groupbycol.fieldname} is null\
;\
\
--in beiden Tabellen vorhanden:\
insert into tmp_abgleich_ds\
(zeitraum ,\
pruefung,\
comparison,\
<#foreach idcol in idcols>\
${idcol.fieldname} ,\
</#foreach>\
result_table_1 ,\
result_table_2 ,\
result_code )\
select T1.${groupbycol.fieldname},\
'Datensatz-Abgleich',\
'Existenz',\
<#foreach idcol in idcols>\
T1.${idcol.fieldname} ,\
</#foreach>\
'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}\
</#foreach>\
)\
;\
\
\
</#if> --von Aggregation=2\
\
<#if aggregation=="3">\
--felder:\
<#foreach field in fields>\ <#foreach field in fields>\
<#if field.priority!="P" && (field.priority==prio_filter || prio_filter=="")>\ <#if field.priority!="P" && (field.priority==prio_filter || prio_filter=="")>\
\ \
<#assign ord=ord+1 />\ <#assign ord=ord+1 />\
\ \
insert into tmp_abgleich\ insert into tmp_abgleich\
(semester,\ (zeitraum,\
prio,\ prio,\
ord,\ ord,\
pruefung,\ pruefung,\
comparison,\ comparison,\
fieldname,\ fieldname,\
fieldcaption,\
result_table_1,\ result_table_1,\
result_table_2,\ result_table_2,\
result_code\ result_code\
)\ )\
select <#foreach groupbycol in groupbycols>\ select T1.${groupbycol.fieldname},\
T1.${groupbycol.fieldname},\
</#foreach>\
'${field.priority}',\ '${field.priority}',\
${ord},\ ${ord},\
'Feld-Abgleich',\ 'Feld-Abgleich',\
'Gleichheit',\ 'Gleichheit',\
'${field.name}',\ '${field.name}',\
'${field.caption}',\
T1.${field.name},\ T1.${field.name},\
T2.${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\ 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>\ on (1=1 <#foreach idcol in idcols>\
and T1.${idcol.fieldname}=T2.${idcol.fieldname}\ and T1.${idcol.fieldname}=T2.${idcol.fieldname}\
</#foreach>\ </#foreach>\
)\ )\
where 1=1\ where 1=1\
<#if "<<Zeitraum>>"!="">\
and T1.${groupbycol.fieldname}=<<Zeitraum>>\
</#if>\
;\ ;\
\ \
</#if> --vom prio-Filter\ </#if> --vom prio-Filter\
@ -224,74 +338,84 @@ where 1=1\
</#foreach>\ </#foreach>\
</#if> --wenn aggregation=Felder\ </#if> --wenn aggregation=Felder\
\ \
</#foreach> --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=<<Profil>>&Zeitraum='||zeitraum||'&Feld='||fieldname||'&cachingcontrol=clearmask&navi=true' \
where result_code!=0;\ where result_code!=0;\
\ \
update tmp_abgleich set result_code_str='Erfolg'\ update tmp_abgleich set result_code_str='Erfolg'\
where result_code=0;\ where result_code=0;\
\ \
drop table tmp_table_1;\
drop table tmp_table_2;\
\
<#if aggregation="1">\ <#if aggregation="1">\
select ord,\ select ord,\
prio,\
pruefung,\ pruefung,\
semester,\ zeitraum,\
comparison,\ comparison,\
result_table_1,\ result_table_1,\
result_table_2,\ result_table_2,\
result_code_str\ result_code_str,\
hidden_summe\
from tmp_abgleich\ from tmp_abgleich\
where 1=1\ where 1=1\
/* and <<Ausführungs-Status>>=result_code */\ /* and <<Ausführungs-Status>>=result_code */\
order by 1;\ order by 1;\
\
<#elseif aggregation=="2">\ <#elseif aggregation=="2">\
select ord,prio,pruefung,\ \
semester,\ update tmp_abgleich_ds set result_code_str='Differenz'\
null::integer as matrikel_nr,\ where result_code!=0 or result_code is null;\
fieldname,result_code_str,count(*)\ update tmp_abgleich_ds set result_code_str='Erfolg'\
where result_code=0;\
\
\
select \
pruefung,\
zeitraum,\
<#foreach idcol in idcols>\
${idcol.fieldname} ,\
</#foreach>\
result_table_1,\
result_table_2,\
result_code_str\
from tmp_abgleich_ds\
where 1=1\
/* and <<Ausführungs-Status>>=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\ from tmp_abgleich\
where 1=1\ where 1=1\
/* and <<Ausführungs-Status>>=result_code */\ /* and <<Ausführungs-Status>>=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;\ order by 1,2,3,4;\
</#if>^--Freemarker Template\ </#if>^--Freemarker Template\
<sqlvars>\
\
<sqlvar name="profile" type="hash">\
\ \
select name,\
uniquename,\
table_1,\
table_1_caption,\
table_2,\
table_2_caption,\
is_active,\
systeminfo_id\
FROM qa_tablecomp_profile \
where tid=<<Profil>> \
\
</sqlvar>\
</sqlvars>\
<#assign aggregation="<<Aggregation des Vergleichs>>" />\ <#assign aggregation="<<Aggregation des Vergleichs>>" />\
XIL List\ XIL List\
drop_and_delete movable_columns sizable_columns horizontal_scrolling\ drop_and_delete movable_columns sizable_columns horizontal_scrolling\
white_space_color=COLOR_WHITE fixed_columns=2\ white_space_color=COLOR_WHITE fixed_columns=2\
min_heading_height=35\ min_heading_height=35\
<#if aggregation="1">\
Column CID=0 heading_text="Nr." center_heading\ Column CID=0 heading_text="Nr." center_heading\
row_selectable col_selectable heading_platform readonly\ row_selectable col_selectable heading_platform readonly\
width=20 text_size=100\ 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\ Column CID=1 heading_text="Testfall" center_heading\
row_selectable col_selectable heading_platform readonly\ row_selectable col_selectable heading_platform readonly\
width=50 text_size=200\ 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\ row_selectable col_selectable heading_platform readonly\
width=50 text_size=200\ width=50 text_size=200\
<#if aggregation="1">\
Column CID=1 heading_text="Vergleich" center_heading\ Column CID=1 heading_text="Vergleich" center_heading\
row_selectable col_selectable heading_platform readonly\ row_selectable col_selectable heading_platform readonly\
width=50 text_size=200\ 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\ Column CID=1 heading_text="Status" center_heading\
row_selectable col_selectable heading_platform readonly\ row_selectable col_selectable heading_platform readonly\
width=10 text_size=200\ width=10 text_size=200\
<#elseif aggregation=="2">\ <#elseif aggregation="2">\
Column CID=1 heading_text="Matrikelnr." center_heading\ 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\ row_selectable col_selectable heading_platform readonly\
width=10 text_size=200\ width=10 text_size=200\
Column CID=1 heading_text="Feldname" center_heading\ </#foreach>\
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="Vorhanden ${profile.table_2_caption}" center_heading\
row_selectable col_selectable heading_platform readonly\ row_selectable col_selectable heading_platform readonly\
width=10 text_size=200\ width=10 text_size=200\
Column CID=1 heading_text="Ergebnis" center_heading\ 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\ row_selectable col_selectable heading_platform readonly\
width=10 text_size=200\ 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\ row_selectable col_selectable heading_platform readonly\
width=10 text_size=200\ 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\
</#if>\ </#if>\
@@@^^^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^^

11
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^<<SQL>> 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^<<SQL>> 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^<<SQL>> select name,caption from qa_tablecomp_field where qa_tablecomp_profile_id=<<Profil>> 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^<<SQL>> select 1,'Ja' from xdummy union select 0,'nein' from xdummy order by 1 desc;^hidden^<<SQL>>select 1,'Ja' from xdummy^
37186^Ab Datum^40^0^0^150^80^1^date^200^0^999^^hidden^<<SQL>> select today()-3 from xdummy^
37187^Profil^0^0^0^150^80^1^integer^200^1^1^<<SQL>> 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^^ ^<<SQL>>\
--freemarker template \
<#if UserIsAdmin> select '../edit/qa/qa_tablecomp_profile_list.jsp' from xdummy ;<#else> select '../not_authorized.htm' from xdummy;</#if>^

1
src-modules/module/qa/masken/37180_maske_system_bez.unl

@ -0,0 +1 @@
37180^260^

9
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^

75
src-modules/module/qa/masken/37180_maskeninfo.unl

@ -0,0 +1,75 @@
37180^Tabellen-Abgleich Differenzen^--Freemarker Template\
<sqlvars>\
\
<sqlvar name="profile" type="hash">\
select name,\
uniquename,\
table_1,\
table_1_caption,\
table_2,\
table_2_caption,\
is_active,\
systeminfo_id\
FROM qa_tablecomp_profile \
where tid=<<Profil>> \
\
</sqlvar>\
\
<sqlvar name="idcols" type="hashsequence">\
SELECT \
fieldname,\
fieldcaption\
FROM qa_tablecomp_idcol \
where qa_tablecomp_profile_id=<<Profil>>\
\
</sqlvar> \
<sqlvar name="groupbycols" type="hashsequence">\
SELECT fieldname\
FROM qa_tablecomp_groupby \
where qa_tablecomp_profile_id=<<Profil>>\
</sqlvar> \
<sqlvar name="vergleichsfeld" type="hash">\
SELECT name,\
caption\
FROM qa_tablecomp_field\
where qa_tablecomp_profile_id=<<Profil>>\
and name=<<Feld>>;\
\
</sqlvar> \
</sqlvars>\
\
\
select distinct <#foreach idcol in idcols>T1.${idcol.fieldname},</#foreach>\
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}\
</#foreach>\
)\
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 "<<Zeitraum>>"!="">\
<#foreach groupbycol in groupbycols>\
and T1.${groupbycol.fieldname}=<<Zeitraum>>\
</#foreach>\
</#if>\
order by <#list 1..idcols?size as i>${i},</#list> ${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\
</#foreach>\
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^^

1
src-modules/module/qa/masken/37180_sachgeb_maske_bez.unl

@ -0,0 +1 @@
260^37180^

141
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}';
</#foreach>
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>
<#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}';
</#foreach>
--Ende Profil
</#foreach>

141
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}';
</#foreach>
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>
<#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}';
</#foreach>
--Ende Profil
</#foreach>

141
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}';
</#foreach>
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>
<#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}';
</#foreach>
--Ende Profil
</#foreach>

5
src-modules/module/qa/upgrade/qa_upgrade_man.sql

@ -13,3 +13,8 @@ where assert_result_value_max is null;
--Obsolete Maske: --Obsolete Maske:
delete from themenbaum where maskeninfo_id=37100; 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;

Loading…
Cancel
Save