4 changed files with 327 additions and 45 deletions
@ -1,37 +1,33 @@
@@ -1,37 +1,33 @@
|
||||
44130^Köpfe oder Fälle ?^0^0^0^140^150^1^sql^70^0^1^<<SQL>> select apnr, eintrag from koepfe_oder_faelle order by 2^hidden^<<SQL>> select apnr, eintrag from koepfe_oder_faelle where eintrag='Köpfe';^ |
||||
44131^Seit Semester^3^0^0^140^80^1^integer^30^0^1^<<SQL>> select tid, eintrag from semester order by tid DESC;^Eintrag^<<SQL>> select tid,eintrag from semester where today() between sem_beginn and sem_ende;^ |
||||
44132^Stichtag^1^350^-1^140^100^1^sql^30^0^1^<<SQL>> select tid, name from sos_stichtag where stichtagsart='Studierende';^hidden^<<SQL>> select tid, name from sos_stichtag where stichtagsart='Studierende' and appl_key='0';^ |
||||
44133^Staatsangehörigkeit^36^0^0^130^150^10^char^30^0^12^<<SQL>> select tid,name,sortnr from sichten where art='SOS-Staaten-Sicht' order by 3,2;^^^ |
||||
44134^Status^14^350^-1^140^180^1^sql^30^0^1^<<SQL>> select apnr,eintrag from sos_status order by 2^hidden^<<SQL>> select apnr,eintrag from sos_status where eintrag='Alle ohne Beurl.';^ |
||||
44135^Hörerstatus^33^0^0^140^170^1^sql^30^0^1^<<SQL>> select apnr, eintrag from hoererstatus order by 2^hidden^<<SQL>> select apnr, eintrag from hoererstatus where eintrag='alle';^ |
||||
44136^Weitere Tabellen^123^0^0^140^140^10^char^30^0^1^<<SQL>> select name,string_not_null(caption) || ' - ' || name from sx_tables where name in ('dim_studiengang','dim_staat')\ |
||||
order by 2^hidden^^ |
||||
44137^bis Fachsemester^35^350^-1^140^100^1^integer^30^0^0^^hidden^^ |
||||
44139^Bis Semester^4^350^-1^140^80^1^integer^30^0^1^<<SQL>> select tid, eintrag from semester order by tid DESC;^Eintrag^<<SQL>> select tid,eintrag from semester where today() between sem_beginn and sem_ende;^ |
||||
44140^Filter Studierende^119^0^0^140^150^1^sql^20^0^1^<<SQL>> SELECT id,caption from sx_repository where aktiv =1 and today() between gueltig_seit and gueltig_bis and art='SOS_STUD_FILTER' order by 2;^^^ |
||||
44141^Geschlecht^37^0^0^140^80^1^integer^30^0^1^<<SQL>> SELECT apnr,druck FROM cif where key = 9003 and apnr between 1 and 4 order by 1;^^^ |
||||
44142^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,\ |
||||
sx_tables T where F.table_name=T.name and F.currentlyused=1\ |
||||
--Pseudonyme eingeschaltet:\ |
||||
and (F.name != 'matrikel_nr' or 0=(select \ |
||||
count(*) from konstanten where beschreibung='SOS_MTKNR_EXT'\ |
||||
and apnr=1)) \ |
||||
and F.table_name in ('sos_stg_aggr','dim_staat','dim_studiengang') \ |
||||
order by 2;^hidden^sos_stg_aggr.alter,sos_stg_aggr.geschlecht,sos_stg_aggr.matrikel_nr,sos_stg_aggr.summe^ |
||||
44143^Studiengang^6^0^0^140^150^50^char^30^0^12^<<SQL>> select tid,name,sortnr from sichten where art in ('SOS-Kostenstellen-Sicht', 'SOS-Studiengang-Sicht') order by 3,2;^^^ |
||||
44144^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^hidden^<<SQL>> select 1,'Ja' from xdummy^ |
||||
44145^tablestylesheet^121^0^0^100^200^1^char^200^1^1^<<SQL>> select filename,X.caption,ord from sx_stylesheets X,sx_mask_style S where X.tid=S.stylesheet_id and S.maskeninfo_id=44130 order by ord^^<<SQL>> select filename,X.caption from sx_stylesheets X,sx_mask_style S where X.tid=S.stylesheet_id and S.maskeninfo_id=44130 and ord=20 order by ord limit 1^ |
||||
44146^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^hidden^<<SQL>> select element_value,description from menu_element where element='Ausgabeformat' and description='HTML'^ |
||||
44147^Grafik^1000^300^-1^170^150^1^char^30^0^1^<<SQL>> select uniquename, caption from viz_chart where maskeninfo_id=44130 order by 2;^^<<SQL>> select uniquename, caption from viz_chart where maskeninfo_id=44130 order by 2 limit 1^ |
||||
44148^Jahrgang^42^350^-1^140^180^1^sql^30^0^13^<<SQL>> select attributevalue from personattribute_value_list where personattributetype_id = (select personattributetype_id from personattributetype where attributevalue = 'Jahrgang');^hidden^^ |
||||
44149^Name der Hochschule^15^350^-1^140^80^1^char^255^0^13^<<SQL>> select name from hochschulinfo;^Eintrag^<<SQL>> select name from hochschulinfo;^ |
||||
44150^Spaltenanzahl^300^0^0^140^80^1^integer^30^0^1^<<SQL>> SELECT 1,'1-spaltig' from xdummy \ |
||||
union SELECT 2,'2-spaltig' from xdummy \ |
||||
union SELECT 3,'3-spaltig' from xdummy \ |
||||
union SELECT 4,'4-spaltig' from xdummy \ |
||||
order by 1;^hidden^<<SQL>> SELECT 1,'1-spaltig' from xdummy^ |
||||
44151^Abschluss^7^0^0^140^170^5^char^30^0^1^<<SQL>> select abint,dtxt from k_abint order by 2;^^^ |
||||
44152^Matrikel-Nr.^20^350^-1^150^180^1^char^200^0^0^^hidden^^ |
||||
44153^##line##^40^0^0^100^100^1^char^5000^0^8^^^1^ |
||||
44130^Spaltenlayout^3000^350^-1^140^180^1^char^30^1^1^<<SQL>>SELECT uniquename,\ |
||||
caption\ |
||||
FROM rpta_column_layout \ |
||||
where resultset_id in (select R.tid from rpta_resultset R where R.uniquename in ('sos_stud_astat')\ |
||||
and R.systeminfo_id=7)\ |
||||
and uniquename in ('sos_stud_nach_alter')\ |
||||
order by sortnr, caption\ |
||||
;^^<<SQL>>SELECT uniquename,\ |
||||
caption\ |
||||
FROM rpta_column_layout \ |
||||
where resultset_id in (select R.tid from rpta_resultset R where R.uniquename in ('sos_stud_astat')\ |
||||
and R.systeminfo_id=7)\ |
||||
and uniquename in ('sos_stud_nach_alter')\ |
||||
order by sortnr, caption\ |
||||
;^ |
||||
44131^Seit Semester^10^0^0^140^80^1^integer^30^0^1^<<SQL>> select tid, eintrag from semester order by tid DESC;^ ^<<SQL>> select tid,eintrag from semester where today() between sem_beginn and sem_ende;^ |
||||
44132^Fächer^30^0^0^130^200^6^char^1000^0^12^<<SQL>> select tid,name,sortnr from sichten where art='Fächer-Sicht' order by 3,2;^ ^ ^ |
||||
44133^Abschluss^40^0^0^100^200^3^char^1500^0^1^<<SQL>> select apnr, druck from cifx where key=35 order by 2;^ ^ ^ |
||||
44134^bis Fachsemester^1000^300^-1^200^100^1^integer^30^0^0^^ ^ ^ |
||||
44135^Semestertyp^22^350^-1^140^80^1^integer^255^0^1^<<SQL>> select 1,'nur Sommersemester' from xdummy union select 2,'nur Wintersemester' from xdummy^Eintrag^<<SQL>> select 2,'nur Wintersemester' from xdummy^ |
||||
44136^Hochschulzugangsberechtigung^120^300^-1^200^200^1^sql^30^0^1^hs_zugangsber^apnr, eintrag^ ^ |
||||
44137^Bis Semester^20^350^-1^140^80^1^integer^30^0^1^<<SQL>> select tid, eintrag from semester order by tid DESC;^ ^<<SQL>> select tid,eintrag from semester where today() between sem_beginn and sem_ende;^ |
||||
44138^Staatsangehörigkeit^150^0^0^140^150^10^char^30^0^12^<<SQL>> select tid,name,sortnr from sichten where art='SOS-Staaten-Sicht' order by 3,2;^ ^ ^ |
||||
44139^Studiengang^25^0^0^140^150^50^char^1000^0^12^<<SQL>> select tid,name,sortnr from sichten where art in ('SOS-Kostenstellen-Sicht', 'SOS-Studiengang-Sicht') order by 3,2;^ ^ ^ |
||||
44140^Grafik^4000^300^-1^170^150^1^char^30^0^1^<<SQL>> select uniquename, caption from viz_chart where maskeninfo_id=44130 order by 2;^^<<SQL>> select uniquename, caption from viz_chart where maskeninfo_id=44130 order by 2 limit 1;^ |
||||
44141^Stichtag^23^330^-1^130^100^1^sql^30^1^1^<<SQL>> select tid, name from sos_stichtag where stichtagsart='Studierende';^ ^<<SQL>> select tid, name from sos_stichtag where stichtagsart='Studierende' and appl_key='0';^ |
||||
44142^Hörerstatus^200^330^-1^140^150^1^sql^30^0^1^<<SQL>> select apnr, eintrag from hoererstatus order by 2^apnr, eintrag^<<SQL>> select apnr, eintrag from hoererstatus where eintrag='alle';^ |
||||
44143^tablestylesheet^1500^0^0^100^100^1^char^255^1^1^<<SQL>> select filename,caption from sx_stylesheets S, sx_mask_style M where S.tid=M.stylesheet_id and M.maskeninfo_id=44130 order by ord^ ^<<SQL>> select filename,caption from sx_stylesheets S, sx_mask_style M where S.tid=M.stylesheet_id and M.maskeninfo_id=44130 order by ord limit 1^ |
||||
44148^Köpfe oder Fälle ?^0^0^0^140^150^1^sql^70^0^1^<<SQL>> select apnr, eintrag from koepfe_oder_faelle order by 2^apnr, eintrag^<<SQL>> select apnr, eintrag from koepfe_oder_faelle where eintrag = 'Fälle';^ |
||||
44152^Geschlecht^110^0^0^140^80^1^integer^30^0^1^<<SQL>> SELECT apnr,druck FROM cif where key = 9003 and apnr between 1 and 4 order by 1;^ ^ ^ |
||||
44153^Spalten^3001^0^0^150^190^10^char^30^0^1^<<SQL>>\ |
||||
select C.uniquename, C.caption ,L.layout_id from rpta_column C, rpta_column2layout L where C.tid=L.column_id and layout_id in\ |
||||
(select tid from rpta_column_layout where uniquename=<<Spaltenlayout>>) order by 2;^hidden^^ |
||||
|
@ -1 +1 @@
@@ -1 +1 @@
|
||||
44130^Studierende nach Alter (Boxplot)^<sximport>select select_stmt from maskeninfo where tid=160440</sximport>^<sximport>select xil_proplist from maskeninfo where tid=160440</sximport>^Altersgruppe^Anzahl^Altersverteilung der Studierenden als Boxplot^<sximport>select cleanup_stmt from maskeninfo where tid=160440</sximport>^^3^700^360^0^1^ ^ |
||||
44130^Studierende nach Alter (Boxplot)^<sximport>select select_stmt from maskeninfo where tid=45000</sximport>^<sximport>select xil_proplist from maskeninfo where tid=45000</sximport>^Studienfach^Anzahl bzw. Anteil^Datenblatt Studierendenstatistik^<sximport>select cleanup_stmt from maskeninfo where tid=45000</sximport>^^2^850^540^^1^<<SQL>>SELECT description FROM rpta_column_layout where tid=<<Spaltenlayout>>;^ |
||||
|
@ -0,0 +1,292 @@
@@ -0,0 +1,292 @@
|
||||
--freemarker template |
||||
<sqlvars> |
||||
<sqlvar name="sos_stud_astat_exists"> |
||||
select count(*) from rpta_resultset where uniquename='sos_stud_astat'; |
||||
</sqlvar> |
||||
</sqlvars> |
||||
<#assign rpta_column_layout = {"uniquename":"sos_stud_nach_alter", |
||||
"caption":"Studierende nach Alter", |
||||
"rpta_resultset":"sos_stud_astat", |
||||
"whereclause":"", |
||||
"description":"Studierende nach Alter" |
||||
} |
||||
/> |
||||
|
||||
<#assign rpta_columns = [ |
||||
{"uniquename":"alter", |
||||
"caption":"Alter", |
||||
"srcfieldname":"alter", |
||||
"targetfieldname":"", |
||||
"column_type":"physicalColumn", |
||||
"col_function":"", |
||||
"is_visible":"1", |
||||
"format_code":"INTEGER", |
||||
"visible_size":"5", |
||||
"is_aggregate":"0", |
||||
"description":"Alter in Jahren" |
||||
}, |
||||
{"uniquename":"geschlecht", |
||||
"caption":"Geschlecht", |
||||
"srcfieldname":"geschlecht", |
||||
"targetfieldname":"", |
||||
"column_type":"logicalColumn", |
||||
"col_function":"(select druck from cif where key=9003 and apnr=geschlecht)", |
||||
"is_visible":"1", |
||||
"format_code":"", |
||||
"visible_size":"5", |
||||
"is_aggregate":"0", |
||||
"description":"Geschlecht" |
||||
}, |
||||
{"uniquename":"geschlecht_schl", |
||||
"caption":"Geschlecht (Schlüssel)", |
||||
"srcfieldname":"geschlecht", |
||||
"targetfieldname":"geschlecht_schl", |
||||
"column_type":"logicalColumn", |
||||
"col_function":"geschlecht", |
||||
"is_visible":"1", |
||||
"format_code":"", |
||||
"visible_size":"5", |
||||
"is_aggregate":"0", |
||||
"description":"Geschlecht (Schlüssel)" |
||||
}, |
||||
{"uniquename":"matrikel_nr", |
||||
"caption":"Matrikelnummer", |
||||
"srcfieldname":"matrikel_nr", |
||||
"column_type":"physicalColumn", |
||||
"col_function":"", |
||||
"is_visible":"1", |
||||
"format_code":"INT_NO_SEP", |
||||
"visible_size":"5", |
||||
"is_aggregate":"0", |
||||
"description":"Matrikelnr." |
||||
}, |
||||
{"uniquename":"summe", |
||||
"caption":"Anzahl der Studierenden", |
||||
"srcfieldname":"summe", |
||||
"column_type":"physicalColumn", |
||||
"col_function":"sum", |
||||
"is_visible":"1", |
||||
"visible_size":"5", |
||||
"is_aggregate":"1", |
||||
"description":"Summe der Studierenden" |
||||
} |
||||
] |
||||
/> |
||||
|
||||
---ab hier nicht mehr ändern: |
||||
|
||||
CREATE temp TABLE tmp_rpta_column |
||||
( |
||||
uniquename varchar(255) NOT NULL, |
||||
caption varchar(255), |
||||
srcfieldname varchar(255), |
||||
targetfieldname varchar(255), |
||||
column_type integer, |
||||
col_function text, |
||||
is_visible smallint, |
||||
visible_size smallint, |
||||
is_aggregate smallint, |
||||
resultset_id integer, |
||||
sortnr integer, |
||||
description TEXT, |
||||
format_code_uniquename varchar(255), |
||||
format_code_id integer |
||||
); |
||||
|
||||
CREATE temp TABLE tmp_rpta_column_layout |
||||
( |
||||
uniquename varchar(255) NOT NULL, |
||||
caption varchar(255), |
||||
resultset_id integer, |
||||
whereclause text, |
||||
description text |
||||
); |
||||
|
||||
insert into tmp_rpta_column_layout( |
||||
resultset_id, |
||||
uniquename, |
||||
caption, |
||||
whereclause, |
||||
description |
||||
) |
||||
select tid, |
||||
'${rpta_column_layout.uniquename}', |
||||
'${rpta_column_layout.caption}', |
||||
'${rpta_column_layout.whereclause}', |
||||
'${rpta_column_layout.description}' |
||||
FROM rpta_resultset |
||||
where uniquename='${rpta_column_layout.rpta_resultset}'; |
||||
|
||||
<#assign sortnr=0 /> |
||||
<#foreach column in rpta_columns> |
||||
<#assign sortnr=sortnr +1 /> |
||||
|
||||
INSERT INTO tmp_rpta_column |
||||
(resultset_id, |
||||
uniquename, |
||||
caption, |
||||
srcfieldname, |
||||
targetfieldname, |
||||
column_type, |
||||
col_function, |
||||
is_visible, |
||||
visible_size, |
||||
is_aggregate, |
||||
sortnr, |
||||
description, |
||||
format_code_uniquename |
||||
) |
||||
select R.tid, |
||||
'${column.uniquename}', |
||||
'${column.caption}', |
||||
'${column.srcfieldname}', |
||||
<#if !column.targetfieldname?exists || column.targetfieldname=="">null::varchar <#else>'${column.targetfieldname}' </#if>, |
||||
T.tid as column_type, |
||||
<#if column.col_function?exists>'${column.col_function}'<#else>null::varchar </#if>, |
||||
${column.is_visible}, |
||||
${column.visible_size}, |
||||
${column.is_aggregate}, |
||||
${sortnr*10}, |
||||
'${column.description}', |
||||
<#if column.description?exists>'${column.description}'<#else>null::varchar </#if> |
||||
FROM rpta_resultset R, rpta_column_type T |
||||
where R.uniquename='${rpta_column_layout.rpta_resultset}' |
||||
and T.uniquename='${column.column_type}'; |
||||
|
||||
</#foreach> |
||||
|
||||
update tmp_rpta_column set format_code_id=C.tid |
||||
from rpta_format_code C |
||||
where C.uniquename=tmp_rpta_column.format_code_uniquename |
||||
and format_code_uniquename is not null; |
||||
|
||||
|
||||
select * into temp tmp_rpta_column2layout |
||||
from rpta_column2layout |
||||
where layout_id in (select L.tid |
||||
from rpta_column_layout L,rpta_resultset R |
||||
where R.tid=L.resultset_id |
||||
and R.uniquename='${rpta_column_layout.rpta_resultset}' |
||||
and L.uniquename='${rpta_column_layout.uniquename}' |
||||
) |
||||
; |
||||
|
||||
select * into temp tmp_rpta_column_layout_target |
||||
from rpta_column_layout |
||||
where resultset_id in (select tid |
||||
FROM rpta_resultset |
||||
where uniquename='${rpta_column_layout.rpta_resultset}') |
||||
and uniquename in (select uniquename from tmp_rpta_column_layout) |
||||
; |
||||
|
||||
insert into rpta_column_layout |
||||
(uniquename, |
||||
caption, |
||||
resultset_id, |
||||
whereclause, |
||||
description) |
||||
select uniquename, |
||||
caption, |
||||
resultset_id, |
||||
whereclause, |
||||
description |
||||
FROM tmp_rpta_column_layout T |
||||
where 0=(select count(*) from tmp_rpta_column_layout_target T2 |
||||
where T.uniquename=T2.uniquename); |
||||
|
||||
drop table tmp_rpta_column_layout_target; |
||||
|
||||
delete from rpta_column2layout |
||||
where layout_id in (select L.tid |
||||
from rpta_column_layout L,rpta_resultset R |
||||
where R.tid=L.resultset_id |
||||
and R.uniquename='${rpta_column_layout.rpta_resultset}' |
||||
and L.uniquename='${rpta_column_layout.uniquename}' |
||||
) |
||||
; |
||||
|
||||
select * into temp tmp_rpta_column2 |
||||
from tmp_rpta_column T |
||||
where (resultset_id,uniquename) not in |
||||
(select resultset_id,uniquename from rpta_column); |
||||
|
||||
INSERT INTO rpta_column |
||||
(resultset_id, |
||||
uniquename, |
||||
caption, |
||||
srcfieldname, |
||||
targetfieldname, |
||||
column_type, |
||||
col_function, |
||||
is_aggregate, |
||||
description, |
||||
custom |
||||
) |
||||
select |
||||
resultset_id, |
||||
uniquename, |
||||
caption, |
||||
srcfieldname, |
||||
targetfieldname, |
||||
column_type, |
||||
col_function, |
||||
is_aggregate, |
||||
description, |
||||
0 as custom |
||||
from tmp_rpta_column2; |
||||
|
||||
--evtl. neuen Satz einfügen, dann alle updaten |
||||
|
||||
update rpta_column set ( caption, |
||||
srcfieldname, |
||||
targetfieldname, |
||||
column_type, |
||||
col_function, |
||||
is_aggregate, |
||||
description) |
||||
= (select caption, |
||||
srcfieldname, |
||||
targetfieldname, |
||||
column_type, |
||||
col_function, |
||||
is_aggregate, |
||||
description |
||||
from tmp_rpta_column T |
||||
where T.resultset_id=rpta_column.resultset_id |
||||
and T.uniquename=rpta_column.uniquename) |
||||
where custom=0 |
||||
and (resultset_id,uniquename) in |
||||
(select T.resultset_id,T.uniquename |
||||
from tmp_rpta_column T) |
||||
; |
||||
|
||||
drop table tmp_rpta_column2; |
||||
|
||||
insert into rpta_column2layout(column_id, |
||||
layout_id, |
||||
sortnr, |
||||
is_visible, |
||||
visible_size, |
||||
caption, |
||||
description, |
||||
format_code_id) |
||||
select C.tid as column_id, |
||||
L.tid as layout_id, |
||||
T.sortnr, |
||||
T.is_visible, |
||||
T.visible_size, |
||||
T.caption, |
||||
T.description, |
||||
T.format_code_id |
||||
FROM rpta_column C, rpta_column_layout L, tmp_rpta_column T |
||||
where C.uniquename=T.uniquename |
||||
and C.resultset_id=T.resultset_id |
||||
and L.uniquename='${rpta_column_layout.uniquename}' |
||||
and L.resultset_id=T.resultset_id |
||||
; |
||||
drop table tmp_rpta_column; |
||||
drop TABLE tmp_rpta_column_layout; |
||||
drop table tmp_rpta_column2layout; |
||||
|
||||
|
||||
|
Loading…
Reference in new issue