Daniel Quathamer
7 months ago
15 changed files with 1318 additions and 108 deletions
@ -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> |
@ -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> |
||||||
|
|
@ -1,17 +1,17 @@ |
|||||||
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 \ |
||||||
<#if UserIsAdmin> select '../edit/qa/qa_tablecomp_profile_list.jsp' from xdummy ;<#else> select '../not_authorized.htm' from xdummy;</#if>^ |
<#if UserIsAdmin> select '../edit/qa/qa_tablecomp_profile_list.jsp' from xdummy ;<#else> select '../not_authorized.htm' from xdummy;</#if>^ |
||||||
|
@ -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>^ |
@ -0,0 +1 @@ |
|||||||
|
37180^260^ |
@ -0,0 +1,9 @@ |
|||||||
|
37180^37180^ |
||||||
|
37180^37181^ |
||||||
|
37180^37182^ |
||||||
|
37180^37183^ |
||||||
|
37180^37184^ |
||||||
|
37180^37185^ |
||||||
|
37180^37186^ |
||||||
|
37180^37187^ |
||||||
|
37180^37188^ |
@ -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^^ |
@ -0,0 +1 @@ |
|||||||
|
260^37180^ |
@ -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> |
@ -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> |
@ -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> |
Loading…
Reference in new issue