Browse Source

Abfrage 47030 als Kopie von 21000, Definiton Definition von Würfel, Restrictions, Dimensionen, sichten_fuellen nicht notwendig, deshalb wieder gelöscht

master
Marlies Winterstein 10 months ago
parent
commit
d6a6b7332a
  1. 15
      src-modules/module/sxc/masken/47030_felderinfo.unl
  2. 14
      src-modules/module/sxc/masken/47030_maskeninfo.unl
  3. 155
      src-modules/module/sxc/schluesseltabellen/sichten_fuellen.sql
  4. 7
      src-modules/module/sxc/schluesseltabellen/xcube_dims_install.sql
  5. 262
      src-modules/module/sxc/schluesseltabellen/xcube_dims_install_sic.sql
  6. 23
      src-modules/module/sxc/schluesseltabellen/xcube_install.sql
  7. 9
      src-modules/module/sxc/schluesseltabellen/xcube_install_restrictions.sql

15
src-modules/module/sxc/masken/47030_felderinfo.unl

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
47030^Hochschule^0^0^0^100^150^1^char^30^0^12^<<SQL>> select tid, type, name,sortnr from sichten where art in('KENN-Kostenstellen-Sicht','KENN-Hochschulen-Sicht') order by sortnr, name;^^ ^
47031^Seit Semester^1^0^0^130^80^1^integer^30^0^1^<<SQL>> select tid,druck from kenn_semester order by tid DESC;^^<<SQL>> select tid,druck from kenn_semester where today() between sem_beginn and sem_ende;^
47032^Bis Semester^3^330^-1^130^100^1^integer^30^0^1^<<SQL>> select tid,druck from kenn_semester order by tid DESC;^ ^<<SQL>> select tid,druck from kenn_semester where today() between sem_beginn and sem_ende;^
47030^Hochschule^0^0^0^100^150^3^char^30^0^12^<<SQL>> select tid, type, name,sortnr from sichten where art in('KENN-Kostenstellen-Sicht','KENN-Hochschulen-Sicht') order by sortnr, name;^^ ^
47031^Seit Semester^1^0^0^130^80^1^integer^30^0^1^<<SQL>> select tid,druck from kenn_semester where tid in (select semester from sxc_stud_sem_da_geschl_hs) order by tid DESC;^^<<SQL>> select tid,druck from kenn_semester where today() between sem_beginn and sem_ende;^
47032^Bis Semester^3^330^-1^130^100^1^integer^30^0^1^<<SQL>> select tid,druck from kenn_semester where tid in (select semester from sxc_stud_sem_da_geschl_hs) order by tid DESC;^ ^<<SQL>> select tid,druck from kenn_semester where today() between sem_beginn and sem_ende;^
47041^Geschlecht^37^0^0^140^80^1^char^30^0^1^<<SQL>> select apnr, name from xcube_dims where id='auspraegung_code_3' order by 1^^^
47042^Felder^125^0^0^150^190^10^char^30^0^999^<<SQL>>\
--freemarker template\
@ -18,6 +18,7 @@ and trim(F.table_name) || '.' || F.name in (select trim(tablename)||'.'||trim(fi @@ -18,6 +18,7 @@ and trim(F.table_name) || '.' || F.name in (select trim(tablename)||'.'||trim(fi
(select tid from sx_stylesheets where filename=<<tablestylesheet>>))\
</#if>\
order by 2;^^^
47043^Nationalität^38^0^0^100^150^3^char^30^0^1^<<SQL>> select apnr, name from xcube_dims where id='auspraegung_code_2' order by 1^^ ^
47044^Schlüssel anzeigen^150^0^0^100^100^1^integer^30^1^999^<<SQL>> select 1,'Ja' from xdummy union select 0,'Nein' from xdummy^^<<SQL>> select 1,'Ja' from xdummy^
47045^Ansicht in Ergebniszeilen^121^0^0^100^200^1^char^200^1^1^<<SQL>> select name,caption from xcube_dimconfig where maskeninfo_id=${Maskennummer} and is_rowdim=1 order by 2^^<<SQL>> select name,caption from xcube_dimconfig where maskeninfo_id=${Maskennummer} and is_rowdefault=1^
47046^Ansicht in Ergebnisspalten^2001^0^0^100^150^1^char^200^1^1^<<SQL>> select name,caption from xcube_dimconfig where maskeninfo_id=${Maskennummer} and is_coldim=1 order by 2^^<<SQL>> select name,caption from xcube_dimconfig where maskeninfo_id=${Maskennummer} and is_coldefault=1^
@ -25,7 +26,13 @@ and trim(F.table_name) || '.' || F.name in (select trim(tablename)||'.'||trim(fi @@ -25,7 +26,13 @@ and trim(F.table_name) || '.' || F.name in (select trim(tablename)||'.'||trim(fi
47050^Leere Spalten ausblenden^2020^0^0^100^100^1^char^30^0^1^<<SQL>> select 'ja','ja' from xdummy union select 'nein','nein' from xdummy^^<<SQL>> select 'ja','ja' from xdummy^
47052^Kennzahl^3000^350^-1^150^180^1^integer^200^1^1^<<SQL>> select tid,name from xcube_kennzahl where maskeninfo_id=${Maskennummer} order by sortnr,name;^hidden^<<SQL>> select tid,name from xcube_kennzahl where maskeninfo_id=${Maskennummer} and is_default=1^
47053^2.Ansicht in Zeilen^125^0^0^100^100^1^char^50^0^999^<<SQL>> select name,caption from xcube_dimconfig where maskeninfo_id=${Maskennummer} and is_secondrowdim=1 order by 1^hidden^1^
47054^Visualisierung auf Ebene^10001^0^0^140^80^1^integer^30^0^0^ ^^^
47058^Spaltenvisualisierung^10000^0^0^140^80^1^char^30^0^1^<<SQL>> select '_graph','Balken (horiz. linksb.)' from xdummy\
union select '_graphbarright','Balken (horiz. rechtsb.)' from xdummy\
union select '_graphbaralternating','Balken (horiz. rechtsb./linksb.)' from xdummy^^^
union select '_graphbaralternating','Balken (horiz. rechtsb./linksb.)' from xdummy\
union select '_sparkbar','Balkendiagramm' from xdummy\
where 0 < (select count(*) from sx_stylesheets where filename='tabelle_html_viz.xsl')\
union select '_sparkline','Liniendiagramm' from xdummy\
where 0 < (select count(*) from sx_stylesheets where filename='tabelle_html_viz.xsl')\
order by 1^^^
47059^Zeilenfilter bis Ebene^140^0^0^140^80^1^integer^30^0^0^ ^^^

14
src-modules/module/sxc/masken/47030_maskeninfo.unl

@ -380,7 +380,11 @@ select \ @@ -380,7 +380,11 @@ select \
ebene as level, --bei Grafiken keine Ebenenanzeige\
</#if>\
</#if>\
<#if graph_col?starts_with("_spark")>\
name as _categorySpark\
<#else>\
name\
</#if>\
--TODO: wenn <<2.Ansicht in Zeilen>>"!="" dann ,col2\
<#assign i=0/>\
<#foreach spalte in ergspalten>\
@ -393,14 +397,22 @@ name\ @@ -393,14 +397,22 @@ name\
<#else>\
, '' || c${i}::${datatype} || '|' || tmp_cellmax.maxvalue as _graphbarright${i}\
</#if>\
<#else>\
<#elseif graph_col?starts_with("_spark")>\
, c${i} as ${graph_col}${i}\
<#else>\
, '' || c${i}::${datatype} || '|' || tmp_cellmax.maxvalue as ${graph_col}${i}\
</#if>\
\
<#else>\
--letzte Spalte:\
<#if graph_col?starts_with("_spark")>\
, c${i} as ${graph_col}${i}\
<#else>\
, c${i}::${datatype} as col${i}\
</#if>\
\
</#if>\
\
</#foreach>\
\
from tmp_erg, tmp_cellmax order by sortnr;^--freemarker Template\

155
src-modules/module/sxc/schluesseltabellen/sichten_fuellen.sql

@ -1,155 +0,0 @@ @@ -1,155 +0,0 @@
--freemarker template
<#if SQLdialect='Postgres'>
select setval('sichten_tid_seq',(select max(tid) from sichten));
</#if>
<#assign systeminfoid="1000" />
<#assign sichten = [
{"name_intern":"xcube_dim_alter",
"name":"Alter (gruppiert in 5er-Schritten)",
"quelle":"<<SQL>> select name,apnr,parent,strukturstr from xcube_dims where id=''alter'' order by 2",
"art":"XCUBE-Alter-Sicht"},
{"name_intern":"xcube_dim_wohnort",
"name":"Wohnort nach Bundesländern",
"quelle":"<<SQL>> select druck ,apnr, parent from xcube_wohnort_staat order by 1",
"art":"XCUBE-Wohnort-Sicht"},
{"name_intern":"xcube_dim_hzbnote",
"name":"HZB-Note (gruppiert)",
"quelle":"<<SQL>> select name,apnr,parent,strukturstr from xcube_dims where id=''hzbnote'' order by 2",
"art":"XCUBE-HZB-Note-Sicht"},
{"name_intern":"xcube_dim_hoererstatus",
"name":"Hörerstatus (intern)",
"quelle":"<<SQL>> select druck ,apnr, parent from xcube_hoererstatus order by 1",
"art":"XCUBE-Hörerstatus-Sicht"},
{"name_intern":"xcube_dim_note",
"name":"Note (gruppiert)",
"quelle":"<<SQL>> select name,apnr,parent,strukturstr from xcube_dims where id=''note'' order by 2",
"art":"XCUBE-Note-Sicht"},
{"name_intern":"xcube_dim_alter1",
"name":"Alter (starke Aufteilung)",
"quelle":"<<SQL>> select name,apnr,parent,strukturstr from xcube_dims where id=''alter1'' order by 2",
"art":"XCUBE-Alter-Sicht"},
{"name_intern":"xcube_dim_alter2",
"name":"Alter (spez. für Studierende/Prüf.)",
"quelle":"<<SQL>> select name,apnr,parent,strukturstr from xcube_dims where id=''alter2'' order by 2",
"art":"XCUBE-Alter-Sicht"},
{"name_intern":"xcube_dim_alter3",
"name":"Alter (einzeln)",
"quelle":"<<SQL>> select name,apnr,parent,strukturstr from xcube_dims where id=''alter3'' order by 2",
"art":"XCUBE-Alter-Sicht"},
{"name_intern":"xcube_dim_hzb_zul",
"name":"Hochschulzugangsber",
"quelle":"<<SQL>> select name,apnr,parent,strukturstr from xcube_dims where id=''hzb_zul'' order by 2",
"art":"XCUBE-HZB-ZUL-Sicht"},
{"name_intern":"xcube_dim_zul_erg",
"name":"Zulassungsergebnis",
"quelle":"<<SQL>> select name,apnr,parent,strukturstr from xcube_dims where id=''zul_erg'' order by 2",
"art":"XCUBE-ZUL-Erg-Sicht"}
] />
--Ab hier braucht man nichts ändern:
CREATE temp TABLE tmp_sichten (
parent character(255),
systeminfoid integer DEFAULT 0 NOT NULL,
art character(40),
type integer ,
name_intern character(200),
name character(200),
beschreibung character(255),
sortnr integer DEFAULT 0 NOT NULL,
quelle character(255),
alt_hier_id character(150),
treecfgtable character(255),
treecfgid character(150),
label smallint DEFAULT 0 NOT NULL,
user_rechte smallint DEFAULT 1 NOT NULL,
rechtequelle character(255),
sesamkey character(100),
standbutton smallint DEFAULT 0 NOT NULL,
attribut1 character(255),
attribut2 character(255),
attribut3 integer,
attribut4 integer,
xmlmaxentries integer,
gueltig_seit date ,
gueltig_bis date,
aktiv smallint DEFAULT 1
);
<#assign sortnr=0 />
<#foreach sicht in sichten>
<#assign sortnr=sortnr+1 />
-- Sicht ${sicht.name}
INSERT INTO tmp_sichten(
systeminfoid ,
art ,
type ,
name_intern ,
name ,
sortnr ,
quelle ,
label ,
user_rechte ,
standbutton ,
gueltig_seit ,
gueltig_bis ,
aktiv
) select
${systeminfoid} ,
'${sicht.art}' ,
10 ,
'${sicht.name_intern}' ,
'${sicht.name}' ,
${sortnr} ,
'${sicht.quelle}',
0 ,
0 ,
0 ,
date_val('01.01.1900') ,
date_val('01.01.3000') ,
1 from xdummy;
</#foreach>
--Zur Sicherheit alle Quellen und Standbutton von Sichten
update sichten set quelle=(select T.quelle from tmp_sichten T
where T.name_intern=sichten.name_intern)
where name_intern in (select T2.name_intern from tmp_sichten T2)
;
update sichten set standbutton=(select T.standbutton from tmp_sichten T
where T.name_intern=sichten.name_intern)
where name_intern in (select T2.name_intern from tmp_sichten T2)
;
delete from tmp_sichten where name_intern in (select name_intern from sichten);
INSERT INTO sichten(
systeminfoid , art , type , name_intern , name ,
sortnr , quelle , label ,
user_rechte , standbutton ,
xmlmaxentries ,
gueltig_seit , gueltig_bis , aktiv)
select systeminfoid , art , type , name_intern , name ,
sortnr , quelle , label ,
user_rechte , standbutton ,
xmlmaxentries ,
gueltig_seit , gueltig_bis , aktiv
from tmp_sichten S;
--Rechte für Sichten geben
select 'Rechte für Sichten geben' from xdummy;
delete from sachgeb_sichtarten where sichtart in
(select distinct art from tmp_sichten);
insert into sachgeb_sichtarten
(
sachgebiete_id ,
sichtart
)
select distinct ${systeminfoid},art from tmp_sichten;
drop table tmp_sichten;

7
src-modules/module/sxc/schluesseltabellen/xcube_dims_install.sql

@ -10,6 +10,13 @@ INSERT INTO xcube_dims (id,apnr,name,sort1) values @@ -10,6 +10,13 @@ INSERT INTO xcube_dims (id,apnr,name,sort1) values
INSERT INTO xcube_dims (id,apnr,name,sort1) values
('auspraegung_code_3','UNB','nicht bekannt',3);
</#if>
<#if TableFieldExists('sxc_stud_sem_da_geschl_hs','auspraegung_code_2')>
delete from xcube_dims where id='auspraegung_code_2';
INSERT INTO xcube_dims (id,apnr,name,sort1) values
('auspraegung_code_2','NATD','Deutschland',1);
INSERT INTO xcube_dims (id,apnr,name,sort1) values
('auspraegung_code_2','NATA','Ausland',2);
</#if>
--Zum Testen

262
src-modules/module/sxc/schluesseltabellen/xcube_dims_install_sic.sql

@ -1,262 +0,0 @@ @@ -1,262 +0,0 @@
--Freemarker Template
-- TableFieldExists wird genutzt, um zu prüfen, ob die entsprechende Tabelle existiert
<#if TableFieldExists('aggregierung','ord')>
delete from xcube_dims where id='jahr';
insert into xcube_dims (id, name,apnr,sort1)
select distinct 'jahr',ord::char(6),ord::char(6),ord from aggregierung where kategorie like '%-Jahr%';
delete from xcube_dims where id='cob_jahr';
insert into xcube_dims (id, name,apnr,sort1)
select distinct 'cob_jahr',ord::char(6),ord::char(6),ord from aggregierung where kategorie='COB-Jahr';
</#if>
delete from xcube_dims where id='monat';
INSERT INTO xcube_dims (id,apnr,name,sort1) values
('monat','1','Januar',1),
('monat','2','Februar',2),
('monat','3','März',3),
('monat','4','April',4),
('monat','5','Mai',5),
('monat','6','Juni',6),
('monat','7','Juli',7),
('monat','8','August',8),
('monat','9','September',9),
('monat','10','Oktober',10),
('monat','11','November',11),
('monat','12','Dezember',12);
--TODO: zerlegen in modulweise Dateien
-- priorität: semester, zul_semester, kenn_semester
<#if TableFieldExists('semester','eintrag')>
delete from xcube_dims where id='semester';
insert into xcube_dims (id, name,apnr,sort1)
select 'semester',eintrag ,tid::varchar(50),tid from semester
where tid in (select distinct sem_rueck_beur_ein from sos_stg_aggr);
<#elseif TableFieldExists('zul_semester','eintrag')>
delete from xcube_dims where id='semester';
insert into xcube_dims (id, apnr,sort1)
select 'semester',eintrag ,tid::varchar(50),tid from zul_semester;
<#elseif TableFieldExists('kenn_semester','eintrag')>
delete from xcube_dims where id='semester';
insert into xcube_dims (id, apnr,sort1)
select 'semester',druck ,tid::varchar(50),tid from kenn_semester;
</#if>
<#if TableFieldExists('sos_stg_aggr','fach_sem_zahl')>
delete from xcube_dims where id='fssemzahl';
INSERT INTO xcube_dims (id,apnr,name,sort1)
select distinct 'fssemzahl',fach_sem_zahl::varchar(10),fach_sem_zahl||'.FS',fach_sem_zahl from sos_stg_aggr
where fach_sem_zahl <= 10;
INSERT INTO xcube_dims (id,apnr,name,sort1)
select distinct 'fssemzahl', '99','FS>10',99 from sos_stg_aggr where fach_sem_zahl>10;
</#if>
<#if TableFieldExists('sos_stg_aggr','hssem')>
delete from xcube_dims where id='hssem';
INSERT INTO xcube_dims (id,apnr,name,sort1)
select distinct 'hssemzahl',hssem::varchar(10),hssem||'.HS',hssem from sos_stg_aggr
where hssem <= 10;
INSERT INTO xcube_dims (id,apnr,name,sort1)
select distinct 'hssemzahl', '999','HS>10',99 from sos_stg_aggr where hssem>10;
</#if>
<#if TableFieldExists('sos_stg_aggr','hzbart')>
delete from xcube_dims where id='hzbart';
INSERT INTO xcube_dims (id,apnr,name,sort1)
select distinct 'hzbart',tid::varchar(10),eintrag,tid from hs_zugangsber;
</#if>
<#if TableFieldExists('sos_stg_aggr','alter')>
delete from xcube_dims where id='alter';
INSERT INTO xcube_dims (id,apnr,parent, name,strukturstr,sort1)
values
('alter','gesamt',null,'alle','1=1',1),
('alter', 'a1', 'gesamt', '<20 Jahre','$1::numeric(14,2)<20.00',10),
('alter', 'a2', 'gesamt','20-24 Jahre','$1::numeric(14,2)>=20.00 and $1::numeric(14,2)<25.00',20),
('alter', 'a3', 'gesamt','25-29 Jahre','$1::numeric(14,2)>=25.00 and $1::numeric(14,2)<30.00',30),
('alter', 'a4', 'gesamt','30-34 Jahre','$1::numeric(14,2)>=30.00 and $1::numeric(14,2)<35.00',40),
('alter', 'a5', 'gesamt','35-39 Jahre','$1::numeric(14,2)>=35.00 and $1::numeric(14,2)<40.00',50),
('alter', 'a6', 'gesamt','40-44 Jahre','$1::numeric(14,2)>=40.00 and $1::numeric(14,2)<45.00',60),
('alter', 'a7', 'gesamt','45-49 Jahre','$1::numeric(14,2)>=45.00 and $1::numeric(14,2)<50.00',70),
('alter', 'a8', 'gesamt','50-54 Jahre','$1::numeric(14,2)>=50.00 and $1::numeric(14,2)<55.00',80),
('alter', 'a9', 'gesamt','55-59 Jahre','$1::numeric(14,2)>=55.00 and $1::numeric(14,2)<60.00',90),
('alter', 'a99', 'gesamt','>=60 Jahre','$1::numeric(14,2)>=60.00',100);
</#if>
delete from xcube_dims where id='alter1';
INSERT INTO xcube_dims (id,apnr,parent, name,strukturstr,sort1)
values
('alter1','gesamt',null,'alle','1=1',1),
('alter1', 'b2', 'gesamt','16-17 Jahre','$1::numeric(14,2)>=16.00 and $1::numeric(14,2)<18.00',20),
('alter1', 'b3', 'gesamt','18-20 Jahre','$1::numeric(14,2)>=18.00 and $1::numeric(14,2)<21.00',30),
('alter1', 'b4', 'gesamt','21-24 Jahre','$1::numeric(14,2)>=21.00 and $1::numeric(14,2)<25.00',40),
('alter1', 'b5', 'gesamt','25-29 Jahre','$1::numeric(14,2)>=25.00 and $1::numeric(14,2)<30.00',50),
('alter1', 'b6', 'gesamt','30-39 Jahre','$1::numeric(14,2)>=30.00 and $1::numeric(14,2)<40.00',60),
('alter1', 'b7', 'gesamt','40-49 Jahre','$1::numeric(14,2)>=40.00 and $1::numeric(14,2)<50.00',70),
('alter1', 'b8', 'gesamt','50-54 Jahre','$1::numeric(14,2)>=50.00 and $1::numeric(14,2)<55.00',80),
('alter1', 'b9', 'gesamt','55-60 Jahre','$1::numeric(14,2)>=55.00 and $1::numeric(14,2)<61.00',90),
('alter1', 'b90', 'gesamt','61 Jahre','$1::numeric(14,2)>=61.00 and $1::numeric(14,2)<62.00',91),
('alter1', 'b91', 'gesamt','62 Jahre','$1::numeric(14,2)>=62.00 and $1::numeric(14,2)<63.00',92),
('alter1', 'b92', 'gesamt','63 Jahre','$1::numeric(14,2)>=63.00 and $1::numeric(14,2)<64.00',93),
('alter1', 'b93', 'gesamt','64 Jahre','$1::numeric(14,2)>=64.00 and $1::numeric(14,2)<65.00',94),
('alter1', 'b94', 'gesamt','65 Jahre','$1::numeric(14,2)>=65.00 and $1::numeric(14,2)<66.00',95),
('alter1', 'b95', 'gesamt','66 Jahre','$1::numeric(14,2)>=66.00 and $1::numeric(14,2)<67.00',96),
('alter1', 'b96', 'gesamt','67 Jahre','$1::numeric(14,2)>=67.00 and $1::numeric(14,2)<68.00',97),
('alter1', 'b99', 'gesamt','>=68 Jahre','$1::numeric(14,2)>=68.00',100);
<#list 16..17 as i>
INSERT INTO xcube_dims (id,apnr,parent, name,strukturstr,sort1)
select 'alter1', ${i}::char(10), 'b2', ${i}::char(2) || ' Jahre' , '$1::numeric(14,2)>=${i}::numeric(14,2) and $1::numeric(14,2)<${i+1}::numeric(14,2)', ${i} from xdummy;
</#list>
<#list 18..20 as i>
INSERT INTO xcube_dims (id,apnr,parent, name,strukturstr,sort1)
select 'alter1', ${i}::char(10), 'b3', ${i}::char(2) || ' Jahre' , '$1::numeric(14,2)>=${i}::numeric(14,2) and $1::numeric(14,2)<${i+1}::numeric(14,2)', ${i} from xdummy;
</#list>
<#list 21..24 as i>
INSERT INTO xcube_dims (id,apnr,parent, name,strukturstr,sort1)
select 'alter1', ${i}::char(10), 'b4', ${i}::char(2) || ' Jahre' , '$1::numeric(14,2)>=${i}::numeric(14,2) and $1::numeric(14,2)<${i+1}::numeric(14,2)', ${i} from xdummy;
</#list>
<#list 25..29 as i>
INSERT INTO xcube_dims (id,apnr,parent, name,strukturstr,sort1)
select 'alter1', ${i}::char(10), 'b5', ${i}::char(2) || ' Jahre' , '$1::numeric(14,2)>=${i}::numeric(14,2) and $1::numeric(14,2)<${i+1}::numeric(14,2)', ${i} from xdummy;
</#list>
<#list 30..39 as i>
INSERT INTO xcube_dims (id,apnr,parent, name,strukturstr,sort1)
select 'alter1', ${i}::char(10), 'b6', ${i}::char(2) || ' Jahre' , '$1::numeric(14,2)>=${i}::numeric(14,2) and $1::numeric(14,2)<${i+1}::numeric(14,2)', ${i} from xdummy;
</#list>
<#list 40..49 as i>
INSERT INTO xcube_dims (id,apnr,parent, name,strukturstr,sort1)
select 'alter1', ${i}::char(10), 'b7', ${i}::char(2) || ' Jahre' , '$1::numeric(14,2)>=${i}::numeric(14,2) and $1::numeric(14,2)<${i+1}::numeric(14,2)', ${i} from xdummy;
</#list>
<#list 50..54 as i>
INSERT INTO xcube_dims (id,apnr,parent, name,strukturstr,sort1)
select 'alter1', ${i}::char(10), 'b8', ${i}::char(2) || ' Jahre' , '$1::numeric(14,2)>=${i}::numeric(14,2) and $1::numeric(14,2)<${i+1}::numeric(14,2)', ${i} from xdummy;
</#list>
<#list 55..60 as i>
INSERT INTO xcube_dims (id,apnr,parent, name,strukturstr,sort1)
select 'alter1', ${i}::char(10), 'b9', ${i}::char(2) || ' Jahre' , '$1::numeric(14,2)>=${i}::numeric(14,2) and $1::numeric(14,2)<${i+1}::numeric(14,2)', ${i} from xdummy;
</#list>
delete from xcube_dims where id='alter2';
INSERT INTO xcube_dims (id,apnr,parent, name,strukturstr,sort1)
values
('alter2','gesamt',null,'alle','1=1',1),
('alter2', 'b2', 'gesamt','16-18 Jahre','$1::numeric(14,2)>=16.00 and $1::numeric(14,2)<19.00',20),
('alter2', 'b3', 'gesamt','19-20 Jahre','$1::numeric(14,2)>=19.00 and $1::numeric(14,2)<21.00',30),
('alter2', 'b4', 'gesamt','21-25 Jahre','$1::numeric(14,2)>=21.00 and $1::numeric(14,2)<26.00',40),
('alter2', 'b5', 'gesamt','26-30 Jahre','$1::numeric(14,2)>=26.00 and $1::numeric(14,2)<31.00',50),
('alter2', 'b6', 'gesamt','31-40 Jahre','$1::numeric(14,2)>=31.00 and $1::numeric(14,2)<41.00',60),
('alter2', 'b7', 'gesamt','41-50 Jahre','$1::numeric(14,2)>=41.00 and $1::numeric(14,2)<51.00',70),
('alter2', 'b99', 'gesamt','> 50 Jahre','$1::numeric(14,2)>=51.00',100);
delete from xcube_dims where id='alter3';
INSERT INTO xcube_dims (id,apnr,parent, name,strukturstr,sort1)
values
('alter3','gesamt',null,'alle','1=1',1);
INSERT INTO xcube_dims (id,apnr,parent, name,strukturstr,sort1) values
<#list 16..67 as i>
('alter3', ${i}::char(10), 'gesamt', ${i}::char(2) || ' Jahre' , '$1::numeric(14,2)>=${i}::numeric(14,2) and $1::numeric(14,2)<${i+1}::numeric(14,2)', ${i}),
</#list>
('alter3', '68', 'gesamt','68 Jahre','$1::numeric(14,2)>=68.00',100);
<#if TableFieldExists('sos_stg_aggr','ch27_grund_beurl')>
delete from xcube_dims where id='ch27_grund_beurl';
INSERT INTO xcube_dims (id,apnr,name,sort1)
select distinct 'ch27_grund_beurl',apnr,druck,1 from cifx where key=27;
</#if>
<#if TableFieldExists('sos_stg_aggr','aktiv')>
delete from xcube_dims where id='aktiv';
INSERT INTO xcube_dims (id,apnr,name,sort1)
select 'aktiv',0::varchar(10),'inaktiv',2 from xdummy union select 'aktiv',1::varchar(10),'aktiv',1 from xdummy;
</#if>
<#if TableFieldExists('sos_stg_aggr','hzbart_int')>
delete from xcube_dims where id='hzbart_int';
INSERT INTO xcube_dims (id,apnr,name,sort1)
select distinct 'hzbart_int',hzbart,dtxt,1 from k_hzbart;
</#if>
<#if TableFieldExists('sos_stg_aggr','hzbnote')>
delete from xcube_dims where id='hzbnote';
INSERT INTO xcube_dims (id,apnr,parent, name,strukturstr,sort1)
values
('hzbnote','gesamt',null,'alle','1=1',1),
('hzbnote', 'a1', 'gesamt','Sehr gut <=1,0','$1::numeric(5,2)>=0.00 and $1::numeric(5,2)<=1.00',10),
('hzbnote', 'a2', 'gesamt','Sehr gut 1,1-1,5','$1::numeric(5,2)>1.00 and $1::numeric(5,2)<=1.50',20),
('hzbnote', 'a3', 'gesamt','gut 1,6-2,0','$1::numeric(5,2)>1.50 and $1::numeric(5,2)<=2.00',30),
('hzbnote', 'a4', 'gesamt','gut 2,1-2,5','$1::numeric(5,2)>2.00 and $1::numeric(5,2)<=2.50',40),
('hzbnote', 'a5', 'gesamt','befriedigend 2,6-3,0','$1::numeric(5,2)>2.50 and $1::numeric(5,2)<=3.00',50),
('hzbnote', 'a6', 'gesamt','befriedigend 3,1-3,5','$1::numeric(5,2)>3.00 and $1::numeric(5,2)<=3.50',60),
('hzbnote', 'a7', 'gesamt','ausreichend 3,6-4,5','$1::numeric(5,2)>3.500 and $1::numeric(5,2)<=4.50',70),
('hzbnote', 'a8', 'gesamt','Note unbekannt','$1::numeric(5,2)<0.00 or $1::numeric(5,2)>4.50',80);
</#if>
--wäre eine Möglichkeit, die Werte aus der cifx zu überschreiben. Ist aber nicht notwendig, der Quatsch steht schon
--in dim_studiengang und lehr_stg_ab
--delete from xcube_dims where id='fb';
--INSERT INTO xcube_dims (id,apnr,name,sort1)
--select 'fb',key_apnr,name,0 from organigramm where orgstruktur=20
--and today() between gueltig_seit and gueltig_bis;
--in der cifx stehen unter key=110 alle Institutionen, nicht nur lehreinheiten
delete from xcube_dims where id='lehr';
INSERT INTO xcube_dims (id,apnr,name,sort1)
select 'lehr',key_apnr,name,0 from organigramm where orgstruktur=30
and today() between gueltig_seit and gueltig_bis;
<#if TableFieldExists('sos_lab_aggr','note')>
delete from xcube_dims where id='note';
INSERT INTO xcube_dims (id,apnr,parent, name,strukturstr,sort1)
values
('note','gesamt',null,'alle','1=1',1),
('note', 'a1', 'gesamt','Sehr gut <=1,0','$1::numeric(5,2)>=0.00 and $1::numeric(5,2)<=1.00',10),
('note', 'a2', 'gesamt','Sehr gut 1,1-1,5','$1::numeric(5,2)>1.00 and $1::numeric(5,2)<=1.50',20),
('note', 'a3', 'gesamt','gut 1,6-2,0','$1::numeric(5,2)>1.50 and $1::numeric(5,2)<=2.00',30),
('note', 'a4', 'gesamt','gut 2,1-2,5','$1::numeric(5,2)>2.00 and $1::numeric(5,2)<=2.50',40),
('note', 'a5', 'gesamt','befriedigend 2,6-3,0','$1::numeric(5,2)>2.50 and $1::numeric(5,2)<=3.00',50),
('note', 'a6', 'gesamt','befriedigend 3,1-3,5','$1::numeric(5,2)>3.00 and $1::numeric(5,2)<=3.50',60),
('note', 'a7', 'gesamt','ausreichend 3,6-4,5','$1::numeric(5,2)>3.500 and $1::numeric(5,2)<=4.50',70),
('note', 'a8', 'gesamt','Note unbekannt','$1::numeric(5,2)<0.00 or $1::numeric(5,2)>4.50',80);
</#if>
delete from xcube_dims where id='dauer_rsz';
INSERT INTO xcube_dims (id,apnr,name,sort1)
select distinct 'dauer_rsz',(-1)::varchar(10),'Stud.Dauer schneller als RSZ',-1 from xdummy;
INSERT INTO xcube_dims (id,apnr,name,sort1)
select distinct 'dauer_rsz',0::varchar(10),'Stud.Dauer in RSZ',0 from xdummy;
INSERT INTO xcube_dims (id,apnr,name,sort1)
select distinct 'dauer_rsz',1::varchar(10),'Stud.Dauer in RSZ + 1',1 from xdummy;
INSERT INTO xcube_dims (id,apnr,name,sort1)
select distinct 'dauer_rsz',2::varchar(10),'>= Stud.Dauer in RSZ + 2',2 from xdummy;
delete from xcube_dims where id='hzb_zul';
INSERT INTO xcube_dims (id,apnr, parent, name,strukturstr,sort1)
values
('hzb_zul','gesamt',null,'alle','1=1',1),
('hzb_zul', '1', '1-2-5-6', 'Allg. Hochschulreife','$1::integer = 1',10),
('hzb_zul', '4', '3-4', 'Allg. Hochschulreife im Ausland','$1::integer = 4',20),
('hzb_zul', '3-4','gesamt', 'Allg.u.fach(geb.) HSReife im Ausland','$1::integer in (3,4)',40),
('hzb_zul', '1-2-5-6','gesamt', 'Allg.u.fach(geb.) HSReife im Inland','$1::integer in (1,2,5,6)',30),
('hzb_zul', '3', '3-4', 'Fach(geb.) Hochschulreife im Ausl.','$1::integer = 3',40),
('hzb_zul', '6', '1-2-5-6','Fachgeb.HS-Reife','$1::integer = 6',50),
('hzb_zul', '2', '1-2-5-6','Fachhochschulreife','$1::integer = 2',60),
('hzb_zul', '5', '1-2-5-6','Sonstige','$1::integer = 5',70);
delete from xcube_dims where id='zul_erg';
INSERT INTO xcube_dims (id,apnr, name,strukturstr, sort1)
values
('zul_erg','0','Bewerbungen','1=1',0),
('zul_erg','1'::varchar(10),'Zulassungen','$1::integer in (1,2,3)',1 ),
('zul_erg','2'::varchar(10),'Annahmen','$1::integer in (2,3)',2 ),
('zul_erg','3'::varchar(10),'Einschreibung','$1::integer in (3)',3 );
--Zum Testen
--INSERT INTO xcube_dims (id,apnr,name,sort1,parent,strukturstr)
--VALUES
-- -('fs4','0','FS<4',1,NULL,NULL),
-- ('fs4','1','FS>=4',2,NULL,NULL);

23
src-modules/module/sxc/schluesseltabellen/xcube_install.sql

@ -30,13 +30,30 @@ @@ -30,13 +30,30 @@
"foreignkey_tab":"kenn_semester",
"foreignkey_col":"tid",
"foreignkey_cap":"druck",
"sortfield":"tid"},
"sortfield":"tid",
"calc_gesamt":0},
{"maskeninfo_id":47030,
"name":"hs_nr",
"caption":"Hochschule",
"is_rowdefault":1,
"is_sicht":1}
"is_sicht":1},
{"maskeninfo_id":47030,
"name":"auspraegung_code_3",
"caption":"Geschlecht",
"foreignkey_tab":"xcube_dims",
"foreignkey_col":"apnr",
"foreignkey_cap":"name",
"foreignkey_cond":"id='auspraegung_code_3'",
"attrib_nachbearbeitung": "update <<tmp_table>> set <<col>>='UNB' where <<col>> is NULL",
"sortfield":"sort1"},
{"maskeninfo_id":47030,
"name":"auspraegung_code_2",
"caption":"Nationalität",
"foreignkey_tab":"xcube_dims",
"foreignkey_col":"apnr",
"foreignkey_cap":"name",
"foreignkey_cond":"id='auspraegung_code_2'",
"sortfield":"sort1"}
] />

9
src-modules/module/sxc/schluesseltabellen/xcube_install_restrictions.sql

@ -0,0 +1,9 @@ @@ -0,0 +1,9 @@
update xcube set restriction='1=1
/* and semester >= <<Seit Semester>> */
/*and semester <= <<Bis Semester>>*/
/* and hs_nr::char(20) in (<<Hochschule>>) */
/* and ((trim(auspraegung_code_3) = <<Geschlecht>> and trim(auspraegung_code_3) in (''GESM'',''GESW''))*/
/* or (trim(auspraegung_code_3) is null and <<Geschlecht>> = ''UNB'')) */
/* and trim(auspraegung_code_2) = <<Nationalität>> */
' where maskeninfo_id=47030;
Loading…
Cancel
Save