Gitea
1 year ago
19 changed files with 1050 additions and 25 deletions
@ -0,0 +1,23 @@ |
|||||||
|
19620^Beschäftigungsstelle (Person)^0^0^0^150^150^1^char^30^0^12^<<SQL>>select tid,type,name,sortnr from sichten where art in ('SVA-Kostenstellen-Sicht','SVA-spez-Besch./Kostenstellen-Sicht') and aktiv=1 order by sortnr,type,name;^^^ |
||||||
|
19621^Datum^1^300^-1^100^80^1^date^10^0^0^^^<<SQL>> select today() from xdummy^ |
||||||
|
19622^Kostenstelle (Person)^3^0^0^100^150^3^char^30^0^12^<<SQL>> select tid,type,name,sortnr from sichten where art in ('SVA-Kostenstellen-Sicht','SVA-spez-Kostenstellen-Sicht','SVA-Kst-spezial') and aktiv=1 order by sortnr,type,name;^^^ |
||||||
|
19623^Dienstart^4^0^0^100^150^3^char^30^0^12^<<SQL>>select tid,type,name from sichten where art ='SVA Dienstart' and aktiv=1 order by type,name;^^^ |
||||||
|
19624^BVL-Gruppe^5^300^-1^100^150^3^char^30^0^12^<<SQL>>select tid,type,name from sichten where art ='SVA BVL-Gruppen' and aktiv=1 order by type,name;^^^ |
||||||
|
19625^Amtsbezeichnung^6^0^0^100^150^3^char^30^0^12^<<SQL>>select tid,type,name from sichten where art ='SVA Amtsdienstbez.' and aktiv=1 order by type,name;^^^ |
||||||
|
19626^Personalzählung^121^0^0^110^150^1^sql^20^1^1^<<SQL>> SELECT 'v','Vollzeit-Äquiv.' from xdummy union select 'k','Köpfe' from xdummy ;^^<<SQL>> select 'v','Vollzeit-Äquiv.' from xdummy;^ |
||||||
|
19627^Alter (bis)^11^130^-1^100^70^1^integer^5^0^0^^^^ |
||||||
|
19628^Befristet bis^12^300^-1^100^80^1^date^10^0^0^^^^ |
||||||
|
19629^Beurlaubung^3^300^-1^100^150^3^char^30^0^12^<<SQL>>select tid,type,name from sichten where art ='SVA-Beurlaubung-Sicht' and aktiv=1 order by type,name;^^^ |
||||||
|
19630^Vertragsart^7^300^-1^100^160^3^char^30^0^12^<<SQL>>select tid,type,name from sichten where art ='SVA-Vertragsart-Sicht' and aktiv=1 order by type,name;^^^ |
||||||
|
19631^Filter Personal^110^0^0^100^150^1^sql^20^0^1^<<SQL>> SELECT content,caption from sx_repository where aktiv =1 and today() between gueltig_seit and gueltig_bis and art='SVA_PERS_FILTER' order by 2;^^^ |
||||||
|
19632^Staatsangehörigkeit^120^0^0^100^120^1^sql^30^0^1^<<SQL>> select '!=0','Alle ohne Deutschland' from xdummy union select '=' || astat, trim(druck) || ' (' || trim(apnr) || ')' from sva_k_staat order by 2;^^^ |
||||||
|
19633^Geschlecht^100^300^-1^100^70^1^integer^4^0^1^<<SQL>> select tid, beschreibung from konstanten where tid in (1,2);^^^ |
||||||
|
19634^Geldgeber^115^300^-1^100^120^3^char^20^0^12^<<SQL>>select tid,type,name from sichten where art ='Geldgeber-Sicht (SVA)' and aktiv=1 order by sortnr,type,name;^^^ |
||||||
|
19635^tablestylesheet^122^0^0^100^200^1^char^200^1^1^<<SQL>> select distinct filename,X.caption from sx_stylesheets X,sx_mask_style S where X.tid=S.stylesheet_id and S.maskeninfo_id=19460^^<<SQL>> select distinct filename,X.caption from sx_stylesheets X,sx_mask_style S where X.tid=S.stylesheet_id and S.maskeninfo_id=19620 and S.ord=1^ |
||||||
|
19636^Ausgabeformat^2001^0^0^100^150^1^char^200^1^1^<<SQL>> select element_value,description from menu_element where element='Ausgabeformat' and nature::smallint<100 order by nature::smallint^^<<SQL>> select element_value,description from menu_element where element='Ausgabeformat' and description='HTML'^ |
||||||
|
19637^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 ('sva_k_vertragsart','sva_k_amtsdienst','sva_k_dienstart','sva_k_bvlgruppe') order by 2^^^ |
||||||
|
19638^Felder^125^0^0^150^190^10^char^30^0^1^<<SQL>> 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 and (F.table_name ='sva_pbv_aggr' /* or F.table_name in (<<Weitere Tabellen>>) */) order by 2;^^^ |
||||||
|
19639^Schlüssel anzeigen^150^0^0^100^100^1^integer^30^1^1^<<SQL>> select 1,'Ja' from xdummy union select 0,'Nein' from xdummy^^<<SQL>> select 1,'Ja' from xdummy^ |
||||||
|
19640^oder Stichtag^2^0^0^100^150^1^integer^20^0^1^<<SQL>> SELECT tid,date_str(stichtag),stichtag from sva_stichtag where bereich='p' order by 3 desc;^^^ |
||||||
|
19641^Beschv.-Nr.^102^0^0^100^70^1^char^100^0^0^^^^ |
||||||
|
19642^Pers.-Nr.^101^0^0^100^70^1^char^100^0^999^^^^ |
@ -0,0 +1 @@ |
|||||||
|
19620^6^ |
@ -0,0 +1,23 @@ |
|||||||
|
19620^19620^ |
||||||
|
19620^19621^ |
||||||
|
19620^19622^ |
||||||
|
19620^19623^ |
||||||
|
19620^19624^ |
||||||
|
19620^19625^ |
||||||
|
19620^19626^ |
||||||
|
19620^19627^ |
||||||
|
19620^19628^ |
||||||
|
19620^19629^ |
||||||
|
19620^19630^ |
||||||
|
19620^19631^ |
||||||
|
19620^19632^ |
||||||
|
19620^19633^ |
||||||
|
19620^19634^ |
||||||
|
19620^19635^ |
||||||
|
19620^19636^ |
||||||
|
19620^19637^ |
||||||
|
19620^19638^ |
||||||
|
19620^19639^ |
||||||
|
19620^19640^ |
||||||
|
19620^19641^ |
||||||
|
19620^19642^ |
@ -0,0 +1,301 @@ |
|||||||
|
19620^Personal Datenblatt (Stichtag)^--Freemarker Template\ |
||||||
|
<#include "SuperX_general"/>\ |
||||||
|
<#include "SQL_multitable_output"/> \ |
||||||
|
\ |
||||||
|
\ |
||||||
|
\ |
||||||
|
<sqlvars>\ |
||||||
|
<sqlvar name="get_tables"><![CDATA[\ |
||||||
|
<#assign srctable="sva_pbv_aggr" />\ |
||||||
|
<#if "<<oder Stichtag>>" !="">\ |
||||||
|
<#assign srctable="sva_pbv_aggr_stich" />\ |
||||||
|
</#if>\ |
||||||
|
SELECT distinct name,name\ |
||||||
|
from sx_tables\ |
||||||
|
where name in ('${srctable}'\ |
||||||
|
${DatenblattTables(<<tablestylesheet>>,"<<Weitere Tabellen>>",.vars["Weitere TabellenObject"].allKeys)}\ |
||||||
|
\ |
||||||
|
)\ |
||||||
|
order by 2;]]>\ |
||||||
|
</sqlvar>\ |
||||||
|
<sqlvar name="get_table_joins"><![CDATA[\ |
||||||
|
<#assign srctable="sva_pbv_aggr" />\ |
||||||
|
<#if "<<oder Stichtag>>" !="">\ |
||||||
|
<#assign srctable="sva_pbv_aggr_stich" />\ |
||||||
|
</#if>\ |
||||||
|
select table_name || '.' || name || '=' || foreignkey_tab || '.' || foreignkey_col,table_name \ |
||||||
|
from sx_fields where table_name in ('${srctable}'\ |
||||||
|
${DatenblattTables(<<tablestylesheet>>,"<<Weitere Tabellen>>",.vars["Weitere TabellenObject"].allKeys)} )\ |
||||||
|
and foreignkey_tab in ('${srctable}'\ |
||||||
|
${DatenblattTables(<<tablestylesheet>>,"<<Weitere Tabellen>>",.vars["Weitere TabellenObject"].allKeys)})\ |
||||||
|
;]]>\ |
||||||
|
</sqlvar>\ |
||||||
|
<sqlvar name="get_felder"><![CDATA[\ |
||||||
|
<#assign srctable="sva_pbv_aggr" />\ |
||||||
|
<#if "<<oder Stichtag>>" !="">\ |
||||||
|
<#assign srctable="sva_pbv_aggr_stich" />\ |
||||||
|
</#if>\ |
||||||
|
SELECT name,\ |
||||||
|
caption,\ |
||||||
|
(trim(field_type) || '#' || is_primarykey || '#' || trim(string_not_null(foreignkey_tab)) || '#' || trim(string_not_null(foreignkey_col))\ |
||||||
|
|| '#' || trim(string_not_null(foreignkey_cap))\ |
||||||
|
|| '#' || trim(string_not_null(foreignkey_cond))\ |
||||||
|
|| '#' || trim(string_not_null(foreignkey_func))\ |
||||||
|
|| '#' || trim(string_not_null(table_name)))::char(255) as strukturStr\ |
||||||
|
from sx_fields\ |
||||||
|
where table_name in ('${srctable}'\ |
||||||
|
${DatenblattTables(<<tablestylesheet>>,"<<Weitere Tabellen>>",.vars["Weitere TabellenObject"].allKeys)}\ |
||||||
|
)\ |
||||||
|
and currentlyused=1\ |
||||||
|
${DatenblattFields(<<tablestylesheet>>,"<<Felder>>",FelderObject.allKeys)}\ |
||||||
|
order by 2,3;]]>\ |
||||||
|
</sqlvar>\ |
||||||
|
<sqlvar name="get_felder_fk"><![CDATA[\ |
||||||
|
<#assign srctable="sva_pbv_aggr" />\ |
||||||
|
<#if "<<oder Stichtag>>" !="">\ |
||||||
|
<#assign srctable="sva_pbv_aggr_stich" />\ |
||||||
|
</#if>\ |
||||||
|
SELECT name,\ |
||||||
|
caption,\ |
||||||
|
(trim(table_name)\ |
||||||
|
|| '#' || trim(string_not_null(foreignkey_tab)))::char(255) as strukturStr\ |
||||||
|
from sx_fields\ |
||||||
|
where table_name in ('${srctable}' ${DatenblattTables(<<tablestylesheet>>,"<<Weitere Tabellen>>",.vars["Weitere TabellenObject"].allKeys)}\ |
||||||
|
)\ |
||||||
|
and currentlyused=1\ |
||||||
|
${DatenblattFields(<<tablestylesheet>>,"<<Felder>>",FelderObject.allKeys)}\ |
||||||
|
order by 2,3;]]>\ |
||||||
|
</sqlvar>\ |
||||||
|
<sqlvar name="datum"><![CDATA[\ |
||||||
|
SELECT date_str(stichtag) from sva_stichtag where '' || tid='<<oder Stichtag>>'\ |
||||||
|
union \ |
||||||
|
select '' /* || <<Datum>> */ \ |
||||||
|
from xdummy \ |
||||||
|
where 1=1\ |
||||||
|
/* and <<Datum>> != '' */\ |
||||||
|
and '<<oder Stichtag>>' = ''\ |
||||||
|
;]]>\ |
||||||
|
</sqlvar>\ |
||||||
|
</sqlvars>\ |
||||||
|
\ |
||||||
|
\ |
||||||
|
\ |
||||||
|
<@generate_multitable_list />\ |
||||||
|
<@generate_field_list_multitable aggregationsfeld="*" aggregatfunktion="count(" />\ |
||||||
|
<@generate_foreign_fields_multitable />\ |
||||||
|
\ |
||||||
|
\ |
||||||
|
<#assign stichtag_fld="" />\ |
||||||
|
<#assign datumsfilter="and 1=0" />\ |
||||||
|
/* <#assign stichtag_fld="<<oder Stichtag>>" /> */\ |
||||||
|
<#if stichtag_fld == "" && "<<Datum>>" != "">\ |
||||||
|
<#assign srctable="sva_pbv_aggr" />\ |
||||||
|
<#assign datumsfilter="and date_val(<<Datum>>) between d_besch_von and d_besch_bis" />\ |
||||||
|
<#else>\ |
||||||
|
<#assign srctable="sva_pbv_aggr_stich" />\ |
||||||
|
<#assign datumsfilter="and stichtag="+stichtag_fld />\ |
||||||
|
</#if>\ |
||||||
|
\ |
||||||
|
<#assign filter= datumsfilter + " \ |
||||||
|
/* and ca501_staat <<Staatsangehörigkeit>> */\ |
||||||
|
/* and geschlecht= <<Geschlecht>> */\ |
||||||
|
/* and trunc(( date_val(${datum}) - geburtsdatum) / 365.25 , 0) >= <<Alter (von)>> */\ |
||||||
|
/* and trunc(( date_val(${datum}) - geburtsdatum) / 365.25 , 0) <= <<Alter (bis)>> */\ |
||||||
|
/* and d_befristung <= date_val(<<Befristet bis>>)*/\ |
||||||
|
/* and <<Filter Personal>> */\ |
||||||
|
" />\ |
||||||
|
<#if "<<Beurlaubung>>"!="">\ |
||||||
|
<#if "<<Beurlaubung>>"=="'_AOB'"> <#assign filter=filter + " and beurl_art is null "/>\ |
||||||
|
<#else> <#assign filter=filter + " and beurl_art in "+Beurlaubung.allNeededKeys+" "/>\ |
||||||
|
</#if>\ |
||||||
|
</#if>\ |
||||||
|
<#if .vars["Pers.-Nr."]?exists&& "<<Pers.-Nr.>>"!="">\ |
||||||
|
<#assign filter=filter+" and personal_nr in (<<Pers.-Nr.>>)"?replace("'","")+" "/>\ |
||||||
|
</#if>\ |
||||||
|
<#if .vars["Beschv.-Nr."]?exists&& "<<Beschv.-Nr.>>"!="">\ |
||||||
|
<#assign filter=filter+" and besch_verh_nr in (<<Beschv.-Nr.>>)"?replace("'","")+" "/>\ |
||||||
|
</#if>\ |
||||||
|
\ |
||||||
|
\ |
||||||
|
<#assign filter = filter + "and ch110_besch_st in "+.vars["Beschäftigungsstelle (Person)"].allNeededKeys /> \ |
||||||
|
/* \ |
||||||
|
<#assign filter = filter + "and ( kostenstelle in "+.vars["Kostenstelle (Person)"].allNeededKeys +" )" /> --<<Kostenstelle (Person)>> */\ |
||||||
|
/* \ |
||||||
|
<#assign filter = filter + "and (ch212_geldgeber in "+.vars["Geldgeber"].allNeededKeys +")" /> --<<Geldgeber>> */\ |
||||||
|
/* \ |
||||||
|
<#assign filter = filter + "and (vertart in "+.vars["Vertragsart"].allNeededKeys +")" /> --<<Vertragsart>> */\ |
||||||
|
/* \ |
||||||
|
<#assign filter = filter + "and (ca109_key_bvl in "+.vars["BVL-Gruppe"].allNeededKeys +")" /> --<<BVL-Gruppe>> */\ |
||||||
|
/* \ |
||||||
|
<#assign filter = filter + "and (ca108_amtsbez in "+.vars["Amtsbezeichnung"].allNeededKeys +")" /> --<<Amtsbezeichnung>> */\ |
||||||
|
/* \ |
||||||
|
<#assign filter = filter + "and (ca107_dienstart in"+.vars["Dienstart"].allNeededKeys +")" /> --<<Dienstart>> */\ |
||||||
|
\ |
||||||
|
<#assign field_list_select_orig=field_list_select />\ |
||||||
|
<#assign field_list_groupby_orig=field_list_groupby />\ |
||||||
|
\ |
||||||
|
<#if "<<Personalzählung>>" = "k" >\ |
||||||
|
--dafür werden drei Merkmale gebraucht: Personal-Nr., vzae und drittmittel: \ |
||||||
|
<#if field_list_select?index_of("tid") == -1>\ |
||||||
|
<#assign field_list_select=field_list_select+",tid as "+srctable+"_tid" />\ |
||||||
|
</#if>\ |
||||||
|
<#if field_list_groupby?index_of("tid") == -1>\ |
||||||
|
<#assign field_list_groupby=field_list_groupby+",tid" />\ |
||||||
|
</#if>\ |
||||||
|
<#if field_list_select?index_of("personal_nr") == -1>\ |
||||||
|
<#assign field_list_select=field_list_select+",personal_nr as "+srctable+"_personal_nr" />\ |
||||||
|
</#if>\ |
||||||
|
<#if field_list_groupby?index_of("personal_nr") == -1>\ |
||||||
|
<#assign field_list_groupby=field_list_groupby+",personal_nr" />\ |
||||||
|
</#if>\ |
||||||
|
<#if field_list_select?index_of("vzae") == -1>\ |
||||||
|
<#assign field_list_select=field_list_select+",vzae as "+srctable+"_vzae" />\ |
||||||
|
</#if>\ |
||||||
|
<#if field_list_groupby?index_of("vzae") == -1>\ |
||||||
|
<#assign field_list_groupby=field_list_groupby+",vzae" />\ |
||||||
|
</#if>\ |
||||||
|
<#if field_list_select?index_of("drittmittel") == -1>\ |
||||||
|
<#assign field_list_select=field_list_select+",drittmittel as "+srctable+"_drittmittel" />\ |
||||||
|
</#if>\ |
||||||
|
<#if field_list_groupby?index_of("drittmittel") == -1>\ |
||||||
|
<#assign field_list_groupby=field_list_groupby+",drittmittel" />\ |
||||||
|
</#if>\ |
||||||
|
\ |
||||||
|
<#else>\ |
||||||
|
<#assign field_list_select=field_list_select+",sum(vzae) as summe" />\ |
||||||
|
</#if>\ |
||||||
|
\ |
||||||
|
<@generate_resultset_multitable tabellen=table_list\ |
||||||
|
p_show_keys=<<Schlüssel anzeigen>>\ |
||||||
|
p_field_list_select=field_list_select\ |
||||||
|
p_foreign_fields=foreign_fields\ |
||||||
|
p_filter=filter\ |
||||||
|
p_field_list_groupby=field_list_groupby \ |
||||||
|
p_join_clause=join_clause\ |
||||||
|
/>\ |
||||||
|
\ |
||||||
|
<#assign field_list_select_tmp_tabelle="summe" />\ |
||||||
|
\ |
||||||
|
<#if get_felder_fk?has_content >\ |
||||||
|
<#assign field_list_select_tmp_tabelle="" />\ |
||||||
|
<#assign rownum=1 />\ |
||||||
|
<#foreach row_feld in get_felder_fk>\ |
||||||
|
<#assign feldname=row_feld.key />\ |
||||||
|
<#assign caption=row_feld.name />\ |
||||||
|
<#assign zaehler=1 />\ |
||||||
|
<#list row_feld.strukturStr?split("#") as row>\ |
||||||
|
<#if zaehler=1>\ |
||||||
|
<#assign table_name=row />\ |
||||||
|
</#if>\ |
||||||
|
<#if zaehler=2>\ |
||||||
|
<#assign foreignkey_tab=row />\ |
||||||
|
</#if>\ |
||||||
|
<#if zaehler=3>\ |
||||||
|
<#assign foreignkey_uniquename=row />\ |
||||||
|
</#if>\ |
||||||
|
<#assign zaehler= zaehler+1 />\ |
||||||
|
</#list>\ |
||||||
|
<#if foreignkey_tab != "">\ |
||||||
|
<#assign field_list_select_tmp_tabelle=field_list_select_tmp_tabelle+table_name+"_"+feldname+"_str" />\ |
||||||
|
<#if <<Schlüssel anzeigen>>=1>\ |
||||||
|
<#if !foreignkey_uniquename?exists || foreignkey_uniquename=="">\ |
||||||
|
<#assign field_list_select_tmp_tabelle=field_list_select_tmp_tabelle+","+table_name+"_"+feldname />\ |
||||||
|
<#else>\ |
||||||
|
<#assign field_list_select_tmp_tabelle=field_list_select_tmp_tabelle+","+table_name+"_"+feldname+"_uniquename" />\ |
||||||
|
</#if>\ |
||||||
|
</#if>\ |
||||||
|
<#else>\ |
||||||
|
<#assign field_list_select_tmp_tabelle=field_list_select_tmp_tabelle+" " + table_name+"_"+feldname />\ |
||||||
|
</#if>\ |
||||||
|
<#if rownum < get_felder_fk?size>\ |
||||||
|
<#assign field_list_select_tmp_tabelle=field_list_select_tmp_tabelle+"," />\ |
||||||
|
</#if>\ |
||||||
|
<#assign rownum= rownum+1 />\ |
||||||
|
<#assign foreignkey_uniquename="" />\ |
||||||
|
</#foreach>\ |
||||||
|
</#if>\ |
||||||
|
\ |
||||||
|
<#if "<<Personalzählung>>" = "k" >\ |
||||||
|
create temp table tmp_doppelt(\ |
||||||
|
tid integer,\ |
||||||
|
personal_nr integer,\ |
||||||
|
vzae decimal(7,2))\ |
||||||
|
;\ |
||||||
|
insert into tmp_doppelt(personal_nr,vzae)\ |
||||||
|
select ${srctable}_personal_nr,max(${srctable}_vzae) from tmp_tabelle\ |
||||||
|
group by 1;\ |
||||||
|
--erste Priorität hat PLAN-Finanzierung:\ |
||||||
|
update tmp_doppelt set tid=(\ |
||||||
|
select min(A.${srctable}_tid) from tmp_tabelle A\ |
||||||
|
where A.${srctable}_personal_nr=tmp_doppelt.personal_nr\ |
||||||
|
and A.${srctable}_vzae=tmp_doppelt.vzae\ |
||||||
|
and (A.${srctable}_drittmittel !=1 or A.${srctable}_drittmittel is null)\ |
||||||
|
);\ |
||||||
|
--zweite Priorität hat Drittmittel-Finanzierung:\ |
||||||
|
update tmp_doppelt set tid=(\ |
||||||
|
select min(A.${srctable}_tid) from tmp_tabelle A\ |
||||||
|
where A.${srctable}_personal_nr=tmp_doppelt.personal_nr\ |
||||||
|
and A.${srctable}_vzae=tmp_doppelt.vzae\ |
||||||
|
and A.${srctable}_drittmittel =1 )\ |
||||||
|
where tid is null\ |
||||||
|
;\ |
||||||
|
<@selectintotmp select=field_list_select_tmp_tabelle+", count(distinct T."+srctable+"_personal_nr) as summe"\ |
||||||
|
target="tmp_tabelle2"\ |
||||||
|
source="tmp_tabelle T, tmp_doppelt D">\ |
||||||
|
where D.tid=T.${srctable}_tid\ |
||||||
|
group by ${field_list_select_tmp_tabelle}\ |
||||||
|
</@selectintotmp> <@informixnolog/>;\ |
||||||
|
\ |
||||||
|
drop table tmp_doppelt;\ |
||||||
|
drop table tmp_tabelle;\ |
||||||
|
</#if>\ |
||||||
|
\ |
||||||
|
\ |
||||||
|
\ |
||||||
|
select ${field_list_select_tmp_tabelle},summe\ |
||||||
|
from tmp_tabelle<#if "<<Personalzählung>>" = "k" >2</#if>\ |
||||||
|
;^--Freemarker Template \ |
||||||
|
<sqlvars>\ |
||||||
|
<sqlvar name="get_felder"><![CDATA[\ |
||||||
|
<#assign srctable="sva_pbv_aggr" />\ |
||||||
|
<#if "<<oder Stichtag>>" !="">\ |
||||||
|
<#assign srctable="sva_pbv_aggr_stich" />\ |
||||||
|
</#if>\ |
||||||
|
SELECT caption,\ |
||||||
|
foreignkey_tab,\ |
||||||
|
description as strukturStr\ |
||||||
|
from sx_fields\ |
||||||
|
where table_name in ('${srctable}'\ |
||||||
|
${DatenblattTables(<<tablestylesheet>>,"<<Weitere Tabellen>>",.vars["Weitere TabellenObject"].allKeys)}\ |
||||||
|
)\ |
||||||
|
\ |
||||||
|
and currentlyused=1\ |
||||||
|
${DatenblattFields(<<tablestylesheet>>,"<<Felder>>",FelderObject.allKeys)}\ |
||||||
|
\ |
||||||
|
order by 1;\ |
||||||
|
]]>\ |
||||||
|
</sqlvar>\ |
||||||
|
</sqlvars>\ |
||||||
|
XIL List\ |
||||||
|
sizable_columns horizontal_scrolling\ |
||||||
|
white_space_color=COLOR_WHITE fixed_columns=1\ |
||||||
|
min_heading_height=35\ |
||||||
|
<#assign i=1 />\ |
||||||
|
<#if get_felder?has_content >\ |
||||||
|
<#foreach myfield in get_felder>\ |
||||||
|
<#assign i=i+1 />\ |
||||||
|
Column CID=${i} heading_text="${myfield.key}" explanation="${myfield.strukturStr}" center_heading\ |
||||||
|
row_selectable col_selectable rightJust heading_platform readonly\ |
||||||
|
width=20\ |
||||||
|
<#if myfield.name != ''&& <<Schlüssel anzeigen>>==1>\ |
||||||
|
<#assign i=i+1 />\ |
||||||
|
Column CID=${i} heading_text="${myfield.key}\\n(Schlüssel)" explanation="Schlüssel des Feldes ${myfield.key}" center_heading\ |
||||||
|
row_selectable col_selectable rightJust heading_platform readonly\ |
||||||
|
width=20\ |
||||||
|
</#if>\ |
||||||
|
</#foreach>\ |
||||||
|
Column CID=${i} heading_text="Summe" explanation="Summe VZÄ oder Köpfe" center_heading\ |
||||||
|
row_selectable col_selectable rightJust heading_platform readonly\ |
||||||
|
width=20\ |
||||||
|
</#if>\ |
||||||
|
@@@^^^Flexible Auswertung von Personalstatistik^drop table tmp_tabelle<#if "<<Personalzählung>>" = "k" >2</#if>;^^2^700^360^^^<<SQL>> select 'Achtung: Das Datum des Buttons Beschäftigungsstelle (Person) unterscheidet sich vom ausgewählten Datum im Maskenfeld.' from xdummy where <<Beschäftigungsstelle (Person)-Stand>> != date_val(<<Datum>>)^ |
@ -0,0 +1 @@ |
|||||||
|
10^19620^ |
@ -0,0 +1,28 @@ |
|||||||
|
21200^Beschäftigungsstelle (Person)^0^0^0^150^150^1^char^30^0^12^<<SQL>>select tid,type,name,sortnr from sichten where art in ('SVA-Kostenstellen-Sicht','SVA-spez-Besch./Kostenstellen-Sicht') and aktiv=1 order by sortnr,type,name;^^^ |
||||||
|
21201^Datum^1^300^-1^100^80^1^date^10^0^0^^^<<SQL>> select today() from xdummy^ |
||||||
|
21202^Kostenstelle (Person)^3^0^0^100^150^3^char^30^0^12^<<SQL>> select tid,type,name,sortnr from sichten where art in ('SVA-Kostenstellen-Sicht','SVA-spez-Kostenstellen-Sicht','SVA-Kst-spezial') and aktiv=1 order by sortnr,type,name;^^^ |
||||||
|
21203^Dienstart^4^0^0^100^150^3^char^30^0^12^<<SQL>>select tid,type,name from sichten where art ='SVA Dienstart' and aktiv=1 order by type,name;^^^ |
||||||
|
21204^BVL-Gruppe^5^300^-1^100^150^3^char^30^0^12^<<SQL>>select tid,type,name from sichten where art ='SVA BVL-Gruppen' and aktiv=1 order by type,name;^^^ |
||||||
|
21205^Amtsbezeichnung^6^0^0^100^150^3^char^30^0^12^<<SQL>>select tid,type,name from sichten where art ='SVA Amtsdienstbez.' and aktiv=1 order by type,name;^^^ |
||||||
|
21206^Personalzählung^121^0^0^110^150^1^sql^20^1^1^<<SQL>> SELECT 'v','Vollzeit-Äquiv.' from xdummy ;^^<<SQL>> select 'v','Vollzeit-Äquiv.' from xdummy;^ |
||||||
|
21207^Alter (bis)^11^130^-1^100^70^1^integer^5^0^0^^^^ |
||||||
|
21208^Befristet bis^12^300^-1^100^80^1^date^10^0^0^^^^ |
||||||
|
21209^Beurlaubung^3^300^-1^100^150^3^char^30^0^12^<<SQL>>select tid,type,name from sichten where art ='SVA-Beurlaubung-Sicht' and aktiv=1 order by type,name;^^^ |
||||||
|
21210^Vertragsart^7^300^-1^100^160^3^char^30^0^12^<<SQL>>select tid,type,name from sichten where art ='SVA-Vertragsart-Sicht' and aktiv=1 order by type,name;^^^ |
||||||
|
21211^Filter Personal^110^0^0^100^150^1^sql^20^0^1^<<SQL>> SELECT content,caption from sx_repository where aktiv =1 and today() between gueltig_seit and gueltig_bis and art='SVA_PERS_FILTER' order by 2;^^^ |
||||||
|
21212^Staatsangehörigkeit^120^0^0^100^120^1^sql^30^0^1^<<SQL>> select '!=0','Alle ohne Deutschland' from xdummy union select '=' || astat, trim(druck) || ' (' || trim(apnr) || ')' from sva_k_staat order by 2;^^^ |
||||||
|
21213^Geschlecht^100^300^-1^100^70^1^integer^4^0^1^<<SQL>> select tid, beschreibung from konstanten where tid in (1,2);^^^ |
||||||
|
21214^Geldgeber^115^300^-1^100^120^3^char^20^0^12^<<SQL>>select tid,type,name from sichten where art ='Geldgeber-Sicht (SVA)' and aktiv=1 order by sortnr,type,name;^^^ |
||||||
|
21220^oder Stichtag^2^0^0^100^150^1^integer^20^0^1^<<SQL>> SELECT tid,date_str(stichtag),stichtag from sva_stichtag where bereich='p' order by 3 desc;^^^ |
||||||
|
21221^Beschv.-Nr.^102^0^0^100^70^1^char^100^0^999^^^^ |
||||||
|
21222^Pers.-Nr.^101^0^0^100^70^1^char^100^0^999^^^^ |
||||||
|
21223^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^ |
||||||
|
21224^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^ |
||||||
|
21225^Leere Zeilen ausblenden^130^350^-1^140^80^1^char^30^0^1^<<SQL>> select 'ja','ja' from xdummy union select 'nein','nein' from xdummy^ ^<<SQL>> select 'ja','ja' from xdummy^ |
||||||
|
21226^Zeilenfilter bis Ebene^140^0^0^140^80^1^integer^30^0^0^ ^^^ |
||||||
|
21227^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^ |
||||||
|
21228^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^^^ |
||||||
|
21229^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^ |
||||||
|
21230^Alter^39^0^0^140^80^1^char^30^0^12^<<SQL>> select tid,name,sortnr from sichten where art in ('XCUBE-Alter-Sicht') order by 3,2;^^^ |
@ -0,0 +1 @@ |
|||||||
|
21200^6^ |
@ -0,0 +1,31 @@ |
|||||||
|
21200^21200^ |
||||||
|
21200^21201^ |
||||||
|
21200^21202^ |
||||||
|
21200^21203^ |
||||||
|
21200^21204^ |
||||||
|
21200^21205^ |
||||||
|
21200^21206^ |
||||||
|
21200^21207^ |
||||||
|
21200^21208^ |
||||||
|
21200^21209^ |
||||||
|
21200^21210^ |
||||||
|
21200^21211^ |
||||||
|
21200^21212^ |
||||||
|
21200^21213^ |
||||||
|
21200^21214^ |
||||||
|
21200^21215^ |
||||||
|
21200^21216^ |
||||||
|
21200^21217^ |
||||||
|
21200^21218^ |
||||||
|
21200^21219^ |
||||||
|
21200^21220^ |
||||||
|
21200^21221^ |
||||||
|
21200^21222^ |
||||||
|
21200^21223^ |
||||||
|
21200^21224^ |
||||||
|
21200^21225^ |
||||||
|
21200^21226^ |
||||||
|
21200^21227^ |
||||||
|
21200^21228^ |
||||||
|
21200^21229^ |
||||||
|
21200^21230^ |
@ -0,0 +1,430 @@ |
|||||||
|
21200^Personal Xcube^--freemarker template\ |
||||||
|
-- Maskenfelder -Leere Zeilen ausblenden, leere SPalten ausblenden?\ |
||||||
|
<sqlvars>\ |
||||||
|
<sqlvar name="table_name">select table_name from xcube where maskeninfo_id=${Maskennummer}</sqlvar>\ |
||||||
|
<sqlvar name="aggrfunction">select aggrfunction from xcube_kennzahl where maskeninfo_id=${Maskennummer} and tid=<<Kennzahl>></sqlvar>\ |
||||||
|
<sqlvar name="aggrfunction_restriction">select nvl(restriction,''::char(1)) from xcube_kennzahl \ |
||||||
|
where maskeninfo_id=${Maskennummer} and tid=<<Kennzahl>>\ |
||||||
|
</sqlvar>\ |
||||||
|
<sqlvar name="datatype">select nvl(datatype,'decimal(17,2)'::varchar(30)) from xcube_kennzahl \ |
||||||
|
where maskeninfo_id=${Maskennummer} and tid=<<Kennzahl>></sqlvar>\ |
||||||
|
--benoetigt falls Kennzahlen in Zeilen oder Spalten\ |
||||||
|
<sqlvar name="kennzahlen" type="hashsequence">select apnr,aggrfunction,\ |
||||||
|
nvl(restriction,''::char(1)) as restriction \ |
||||||
|
from xcube_kennzahl where maskeninfo_id=${Maskennummer}</sqlvar>\ |
||||||
|
<sqlvar name="restriction" type="string"><![CDATA[<sximport>select restriction from xcube where maskeninfo_id=<<Maskennummer>></sximport>]]></sqlvar>\ |
||||||
|
<sqlvar name="coldef" type="hash"><![CDATA[select name,\ |
||||||
|
caption,\ |
||||||
|
foreignkey_tab,\ |
||||||
|
foreignkey_col,\ |
||||||
|
foreignkey_cap,\ |
||||||
|
nvl(foreignkey_cond,''::varchar(1))\ |
||||||
|
as foreignkey_cond,\ |
||||||
|
--nvl(C.specific_restriction,''::varchar(1)) as specific_restriction,\ |
||||||
|
sortfield,\ |
||||||
|
is_sicht,\ |
||||||
|
calc_gesamt,\ |
||||||
|
is_virtual,\ |
||||||
|
vcsql,\ |
||||||
|
nvl(attrib_nachbearbeitung,''::char(1)) as attrib_nachbearbeitung\ |
||||||
|
from xcube_dimconfig where \ |
||||||
|
maskeninfo_id=${Maskennummer} \ |
||||||
|
and name=<<Ansicht in Ergebnisspalten>>]]>\ |
||||||
|
</sqlvar>\ |
||||||
|
<sqlvar name="nichtsicht_ergspalten" type='hashsequence'><![CDATA[\ |
||||||
|
<#if coldef.is_sicht=0>\ |
||||||
|
select distinct ${coldef.foreignkey_col}::varchar(255) as apnr,\ |
||||||
|
${coldef.foreignkey_cap} as name,\ |
||||||
|
1::smallint as detailgesamtsort,\ |
||||||
|
${coldef.sortfield} as tmp_sortfield\ |
||||||
|
from ${coldef.foreignkey_tab} where \ |
||||||
|
1=1 \ |
||||||
|
<#if coldef.foreignkey_cond!=''> and ${coldef.foreignkey_cond} </#if>\ |
||||||
|
--{coldef.specific_restriction} \ |
||||||
|
--ausblenden von Spalten, die gar nicht in konkretem Teilergebnis vorkommen, geht derzeit nicht für virtuelle Spalten und nachbearbeitung, -> Kernmodul\ |
||||||
|
<#if coldef.is_virtual?number=0&&coldef.attrib_nachbearbeitung=''&&"<<Leere Spalten ausblenden>>"="'ja'">\ |
||||||
|
and ${coldef.foreignkey_col}::varchar(255) in (select distinct ${coldef.name}::varchar(255) from ${table_name} where \ |
||||||
|
${restriction} \ |
||||||
|
)\ |
||||||
|
</#if>\ |
||||||
|
<#if coldef.calc_gesamt?number=1> \ |
||||||
|
union\ |
||||||
|
select 'gesamt','Gesamt',\ |
||||||
|
2::smallint as detailgesamtsort,\ |
||||||
|
null as tmp_sortfield from xdummy\ |
||||||
|
</#if>\ |
||||||
|
order by detailgesamtsort,\ |
||||||
|
tmp_sortfield,\ |
||||||
|
name;\ |
||||||
|
<#else>\ |
||||||
|
select 'Sichtspalten aktiv' from xdummy;\ |
||||||
|
</#if>\ |
||||||
|
]]>\ |
||||||
|
</sqlvar>\ |
||||||
|
\ |
||||||
|
\ |
||||||
|
\ |
||||||
|
<sqlvar name="rowdef" type="hash"><![CDATA[select name,caption,is_sicht,calc_gesamt,foreignkey_tab,foreignkey_col,foreignkey_cap,\ |
||||||
|
nvl(foreignkey_cond,''::varchar(1)) as foreignkey_cond,\ |
||||||
|
--nvl(C.specific_restriction,''::varchar(1)) as specific_restriction,\ |
||||||
|
sortfield,is_virtual,vcsql,nvl(attrib_nachbearbeitung,''::char(1)) as attrib_nachbearbeitung\ |
||||||
|
from xcube_dimconfig C where maskeninfo_id=${Maskennummer} and name=<<Ansicht in Ergebniszeilen>>]]>\ |
||||||
|
</sqlvar>\ |
||||||
|
--nur bei wenn Ergzeilen_def nicht vom Typ Sicht relevant\ |
||||||
|
<sqlvar name="nichtsicht_ergzeilen" type='hashsequence'><![CDATA[\ |
||||||
|
<#if rowdef.is_sicht=0>\ |
||||||
|
select 1::smallint as level, \ |
||||||
|
${rowdef.foreignkey_col}::varchar(255) as key,--hier wird zur Vereinheitlichung mit Sichten Bezeichung "key" für eigentlichen Schluessel benoetigt\ |
||||||
|
${rowdef.foreignkey_cap} as name,\ |
||||||
|
${rowdef.sortfield} as tmp_sortfield \ |
||||||
|
from ${rowdef.foreignkey_tab}\ |
||||||
|
where 1=1\ |
||||||
|
<#if rowdef.foreignkey_cond!=''> and ${rowdef.foreignkey_cond} </#if>\ |
||||||
|
--{rowdef.specific_restriction} \ |
||||||
|
<#if rowdef.calc_gesamt?number=1>\ |
||||||
|
union\ |
||||||
|
select 2,'gesamt','Gesamt',null as ${rowdef.sortfield} from xdummy\ |
||||||
|
</#if>\ |
||||||
|
order by level,tmp_sortfield; \ |
||||||
|
<#else>\ |
||||||
|
select 'nicht relevant' from xdummy;</#if>\ |
||||||
|
]]>\ |
||||||
|
</sqlvar>\ |
||||||
|
\ |
||||||
|
<sqlvar name="zweiteRowDef" type="hash"><![CDATA[\ |
||||||
|
<#if "<<2.Ansicht in Zeilen>>"!=""&&"<<2.Ansicht in Zeilen>>"!="<<2.Ansicht in Zeilen>>">\ |
||||||
|
select name,caption,\ |
||||||
|
is_sicht,\ |
||||||
|
calc_gesamt,\ |
||||||
|
foreignkey_tab,\ |
||||||
|
foreignkey_col,\ |
||||||
|
foreignkey_cap,\ |
||||||
|
nvl(foreignkey_cond,''::varchar(1)) as foreignkey_cond,\ |
||||||
|
--nvl(C.specific_restriction,''::varchar(1)) as specific_restriction,\ |
||||||
|
C.sortfield\ |
||||||
|
from xcube_dimconfig where maskeninfo_id=${Maskennummer} and name=<<2.Ansicht in Zeilen>>\ |
||||||
|
<#else>\ |
||||||
|
select 'keine zweite RowDef' from xdummy;\ |
||||||
|
</#if>\ |
||||||
|
]]>\ |
||||||
|
</sqlvar>\ |
||||||
|
--nur bei wenn Ergzeilen_def nicht vom Typ Sicht relevant\ |
||||||
|
<sqlvar name="zweiteRow_nichtsicht_ergzeilen" type='hashsequence'><![CDATA[\ |
||||||
|
<#if "<<2.Ansicht in Zeilen>>"!=""&&"<<2.Ansicht in Zeilen>>"!="<<2.Ansicht in Zeilen>>"&&zweiteRowDef.is_sicht=0>\ |
||||||
|
select 1::smallint as level, \ |
||||||
|
${zweiteRowDef.foreignkey_col}::varchar(255) as key,--hier wird zur Vereinheitlichung mit Sichten Bezeichung "key" für eigentlichen Schluessel benoetigt\ |
||||||
|
${zweiteRowDef.foreignkey_cap} as name,\ |
||||||
|
${zweiteRowDef.sortfield} as tmp_sortfield \ |
||||||
|
from ${zweiteRowDef.foreignkey_tab}\ |
||||||
|
where 1=1\ |
||||||
|
<#if zweiteRowDef.foreignkey_cond!=''> and ${zweiteRowDef.foreignkey_cond} </#if>\ |
||||||
|
--{zweiteRowDef.specific_restriction} \ |
||||||
|
<#if zweiteRowDef.calc_gesamt?number=1>\ |
||||||
|
union\ |
||||||
|
select 2,'gesamt','Gesamt',null as ${zweiteRowDef.sortfield} from xdummy\ |
||||||
|
</#if>\ |
||||||
|
order by level,tmp_sortfield; \ |
||||||
|
<#else>\ |
||||||
|
select 'nicht relevant' from xdummy;</#if>\ |
||||||
|
]]>\ |
||||||
|
</sqlvar>\ |
||||||
|
\ |
||||||
|
\ |
||||||
|
</sqlvars>\ |
||||||
|
\ |
||||||
|
<#function kennzahlInRowOrCol>\ |
||||||
|
--TODO auch 2. Dimension in Zeilen/Spalten\ |
||||||
|
<#if coldef.name="xckennzahl"||rowdef.name="xckennzahl"> <#return 1><#else> return <#return 0> </#if>\ |
||||||
|
</#function>\ |
||||||
|
\ |
||||||
|
<#function hasVirtualColumns>\ |
||||||
|
--TODO auch 2. Dimension in Zeilen/Spalten\ |
||||||
|
<#if coldef.is_virtual?number=1||rowdef.is_virtual?number=1> <#return 1><#else> return <#return 0> </#if>\ |
||||||
|
</#function>\ |
||||||
|
<#assign graph_col= "col" />\ |
||||||
|
/* <#assign graph_col=<<Spaltenvisualisierung>> /> */\ |
||||||
|
\ |
||||||
|
create temp table tmp_cellmax (maxvalue ${datatype} );\ |
||||||
|
insert into tmp_cellmax values(0);\ |
||||||
|
\ |
||||||
|
\ |
||||||
|
<#if hasVirtualColumns()=1||kennzahlInRowOrCol()=1>\ |
||||||
|
select * into temp tmp_rohdaten from \ |
||||||
|
${table_name}\ |
||||||
|
where \ |
||||||
|
${restriction};\ |
||||||
|
<#if coldef.is_virtual?number=1> alter table tmp_rohdaten add column ${coldef.name} varchar(255); ${coldef.vcsql}; </#if>\ |
||||||
|
<#if rowdef.is_virtual?number=1> alter table tmp_rohdaten add column ${rowdef.name} varchar(255); ${rowdef.vcsql}; </#if>\ |
||||||
|
--create index ix_tmp_r1 on tmp_rohdaten(${coldef.name},${rowdef.name}); --Todo nicht xckennzahl ggfs. für 2. Dimension in Spalten\ |
||||||
|
</#if>\ |
||||||
|
\ |
||||||
|
\ |
||||||
|
<#if kennzahlInRowOrCol()=0>\ |
||||||
|
create temp table tmp_cache (\ |
||||||
|
colattrib varchar(255), <@addcomment comment=coldef.caption/>\ |
||||||
|
rowattrib varchar(255), <@addcomment comment=rowdef.caption/>\ |
||||||
|
row2attrib varchar(255),\ |
||||||
|
value decimal(17,5));\ |
||||||
|
insert into tmp_cache (colattrib,rowattrib,<#if "<<2.Ansicht in Zeilen>>"!=""&&"<<2.Ansicht in Zeilen>>"!="<<2.Ansicht in Zeilen>>">row2attrib, </#if> value)\ |
||||||
|
select ${coldef.name}::varchar(255), \ |
||||||
|
${rowdef.name}::varchar(255),\ |
||||||
|
<#if "<<2.Ansicht in Zeilen>>"!=""&&"<<2.Ansicht in Zeilen>>"!="<<2.Ansicht in Zeilen>>">${zweiteRowDef.name}::varchar(255),</#if>\ |
||||||
|
${aggrfunction}\ |
||||||
|
\ |
||||||
|
<#if hasVirtualColumns()=0> \ |
||||||
|
from ${table_name} where \ |
||||||
|
${restriction}\ |
||||||
|
<#if (aggrfunction_restriction?length>0)> and ${aggrfunction_restriction} </#if>\ |
||||||
|
<#else>\ |
||||||
|
from tmp_rohdaten\ |
||||||
|
</#if>\ |
||||||
|
\ |
||||||
|
group by 1,2 <#if "<<2.Ansicht in Zeilen>>"!=""&&"<<2.Ansicht in Zeilen>>"!="<<2.Ansicht in Zeilen>>">,${zweiteRowDef.name}</#if> ;\ |
||||||
|
create index ix_tmp_roh1 on tmp_cache (colattrib,rowattrib,row2attrib);\ |
||||||
|
</#if>\ |
||||||
|
\ |
||||||
|
--moegliche attrib_nachbearbeitung\ |
||||||
|
<#if kennzahlInRowOrCol()=0> \ |
||||||
|
<#assign tmp_table="tmp_cache"/> <#assign rowfield="rowattrib"/> <#assign colfield="colattrib"/> \ |
||||||
|
<#else>\ |
||||||
|
<#assign tmp_table="tmp_rohdaten"/> <#assign rowfield=rowdef.name/> <#assign colfield=coldef.name/> \ |
||||||
|
</#if>\ |
||||||
|
\ |
||||||
|
<#if (rowdef.attrib_nachbearbeitung?length>1)>\ |
||||||
|
${rowdef.attrib_nachbearbeitung?replace("<<tmp_table>>",tmp_table)?replace("<<col>>",rowfield)};\ |
||||||
|
-- z.B. update tmp_cache R set rowattrib='s_'||rowattrib;\ |
||||||
|
</#if>\ |
||||||
|
<#if (coldef.attrib_nachbearbeitung?length>1)>\ |
||||||
|
${coldef.attrib_nachbearbeitung?replace("<<tmp_table>>",tmp_table)?replace("<<col>>",colfield)};\ |
||||||
|
-- z.B. update tmp_cache R set rowattrib='s_'||rowattrib;\ |
||||||
|
</#if>\ |
||||||
|
\ |
||||||
|
\ |
||||||
|
\ |
||||||
|
\ |
||||||
|
<#if coldef.is_sicht>0>\ |
||||||
|
<#assign ergspalten=.vars[coldef.caption].elements/>\ |
||||||
|
<#else>\ |
||||||
|
<#assign ergspalten=nichtsicht_ergspalten/>\ |
||||||
|
</#if>\ |
||||||
|
create temp table tmp_erg (\ |
||||||
|
ebene integer,\ |
||||||
|
col1 varchar(255),\ |
||||||
|
name varchar(255),\ |
||||||
|
<#if "<<2.Ansicht in Zeilen>>"!=""&&"<<2.Ansicht in Zeilen>>"!="<<2.Ansicht in Zeilen>>">col2 varchar(255),</#if>\ |
||||||
|
<#assign i=0/>\ |
||||||
|
<#foreach spalte in ergspalten>\ |
||||||
|
<#assign i=i+1/>\ |
||||||
|
c${i} decimal(17,5) default 0, <@addcomment comment=spalte.name/>\ |
||||||
|
\ |
||||||
|
</#foreach>\ |
||||||
|
sortnr integer\ |
||||||
|
) <@informixnolog/>;\ |
||||||
|
\ |
||||||
|
create index ix_tmp_erg on tmp_erg (sortnr);\ |
||||||
|
\ |
||||||
|
<#if rowdef.is_sicht>0> \ |
||||||
|
<#assign zeilendef=.vars[rowdef.caption].elements/> --ermittelt des SichtObjekts anhand des Feldnames (aus felderinfo)\ |
||||||
|
<#else>\ |
||||||
|
<#assign zeilendef=nichtsicht_ergzeilen/>\ |
||||||
|
</#if>\ |
||||||
|
<#assign sortnr=0/>\ |
||||||
|
<#foreach zeile in zeilendef>\ |
||||||
|
<#if "<<2.Ansicht in Zeilen>>"!=""&&"<<2.Ansicht in Zeilen>>"!="<<2.Ansicht in Zeilen>>">\ |
||||||
|
<#foreach zeile2 in zweiteRow_nichtsicht_ergzeilen>\ |
||||||
|
<#assign sortnr=sortnr+1/>\ |
||||||
|
insert into tmp_erg (ebene,col1,name,col2,sortnr)\ |
||||||
|
values (${zeile.level},'${zeile.key}','${zeile.name}','${zeile2.name}',${sortnr});\ |
||||||
|
<#assign i=0/>\ |
||||||
|
<#foreach spalte in ergspalten>\ |
||||||
|
<#assign i=i+1/>\ |
||||||
|
<@updateval i=i col=spalte row=zeile row2=zeile2 sortnr=sortnr/>\ |
||||||
|
</#foreach>\ |
||||||
|
</#foreach>\ |
||||||
|
<#else>\ |
||||||
|
/* <#if zeile.level <= <<Zeilenfilter bis Ebene>> > */\ |
||||||
|
<#assign sortnr=sortnr+1/>\ |
||||||
|
insert into tmp_erg (ebene,col1,name,sortnr)\ |
||||||
|
values (${zeile.level},'${zeile.key}','${zeile.name}',${sortnr});\ |
||||||
|
<#assign i=0/>\ |
||||||
|
<#foreach spalte in ergspalten>\ |
||||||
|
<#assign i=i+1/>\ |
||||||
|
<@updateval i=i col=spalte row=zeile row2='' sortnr=sortnr/>\ |
||||||
|
</#foreach>\ |
||||||
|
/* </#if> --<<Zeilenfilter bis Ebene>> */\ |
||||||
|
</#if> \ |
||||||
|
</#foreach>\ |
||||||
|
\ |
||||||
|
<#macro updateval i col row row2 sortnr>\ |
||||||
|
update tmp_erg T set c${i}=\ |
||||||
|
<#if kennzahlInRowOrCol()=0>\ |
||||||
|
(select nvl(sum(value),0) from tmp_cache R where 1=1 \ |
||||||
|
<@colrestriction col=col/>\ |
||||||
|
<@rowrestriction row=row row2=row2/>\ |
||||||
|
) \ |
||||||
|
<#else> -- Kennzahl ist in Zeile oder Spalte\ |
||||||
|
(select <@kennzahlSelect row=row col=col/>\ |
||||||
|
from tmp_rohdaten R where 1=1 \ |
||||||
|
<#if rowdef.name="xckennzahl"> <@kennzahlrestrict row=row col=col/> <#else> <@rowrestriction row=row row2=row2 rowattribname=rowdef.name/></#if>\ |
||||||
|
<#if coldef.name="xckennzahl"> <@kennzahlrestrict row=row col=col/> <#else> <@colrestriction col=col colattribname=coldef.name/></#if>\ |
||||||
|
\ |
||||||
|
)\ |
||||||
|
</#if>\ |
||||||
|
where T.sortnr='${sortnr}'\ |
||||||
|
;\ |
||||||
|
</#macro>\ |
||||||
|
\ |
||||||
|
<#macro kennzahlrestrict row col>\ |
||||||
|
<#if coldef.name="xckennzahl">\ |
||||||
|
<#foreach k in kennzahlen>\ |
||||||
|
<#if (col.apnr=k.apnr&&k.restriction?length>0)> and ${k.restriction} </#if>\ |
||||||
|
</#foreach>\ |
||||||
|
</#if>\ |
||||||
|
<#if rowdef.name="xckennzahl">\ |
||||||
|
<#foreach k in kennzahlen>\ |
||||||
|
<#if (row.key=k.apnr&&k.restriction?length>0)> and ${k.restriction} </#if>\ |
||||||
|
</#foreach>\ |
||||||
|
</#if>\ |
||||||
|
</#macro>\ |
||||||
|
\ |
||||||
|
<#macro kennzahlSelect row col>\ |
||||||
|
<#if coldef.name="xckennzahl">\ |
||||||
|
<#foreach k in kennzahlen>\ |
||||||
|
<#if col.apnr=k.apnr> ${k.aggrfunction} </#if>\ |
||||||
|
</#foreach>\ |
||||||
|
</#if>\ |
||||||
|
<#if rowdef.name="xckennzahl">\ |
||||||
|
<#foreach k in kennzahlen>\ |
||||||
|
<#if row.key=k.apnr> ${k.aggrfunction} </#if>\ |
||||||
|
</#foreach>\ |
||||||
|
</#if>\ |
||||||
|
\ |
||||||
|
\ |
||||||
|
</#macro>\ |
||||||
|
\ |
||||||
|
\ |
||||||
|
\ |
||||||
|
<#macro colrestriction col colattribname='R.colattrib'>\ |
||||||
|
<#if coldef.is_sicht==1>\ |
||||||
|
and ${colattribname}::varchar(255) in ${col.subkeys}\ |
||||||
|
<#elseif coldef.is_sicht=2>\ |
||||||
|
and (${col.strukturStr?replace('$1',' '+colattribname+"::varchar(255)")}) \ |
||||||
|
<#else>\ |
||||||
|
<#if col.apnr!='gesamt'>\ |
||||||
|
and ${colattribname}::varchar(255)='${col.apnr}' \ |
||||||
|
</#if>\ |
||||||
|
</#if>\ |
||||||
|
</#macro>\ |
||||||
|
\ |
||||||
|
<#macro rowrestriction row row2 rowattribname='R.rowattrib' >\ |
||||||
|
<#if rowdef.is_sicht==1>\ |
||||||
|
and ${rowattribname}::varchar(255) in ${row.subkeys}\ |
||||||
|
<#elseif rowdef.is_sicht==2>\ |
||||||
|
and ( ${row.strukturStr?replace('$1',' '+rowattribname+"::varchar(255)")} ) \ |
||||||
|
<#else>\ |
||||||
|
<#if row.key!='gesamt'> and ${rowattribname}::varchar(255)='${row.key}' </#if>\ |
||||||
|
</#if>\ |
||||||
|
<#if row2?is_hash> and R.row2attrib='${row2.key}' </#if> \ |
||||||
|
</#macro>\ |
||||||
|
\ |
||||||
|
drop table if exists tmp_cache;\ |
||||||
|
\ |
||||||
|
drop table if exists tmp_rohdaten;\ |
||||||
|
\ |
||||||
|
-- Kennzahl in Spalten/Zeilen ggfs. null\ |
||||||
|
<#assign i=0/>\ |
||||||
|
<#foreach spalte in ergspalten>\ |
||||||
|
<#assign i=i+1/>\ |
||||||
|
update tmp_erg set c${i}=0 where c${i} is null; \ |
||||||
|
</#foreach>\ |
||||||
|
<#assign lastcol=i />\ |
||||||
|
\ |
||||||
|
--Wenn Grafikfunktion eingeschaltet ist, wird Maximalwert ermittelt:\ |
||||||
|
<#if i != 0 && graph_col != "col" >\ |
||||||
|
\ |
||||||
|
<#assign i=0/>\ |
||||||
|
<#foreach spalte in ergspalten>\ |
||||||
|
<#assign i=i+1/>\ |
||||||
|
<#if i == lastcol>\ |
||||||
|
update tmp_cellmax set maxvalue = (select max(c${i}) from tmp_erg) \ |
||||||
|
where tmp_cellmax.maxvalue < (select max(c${i}) from tmp_erg) ;\ |
||||||
|
</#if> \ |
||||||
|
</#foreach>\ |
||||||
|
\ |
||||||
|
</#if>\ |
||||||
|
\ |
||||||
|
<#if "<<Leere Zeilen ausblenden>>"="'ja'">\ |
||||||
|
delete from tmp_erg where 1=1\ |
||||||
|
<#assign i=0/>\ |
||||||
|
<#foreach spalte in ergspalten>\ |
||||||
|
<#assign i=i+1/>\ |
||||||
|
and c${i}=0\ |
||||||
|
</#foreach>;\ |
||||||
|
</#if>\ |
||||||
|
<#if "<<Ansicht in Ergebniszeilen>>"="'institution'">\ |
||||||
|
update tmp_erg set name=replace(name,col1||' - ','');\ |
||||||
|
update tmp_erg set col1=(select max(uniquename) from organigramm where col1=trim(key_apnr))\ |
||||||
|
where substring(col1 from 1 for 1)='_';\ |
||||||
|
--vorher war ggfs _3 zu O005030, auch O005030 in Namen ersetzen\ |
||||||
|
update tmp_erg set name=replace(name,col1||' - ','');\ |
||||||
|
</#if> \ |
||||||
|
\ |
||||||
|
\ |
||||||
|
\ |
||||||
|
\ |
||||||
|
select \ |
||||||
|
<#if rowdef.is_sicht>0>ebene,</#if>\ |
||||||
|
name\ |
||||||
|
<#if "<<2.Ansicht in Zeilen>>"!=""&&"<<2.Ansicht in Zeilen>>"!="<<2.Ansicht in Zeilen>>">,col2</#if>\ |
||||||
|
<#assign i=0/>\ |
||||||
|
<#assign i=0/>\ |
||||||
|
<#foreach spalte in ergspalten>\ |
||||||
|
<#assign i=i+1/>\ |
||||||
|
<#if i != lastcol && graph_col != "col" >\ |
||||||
|
<#if graph_col == "_graphbaralternating">\ |
||||||
|
--bei symmetr. Balken jeder 2. Balken rechtsbündig\ |
||||||
|
<#if i % 2 == 0>\ |
||||||
|
, '' || c${i}::${datatype} || '|' || tmp_cellmax.maxvalue as _graph${i}\ |
||||||
|
<#else>\ |
||||||
|
, '' || c${i}::${datatype} || '|' || tmp_cellmax.maxvalue as _graphbarright${i}\ |
||||||
|
</#if>\ |
||||||
|
<#else>\ |
||||||
|
, '' || c${i}::${datatype} || '|' || tmp_cellmax.maxvalue as ${graph_col}${i}\ |
||||||
|
</#if>\ |
||||||
|
\ |
||||||
|
<#else>\ |
||||||
|
, c${i}::${datatype} as col${i}\ |
||||||
|
</#if>\ |
||||||
|
\ |
||||||
|
</#foreach>\ |
||||||
|
from tmp_erg, tmp_cellmax order by sortnr;^--freemarker Template\ |
||||||
|
XIL List\ |
||||||
|
sizable_columns horizontal_scrolling\ |
||||||
|
drop_and_delete movable_columns\ |
||||||
|
white_space_color=COLOR_WHITE fixed_columns=1\ |
||||||
|
min_heading_height=35\ |
||||||
|
<#if rowdef.is_sicht>0>\ |
||||||
|
Column CID=0 heading_text="Ebene" center_heading\ |
||||||
|
row_selectable heading_platform readonly explanation="Hierarchieebene"\ |
||||||
|
width=5 text_size=8\ |
||||||
|
</#if>\ |
||||||
|
Column CID=20 heading_text="${.vars["Ansicht in ErgebniszeilenObject"].selectedItems[0].name}" center_heading\ |
||||||
|
row_selectable heading_platform readonly explanation="Schlüssel: ${.vars["Ansicht in ErgebniszeilenObject"].selectedItems[0].name}Nr"\ |
||||||
|
width=30 text_size=30\ |
||||||
|
<#if "<<2.Ansicht in Zeilen>>"!=""&&"<<2.Ansicht in Zeilen>>"!="<<2.Ansicht in Zeilen>>">\ |
||||||
|
Column CID=20 heading_text="${.vars["2.Ansicht in ZeilenObject"].selectedItems[0].name}" center_heading\ |
||||||
|
row_selectable heading_platform readonly\ |
||||||
|
width=20 text_size=10 explanation="${.vars["2.Ansicht in ZeilenObject"].selectedItems[0].name}"\ |
||||||
|
</#if>\ |
||||||
|
<#if coldef.is_sicht>0>\ |
||||||
|
<#assign ergspalten=.vars[coldef.caption].elements/>\ |
||||||
|
<#else>\ |
||||||
|
<#assign ergspalten=nichtsicht_ergspalten/>\ |
||||||
|
</#if>\ |
||||||
|
<#foreach spalte in ergspalten>\ |
||||||
|
Column CID=1 heading_text="${spalte.name}" center_heading\ |
||||||
|
row_selectable heading_platform readonly explanation="Ausprägung ${spalte.name}"\ |
||||||
|
width=12\ |
||||||
|
</#foreach>\ |
||||||
|
@@@^Altersgruppe^Anzahl^Kreuztabellen zu Personalzahlen^drop table tmp_erg;\ |
||||||
|
drop table tmp_cellmax;^ ^3^700^360^0^1^ ^ |
@ -0,0 +1 @@ |
|||||||
|
10^21200^ |
Loading…
Reference in new issue