Daniel Quathamer
11 months ago
14 changed files with 589 additions and 19 deletions
@ -0,0 +1,43 @@ |
|||||||
|
24570^Ausgabetabelle^200^0^0^100^150^1^sql^30^1^1^<<SQL>> select 'stud_hs1','Studierende im 1. Hochschulsemester' from xdummy\ |
||||||
|
union select 'stud_rsz2','Studierende in RSZ +2 ' from xdummy\ |
||||||
|
union select 'absolv','Erfolgreiche Prüfungen' from xdummy\ |
||||||
|
order by 1^ ^<<SQL>> select 'stud_hs1','Studierende im 1. Hochschulsemester' from xdummy^ |
||||||
|
24571^Jahr von^1^300^-1^170^150^1^integer^30^0^1^<<SQL>> SELECT ord,name from aggregierung\ |
||||||
|
where kategorie='KENN-Jahr'\ |
||||||
|
order by 1 desc^ ^<<SQL>> SELECT ord,name from aggregierung\ |
||||||
|
where kategorie='KENN-Jahr' and ord=year(today())-1^ |
||||||
|
24572^Spalten^400^0^0^100^200^1^sql^30^1^1^<<SQL>> select 'hs_nr','Hochschulen' from xdummy \ |
||||||
|
union select 'jahr','Jahr' from xdummy\ |
||||||
|
union select 'fgr','Fächergruppen' from xdummy \ |
||||||
|
union select 'abgrp','Abschlussgruppen' from xdummy \ |
||||||
|
order by 2;^ ^<<SQL>> select 'fgr','Fächergruppen' from xdummy^ |
||||||
|
24573^Abschluss^14^0^0^100^200^5^char^30^0^13^<<SQL>> select astat, dtxt from kenn_abschl_astat where struktur_c='Abschluss (amtlich)' order by 2;^ ^ ^ |
||||||
|
24574^Gewichtung^100^0^0^100^10^1^integer^30^0^1^<<SQL>> select 1,'Ja' from xdummy union select 0,'Nein' from xdummy^ ^<<SQL>> select 0,'Nein' from xdummy^ |
||||||
|
24575^Spaltenvisualisierung^500^0^0^100^10^1^char^30^0^1^<<SQL>> select '_graph','Balken (horiz. 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')^ ^ ^ |
||||||
|
24577^Staatsangehörigkeit^11^0^0^100^120^1^sql^30^0^1^<<SQL>> --Freemarker Template\ |
||||||
|
<sqlvars>\ |
||||||
|
<sqlvar name="sos_staat_eu_exists">\ |
||||||
|
select sp_table_exists('sos_staat_eu') from xdummy;\ |
||||||
|
</sqlvar>\ |
||||||
|
</sqlvars>\ |
||||||
|
select 'A','Alle ohne Deutschland' from xdummy\ |
||||||
|
union select 'I','Deutsch' from xdummy \ |
||||||
|
<#if sos_staat_eu_exists==1>\ |
||||||
|
union select 'EU','EU-Ausländer' from xdummy union select 'NEU','Nicht-EU-Ausländer' from xdummy\ |
||||||
|
</#if>\ |
||||||
|
order by 2;^ ^ ^ |
||||||
|
24578^Zeilen^300^300^-1^170^150^1^sql^30^1^1^<<SQL>>select 'hs_nr','Hochschulen' from xdummy \ |
||||||
|
union select 'jahr','Jahr' from xdummy\ |
||||||
|
union select 'fgr','Fächergruppen' from xdummy \ |
||||||
|
union select 'abgrp','Abschlussgruppen' from xdummy \ |
||||||
|
order by 2;^ ^<<SQL>> select 'hs_nr','Hochschulen' from xdummy ;^ |
||||||
|
24579^Hochschule^0^0^0^100^150^1^char^30^0^12^<<SQL>> select tid, type, name from sichten where art in('KENN-Kostenstellen-Sicht','KENN-Hochschulen-Sicht') order by sortnr, name;^ ^ ^ |
||||||
|
24581^Jahr bis^5^0^0^100^70^1^integer^30^0^1^<<SQL>> SELECT ord,name from aggregierung\ |
||||||
|
where kategorie='KENN-Jahr'\ |
||||||
|
order by 1 desc^ ^<<SQL>> SELECT ord,name from aggregierung\ |
||||||
|
where kategorie='KENN-Jahr' and ord=year(today())-1^ |
||||||
|
24583^Geschlecht^13^300^-1^170^100^1^integer^30^0^1^<<SQL>> SELECT apnr,druck FROM kenn_geschl order by 2^ ^ ^ |
@ -0,0 +1,11 @@ |
|||||||
|
24570^24570^ |
||||||
|
24570^24571^ |
||||||
|
24570^24572^ |
||||||
|
24570^24573^ |
||||||
|
24570^24574^ |
||||||
|
24570^24575^ |
||||||
|
24570^24577^ |
||||||
|
24570^24578^ |
||||||
|
24570^24579^ |
||||||
|
24570^24581^ |
||||||
|
24570^24583^ |
@ -0,0 +1,296 @@ |
|||||||
|
24570^ZSL-Mittelverteilung (Teiltabelle)^--(c) 2023 Jutta Otten jutta.otten@verwaltung.uni-stuttgart.de & D.Quathamer\ |
||||||
|
--Freemarker Template\ |
||||||
|
<#include "SQL_lingua_franca"/>\ |
||||||
|
<#include "SuperX_general"/>\ |
||||||
|
<sqlvars>\ |
||||||
|
<sqlvar name="jahr" type="hashsequence"><![CDATA[\ |
||||||
|
SELECT ord as key,name from aggregierung\ |
||||||
|
where kategorie='KENN-Jahr'\ |
||||||
|
/* and ord >= <<Jahr von>> */\ |
||||||
|
/* and ord <= <<Jahr bis>> */\ |
||||||
|
order by 1\ |
||||||
|
;\ |
||||||
|
]]>\ |
||||||
|
</sqlvar>\ |
||||||
|
<sqlvar name="hs_nr" type="hashsequence"><![CDATA[\ |
||||||
|
SELECT hs_nr as key,name from kenn_hochschulen\ |
||||||
|
where hs_nr::char(10) in <@printkeys .vars["Hochschule"].allNeededKeys />\ |
||||||
|
and traegerschaft='ST'\ |
||||||
|
order by 2\ |
||||||
|
;\ |
||||||
|
]]>\ |
||||||
|
</sqlvar>\ |
||||||
|
<sqlvar name="fgr" type="hashsequence"><![CDATA[\ |
||||||
|
SELECT apnr as key,drucktext as name from kenn_dim_fgr\ |
||||||
|
where fg_studierende is not null\ |
||||||
|
order by 2\ |
||||||
|
;\ |
||||||
|
]]>\ |
||||||
|
</sqlvar>\ |
||||||
|
<sqlvar name="abgrp" type="hashsequence"><![CDATA[\ |
||||||
|
SELECT 'BA'::char(2) as key,'Bachelor'::varchar(255) as name from xdummy\ |
||||||
|
union\ |
||||||
|
SELECT 'MA','Master' from xdummy\ |
||||||
|
union\ |
||||||
|
SELECT 'ST','Staatsexamen' from xdummy\ |
||||||
|
order by 1\ |
||||||
|
;\ |
||||||
|
]]>\ |
||||||
|
</sqlvar>\ |
||||||
|
</sqlvars>\ |
||||||
|
<#assign fact_table="kenn_stg_aggr_astat" />\ |
||||||
|
<#assign fact_filter="1=1" />\ |
||||||
|
<#assign semesterfeld="sem_rueck_beur_ein" />\ |
||||||
|
<#assign aggrfunction="sum(summe)" />\ |
||||||
|
<#assign aggrcoltype="integer" />\ |
||||||
|
\ |
||||||
|
<#assign graph_col_summe= "" />\ |
||||||
|
<#assign graph_col= "col" />\ |
||||||
|
/* <#assign graph_col=<<Spaltenvisualisierung>> /> */\ |
||||||
|
<#if graph_col=="_graph">\ |
||||||
|
<#assign graph_col_summe= "|" />\ |
||||||
|
</#if>\ |
||||||
|
\ |
||||||
|
<#if "<<Gewichtung>>"=="1">\ |
||||||
|
<#assign aggrcoltype="float" />\ |
||||||
|
<#assign aggrfunction="sum(summe::"+aggrcoltype+"*faktor)" />\ |
||||||
|
</#if>\ |
||||||
|
\ |
||||||
|
<#if "<<Ausgabetabelle>>" == "stud_hs1" >\ |
||||||
|
<#assign jahrfeld="akad_jahr_anf" />\ |
||||||
|
<#assign semesterfilter="substring('' || S.tid from 5 for 1) in ('1','2')" />\ |
||||||
|
<#assign fact_filter=fact_filter + " and kz_rueck_beur_ein < 4" /> -- ohne exmatr., ohne beurlaubten\ |
||||||
|
<#assign fact_filter=fact_filter + " and studiengang_nr = 1 and fach_nr = 1" /> -- Kopf mit 1. Studiengang, 1. Fach\ |
||||||
|
<#assign fact_filter=fact_filter + " and hssem = 1" /> -- 1. HS-Sem.\ |
||||||
|
<#elseif "<<Ausgabetabelle>>" == "stud_rsz2" >\ |
||||||
|
<#assign jahrfeld="val(substring('' || S.tid from 1 for 4))" />\ |
||||||
|
<#assign semesterfilter="substring('' || S.tid from 5 for 1)='2'" />\ |
||||||
|
<#assign fact_filter=fact_filter + " and kz_rueck_beur_ein < 4" /> -- ohne exmatr., ohne beurlaubten\ |
||||||
|
<#assign fact_filter=fact_filter + " and studiengang_nr = 1 and fach_nr = 1" /> -- Kopf mit 1. Studiengang, 1. Fach\ |
||||||
|
<#assign fact_filter=fact_filter + " and coalesce(fach_sem_zahl,0) < regel+3" /> -- in RSZ +2\ |
||||||
|
<#elseif "<<Ausgabetabelle>>" == "absolv" >\ |
||||||
|
<#assign fact_table="kenn_lab_aggr_astat" />\ |
||||||
|
<#assign jahrfeld="akad_jahr_absolv" />\ |
||||||
|
<#assign semesterfeld="sem_der_pruefung" />\ |
||||||
|
<#assign semesterfilter="substring('' || S.tid from 5 for 1) in ('1','2')" />\ |
||||||
|
<#assign fact_filter=fact_filter + " and studiengang_nr = 1 and fach_nr = 1" /> -- Kopf mit 1. Studiengang, 1. Fach?\ |
||||||
|
<#assign fact_filter=fact_filter + " and pruefung_ergebnis <> 2" /> -- nur erfolgreiche Prüfungen\ |
||||||
|
</#if>\ |
||||||
|
\ |
||||||
|
\ |
||||||
|
\ |
||||||
|
\ |
||||||
|
<#assign staat_filter="1=1" />\ |
||||||
|
<#if "<<Staatsangehörigkeit>>"="I">\ |
||||||
|
<#assign staat_filter="ca12_staat=0" />\ |
||||||
|
<#elseif "<<Staatsangehörigkeit>>"="A">\ |
||||||
|
<#assign staat_filter="ca12_staat!=0" />\ |
||||||
|
<#elseif "<<Staatsangehörigkeit>>"="EU">\ |
||||||
|
<#assign staat_filter="ca12_staat !=0 and 0 <(select count(*) from sos_staat_eu E where val(E.astat)=ca12_staat and "+semesterfeld+" between E.semester_von and E.semester_bis and EU='J') " />\ |
||||||
|
<#elseif "<<Staatsangehörigkeit>>"="NEU">\ |
||||||
|
<#assign staat_filter="0 <(select count(*) from sos_staat_eu E where val(E.astat)=ca12_staat and "+semesterfeld+" between E.semester_von and E.semester_bis and EU='N') " />\ |
||||||
|
</#if>\ |
||||||
|
\ |
||||||
|
<#assign fieldclause=jahrfeld+" as jahr,hs_nr,hzbart_astat,ca12_staat,fgr,abgrp,"+aggrfunction + " as summe" />\ |
||||||
|
<#assign fromclause="kenn_semester S, "+fact_table +" inner join kenn_zsl_ausgleich_kennungen Z on (concat (substring(stufrm from 1 for 1),abschluss)=Z.astat and kennung_<<Ausgabetabelle>>=1) " />\ |
||||||
|
\ |
||||||
|
<#assign whereclause="S.tid="+semesterfeld+" and " + semesterfilter+" and "+ fact_filter />\ |
||||||
|
<#assign whereclause=whereclause+ " and " + jahrfeld+ " >= <<Jahr von>>" />\ |
||||||
|
<#assign whereclause=whereclause+ " and " + jahrfeld+ " <= <<Jahr bis>>" />\ |
||||||
|
\ |
||||||
|
--Default: Schleife über Hochschule\ |
||||||
|
<#assign rowdim=<<Zeilen>> />\ |
||||||
|
<#assign rowfieldname="<<Zeilen>>" />\ |
||||||
|
<#assign coldim=<<Spalten>> />\ |
||||||
|
<#assign colfieldname="<<Spalten>>" />\ |
||||||
|
\ |
||||||
|
<#if rowfieldname!=colfieldname >\ |
||||||
|
\ |
||||||
|
--start Datentabelle\ |
||||||
|
<@selectintotmp \ |
||||||
|
select=fieldclause\ |
||||||
|
source=fromclause\ |
||||||
|
target="tmp_tabelle">\ |
||||||
|
-- nested in selectinto muss die where Bedingung u. ggfs. group by etc kommen\ |
||||||
|
where hs_nr::char(10) in <@printkeys .vars["Hochschule"].allNeededKeys />\ |
||||||
|
and ${whereclause}\ |
||||||
|
/* and abschluss in (<<Abschluss>>) */\ |
||||||
|
/* and hzbart=<<Hochschulzugangsber.>> */\ |
||||||
|
/* and geschlecht = <<Geschlecht>> */\ |
||||||
|
and ${staat_filter}\ |
||||||
|
group by 1,2,3,4,5,6\ |
||||||
|
</@selectintotmp>\ |
||||||
|
<@informixnolog/>;\ |
||||||
|
\ |
||||||
|
\ |
||||||
|
<#assign sortnr=1 />\ |
||||||
|
--Zuerst Summe:\ |
||||||
|
select 1::smallint as ebene ,\ |
||||||
|
${sortnr}::integer as sortnr,\ |
||||||
|
'Summe'::varchar(255) as levelname,\ |
||||||
|
<#if coldim?has_content>\ |
||||||
|
<#foreach col in coldim>\ |
||||||
|
(case when ${colfieldname}='${col.key}' then sum(summe) else 0 end)::${aggrcoltype} as spalte${col.key},\ |
||||||
|
</#foreach>\ |
||||||
|
</#if>\ |
||||||
|
(case when hzbart_astat in ('39','67','17','47','59','79','76','31','51','96','94','95') \ |
||||||
|
and ca12_staat <> 0 then sum(summe) else 0 end)::${aggrcoltype} as summe_ba,\ |
||||||
|
(sum(summe))::${aggrcoltype} as summe\ |
||||||
|
into temp tmp_tabelle2\ |
||||||
|
FROM tmp_tabelle\ |
||||||
|
group by 1,2,3,${colfieldname},hzbart_astat,ca12_staat\ |
||||||
|
;\ |
||||||
|
\ |
||||||
|
--dann Levels:\ |
||||||
|
<#if rowdim?has_content>\ |
||||||
|
<#foreach row in rowdim>\ |
||||||
|
<#assign sortnr=sortnr+1 />\ |
||||||
|
insert into tmp_tabelle2\ |
||||||
|
select 2::smallint as ebene,\ |
||||||
|
${sortnr},\ |
||||||
|
'${row.name}' as levelname,\ |
||||||
|
<#if coldim?has_content>\ |
||||||
|
<#foreach col in coldim>\ |
||||||
|
(case when ${colfieldname}='${col.key}' then sum(summe) else 0 end)::${aggrcoltype} as spalte${col.key},\ |
||||||
|
</#foreach>\ |
||||||
|
</#if>\ |
||||||
|
(case when hzbart_astat in ('39','67','17','47','59','79','76','31','51','96','94','95') \ |
||||||
|
and ca12_staat <> 0 then sum(summe) else 0 end)::${aggrcoltype} as summe_ba,\ |
||||||
|
sum(summe)\ |
||||||
|
FROM tmp_tabelle\ |
||||||
|
where ${rowfieldname}='${row.key}'\ |
||||||
|
group by 1,2,3,${colfieldname},hzbart_astat,ca12_staat\ |
||||||
|
;\ |
||||||
|
</#foreach>\ |
||||||
|
</#if>\ |
||||||
|
\ |
||||||
|
--Aufsummieren:\ |
||||||
|
select ebene ,\ |
||||||
|
sortnr,\ |
||||||
|
levelname,\ |
||||||
|
<#if coldim?has_content>\ |
||||||
|
<#foreach col in coldim>\ |
||||||
|
sum(spalte${col.key})::${aggrcoltype} as spalte${col.key},\ |
||||||
|
</#foreach>\ |
||||||
|
</#if>\ |
||||||
|
sum(summe_ba)::${aggrcoltype} as summe_ba,\ |
||||||
|
sum(summe)::${aggrcoltype} as summe\ |
||||||
|
into temp tmp_tabelle3\ |
||||||
|
FROM tmp_tabelle2\ |
||||||
|
group by 1,2,3\ |
||||||
|
;\ |
||||||
|
\ |
||||||
|
drop table tmp_tabelle;\ |
||||||
|
drop table tmp_tabelle2;\ |
||||||
|
\ |
||||||
|
\ |
||||||
|
select <#if graph_col=="col">\ |
||||||
|
ebene,\ |
||||||
|
<#else>\ |
||||||
|
ebene as level, --bei Grafiken keine Ebenenanzeige\ |
||||||
|
</#if>\ |
||||||
|
<#if graph_col?starts_with("_spark")>\ |
||||||
|
levelname as _categorySpark,\ |
||||||
|
<#else>\ |
||||||
|
levelname,\ |
||||||
|
</#if>\ |
||||||
|
<#if coldim?has_content>\ |
||||||
|
<#foreach col in coldim>\ |
||||||
|
<#if graph_col=="col">\ |
||||||
|
spalte${col.key},\ |
||||||
|
<#elseif graph_col?starts_with("_spark")>\ |
||||||
|
spalte${col.key} as ${graph_col}${col.key},\ |
||||||
|
<#else>\ |
||||||
|
'' || spalte${col.key} || '|' || summe as ${graph_col}${col.key},\ |
||||||
|
</#if>\ |
||||||
|
</#foreach>\ |
||||||
|
</#if>\ |
||||||
|
<#if graph_col=="col">\ |
||||||
|
summe,\ |
||||||
|
summe_ba\ |
||||||
|
<#elseif graph_col?starts_with("_spark")>\ |
||||||
|
summe as ${graph_col}summe,\ |
||||||
|
summe_ba as ${graph_col}summe_ba\ |
||||||
|
<#else>\ |
||||||
|
summe,\ |
||||||
|
'' || summe_ba || '|' || summe as ${graph_col}summe_ba\ |
||||||
|
</#if>\ |
||||||
|
\ |
||||||
|
FROM tmp_tabelle3\ |
||||||
|
ORDER BY sortnr,1,2,3;\ |
||||||
|
<#else>\ |
||||||
|
--Zeilen und Spalten gleich:\ |
||||||
|
select null::integer into temp tmp_tabelle3\ |
||||||
|
from xdummy;\ |
||||||
|
select * from tmp_tabelle3;\ |
||||||
|
</#if>^--Freemarker Template\ |
||||||
|
<sqlvars>\ |
||||||
|
<sqlvar name="jahr" type="hashsequence"><![CDATA[\ |
||||||
|
SELECT ord,name,'Jahr'::varchar(255) as dimcaption\ |
||||||
|
from aggregierung\ |
||||||
|
where kategorie='KENN-Jahr'\ |
||||||
|
/* and ord >= <<Jahr von>> */\ |
||||||
|
/* and ord <= <<Jahr bis>> */\ |
||||||
|
order by 1\ |
||||||
|
;\ |
||||||
|
]]>\ |
||||||
|
</sqlvar>\ |
||||||
|
<sqlvar name="hs_nr" type="hashsequence"><![CDATA[\ |
||||||
|
SELECT hs_nr as key,name,'Hochschule'::varchar(255) as dimcaption\ |
||||||
|
from kenn_hochschulen\ |
||||||
|
where hs_nr::char(10) in <@printkeys .vars["Hochschule"].allNeededKeys />\ |
||||||
|
and traegerschaft='ST'\ |
||||||
|
order by 2\ |
||||||
|
;\ |
||||||
|
]]>\ |
||||||
|
</sqlvar>\ |
||||||
|
<sqlvar name="fgr" type="hashsequence"><![CDATA[\ |
||||||
|
SELECT apnr as key,drucktext as name,'Fächergruppe'::varchar(255) as dimcaption\ |
||||||
|
from kenn_dim_fgr\ |
||||||
|
where fg_studierende is not null\ |
||||||
|
order by 2\ |
||||||
|
;\ |
||||||
|
]]>\ |
||||||
|
</sqlvar>\ |
||||||
|
<sqlvar name="abgrp" type="hashsequence"><![CDATA[\ |
||||||
|
SELECT 'BA'::char(1) as key,'Bachelor'::varchar(255) as name,\ |
||||||
|
'Abschlussart'::varchar(255) as dimcaption \ |
||||||
|
from xdummy\ |
||||||
|
union\ |
||||||
|
SELECT 'MA','Master',\ |
||||||
|
'Abschlussart'::varchar(255) as dimcaption from xdummy\ |
||||||
|
union\ |
||||||
|
SELECT 'ST','Staatsexamen',\ |
||||||
|
'Abschlussart'::varchar(255) as dimcaption from xdummy\ |
||||||
|
order by 1\ |
||||||
|
;\ |
||||||
|
]]>\ |
||||||
|
</sqlvar>\ |
||||||
|
</sqlvars>\ |
||||||
|
<#assign coldim=<<Spalten>> />\ |
||||||
|
<#assign colfieldname="<<Spalten>>" />\ |
||||||
|
XIL List\ |
||||||
|
drop_and_delete movable_columns sizable_columns horizontal_scrolling\ |
||||||
|
white_space_color=COLOR_WHITE fixed_columns=1\ |
||||||
|
min_heading_height=35\ |
||||||
|
Column CID=2 heading_text=" Ebene " center_heading\ |
||||||
|
row_selectable col_selectable heading_platform readonly\ |
||||||
|
width=5 text_size=30\ |
||||||
|
Column CID=2 heading_text=" Name " center_heading\ |
||||||
|
row_selectable col_selectable heading_platform readonly\ |
||||||
|
width=30 text_size=30\ |
||||||
|
<#if coldim?has_content>\ |
||||||
|
<#foreach col in coldim>\ |
||||||
|
Column CID=3 heading_text=" ${col.dimcaption}\\000${col.name}" center_heading\ |
||||||
|
row_selectable col_selectable heading_platform readonly\ |
||||||
|
width=10 text_size=30\ |
||||||
|
</#foreach>\ |
||||||
|
</#if>\ |
||||||
|
Column CID=3 heading_text="Gesamt" center_heading\ |
||||||
|
row_selectable col_selectable heading_platform readonly\ |
||||||
|
width=10 text_size=30\ |
||||||
|
Column CID=3 heading_text="Darunter\\n\ |
||||||
|
Bildungsausl." center_heading row_selectable col_selectable heading_platform readonly\ |
||||||
|
width=10 text_size=30\ |
||||||
|
@@@^Studienfach^Anzahl bzw. Anteil^Studierende oder Absolvent_innen nach Hochschule, Fächergruppe, Gewichtung^drop table tmp_tabelle3;^^1^850^600^^1^<<SQL>> select 'Bitte wählen Sie unterschiedliche Spalten/Zeilen' from xdummy where '<<Zeilen>>'='<<Spalten>>' union \ |
||||||
|
select 'Gewichtung mit folgenden Faktoren: Abschlüsse grundständiger Studiengänge ohne Staasexamen * 1 + Abschlüsse konsekutiver Master-Studiengänge * 0,5 + Abschlüsse Staatsexamen (inkl. Lehramt) * 1,5' from xdummy where '<<Gewichtung>>'='1'^ |
@ -0,0 +1,24 @@ |
|||||||
|
24601^Jahr von^1^300^-1^170^150^1^integer^30^0^1^<<SQL>> SELECT ord,name from aggregierung\ |
||||||
|
where kategorie='KENN-Jahr'\ |
||||||
|
order by 1 desc^ ^<<SQL>> SELECT ord,name from aggregierung\ |
||||||
|
where kategorie='KENN-Jahr' and ord=year(today())-1^ |
||||||
|
24603^Abschluss^14^0^0^100^200^5^char^30^0^13^<<SQL>> select astat, dtxt from kenn_abschl_astat where struktur_c='Abschluss (amtlich)' order by 2;^ ^ ^ |
||||||
|
24604^Gewichtung^100^0^0^100^10^1^integer^30^0^13^<<SQL>> select 1,'Ja' from xdummy union select 0,'Nein' from xdummy^ ^<<SQL>> select 0,'Nein' from xdummy^ |
||||||
|
24607^Staatsangehörigkeit^11^0^0^100^120^1^sql^30^0^1^<<SQL>> --Freemarker Template\ |
||||||
|
<sqlvars>\ |
||||||
|
<sqlvar name="sos_staat_eu_exists">\ |
||||||
|
select sp_table_exists('sos_staat_eu') from xdummy;\ |
||||||
|
</sqlvar>\ |
||||||
|
</sqlvars>\ |
||||||
|
select 'A','Alle ohne Deutschland' from xdummy\ |
||||||
|
union select 'I','Deutsch' from xdummy \ |
||||||
|
<#if sos_staat_eu_exists==1>\ |
||||||
|
union select 'EU','EU-Ausländer' from xdummy union select 'NEU','Nicht-EU-Ausländer' from xdummy\ |
||||||
|
</#if>\ |
||||||
|
order by 2;^ ^ ^ |
||||||
|
24609^Hochschule^0^0^0^100^150^1^char^30^0^12^<<SQL>> select tid, type, name from sichten where art in('KENN-Kostenstellen-Sicht','KENN-Hochschulen-Sicht') order by sortnr, name;^ ^ ^ |
||||||
|
24611^Jahr bis^5^0^0^100^70^1^integer^30^0^1^<<SQL>> SELECT ord,name from aggregierung\ |
||||||
|
where kategorie='KENN-Jahr'\ |
||||||
|
order by 1 desc^ ^<<SQL>> SELECT ord,name from aggregierung\ |
||||||
|
where kategorie='KENN-Jahr' and ord=year(today())-1^ |
||||||
|
24613^Geschlecht^13^300^-1^170^100^1^integer^30^0^1^<<SQL>> SELECT apnr,druck FROM kenn_geschl order by 2^ ^ ^ |
@ -0,0 +1,7 @@ |
|||||||
|
24600^24601^ |
||||||
|
24600^24603^ |
||||||
|
24600^24604^ |
||||||
|
24600^24607^ |
||||||
|
24600^24609^ |
||||||
|
24600^24611^ |
||||||
|
24600^24613^ |
@ -0,0 +1,3 @@ |
|||||||
|
24600^ZSL-Mittelverteilung (Gesamtbericht)^--Wenn Freemarker eingesetzt wird, muss der folgende Kommentar (case insensitive) irgendwo in der Abfrage stehen\ |
||||||
|
--Freemarker Template^--Freemarker Template^Studienfach^Anzahl bzw. Anteil^Studierende oder Absolvent_innen nach Hochschule, Fächergruppe, Gewichtung^ ^^1^850^600^^1^<<SQL>> select 'Bitte wählen Sie unterschiedliche Spalten/Zeilen' from xdummy where '<<Zeilen>>'='<<Spalten>>' union \ |
||||||
|
select 'Gewichtung mit folgenden Faktoren: Abschlüsse grundständiger Studiengänge ohne Staasexamen * 1 + Abschlüsse konsekutiver Master-Studiengänge * 0,5 + Abschlüsse Staatsexamen (inkl. Lehramt) * 1,5' from xdummy where '<<Gewichtung>>'='1'^ |
@ -1,11 +1,14 @@ |
|||||||
#!/bin/bash |
#!/bin/bash |
||||||
|
|
||||||
sx_auto_insert_mask 32560 |
sx_auto_insert_mask 24570 |
||||||
|
|
||||||
sx_auto_insert_mask 32580 |
sx_auto_insert_mask 24600 |
||||||
|
|
||||||
DOSQL kenn_zsl_ausgleich_kennungen_fuellen.sql |
DOSQL kenn_zsl_ausgleich_kennungen_fuellen.sql |
||||||
|
|
||||||
DOSQL makro_masken_fuellen.sql |
DOSQL makro_masken_fuellen.sql |
||||||
|
|
||||||
DOSQL themenbaum_fuellen.sql |
DOSQL themenbaum_fuellen.sql |
||||||
|
|
||||||
|
DOSQL sx_stylesheets_einfuegen.sql |
||||||
|
|
||||||
|
@ -0,0 +1,168 @@ |
|||||||
|
--Freemarker Template |
||||||
|
--Achtung: Macro fügt Inhalte ein |
||||||
|
--Bitte nur Freemarker Variablen füllen |
||||||
|
|
||||||
|
<#assign masken = [ |
||||||
|
{"mask":"24570", "filename":"tabelle_html_viz.xsl", "ord":"0"} |
||||||
|
|
||||||
|
] /> |
||||||
|
|
||||||
|
<#assign stylesheet = [ |
||||||
|
|
||||||
|
] /> |
||||||
|
<#assign stylesheet_field = [ |
||||||
|
|
||||||
|
] /> |
||||||
|
|
||||||
|
--Hier eventuell notwendige delete's auf die Tabellen sx_mask_style, sx_stylesheets oder stylesheet_field einfügen. |
||||||
|
|
||||||
|
delete from sx_mask_style where maskeninfo_id=44070; |
||||||
|
|
||||||
|
--Achtung: ab hier nicht ändern, Mutterdatei ist $SUPERX_DIR/db/module/sos/schluesseltabellen/sx_stylesheets_fuellen.sql |
||||||
|
<@sx_stylesheets_insert |
||||||
|
m_masken=masken |
||||||
|
m_stylesheet=stylesheet |
||||||
|
m_stylesheet_field=stylesheet_field |
||||||
|
/> |
||||||
|
|
||||||
|
|
||||||
|
<#macro sx_stylesheets_insert m_masken m_stylesheet m_stylesheet_field> |
||||||
|
|
||||||
|
--Sicherstellen, dass keine Duplikate vorkommen: |
||||||
|
--#################################################################################################### |
||||||
|
<#foreach column in m_masken> |
||||||
|
delete from sx_mask_style where maskeninfo_id=${column.mask} and stylesheet_id in (select tid from sx_stylesheets where filename ='${column.filename}') and ord=${column.ord}; |
||||||
|
</#foreach> |
||||||
|
|
||||||
|
<#foreach column in m_stylesheet_field> |
||||||
|
delete from stylesheet_field where stylesheet_id in (select tid from sx_stylesheets where filename ='${column.filename}'); |
||||||
|
</#foreach> |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
-- Stylesheets füllen |
||||||
|
--#################################################################################################### |
||||||
|
create temp table tmp_stylesheets ( |
||||||
|
tid serial not null, |
||||||
|
filename CHAR(255) , |
||||||
|
caption CHAR(255) , |
||||||
|
description CHAR(255) , |
||||||
|
relation CHAR(10) , |
||||||
|
useragent CHAR(255) , |
||||||
|
contenttype CHAR(200) , |
||||||
|
is_generic smallint |
||||||
|
); |
||||||
|
|
||||||
|
create temp table tmp_hilf (tid integer); |
||||||
|
insert into tmp_hilf select max(tid) from sx_stylesheets; |
||||||
|
update tmp_hilf set tid=1 where tid is null; |
||||||
|
|
||||||
|
<#assign counter_tid = 1 /> |
||||||
|
<#foreach column in m_stylesheet> |
||||||
|
insert into tmp_stylesheets (tid,filename,caption,description,relation,contenttype,is_generic) |
||||||
|
select max(tid)+${counter_tid},'${column.filename}', |
||||||
|
'${column.caption}', |
||||||
|
'${column.description}', |
||||||
|
'${column.relation}', |
||||||
|
'${column.contenttype}', |
||||||
|
${column.is_generic} |
||||||
|
from tmp_hilf; |
||||||
|
<#assign counter_tid = counter_tid + 1 /> |
||||||
|
</#foreach> |
||||||
|
|
||||||
|
<#if TableFieldExists?exists && TableFieldExists('sx_stylesheets','is_generic')> |
||||||
|
update sx_stylesheets set is_generic=1 |
||||||
|
where filename in (select T.filename from tmp_stylesheets T where T.is_generic=1); |
||||||
|
</#if> |
||||||
|
|
||||||
|
|
||||||
|
--delete für tml_stylesheets hinzugefügt #ak 06.03.2013 |
||||||
|
delete from tmp_stylesheets where filename in (select filename from sx_stylesheets); |
||||||
|
|
||||||
|
|
||||||
|
insert into sx_stylesheets (tid, |
||||||
|
filename, caption, description, relation, useragent, contenttype |
||||||
|
<#if TableFieldExists?exists && TableFieldExists('sx_stylesheets','is_generic')> |
||||||
|
,is_generic |
||||||
|
</#if> |
||||||
|
) |
||||||
|
SELECT tid, filename, caption, description, relation, useragent, contenttype |
||||||
|
<#if TableFieldExists?exists && TableFieldExists('sx_stylesheets','is_generic')> |
||||||
|
,is_generic |
||||||
|
</#if> |
||||||
|
FROM tmp_stylesheets; |
||||||
|
|
||||||
|
drop table tmp_stylesheets; |
||||||
|
|
||||||
|
|
||||||
|
-- Mask Style füllen |
||||||
|
--#################################################################################################### |
||||||
|
create temp table tmp_mask_style ( |
||||||
|
tid serial not null, |
||||||
|
maskeninfo_id INTEGER , |
||||||
|
stylesheet_id INTEGER , |
||||||
|
ord SMALLINT, |
||||||
|
filename char(255) |
||||||
|
); |
||||||
|
|
||||||
|
delete from tmp_hilf; |
||||||
|
insert into tmp_hilf select max(tid) from sx_mask_style; |
||||||
|
update tmp_hilf set tid=1 where tid is null; |
||||||
|
|
||||||
|
<#assign counter_tid = 1 /> |
||||||
|
<#foreach column in m_masken> |
||||||
|
insert into tmp_mask_style (tid,maskeninfo_id,ord,filename) |
||||||
|
select max(tid)+${counter_tid},${column.mask},${column.ord},'${column.filename}' from tmp_hilf; |
||||||
|
|
||||||
|
update tmp_mask_style set stylesheet_id=(select max(tid) from sx_stylesheets where filename='${column.filename}') |
||||||
|
where filename='${column.filename}'; |
||||||
|
<#assign counter_tid = counter_tid + 1 /> |
||||||
|
</#foreach> |
||||||
|
|
||||||
|
insert into sx_mask_style ( tid, maskeninfo_id, stylesheet_id, ord) |
||||||
|
SELECT tid, maskeninfo_id, stylesheet_id, ord |
||||||
|
FROM tmp_mask_style; |
||||||
|
|
||||||
|
drop table tmp_mask_style; |
||||||
|
|
||||||
|
|
||||||
|
--Field zu Stylesheet Zuordnungen: |
||||||
|
--#################################################################################################### |
||||||
|
CREATE temp TABLE tmp_stylesheet_field |
||||||
|
( |
||||||
|
tid serial NOT NULL, |
||||||
|
stylesheet_id INTEGER, |
||||||
|
tablename char(255), |
||||||
|
fieldname char(255), |
||||||
|
filename char(255) |
||||||
|
); |
||||||
|
|
||||||
|
delete from tmp_hilf; |
||||||
|
insert into tmp_hilf select max(tid) from stylesheet_field; |
||||||
|
update tmp_hilf set tid=1 where tid is null; |
||||||
|
|
||||||
|
<#assign counter_tid = 1 /> |
||||||
|
<#foreach column in m_stylesheet_field> |
||||||
|
INSERT INTO tmp_stylesheet_field (tid, filename, tablename, fieldname) |
||||||
|
select max(tid)+${counter_tid}, '${column.filename}', '${column.tablename}', '${column.fieldname}' from tmp_hilf; |
||||||
|
|
||||||
|
update tmp_stylesheet_field set stylesheet_id=(select max(tid) from sx_stylesheets where filename='${column.filename}') |
||||||
|
where filename='${column.filename}'; |
||||||
|
<#assign counter_tid = counter_tid + 1 /> |
||||||
|
</#foreach> |
||||||
|
|
||||||
|
insert into stylesheet_field ( tid, stylesheet_id, tablename, fieldname) |
||||||
|
SELECT tid, stylesheet_id, tablename, fieldname |
||||||
|
FROM tmp_stylesheet_field; |
||||||
|
|
||||||
|
drop table tmp_stylesheet_field; |
||||||
|
drop table tmp_hilf; |
||||||
|
|
||||||
|
<#if SQLdialect='Postgres'> |
||||||
|
select sp_update_sequence('sx_stylesheets'); |
||||||
|
select sp_update_sequence('sx_mask_style'); |
||||||
|
select sp_update_sequence('stylesheet_field'); |
||||||
|
</#if> |
||||||
|
|
||||||
|
</#macro> |
Loading…
Reference in new issue