diff --git a/src-modules/module/rpta/masken/48110_felderinfo.unl b/src-modules/module/rpta/masken/48110_felderinfo.unl index d52602c..32563c5 100644 --- a/src-modules/module/rpta/masken/48110_felderinfo.unl +++ b/src-modules/module/rpta/masken/48110_felderinfo.unl @@ -26,3 +26,5 @@ union select tid,name,sortnr from sichten where art in ('SOS-Kostenstellen-Sicht 48133^Spalten^3001^0^0^150^190^10^char^30^0^1^<>\ select C.uniquename, C.caption ,L.layout_id from rpta_column C, rpta_column2layout L where C.tid=L.column_id and layout_id in\ (select tid from rpta_column_layout where uniquename=<>) order by 2;^ ^ ^ +48134^tablestylesheet^19^0^0^100^150^1^char^200^1^1^<>\ +select distinct filename,X.caption from sx_stylesheets X,sx_mask_style S where X.tid=S.stylesheet_id and S.maskeninfo_id=48110^hidden^<>select distinct filename,X.caption from sx_stylesheets X,sx_mask_style S where X.tid=S.stylesheet_id and S.maskeninfo_id=48110 and ord=1^ diff --git a/src-modules/module/rpta/masken/48110_masken_felder_bez.unl b/src-modules/module/rpta/masken/48110_masken_felder_bez.unl index 83c16dc..a64e9c6 100644 --- a/src-modules/module/rpta/masken/48110_masken_felder_bez.unl +++ b/src-modules/module/rpta/masken/48110_masken_felder_bez.unl @@ -13,3 +13,4 @@ 48110^48128^ 48110^48132^ 48110^48133^ +48110^48134^ diff --git a/src-modules/module/rpta/masken/48110_maskeninfo.unl b/src-modules/module/rpta/masken/48110_maskeninfo.unl index e9e9a00..b72f9c6 100644 --- a/src-modules/module/rpta/masken/48110_maskeninfo.unl +++ b/src-modules/module/rpta/masken/48110_maskeninfo.unl @@ -90,114 +90,7 @@ and ${filter}\ \ \ \ -select \ ---zuerst die Basisdaten:\ -<#foreach column in columns>\ -<#if column.coltype="physicalColumn">\ -${column.srcfieldname} as ${column.srcfieldname},\ -<#elseif column.coltype="logicalColumn">\ -${column.colfunction} as ${column.targetfieldname},\ -<#elseif column.coltype="lookupColumn">\ -(${column.colfunction}) as ${column.targetfieldname},\ -<#elseif column.coltype="computedColumn" || column.coltype=="processingColumn">\ -null::decimal(19,6) as ${column.targetfieldname},\ -\ -\ -null::char(1) as dummycol\ -into temp tmp_stud\ -from ${basetable.runtime_tablename}\ -<#if rpta_column_layout.whereclause !="">\ -where ${rpta_column_layout.whereclause}\ -\ -;\ -\ ---ergebnistabelle:\ -select \ ---zuerst die nicht-Aggregate:\ -<#assign groupby=0 />\ -<#foreach column in columns>\ --- logicalColumns ausgeschlossen, da sie von processingColumns aggregiert werden\ --- computedColumns immer mitnehmen, da später verarbeitet\ -<#if column.is_aggregate==0 && column.coltype!="logicalColumn" && column.coltype!="processingColumn" || column.coltype="computedColumn"> \ -<#assign groupby=groupby+1 />\ -${column.targetfieldname},\ -<#elseif column.is_aggregate==0 && column.coltype="processingColumn"> \ -<#assign groupby=groupby+1 />\ -${column.srcfieldname} as ${column.targetfieldname},\ -\ -\ ---dann die Aggregate:\ -<#foreach column in columns>\ --- logicalColumns ausgeschlossen, da sie von processingColumns aggregiert werden\ --- computedColumns ausgeschlossen, da später im finalen select verarbeitet\ -<#if column.is_aggregate==1 && column.coltype!="computedColumn" && column.coltype!="logicalColumn"> \ -${column.colfunction}(${column.srcfieldname}) as ${column.targetfieldname},\ -\ -\ -null::char(1) as dummycol\ -into temp tmp_stud2\ -from tmp_stud\ -where 1=1\ -/* ${<>} */\ -group by\ -<#list 1..groupby as i>${i}\ -<#if i != groupby>\ -,\ -\ -\ -;\ ---für Prozentwerte alle Aggregate summieren:\ -select <#foreach column in columns>\ -<#if column.is_aggregate==1 && column.coltype!="computedColumn" && column.coltype!="processingColumn">\ -sum(${column.targetfieldname})::float as ${column.targetfieldname},\ -\ -\ -null::char(1) as dummycol\ -into temp tmp_gesamt\ -from tmp_stud2\ -where 1=1\ -;\ -\ -<#assign number_of_visible_colums=0 />\ -<#foreach column in columns>\ -<#if column.is_visible!=0>\ -<#assign number_of_visible_colums=number_of_visible_colums+1 />\ -\ -\ -<#assign colnr=0 />\ -select \ -<#foreach column in columns>\ -<#if column.is_visible!=0>\ -<#assign colnr=colnr+1 />\ -<#assign format_sql="" />\ -<#if column.format_sql?string != "">\ -<#assign format_sql=column.format_sql />\ -\ -\ -<#if column.coltype=="computedColumn">\ -(${column.colfunction})${format_sql} as ${column.targetfieldname}\ -<#else>\ -${column.targetfieldname}${format_sql} as ${column.targetfieldname}\ -\ -\ -<#if colnr < number_of_visible_colums>,\ - --wenn sichtbar\ -\ -from tmp_stud2\ -order by <#list 1..number_of_visible_colums as i>${i}\ -<#if i != number_of_visible_colums>\ -,\ -\ -\ -;\ -<#if basetable.is_virtual==1>\ -drop table if exists ${basetable.runtime_tablename};\ -\ -\ -\ -drop table if exists tmp_stud;\ -drop table if exists tmp_stud2;\ -drop table if exists tmp_gesamt;\ +<@rpta_interpret_column_layout />\ \ \ --wenn columns?has_content^--Freemarker Template\ diff --git a/src-modules/module/rpta/schluesseltabellen/fm_templates.unl b/src-modules/module/rpta/schluesseltabellen/fm_templates.unl index d4928ad..2583fa9 100644 --- a/src-modules/module/rpta/schluesseltabellen/fm_templates.unl +++ b/src-modules/module/rpta/schluesseltabellen/fm_templates.unl @@ -1,4 +1,4 @@ -84^RPTA-Makros^<#macro rpta_column_layout_fuellen>\ +91^RPTA-Makros^<#macro rpta_column_layout_fuellen>\ CREATE temp TABLE tmp_rpta_column\ (\ uniquename varchar(255) NOT NULL,\ @@ -220,4 +220,116 @@ and L.resultset_id=T.resultset_id\ drop table tmp_rpta_column;\ drop TABLE tmp_rpta_column_layout;\ drop TABLE tmp_rpta_column2layout;\ +\ +\ +<#macro rpta_interpret_column_layout>\ + select \ + --zuerst die Basisdaten:\ + <#foreach column in columns>\ + <#if column.coltype="physicalColumn">\ + ${column.srcfieldname} as ${column.srcfieldname},\ + <#elseif column.coltype="logicalColumn">\ + ${column.colfunction} as ${column.targetfieldname},\ + <#elseif column.coltype="lookupColumn">\ + (${column.colfunction}) as ${column.targetfieldname},\ + <#elseif column.coltype="computedColumn" || column.coltype=="processingColumn">\ + null::decimal(19,6) as ${column.targetfieldname},\ + \ + \ + null::char(1) as dummycol\ + into temp tmp_stud\ + from ${basetable.runtime_tablename}\ + <#if rpta_column_layout.whereclause !="">\ + where ${rpta_column_layout.whereclause}\ + \ + ;\ + \ + --ergebnistabelle:\ + select \ + --zuerst die nicht-Aggregate:\ + <#assign groupby=0 />\ + <#foreach column in columns>\ + -- logicalColumns ausgeschlossen, da sie von processingColumns aggregiert werden\ + -- computedColumns immer mitnehmen, da später verarbeitet\ + <#if (column.is_aggregate==0 && column.coltype!="logicalColumn" && column.coltype!="processingColumn") || column.coltype="computedColumn"> \ + <#assign groupby=groupby+1 />\ + ${column.targetfieldname},\ + <#elseif column.is_aggregate==0 && column.coltype="processingColumn"> \ + <#assign groupby=groupby+1 />\ + ${column.srcfieldname} as ${column.targetfieldname},\ + \ + \ + --dann die Aggregate:\ + <#foreach column in columns>\ + -- logicalColumns ausgeschlossen, da sie von processingColumns aggregiert werden\ + -- computedColumns ausgeschlossen, da später im finalen select verarbeitet\ + <#if column.is_aggregate==1 && column.coltype!="computedColumn" && column.coltype!="logicalColumn"> \ + ${column.colfunction}(${column.srcfieldname}) as ${column.targetfieldname},\ + \ + \ + null::char(1) as dummycol\ + into temp tmp_stud2\ + from tmp_stud\ + where 1=1\ + group by\ + <#list 1..groupby as i>${i}\ + <#if i != groupby>\ + ,\ + \ + \ + ;\ + --für Prozentwerte alle Aggregate summieren:\ + select \ + <#foreach column in columns>\ + <#if column.is_aggregate==1 && column.coltype!="computedColumn" && column.coltype!="processingColumn">\ + sum(${column.targetfieldname})::float as ${column.targetfieldname},\ + \ + \ + null::char(1) as dummycol\ + into temp tmp_gesamt\ + from tmp_stud2\ + where 1=1\ + ;\ + \ + <#assign number_of_visible_colums=0 />\ + <#foreach column in columns>\ + <#if column.is_visible!=0>\ + <#assign number_of_visible_colums=number_of_visible_colums+1 />\ + \ + \ + <#assign colnr=0 />\ + select \ + <#foreach column in columns>\ + <#if column.is_visible!=0>\ + <#assign colnr=colnr+1 />\ + <#assign format_sql="" />\ + <#if column.format_sql?string != "">\ + <#assign format_sql=column.format_sql />\ + \ + \ + <#if column.coltype=="computedColumn">\ + (${column.colfunction})${format_sql} as ${column.targetfieldname}\ + <#else>\ + ${column.targetfieldname}${format_sql} as ${column.targetfieldname}\ + \ + \ + <#if colnr < number_of_visible_colums>,\ + --wenn sichtbar\ + \ + from tmp_stud2\ + order by \ + <#list 1..number_of_visible_colums as i>${i}\ + <#if i != number_of_visible_colums>\ + ,\ + \ + \ + ;\ + \ + <#if basetable.is_virtual==1>\ + drop table if exists ${basetable.runtime_tablename};\ + \ + drop table if exists tmp_stud;\ + drop table if exists tmp_stud2;\ + drop table if exists tmp_gesamt;\ + \ ^Makros zum Umgang mit Spaltenlayouts^^1^ diff --git a/src-modules/module/rpta/schluesseltabellen/macro_masken_bez_fuellen.sql b/src-modules/module/rpta/schluesseltabellen/macro_masken_bez_fuellen.sql index 774084d..9aa71cd 100644 --- a/src-modules/module/rpta/schluesseltabellen/macro_masken_bez_fuellen.sql +++ b/src-modules/module/rpta/schluesseltabellen/macro_masken_bez_fuellen.sql @@ -32,7 +32,7 @@ CREATE TEMP TABLE tmp_macro_masken_bez ( maskeninfo_id2 integer NOT NULL, active integer DEFAULT 1 NOT NULL, sortnr smallint NOT NULL, - schleifenrelation character(255), + schleifenrelation text, schleifenfeldname character(255), alias character(255), schleifenfstand character(255), diff --git a/src-modules/module/rpta/schluesseltabellen/rptaColLay_rpta_exam_unit_dim_studiengang_note_fuellen.sql b/src-modules/module/rpta/schluesseltabellen/rptaColLay_rpta_exam_unit_dim_studiengang_note_fuellen.sql index 354c265..03b2bc8 100644 --- a/src-modules/module/rpta/schluesseltabellen/rptaColLay_rpta_exam_unit_dim_studiengang_note_fuellen.sql +++ b/src-modules/module/rpta/schluesseltabellen/rptaColLay_rpta_exam_unit_dim_studiengang_note_fuellen.sql @@ -18,6 +18,64 @@ select uniquename from rpta_resultset where uniquename='rpta_exam_unit_dim_studi <#assign rpta_columns = [ +{"uniquename":"dim_studiengang_stg", +"srcfieldname":"dim_studiengang_stg", +"column_type":"physicalColumn", +"col_function":"", +"format_code":"", +"caption":"Fach", +"is_visible":"1", +"is_aggregate":0, +"visible_size":10, +"description":""}, + +{"uniquename":"dim_studiengang_abschluss", +"srcfieldname":"dim_studiengang_abschluss", +"column_type":"physicalColumn", +"col_function":"", +"format_code":"", +"caption":"Abschluss", +"is_visible":"1", +"is_aggregate":0, +"visible_size":10, +"description":""}, + + {"uniquename":"sem_der_pruefung", +"srcfieldname":"sem_der_pruefung", +"targetfieldname":"sem_der_pruefung", +"column_type":"physicalColumn", +"col_function":"", +"format_code":"", +"caption":"Semester der Prüfung (Schlüssel)", +"is_visible":"1", +"is_aggregate":0, +"visible_size":5, +"description":""}, + +{"uniquename":"sem_der_pruefung_str", +"srcfieldname":"sem_der_pruefung", +"targetfieldname":"sem_der_pruefung_str", +"column_type":"logicalColumn", +"col_function":"(select eintrag from semester where tid=sem_der_pruefung)", +"format_code":"", +"caption":"Semester der Prüfung", +"is_visible":"0", +"is_aggregate":0, +"visible_size":10, +"description":""}, + + {"uniquename":"sem_der_pruefung_str_process", +"srcfieldname":"sem_der_pruefung_str", +"targetfieldname":"sem_der_pruefung_str_process", +"column_type":"processingColumn", +"col_function":"", +"format_code":"", +"caption":"Semester der Prüfung", +"is_visible":"1", +"is_aggregate":0, +"visible_size":5, +"description":""}, + {"uniquename":"elementnr", "srcfieldname":"elementnr", "column_type":"physicalColumn", diff --git a/src-modules/module/rpta/schluesseltabellen/rptaColLay_rpta_exam_unit_dim_studiengang_note_fuellen_MIN_MAX_SEMESTER_TEST.sql b/src-modules/module/rpta/schluesseltabellen/rptaColLay_rpta_exam_unit_dim_studiengang_note_fuellen_MIN_MAX_SEMESTER_TEST.sql new file mode 100644 index 0000000..4773958 --- /dev/null +++ b/src-modules/module/rpta/schluesseltabellen/rptaColLay_rpta_exam_unit_dim_studiengang_note_fuellen_MIN_MAX_SEMESTER_TEST.sql @@ -0,0 +1,443 @@ +--freemarker template +<#include "RPTA-Makros"/> + + +select count(*) from rpta_resultset where uniquename='rpta_exam_unit_dim_studiengang'; + + +select uniquename from rpta_resultset where uniquename='rpta_exam_unit_dim_studiengang'; + + +<#assign rpta_column_layouts = [{"uniquename":"rpta_exam_unit_dim_studiengang_note", +"caption":"Prüfungsergebnisse", +"rpta_resultset":"rpta_exam_unit_dim_studiengang", +"whereclause":"((modulart=''P'' and sourcesystem=6) or (part=''MP'' and sourcesystem=5))", +"description":"Prüfung und Noten" +}] + /> + +<#assign rpta_columns = [ + +{"uniquename":"dim_studiengang_stg", +"srcfieldname":"dim_studiengang_stg", +"column_type":"physicalColumn", +"col_function":"", +"format_code":"", +"caption":"Fach", +"is_visible":"1", +"is_aggregate":0, +"visible_size":10, +"description":""}, + +{"uniquename":"dim_studiengang_abschluss", +"srcfieldname":"dim_studiengang_abschluss", +"column_type":"physicalColumn", +"col_function":"", +"format_code":"", +"caption":"Abschluss", +"is_visible":"1", +"is_aggregate":0, +"visible_size":10, +"description":""}, + + {"uniquename":"sem_der_pruefung", +"srcfieldname":"sem_der_pruefung", +"targetfieldname":"sem_der_pruefung", +"column_type":"logicalColumn", +"col_function":"sem_der_pruefung", +"format_code":"", +"caption":"Semester der Prüfung", +"is_visible":"0", +"is_aggregate":0, +"visible_size":5, +"description":""}, + + {"uniquename":"sem_der_pruefung_min_process", +"srcfieldname":"sem_der_pruefung", +"targetfieldname":"sem_der_pruefung_min_process", +"column_type":"processingColumn", +"col_function":"min", +"format_code":"", +"caption":"Semester der Prüfung (Min)", +"is_visible":"1", +"is_aggregate":1, +"visible_size":5, +"description":""}, + + {"uniquename":"sem_der_pruefung_max_process", +"srcfieldname":"sem_der_pruefung", +"targetfieldname":"sem_der_pruefung_max_process", +"column_type":"processingColumn", +"col_function":"max", +"format_code":"", +"caption":"Semester der Prüfung (Max)", +"is_visible":"1", +"is_aggregate":1, +"visible_size":5, +"description":""}, + +{"uniquename":"elementnr", +"srcfieldname":"elementnr", +"column_type":"physicalColumn", +"col_function":"", +"format_code":"", +"caption":"pnr", +"is_visible":"1", +"is_aggregate":0, +"visible_size":10, +"description":""}, + + {"uniquename":"pdtxt", +"srcfieldname":"pdtxt", +"column_type":"physicalColumn", +"col_function":"", +"format_code":"", +"caption":"Name der Prüfung", +"is_visible":"1", +"is_aggregate":0, +"visible_size":40, +"description":""}, + + {"uniquename":"summe", +"srcfieldname":"summe", +"column_type":"physicalColumn", +"col_function":"sum", +"format_code":"", +"caption":"Teilnehmer", +"is_visible":"1", +"is_aggregate":1, +"visible_size":15, +"description":""}, + + {"uniquename":"note_case", +"srcfieldname":"note", +"targetfieldname":"note_case", +"column_type":"logicalColumn", +"col_function":"(case when note > 6 then null else note end)", +"format_code":"", +"caption":"Durchschnittsnote % *", +"is_visible":"0", +"is_aggregate":0, +"visible_size":5, +"description":""}, + + {"uniquename":"note_schnitt", +"srcfieldname":"note_case", +"targetfieldname":"note_schnitt", +"column_type":"processingColumn", +"col_function":"avg", +"format_code":"", +"caption":"Durchschnittsnote *", +"is_visible":"0", +"is_aggregate":1, +"visible_size":5, +"description":""}, + + {"uniquename":"note_schnitt_case", +"srcfieldname":"note_schnitt", +"targetfieldname":"note_schnitt_case", +"column_type":"computedColumn", +"col_function":"case when summe < 5 then null else note_schnitt end", +"format_code":"", +"caption":"Durchschnittsnote *", +"is_visible":"1", +"is_aggregate":1, +"visible_size":25, +"description":""}, + + {"uniquename":"pstatus_nb", +"srcfieldname":"pstatus", +"targetfieldname":"pstatus_nb", +"column_type":"logicalColumn", +"col_function":"(case when pstatus in (''NB'',''EN'') then 1 else 0 end)", +"format_code":"", +"caption":"Durchfallquote in % *", +"is_visible":"0", +"is_aggregate":0, +"visible_size":5, +"description":""}, + + {"uniquename":"pstatus_nb_sum", +"srcfieldname":"pstatus_nb", +"targetfieldname":"pstatus_nb_sum", +"column_type":"processingColumn", +"col_function":"sum", +"format_code":"", +"caption":"Durchfallquote in % *", +"is_visible":"0", +"is_aggregate":1, +"visible_size":5, +"description":""}, + + {"uniquename":"pstatus_nb_quote", +"srcfieldname":"pstatus_nb_sum", +"targetfieldname":"pstatus_nb_quote", +"column_type":"computedColumn", +"col_function":"case when summe < 5 then null else pstatus_nb_sum/summe::decimal(18,2)*100 end", +"format_code":"DEC_2", +"caption":"Durchfallquote in % *", +"is_visible":"1", +"is_aggregate":1, +"visible_size":25, +"description":""}, + + {"uniquename":"pvermerk_ne", +"srcfieldname":"pvermerk", +"targetfieldname":"pvermerk_ne", +"column_type":"logicalColumn", +"col_function":"(case when pvermerk in (''NE'',''N'') then 1 else 0 end)", +"format_code":"", +"caption":"Nicht erschienen", +"is_visible":"0", +"is_aggregate":0, +"visible_size":5, +"description":""}, + + {"uniquename":"pvermerk_ne_sum", +"srcfieldname":"pvermerk_ne", +"targetfieldname":"pvermerk_ne_sum", +"column_type":"processingColumn", +"col_function":"sum", +"format_code":"INTEGER", +"caption":"Nicht erschienen", +"is_visible":"1", +"is_aggregate":1, +"visible_size":25, +"description":""} + + + ] /> + + + ---ab hier nicht mehr ändern: + +CREATE temp TABLE tmp_rpta_column +( + uniquename varchar(255) NOT NULL, + caption varchar(255), + srcfieldname varchar(255), + targetfieldname varchar(255), + column_type integer, + col_function text, + is_visible smallint, + visible_size smallint, + is_aggregate smallint, + resultset_id integer, + sortnr integer, + description TEXT, + format_code_uniquename varchar(255), + format_code_id integer +); + +CREATE temp TABLE tmp_rpta_column_layout +( + uniquename varchar(255) NOT NULL, + caption varchar(255), + resultset_id integer, + whereclause text, + description text +); + + +<#foreach rpta_column_layout in rpta_column_layouts> + +insert into tmp_rpta_column_layout( +resultset_id, +uniquename, +caption, +whereclause, + description +) +select tid, +'${rpta_column_layout.uniquename}', +'${rpta_column_layout.caption}', +'${rpta_column_layout.whereclause}', +'${rpta_column_layout.description}' +FROM rpta_resultset +where uniquename='${rpta_column_layout.rpta_resultset}'; + + + +<#assign sortnr=0 /> +<#foreach column in rpta_columns> +<#assign sortnr=sortnr +1 /> + +INSERT INTO tmp_rpta_column +(resultset_id, + uniquename, + caption, + srcfieldname, + targetfieldname, + column_type, + col_function, + is_visible, + visible_size, + is_aggregate, + sortnr, + description, + format_code_uniquename + ) +select R.tid, +'${column.uniquename}', +'${column.caption}', +'${column.srcfieldname}', +<#if !column.targetfieldname?exists || column.targetfieldname=="">null::varchar <#else>'${column.targetfieldname}' , +T.tid as column_type, +<#if column.col_function?exists>'${column.col_function}'<#else>null::varchar , +${column.is_visible}, +${column.visible_size}, +${column.is_aggregate}, +${sortnr*10}, +<#if column.description?exists>'${column.description}'<#else>null::varchar , +<#if column.format_code?exists>'${column.format_code}'<#else>null::varchar +FROM rpta_resultset R, rpta_column_type T +where R.uniquename='${rpta_resultset}' +and T.uniquename='${column.column_type}'; + + + +update tmp_rpta_column set format_code_id=C.tid +from rpta_format_code C +where C.uniquename=tmp_rpta_column.format_code_uniquename +and format_code_uniquename is not null; + + +select * into temp tmp_rpta_column2layout +from rpta_column2layout +where layout_id in (select L.tid +from rpta_column_layout L,rpta_resultset R +where R.tid=L.resultset_id +and R.uniquename='${rpta_resultset}' +and L.uniquename in ( +<#foreach rpta_column_layout in rpta_column_layouts> +'${rpta_column_layout.uniquename}', +'xy') +) +; + +select * into temp tmp_rpta_column_layout_target +from rpta_column_layout +where resultset_id in (select tid +FROM rpta_resultset +where uniquename='${rpta_resultset}') +and uniquename in (select uniquename from tmp_rpta_column_layout) +; + +insert into rpta_column_layout +(uniquename, + caption, + resultset_id, + whereclause, + description) + select uniquename, + caption, + resultset_id, + whereclause, + description +FROM tmp_rpta_column_layout T +where 0=(select count(*) from tmp_rpta_column_layout_target T2 +where T.uniquename=T2.uniquename); + +drop table tmp_rpta_column_layout_target; + +delete from rpta_column2layout +where layout_id in (select L.tid +from rpta_column_layout L,rpta_resultset R +where R.tid=L.resultset_id +and R.uniquename='${rpta_resultset}' +and L.uniquename in ( +<#foreach rpta_column_layout in rpta_column_layouts> +'${rpta_column_layout.uniquename}', +'xy') +) +; + +select * into temp tmp_rpta_column2 +from tmp_rpta_column T +where (resultset_id,uniquename) not in +(select resultset_id,uniquename from rpta_column); + +INSERT INTO rpta_column +(resultset_id, + uniquename, + caption, + srcfieldname, + targetfieldname, + column_type, + col_function, + is_aggregate, + description, + custom + ) + select +resultset_id, + uniquename, + caption, + srcfieldname, + targetfieldname, + column_type, + col_function, + is_aggregate, + description, + 0 as custom +from tmp_rpta_column2; + +--evtl. neuen Satz einfügen, dann alle updaten + +update rpta_column set ( caption, + srcfieldname, + targetfieldname, + column_type, + col_function, + is_aggregate, + description) + = (select caption, + srcfieldname, + targetfieldname, + column_type, + col_function, + is_aggregate, + description + from tmp_rpta_column T + where T.resultset_id=rpta_column.resultset_id + and T.uniquename=rpta_column.uniquename) + where custom=0 + and (resultset_id,uniquename) in +(select T.resultset_id,T.uniquename +from tmp_rpta_column T) +; + +drop table tmp_rpta_column2; + +insert into rpta_column2layout(column_id, + layout_id, + sortnr, + is_visible, + visible_size, + caption, + description, + format_code_id) +select C.tid as column_id, + L.tid as layout_id, + T.sortnr, + T.is_visible, + T.visible_size, + T.caption, + T.description, + T.format_code_id +FROM rpta_column C, rpta_column_layout L, tmp_rpta_column T +where C.uniquename=T.uniquename +and C.resultset_id=T.resultset_id +and L.uniquename in ( +<#foreach rpta_column_layout in rpta_column_layouts> +'${rpta_column_layout.uniquename}', +'xy') +and L.resultset_id=T.resultset_id + ; +drop table tmp_rpta_column; +drop table if exists tmp_rpta_column2; +drop TABLE tmp_rpta_column_layout; + + + + diff --git a/src-modules/module/rpta/schluesseltabellen/sx_stylesheets_einfuegen.sql b/src-modules/module/rpta/schluesseltabellen/sx_stylesheets_einfuegen.sql old mode 100755 new mode 100644 index 39e9362..b59a5c3 --- a/src-modules/module/rpta/schluesseltabellen/sx_stylesheets_einfuegen.sql +++ b/src-modules/module/rpta/schluesseltabellen/sx_stylesheets_einfuegen.sql @@ -4,7 +4,8 @@ <#assign masken = [ {"mask":"48140", "filename":"tabelle_html.xsl", "ord":"10"}, -{"mask":"48140", "filename":"tabelle_xls_48140.xsl", "ord":"1"} +{"mask":"48140", "filename":"tabelle_xls_48140.xsl", "ord":"1"}, +{"mask":"48110", "filename":"48110_leistungen_und_studiengaenge.jrxml", "ord":"1"} ] /> @@ -41,6 +42,17 @@ "usage_resultset_data":"T", "stylesheet_type":"XSL_XLSX", "jr_datasource":"" +}, +{"filename":"48110_leistungen_und_studiengaenge.jrxml", +"caption":"Prüfungsergebnisse (Excel)", +"description":"Studiengangsweise Ausgabe pro Reiter", +"relation":"table", +"contenttype":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", +"is_generic":"0", +"toolbar_icon_filepath":"", +"usage_resultset_data":"T", +"stylesheet_type":"JRXML", +"jr_datasource":"" } ] /> diff --git a/superx/WEB-INF/reports/48110_leistungen_und_studiengaenge.jrxml b/superx/WEB-INF/reports/48110_leistungen_und_studiengaenge.jrxml new file mode 100644 index 0000000..00cefb4 --- /dev/null +++ b/superx/WEB-INF/reports/48110_leistungen_und_studiengaenge.jrxml @@ -0,0 +1,414 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +