diff --git a/2023_zsl_berichte/24570_felderinfo.unl b/2023_zsl_berichte/24570_felderinfo.unl new file mode 100644 index 0000000..600443d --- /dev/null +++ b/2023_zsl_berichte/24570_felderinfo.unl @@ -0,0 +1,43 @@ +24570^Ausgabetabelle^200^0^0^100^150^1^sql^30^1^1^<> 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^ ^<> select 'stud_hs1','Studierende im 1. Hochschulsemester' from xdummy^ +24571^Jahr von^1^300^-1^170^150^1^integer^30^0^1^<> SELECT ord,name from aggregierung\ +where kategorie='KENN-Jahr'\ +order by 1 desc^ ^<> 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^<> 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;^ ^<> select 'fgr','Fächergruppen' from xdummy^ +24573^Abschluss^14^0^0^100^200^5^char^30^0^13^<> 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^<> select 1,'Ja' from xdummy union select 0,'Nein' from xdummy^ ^<> select 0,'Nein' from xdummy^ +24575^Spaltenvisualisierung^500^0^0^100^10^1^char^30^0^1^<> 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^<> --Freemarker Template\ +\ +\ +select sp_table_exists('sos_staat_eu') from xdummy;\ +\ +\ +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\ +\ + order by 2;^ ^ ^ +24578^Zeilen^300^300^-1^170^150^1^sql^30^1^1^<>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;^ ^<> select 'hs_nr','Hochschulen' from xdummy ;^ +24579^Hochschule^0^0^0^100^150^1^char^30^0^12^<> 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^<> SELECT ord,name from aggregierung\ +where kategorie='KENN-Jahr'\ +order by 1 desc^ ^<> 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^<> SELECT apnr,druck FROM kenn_geschl order by 2^ ^ ^ diff --git a/2023_zsl_berichte/24570_maske_system_bez.unl b/2023_zsl_berichte/24570_maske_system_bez.unl new file mode 100644 index 0000000..ab374b5 --- /dev/null +++ b/2023_zsl_berichte/24570_maske_system_bez.unl @@ -0,0 +1 @@ +24570^109^ diff --git a/2023_zsl_berichte/24570_masken_felder_bez.unl b/2023_zsl_berichte/24570_masken_felder_bez.unl new file mode 100644 index 0000000..11e6f52 --- /dev/null +++ b/2023_zsl_berichte/24570_masken_felder_bez.unl @@ -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^ diff --git a/2023_zsl_berichte/24570_maskeninfo.unl b/2023_zsl_berichte/24570_maskeninfo.unl new file mode 100644 index 0000000..cf3f6e0 --- /dev/null +++ b/2023_zsl_berichte/24570_maskeninfo.unl @@ -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"/>\ +\ += <> */\ +/* and ord <= <> */\ +order by 1\ +;\ +]]>\ +\ +\ +and traegerschaft='ST'\ +order by 2\ +;\ +]]>\ +\ +\ +\ +\ +\ +\ +<#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=<> /> */\ +<#if graph_col=="_graph">\ +<#assign graph_col_summe= "|" />\ +\ +\ +<#if "<>"=="1">\ +<#assign aggrcoltype="float" />\ +<#assign aggrfunction="sum(summe::"+aggrcoltype+"*faktor)" />\ +\ +\ +<#if "<>" == "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 "<>" == "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 "<>" == "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\ +\ +\ +\ +\ +\ +<#assign staat_filter="1=1" />\ +<#if "<>"="I">\ +<#assign staat_filter="ca12_staat=0" />\ +<#elseif "<>"="A">\ +<#assign staat_filter="ca12_staat!=0" />\ +<#elseif "<>"="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 "<>"="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') " />\ +\ +\ +<#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_<>=1) " />\ +\ +<#assign whereclause="S.tid="+semesterfeld+" and " + semesterfilter+" and "+ fact_filter />\ +<#assign whereclause=whereclause+ " and " + jahrfeld+ " >= <>" />\ +<#assign whereclause=whereclause+ " and " + jahrfeld+ " <= <>" />\ +\ +--Default: Schleife über Hochschule\ +<#assign rowdim=<> />\ +<#assign rowfieldname="<>" />\ +<#assign coldim=<> />\ +<#assign colfieldname="<>" />\ +\ +<#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 (<>) */\ +/* and hzbart=<> */\ +/* and geschlecht = <> */\ +and ${staat_filter}\ +group by 1,2,3,4,5,6\ +\ + <@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},\ +\ +\ +(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},\ +\ +\ +(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\ +;\ +\ +\ +\ +--Aufsummieren:\ +select ebene ,\ +sortnr,\ +levelname,\ +<#if coldim?has_content>\ +<#foreach col in coldim>\ +sum(spalte${col.key})::${aggrcoltype} as spalte${col.key},\ +\ +\ +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 graph_col?starts_with("_spark")>\ + levelname as _categorySpark,\ + <#else>\ +levelname,\ +\ + <#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 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\ +\ +\ + 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;\ +^--Freemarker Template\ +\ += <> */\ +/* and ord <= <> */\ +order by 1\ +;\ +]]>\ +\ +\ +and traegerschaft='ST'\ +order by 2\ +;\ +]]>\ +\ +\ +\ +\ +\ +\ +<#assign coldim=<> />\ +<#assign colfieldname="<>" />\ +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\ +\ +\ +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^<> select 'Bitte wählen Sie unterschiedliche Spalten/Zeilen' from xdummy where '<>'='<>' 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 '<>'='1'^ diff --git a/2023_zsl_berichte/24570_sachgeb_maske_bez.unl b/2023_zsl_berichte/24570_sachgeb_maske_bez.unl new file mode 100644 index 0000000..8b25cfa --- /dev/null +++ b/2023_zsl_berichte/24570_sachgeb_maske_bez.unl @@ -0,0 +1 @@ +0^24570^ diff --git a/2023_zsl_berichte/24600_felderinfo.unl b/2023_zsl_berichte/24600_felderinfo.unl new file mode 100644 index 0000000..9561d82 --- /dev/null +++ b/2023_zsl_berichte/24600_felderinfo.unl @@ -0,0 +1,24 @@ +24601^Jahr von^1^300^-1^170^150^1^integer^30^0^1^<> SELECT ord,name from aggregierung\ +where kategorie='KENN-Jahr'\ +order by 1 desc^ ^<> 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^<> 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^<> select 1,'Ja' from xdummy union select 0,'Nein' from xdummy^ ^<> select 0,'Nein' from xdummy^ +24607^Staatsangehörigkeit^11^0^0^100^120^1^sql^30^0^1^<> --Freemarker Template\ +\ +\ +select sp_table_exists('sos_staat_eu') from xdummy;\ +\ +\ +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\ +\ + order by 2;^ ^ ^ +24609^Hochschule^0^0^0^100^150^1^char^30^0^12^<> 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^<> SELECT ord,name from aggregierung\ +where kategorie='KENN-Jahr'\ +order by 1 desc^ ^<> 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^<> SELECT apnr,druck FROM kenn_geschl order by 2^ ^ ^ diff --git a/2023_zsl_berichte/24600_maske_system_bez.unl b/2023_zsl_berichte/24600_maske_system_bez.unl new file mode 100644 index 0000000..1c4d520 --- /dev/null +++ b/2023_zsl_berichte/24600_maske_system_bez.unl @@ -0,0 +1 @@ +24600^109^ diff --git a/2023_zsl_berichte/24600_masken_felder_bez.unl b/2023_zsl_berichte/24600_masken_felder_bez.unl new file mode 100644 index 0000000..b0b4d2e --- /dev/null +++ b/2023_zsl_berichte/24600_masken_felder_bez.unl @@ -0,0 +1,7 @@ +24600^24601^ +24600^24603^ +24600^24604^ +24600^24607^ +24600^24609^ +24600^24611^ +24600^24613^ diff --git a/2023_zsl_berichte/24600_maskeninfo.unl b/2023_zsl_berichte/24600_maskeninfo.unl new file mode 100644 index 0000000..0b2768b --- /dev/null +++ b/2023_zsl_berichte/24600_maskeninfo.unl @@ -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^<> select 'Bitte wählen Sie unterschiedliche Spalten/Zeilen' from xdummy where '<>'='<>' 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 '<>'='1'^ diff --git a/2023_zsl_berichte/24600_sachgeb_maske_bez.unl b/2023_zsl_berichte/24600_sachgeb_maske_bez.unl new file mode 100644 index 0000000..d45983c --- /dev/null +++ b/2023_zsl_berichte/24600_sachgeb_maske_bez.unl @@ -0,0 +1 @@ +0^24600^ diff --git a/2023_zsl_berichte/berichte_installieren.x b/2023_zsl_berichte/berichte_installieren.x old mode 100644 new mode 100755 index 78ccda8..061ec8b --- a/2023_zsl_berichte/berichte_installieren.x +++ b/2023_zsl_berichte/berichte_installieren.x @@ -1,11 +1,14 @@ #!/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 makro_masken_fuellen.sql DOSQL themenbaum_fuellen.sql + +DOSQL sx_stylesheets_einfuegen.sql + diff --git a/2023_zsl_berichte/makro_masken_fuellen.sql b/2023_zsl_berichte/makro_masken_fuellen.sql index 38d2a80..df1d611 100644 --- a/2023_zsl_berichte/makro_masken_fuellen.sql +++ b/2023_zsl_berichte/makro_masken_fuellen.sql @@ -1,22 +1,22 @@ --freemarker template <#assign teiltabellen = [ - {"maskeninfo_id1":"32580", "maskeninfo_id2":"32560","sortnr":"10"}, - {"maskeninfo_id1":"32580", "maskeninfo_id2":"32560","sortnr":"20"}, - {"maskeninfo_id1":"32580", "maskeninfo_id2":"32560","sortnr":"30"} + {"maskeninfo_id1":"24600", "maskeninfo_id2":"24570","sortnr":"10"}, + {"maskeninfo_id1":"24600", "maskeninfo_id2":"24570","sortnr":"20"}, + {"maskeninfo_id1":"24600", "maskeninfo_id2":"24570","sortnr":"30"} ] /> <#assign teiltabellen_felder = [ - {"macro":"32580", "sortnr":"10","feldname":"Ausgabetabelle","value":"stud_hs1"}, - {"macro":"32580", "sortnr":"10","feldname":"Zeilen","value":"hs_nr"}, - {"macro":"32580", "sortnr":"10","feldname":"Spalten","value":"fgr"}, + {"macro":"24600", "sortnr":"10","feldname":"Ausgabetabelle","value":"stud_hs1"}, + {"macro":"24600", "sortnr":"10","feldname":"Zeilen","value":"hs_nr"}, + {"macro":"24600", "sortnr":"10","feldname":"Spalten","value":"fgr"}, - {"macro":"32580", "sortnr":"20","feldname":"Ausgabetabelle","value":"stud_rsz2"}, - {"macro":"32580", "sortnr":"20","feldname":"Zeilen","value":"hs_nr"}, - {"macro":"32580", "sortnr":"20","feldname":"Spalten","value":"fgr"}, + {"macro":"24600", "sortnr":"20","feldname":"Ausgabetabelle","value":"stud_rsz2"}, + {"macro":"24600", "sortnr":"20","feldname":"Zeilen","value":"hs_nr"}, + {"macro":"24600", "sortnr":"20","feldname":"Spalten","value":"fgr"}, - {"macro":"32580", "sortnr":"30","feldname":"Ausgabetabelle","value":"absolv"}, - {"macro":"32580", "sortnr":"30","feldname":"Zeilen","value":"hs_nr"}, - {"macro":"32580", "sortnr":"30","feldname":"Spalten","value":"fgr"}, - {"macro":"32580", "sortnr":"30","feldname":"Gewichtung","value":"1"} + {"macro":"24600", "sortnr":"30","feldname":"Ausgabetabelle","value":"absolv"}, + {"macro":"24600", "sortnr":"30","feldname":"Zeilen","value":"hs_nr"}, + {"macro":"24600", "sortnr":"30","feldname":"Spalten","value":"fgr"}, + {"macro":"24600", "sortnr":"30","feldname":"Gewichtung","value":"1"} ] /> CREATE temp TABLE tmp_macro_masken_bez ( @@ -38,6 +38,12 @@ CREATE temp TABLE tmp_macro_feld_wert ( ); +--Alte Version umhängen: +delete from macro_feld_wert where macro=32580; +delete from macro_masken_bez where maskeninfo_id1=32580; + + + <#foreach tab in teiltabellen> insert into tmp_macro_masken_bez(maskeninfo_id1, diff --git a/2023_zsl_berichte/sx_stylesheets_einfuegen.sql b/2023_zsl_berichte/sx_stylesheets_einfuegen.sql new file mode 100644 index 0000000..93f8f3a --- /dev/null +++ b/2023_zsl_berichte/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 column in m_stylesheet_field> +delete from stylesheet_field where stylesheet_id in (select tid from sx_stylesheets where filename ='${column.filename}'); + + + + + +-- 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 /> + + +<#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); + + + +--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 + +) +SELECT tid, filename, caption, description, relation, useragent, contenttype +<#if TableFieldExists?exists && TableFieldExists('sx_stylesheets','is_generic')> +,is_generic + +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 /> + + +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 /> + + +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'); + + + diff --git a/2023_zsl_berichte/themenbaum_fuellen.sql b/2023_zsl_berichte/themenbaum_fuellen.sql index 7e5bd19..e2f1b73 100644 --- a/2023_zsl_berichte/themenbaum_fuellen.sql +++ b/2023_zsl_berichte/themenbaum_fuellen.sql @@ -1,3 +1,8 @@ +--Alte Version umhängen: +delete from themenbaum where maskeninfo_id=32560 and name='ZSL-Mittelverteilung (Einzeltabelle)'; +delete from themenbaum where maskeninfo_id=32580 and name='ZSL-Mittelverteilung (Gesamtbericht)'; + + select sp_update_sequence('themenbaum'); insert into themenbaum(name, -- maskeninfo_id, @@ -32,7 +37,7 @@ insert into themenbaum(name, css_class) SELECT 'ZSL-Mittelverteilung (Einzelbericht)' as name, - 32560 as maskeninfo_id, + 24570 as maskeninfo_id, tid as parent, gueltig_seit, gueltig_bis, @@ -42,7 +47,7 @@ SELECT FROM themenbaum where name='ZSL-Mittelverteilung' -- name like '%ZSL%' -and 0=(select count(*) from themenbaum where maskeninfo_id=32560) +and 0=(select count(*) from themenbaum where maskeninfo_id=24570) ; insert into themenbaum(name, @@ -55,7 +60,7 @@ and 0=(select count(*) from themenbaum where maskeninfo_id=32560) css_class) SELECT 'ZSL-Mittelverteilung (Gesamtbericht)' as name, - 32580 as maskeninfo_id, + 24600 as maskeninfo_id, tid as parent, gueltig_seit, gueltig_bis, @@ -65,5 +70,5 @@ SELECT FROM themenbaum where name='ZSL-Mittelverteilung' -- name like '%ZSL%' -and 0=(select count(*) from themenbaum where maskeninfo_id=32580) +and 0=(select count(*) from themenbaum where maskeninfo_id=24600) ;