Browse Source

TSG Generierung Korrektur stgnr, Bewerbungen Datenblatt left outer join #16

basisressourcen
Daniel Quathamer 10 months ago
parent
commit
5a57bb716e
  1. 277
      src-modules/module/costage/hilfstabellen/costage_st_studien_aggr_fuellen.sql
  2. 36
      src-modules/module/costage/masken/43110_felderinfo.unl
  3. 112
      src-modules/module/costage/masken/43110_maskeninfo.unl

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

@ -341,69 +341,107 @@ select 70,timestamp_str(now()) from xdummy; @@ -341,69 +341,107 @@ select 70,timestamp_str(now()) from xdummy;
<#if K_COSTAGE_TSG_GENERATE == 1>
select T.*,M.st_studiengang_nr_msg as st_studiengang_nr_msg_possible,ST.st_studium_nr as st_studium_nr_msg_possible
into temp tmp_studien3
from tmp_studien2 T, costage_st_studiengaenge_mtsg M, costage_st_studien ST
--was ist das min/max. Semester eines TSG?
select T.st_studiengang_nr as st_studiengang_nr_tsg,
T.st_studstamm_nr,
null::integer as st_studiengang_nr_msg_end,
--M.st_studiengang_nr_msg as st_studiengang_nr_msg_end,
min(ST.semester) as startsemester,max(ST.semester) as endsemester
into temp tmp_studien_msg_tsg
from
tmp_studien2 T, costage_st_studiengaenge_mtsg M, tmp_studien ST --costage_st_studien ST
where ST.st_studiengang_nr=M.st_studiengang_nr_msg
and ST.st_studstamm_nr=T.st_studstamm_nr
and M.st_studiengang_nr_tsg=T.st_studiengang_nr
and T.studiengangs_typ_kb ='TSG'
and ST.studiengangs_typ_kb ='MSG'
and ST.studienstatustyp in ('U','B','E','I','X','Z') --nur tatsächlich eingeschrieben
and ST.status_historie=1
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,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51
;
--Start- und Endsemester aller MSG pro Student:
drop table if exists tmp_studien_msg;
select T.st_studiengang_nr as st_studiengang_nr_msg,
T.st_studstamm_nr,
min(T.semester) as startsemester,
max(T.semester) as endsemester
into temp tmp_studien_msg
from tmp_studien T
where T.studienstatustyp in ('U','B','E','I','X','Z') --nur tatsächlich eingeschrieben
and T.studiengangs_typ_kb ='MSG'--enthält die MSG
and T.status_historie=1
group by 1,2
;
--Verknüpfung mit TSG über alle möglichen Semester:
drop table if exists tmp_studien_msg_tsg;
select distinct
G.studiengangs_identifikator as studiengangs_identifikator_msg,
M.st_studiengang_nr_msg,
T.st_studiengang_nr as st_studiengang_nr_tsg,
M.st_studstamm_nr,
E.semester_tid as semester,
E.semester_anfang,
E.semester_ende,
E.st_sem_nr,
M.startsemester,
M.endsemester
into temp tmp_studien_msg_tsg
from costage_st_studiengaenge G,tmp_studien_msg M, tmp_studien3 T,costage_st_semester E
where G.st_studiengang_nr=M.st_studiengang_nr_msg
and M.st_studiengang_nr_msg=T.st_studiengang_nr_msg_possible
and M.st_studstamm_nr=T.st_studstamm_nr
--and T.semester between M.startsemester and M.endsemester
and E.semester_tid between M.startsemester and M.endsemester
and T.studiengangs_typ_kb ='TSG'
--letzten MSG zuweisen:
update tmp_studien_msg_tsg set st_studiengang_nr_msg_end=ST.st_studiengang_nr
from costage_st_studiengaenge_mtsg M, tmp_studien ST
where ST.st_studiengang_nr=M.st_studiengang_nr_msg
and M.st_studiengang_nr_tsg=tmp_studien_msg_tsg.st_studiengang_nr_tsg
and ST.st_studstamm_nr=tmp_studien_msg_tsg.st_studstamm_nr
and ST.semester = tmp_studien_msg_tsg.endsemester
and ST.studiengangs_typ_kb ='MSG'
and ST.studienstatustyp in ('U','B','E','I','X','Z') --nur tatsächlich eingeschrieben
and ST.status_historie=1
;
select 100,timestamp_str(now()) from xdummy;
--nun fehlende Datensätze ermitteln:
drop table if exists tmp_studien_msg_tsg_fehlend;
select T.*
select distinct S.semester_tid as semester,
S.semester_anfang,
S.semester_ende,
S.st_sem_nr,
T.st_studstamm_nr,
T.st_studiengang_nr_tsg,
T.st_studiengang_nr_msg_end
into temp tmp_studien_msg_tsg_fehlend
from tmp_studien_msg_tsg T --enthält alle möglichen TSG
from costage_st_semester S inner join tmp_studien_msg_tsg T on (S.semester_tid between T.startsemester and T.endsemester) --enthält alle möglichen TSG
left outer join tmp_studien2 T2 --enthält die tatsächlich vorhandenen TSG
on (--T2.st_studiengang_nr_msg=T.st_studiengang_nr_msg
--and
T2.st_studiengang_nr=T.st_studiengang_nr_tsg
on (T2.st_studiengang_nr=T.st_studiengang_nr_tsg
and T2.st_studstamm_nr=T.st_studstamm_nr
and T2.studiengangs_typ_kb ='TSG'
and T.semester=T2.semester)
where T2.st_studstamm_nr is null
and S.semester_tid=T2.semester)
where
T2.st_studstamm_nr is null
;
drop table if exists tmp_studien_msg_tsg_fehlend2;
--Studiengangsdaten des TSG nachladen:
select F.semester,
F.semester_anfang,
F.semester_ende,
T.st_absz_nr,
T.st_skz_nr,
T.studiengangs_identifikator,
T.studiengangs_bezeichnung,
F.st_sem_nr,
T.st_studium_nr,
T.st_studstamm_nr,
T.studiengangs_typ_kb,
T.matrikelnummer,
T.geschlecht,
T.ca12_staat,
T.second_nationality,
T.fachkennzeichen,
T.studienform_statistik_code,
--T.st_studiengang_nr_msg,
F.st_studiengang_nr_msg_end,
-- T.studiengangs_identifikator_msg,
T.st_studiengang_nr_tsg,
T.hrst,
T.hssem,
T.studienstatustyp,
T.statustyp_tsg,
1::integer as tsg_generated,
T.primaerflag,
T.hzb_art_nr,
T.hzb_land_sub_r_nr ,
T.hzb_jahr,
T.hzb_datum ,
T.hzb_note,
T.abm_art_s,
T.studienfach_sortierung,
max(T.semester) as letztes_tsg_semester,
max(T.fachsemester) as fachsemester
into temp tmp_studien_msg_tsg_fehlend2
from tmp_studien_msg_tsg_fehlend F, tmp_studien2 T
where F.st_studstamm_nr=T.st_studstamm_nr
and F.st_studiengang_nr_tsg=T.st_studiengang_nr_tsg
and T.abm_art_s 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,21,22,23,23,24,25,26,27,28,29,30,31,32 --,33
;
--fehlende Semester nachtragen:
insert into tmp_studien2(semester,
semester_anfang,
@ -417,7 +455,7 @@ st_studium_nr, @@ -417,7 +455,7 @@ st_studium_nr,
st_studstamm_nr,
st_studiengang_nr,
studiengangs_typ_kb,
--studienstatustyp,
studienstatustyp,
--st_studienstatus_nr,
--beginn_datum,
--gueltig_ab,
@ -442,108 +480,73 @@ hzb_datum , @@ -442,108 +480,73 @@ hzb_datum ,
hzb_note,
abm_art_s,
fachsemester,
studienfach_sortierung,
letztes_tsg_semester)
select M.semester,
M.semester_anfang,
M.semester_ende,
st_absz_nr,
S.st_skz_nr,
S.studiengangs_identifikator,
S.studiengangs_bezeichnung,
M.st_sem_nr,
S.st_studium_nr,
S.st_studstamm_nr,
S.st_studiengang_nr,
S.studiengangs_typ_kb,
--M.studienstatustyp_msg,
--M.st_studienstatus_nr_msg,
--M.beginn_datum,
--M.gueltig_ab,
S.matrikelnummer,
S.geschlecht,
S.ca12_staat,
S.second_nationality,
S.fachkennzeichen,
S.studienform_statistik_code,
M.st_studiengang_nr_msg,
M.studiengangs_identifikator_msg,
S.st_studiengang_nr_tsg,
null::char(10) as hrst,--hrst kann im Studienverlauf wechseln, daher nachher vom MSG nachladen
S.hssem,
null::char(10) as statustyp_tsg,
1 as tsg_generated,
select distinct semester,
semester_anfang,
semester_ende,
F.st_absz_nr,
F.st_skz_nr,
F.studiengangs_identifikator,
F.studiengangs_bezeichnung,
st_sem_nr,
st_studium_nr,
st_studstamm_nr,
st_studiengang_nr_tsg,
F.studiengangs_typ_kb,
studienstatustyp,
--st_studienstatus_nr,
--beginn_datum,
--gueltig_ab,
matrikelnummer,
geschlecht,
ca12_staat,
second_nationality,
F.fachkennzeichen,
studienform_statistik_code,
st_studiengang_nr_msg_end,
G.studiengangs_identifikator as studiengangs_identifikator_msg,
st_studiengang_nr_tsg,
hrst,
hssem,
'X' as statustyp_tsg, -- generierte TSG sind immer geschlossen S.statustyp_tsg,
1::integer as tsg_generated,
0 as primaerflag, --geschlossene TSG können kein Primärflag haben
S.hzb_art_nr,
S.hzb_land_sub_r_nr ,
S.hzb_jahr,
S.hzb_datum ,
S.hzb_note,
null::char(10) as abm_art_s,
null::integer as fachsemester,
max(S.semester)
from tmp_studien_msg_tsg_fehlend M, tmp_studien2 S, costage_st_studiengaenge_mtsg MT
where M.st_studiengang_nr_msg=MT.st_studiengang_nr_msg
and MT.st_studiengang_nr_tsg=M.st_studiengang_nr_tsg
and MT.st_studiengang_nr_tsg=S.st_studiengang_nr
and M.st_studstamm_nr=S.st_studstamm_nr
and S.studiengangs_typ_kb ='TSG'
and M.semester != S.semester
--and E.st_sem_nr=M.st_sem_nr
--and S.st_studiengang_nr_msg=34454
--and S.studiengangs_bezeichnung='Bildungswissenschaften'
--and M.semester=20211
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,23,24,25,26,27,28,29,30,31,32,33
;
hzb_art_nr,
hzb_land_sub_r_nr ,
hzb_jahr,
hzb_datum ,
hzb_note,
abm_art_s,
fachsemester,
studienfach_sortierung,
letztes_tsg_semester
from tmp_studien_msg_tsg_fehlend2 F, costage_st_studiengaenge G
where G.st_studiengang_nr=F.st_studiengang_nr_msg_end
;
select 110,timestamp_str(now()) from xdummy;
--statustyp und hrst nachladen:
update tmp_studien2 set studienstatustyp=S.studienstatustyp,
hrst=S.hrst
from tmp_studien S
where tmp_studien2.st_studiengang_nr_msg=S.st_studiengang_nr
and tmp_studien2.st_studstamm_nr=S.st_studstamm_nr
and S.studiengangs_typ_kb ='MSG'
and tmp_studien2.tsg_generated=1
and tmp_studien2.st_sem_nr=S.st_sem_nr
--Defaultmäßig den letzten Status im Semester nehmen (status_historie=1)
and S.status_historie=1
--Ausnahme: wenn der MSG bis zum Semesterende läuft und Status X hat,
--wird er auf den vorherigen Status gesetzt, weil der Studi
--bis Semesterende studiert hat
-- and (
-- (S.status_historie=1 and
-- (
-- S.gueltig_ab < S.semester_ende or (S.gueltig_ab >= S.semester_ende and S.studienstatustyp !='X')
-- )
-- )
-- or
-- (S.status_historie=2 and S.gueltig_ab < S.semester_ende)
-- )
;
-- update tmp_studien2 set studienstatustyp=S.studienstatustyp,
-- hrst=S.hrst
-- from tmp_studien S
-- where tmp_studien2.st_studiengang_nr_msg=S.st_studiengang_nr
-- and tmp_studien2.st_studstamm_nr=S.st_studstamm_nr
-- and S.studiengangs_typ_kb ='MSG'
-- and tmp_studien2.tsg_generated=1
-- and tmp_studien2.st_sem_nr=S.st_sem_nr
-- --Defaultmäßig den letzten Status im Semester nehmen (status_historie=1)
-- and S.status_historie=1
-- ;
select 120,timestamp_str(now()) from xdummy;
--statustyp_tsg nachladen:
update tmp_studien2 set statustyp_tsg='X' , -- generierte TSG sind immer geschlossen S.statustyp_tsg,
fachsemester=S.fachsemester,
abm_art_s=S.abm_art_s
from tmp_studien S
where tmp_studien2.st_studium_nr=S.st_studium_nr
and tmp_studien2.st_studstamm_nr=S.st_studstamm_nr
and S.studiengangs_typ_kb ='TSG'
and tmp_studien2.tsg_generated=1
and tmp_studien2.letztes_tsg_semester=S.semester
and S.status_historie=1
;
select 130,timestamp_str(now()) from xdummy;
drop table tmp_studien_msg_tsg_fehlend;
drop table tmp_studien_msg_tsg_fehlend2;
drop table tmp_studien_msg_tsg;
drop table tmp_studien_msg;
drop table tmp_studien3;
</#if>

36
src-modules/module/costage/masken/43110_felderinfo.unl

@ -3,29 +3,29 @@ @@ -3,29 +3,29 @@
select ${i},'${i}. Studiengang' from xdummy\
<#if i_has_next> union </#if>\
</#list>\
order by 1^ ^^
order by 1^ ^ ^
43111^Seit Semester^3^0^0^140^80^1^integer^30^0^1^<<SQL>> select semester_tid, semester_bezeichnung from costage_st_semester order by 1 DESC;^ ^<<SQL>> select semester_tid, semester_bezeichnung from costage_st_semester where today()-365 between date(semester_anfang) and date(semester_ende);^
43112^Studiengang^9^0^0^130^150^50^char^30^0^12^<<SQL>> select tid,name,sortnr from sichten where art in ('COSTAGE-Studiengang-Sicht') order by 3,2;^^^
43113^Staatsangehörigkeit^36^0^0^130^150^10^sql^30^0^1^<<SQL>> SELECT st_land_nr, name from costage_st_laender order by 2;^^^
43112^Studiengang^9^0^0^130^150^50^char^30^0^12^<<SQL>> select tid,name,sortnr from sichten where art in ('COSTAGE-Studiengang-Sicht') order by 3,2;^ ^ ^
43113^Staatsangehörigkeit^36^0^0^130^150^10^sql^30^0^1^<<SQL>> SELECT st_land_nr, name from costage_st_laender order by 2;^ ^ ^
43114^Zulassungsart^14^350^-1^140^180^1^integer^30^0^1^<<SQL>> select nr, name\
FROM costage_bw_zulassungsarten order by 2^^ ^
43115^Person-Nr.^25^350^-1^150^180^1^integer^200^0^0^^^^
FROM costage_bw_zulassungsarten order by 2^ ^ ^
43115^Person-Nr.^25^350^-1^150^180^1^integer^200^0^0^^ ^ ^
43116^Weitere Tabellen^123^0^0^140^140^10^char^30^0^1^<<SQL>> \
--freemarker template\
select name,string_not_null(caption) || ' - ' || name from sx_tables where name in ('costage_st_studierendenstammdaten','costage_dim_studiengang')\
<#if <<tablestylesheet>>!='tabelle_html_datenblatt.xsl'>\
and name in (select distinct tablename from stylesheet_field where stylesheet_id in (select tid from sx_stylesheets where filename=<<tablestylesheet>>)) \
</#if>\
order by 2^^^
43117^bis Fachsemester^20^350^-1^140^10^1^integer^30^0^0^ ^ ^ ^
order by 2^ ^ ^
43117^bis Fachsemester^20^350^-1^140^10^1^integer^30^0^0^^ ^ ^
43119^Bis Semester^4^350^-1^140^80^1^integer^30^0^1^<<SQL>> select semester_tid, semester_bezeichnung from costage_st_semester order by 1 DESC;^ ^<<SQL>> select semester_tid, semester_bezeichnung from costage_st_semester where today() between date(semester_anfang) and date(semester_ende);^
43120^Fach-Nr.^119^0^0^140^150^1^integer^20^0^13^<<SQL>> --Freemarker template\
<#list 1..10 as i>\
select ${i},'${i}. Fach' from xdummy\
<#if i_has_next> union </#if>\
</#list>\
order by 1^ ^^
43121^Geschlecht^37^0^0^140^80^1^integer^30^0^1^<<SQL>> SELECT apnr,druck FROM cif WHERE cif.key = 9003 order by 2;^^^
order by 1^ ^ ^
43121^Geschlecht^37^0^0^140^80^1^integer^30^0^1^<<SQL>> SELECT apnr,druck FROM cif WHERE cif.key = 9003 order by 2;^ ^ ^
43122^Felder^125^0^0^150^190^10^char^30^0^1^<<SQL>>\
--freemarker template\
select trim(F.table_name) || '.' || F.name,trim(T.caption) || ':' || trim(F.caption) || ' - ' || trim(F.name) from sx_fields F,\
@ -37,7 +37,7 @@ order by 1^ ^^ @@ -37,7 +37,7 @@ order by 1^ ^^
and trim(F.table_name) || '.' || F.name in (select trim(tablename)||'.'||trim(fieldname) from stylesheet_field where stylesheet_id in \
(select tid from sx_stylesheets where filename=<<tablestylesheet>>))\
</#if>\
order by 2;^^^
order by 2;^ ^ ^
43123^Fach^6^0^0^140^150^50^char^30^0^1^<<SQL>>\
SELECT \
skz_key,\
@ -45,20 +45,20 @@ SELECT \ @@ -45,20 +45,20 @@ SELECT \
FROM costage_st_studienkennzahlen\
/* where unikey=<<Hochschule>> */\
order by 2\
;^^^
43124^Schlüssel anzeigen^150^0^0^100^100^1^integer^30^1^1^<<SQL>> select 1,'Ja' from xdummy union select 0,'Nein' from xdummy^^<<SQL>> select 1,'Ja' from xdummy^
43125^tablestylesheet^121^0^0^100^200^1^char^200^1^1^<<SQL>> select distinct filename,X.caption,ord from sx_stylesheets X,sx_mask_style S where X.tid=S.stylesheet_id and S.maskeninfo_id=43080 order by ord^^<<SQL>> select distinct filename,X.caption from sx_stylesheets X,sx_mask_style S where X.tid=S.stylesheet_id and S.maskeninfo_id=43080 and S.ord=1^
43126^Ausgabeformat^2001^0^0^100^150^1^char^200^1^1^<<SQL>> select element_value,description from menu_element where element='Ausgabeformat' and nature::smallint<100 order by nature::smallint^^<<SQL>> select element_value,description from menu_element where element='Ausgabeformat' and description='HTML'^
;^ ^ ^
43124^Schlüssel anzeigen^150^0^0^100^100^1^integer^30^1^1^<<SQL>> select 1,'Ja' from xdummy union select 0,'Nein' from xdummy^ ^<<SQL>> select 1,'Ja' from xdummy^
43125^tablestylesheet^121^0^0^100^200^1^char^200^1^1^<<SQL>> select distinct filename,X.caption,ord from sx_stylesheets X,sx_mask_style S where X.tid=S.stylesheet_id and S.maskeninfo_id=43080 order by ord^ ^<<SQL>> select distinct filename,X.caption from sx_stylesheets X,sx_mask_style S where X.tid=S.stylesheet_id and S.maskeninfo_id=43080 and S.ord=1^
43126^Ausgabeformat^2001^0^0^100^150^1^char^200^1^1^<<SQL>> select element_value,description from menu_element where element='Ausgabeformat' and nature::smallint<100 order by nature::smallint^ ^<<SQL>> select element_value,description from menu_element where element='Ausgabeformat' and description='HTML'^
43129^Hochschule^5^350^-1^140^80^1^char^255^0^1^<<SQL>>select distinct K.unikey,K.unikey\
from costage_st_studienkennzahlen K\
order by 2;^ ^<<SQL>> select distinct K.unikey,K.unikey\
from costage_st_studienkennzahlen K, hochschulinfo H\
where K.unikey=H.hs_nr::char(10)^
43130^##line##^10^0^0^100^100^1^char^5000^0^8^^^1^
43130^##line##^10^0^0^100^100^1^char^5000^0^8^^ ^1^
43131^Abschluss^7^0^0^140^170^5^char^30^0^1^<<SQL>> SELECT \
code,\
name\
FROM costage_st_abschlussziele_lokal\
order by 2;^^^
43132^Matrikel-Nr.^30^350^-1^150^180^1^char^200^0^0^^^^
43133^##line##^40^0^0^100^100^1^char^5000^0^8^^^1^
order by 2;^ ^ ^
43132^Matrikel-Nr.^30^350^-1^150^180^1^char^200^0^0^^ ^ ^
43133^##line##^40^0^0^100^100^1^char^5000^0^8^^ ^1^

112
src-modules/module/costage/masken/43110_maskeninfo.unl

@ -1,65 +1,57 @@ @@ -1,65 +1,57 @@
43110^Bewerbungen Datenblatt (CO)^--Freemarker Template\
<#include "SQL_lingua_franca"/>\
<#include "SuperX_general"/>\
<#include "SQL_multitable_output"/>\
<#include "DatenblattSQLGenerator"/>\
\
--ram excelexport \
\
<sqlvars>\
<sqlvar name="get_tables"><![CDATA[\
SELECT distinct name,name\
<sqlvar name="basetable" ><![CDATA[\
SELECT distinct name\
from sx_tables\
where name in ('costage_bw_antr_aggr'\
where name in ('costage_bw_antr_aggr');]]>\
</sqlvar>\
<sqlvar name="getJoinTables" type="hashsequence"><![CDATA[\
SELECT distinct name\
from sx_tables\
where name in (''\
${DatenblattTables(<<tablestylesheet>>,"<<Weitere Tabellen>>",.vars["Weitere TabellenObject"].allKeys)}\
\
)\
order by 2;]]>\
order by 1;]]>\
</sqlvar>\
<sqlvar name="get_table_joins"><![CDATA[\
select table_name || '.' || name || '=' || foreignkey_tab || '.' || foreignkey_col,table_name \
from sx_fields where table_name in ('costage_bw_antr_aggr'\
<sqlvar name="getJoinWhereClauses" type="hashsequence"><![CDATA[\
select table_name || '.' || name || '=' || foreignkey_tab || '.' || foreignkey_col as condition,\
table_name ,\
foreignkey_tab\
from sx_fields where table_name in ('${basetable}'\
${DatenblattTables(<<tablestylesheet>>,"<<Weitere Tabellen>>",.vars["Weitere TabellenObject"].allKeys)} )\
and foreignkey_tab in ('costage_bw_antr_aggr'\
and foreignkey_tab in ('-xy'\
${DatenblattTables(<<tablestylesheet>>,"<<Weitere Tabellen>>",.vars["Weitere TabellenObject"].allKeys)})\
;]]>\
</sqlvar>\
<sqlvar name="get_felder"><![CDATA[\
<sqlvar name="getSelectClause" type="hashsequence"><![CDATA[\
SELECT name,\
caption,\
(trim(field_type) || '#' || is_primarykey || '#' || trim(string_not_null(foreignkey_tab)) || '#' || trim(string_not_null(foreignkey_col))\
|| '#' || trim(string_not_null(foreignkey_cap))\
|| '#' || trim(string_not_null(foreignkey_cond))\
|| '#' || trim(string_not_null(foreignkey_func))\
|| '#' || trim(string_not_null(table_name))\
|| '#' || trim(string_not_null(foreignkey_uniquename)))::char(255) as strukturStr\
field_type,\
is_primarykey,\
foreignkey_tab,\
foreignkey_col,\
foreignkey_cap,\
foreignkey_cond,\
foreignkey_func,\
table_name,\
foreignkey_uniquename\
from sx_fields\
where table_name in ('costage_bw_antr_aggr'\
where table_name in ('${basetable}'\
${DatenblattTables(<<tablestylesheet>>,"<<Weitere Tabellen>>",.vars["Weitere TabellenObject"].allKeys)}\
)\
and currentlyused=1\
${DatenblattFields(<<tablestylesheet>>,"<<Felder>>",FelderObject.allKeys)}\
order by 2,3;]]>\
</sqlvar>\
<sqlvar name="get_felder_fk"><![CDATA[\
SELECT name,\
caption,\
(trim(table_name)\
|| '#' || trim(string_not_null(foreignkey_tab))\
|| '#' || trim(string_not_null(foreignkey_uniquename)))::char(255) as strukturStr\
from sx_fields\
where table_name in ('costage_bw_antr_aggr' ${DatenblattTables(<<tablestylesheet>>,"<<Weitere Tabellen>>",.vars["Weitere TabellenObject"].allKeys)}\
)\
and currentlyused=1\
${DatenblattFields(<<tablestylesheet>>,"<<Felder>>",FelderObject.allKeys)}\
order by 2,3;]]>\
</sqlvar>\
</sqlvars>\
\
<@generate_multitable_list />\
<@generate_field_list_multitable aggregationsfeld="summe" aggregatfunktion="sum(" />\
<@generate_foreign_fields_multitable />\
\
\
<#assign filter="and bw_typ_kb not in ('MBW')\
/* AND bw_zul_art_nr in (<<Zulassungsart>>) */\
/* and costage_bw_antr_aggr.st_studiengang_nr in (select G.st_studiengang_nr from costage_st_studiengaenge G where G.abschluss in (<<Abschluss>>)) */\
@ -89,50 +81,36 @@ SELECT name,\ @@ -89,50 +81,36 @@ SELECT name,\
\
<#assign filter=filter +" and " + fach_filter />\
\
<@generate_resultset_multitable tabellen=table_list\
p_show_keys=<<Schlüssel anzeigen>>\
p_field_list_select=field_list_select\
p_foreign_fields=foreign_fields\
p_filter=filter\
p_field_list_groupby=field_list_groupby\
p_join_clause=join_clause\
--\
\
<@generateDatenblatt \
p_basetable = basetable\
p_joinTables = getJoinTables\
p_joinWhereClauses = getJoinWhereClauses\
p_selectClause = getSelectClause\
p_aggregationsfeld ="summe"\
p_aggregatfunktion = "sum("\
p_filter = filter\
p_show_keys= <<Schlüssel anzeigen>>\
p_postProcessing= ""\
/>^--Freemarker Template \
<sqlvars>\
<sqlvar name="basetable">select 'costage_bw_antr_aggr' from xdummy</sqlvar>\
<sqlvar name="restriction"><![CDATA[\
<#assign restrict=DatenblattTables(<<tablestylesheet>>,"<<Weitere Tabellen>>",.vars["Weitere TabellenObject"].allKeys)/>;\
select '${restrict?replace("\\x0027","\\x0027\\x0027")}' from xdummy;]]>\
</sqlvar>\
<sqlvar name="get_felder"><![CDATA[\
SELECT caption,\
foreignkey_tab,\
description as strukturStr\
from sx_fields\
where table_name in ('${basetable}'\
${restriction}\
)\
and currentlyused=1\
${DatenblattFields(<<tablestylesheet>>,"<<Felder>>",FelderObject.allKeys)}\
order by 1;]]>\
</sqlvar>\
</sqlvars>\
XIL List\
sizable_columns horizontal_scrolling\
white_space_color=COLOR_WHITE fixed_columns=1\
min_heading_height=35\
<#assign i=1 />\
<#if get_felder?has_content >\
<#foreach myfield in get_felder>\
<#if getSelectClause?has_content >\
<#foreach myfield in getSelectClause>\
<#assign i=i+1 />\
Column CID=${i} heading_text="${myfield.key}" explanation="${myfield.strukturStr}" center_heading\
Column CID=${i} heading_text="${myfield.caption}" explanation="" center_heading\
row_selectable col_selectable rightJust heading_platform readonly\
width=20\
<#if myfield.name != '' && <<Schlüssel anzeigen>>==1>\
<#if myfield.foreignkey_tab != '' && <<Schlüssel anzeigen>>==1>\
<#assign i=i+1 />\
Column CID=${i} heading_text="${myfield.key}\\n(Schlüssel)" explanation="Schlüssel des Feldes ${myfield.key}" center_heading\
Column CID=${i} heading_text="${myfield.caption}\\n(Schlüssel)" explanation="" center_heading\
row_selectable col_selectable rightJust heading_platform readonly\
width=20\
</#if>\
</#foreach>\
</#if>\
@@@^Altersgruppe^Anzahl^Bewerbungen Datenblatt aus CO^drop table tmp_tabelle;^ ^2^700^360^0^1^ ^
@@@^Altersgruppe^Anzahl^Bewerbungen Datenblatt aus CO^drop table tmp_tabelle;^^2^700^360^^1^^

Loading…
Cancel
Save