diff --git a/src-modules/module/xcube/schluesseltabellen/xcube_dims_install.sql b/src-modules/module/xcube/schluesseltabellen/xcube_dims_install.sql index d045293..dcd521e 100644 --- a/src-modules/module/xcube/schluesseltabellen/xcube_dims_install.sql +++ b/src-modules/module/xcube/schluesseltabellen/xcube_dims_install.sql @@ -90,12 +90,39 @@ values delete from xcube_dims where id='hrst'; INSERT INTO xcube_dims (id,apnr,name,sort1) select distinct 'hrst',apnr,druck,1 from cifx where key=613; + + + <#if TableFieldExists('sos_stg_aggr','ch27_grund_beurl')> +delete from xcube_dims where id='ch27_grund_beurl'; +INSERT INTO xcube_dims (id,apnr,name,sort1) +select distinct 'ch27_grund_beurl',apnr,druck,1 from cifx where key=27; <#if TableFieldExists('sos_stg_aggr','aktiv')> delete from xcube_dims where id='aktiv'; INSERT INTO xcube_dims (id,apnr,name,sort1) select 'aktiv',0::varchar(10),'inaktiv',2 from xdummy union select 'aktiv',1::varchar(10),'aktiv',1 from xdummy; + + + <#if TableFieldExists('sos_stg_aggr','hzbart_int')> +delete from xcube_dims where id='hzbart_int'; +INSERT INTO xcube_dims (id,apnr,name,sort1) +select distinct 'hzbart_int',hzbart,dtxt,1 from k_hzbart; + + + <#if TableFieldExists('sos_stg_aggr','hzbnote')> +delete from xcube_dims where id='hzbnote'; +INSERT INTO xcube_dims (id,apnr,parent, name,strukturstr,sort1) +values +('hzbnote','gesamt',null,'alle','1=1',1), +('hzbnote', 'a1', 'gesamt','Sehr gut <=1,0','$1::numeric(5,2)>=0.00 and $1::numeric(5,2)<=1.00',10), +('hzbnote', 'a2', 'gesamt','Sehr gut 1,1-1,5','$1::numeric(5,2)>1.00 and $1::numeric(5,2)<=1.50',20), +('hzbnote', 'a3', 'gesamt','gut 1,6-2,0','$1::numeric(5,2)>1.50 and $1::numeric(5,2)<=2.00',30), +('hzbnote', 'a4', 'gesamt','gut 2,1-2,5','$1::numeric(5,2)>2.00 and $1::numeric(5,2)<=2.50',40), +('hzbnote', 'a5', 'gesamt','befriedigend 2,6-3,0','$1::numeric(5,2)>2.50 and $1::numeric(5,2)<=3.00',50), +('hzbnote', 'a6', 'gesamt','befriedigend 2,6-3,0','$1::numeric(5,2)>3.00 and $1::numeric(5,2)<=3.50',60), +('hzbnote', 'a7', 'gesamt','ausreichend 3,6-4,5','$1::numeric(5,2)>3.500 and $1::numeric(5,2)<=4.50',70), +('hzbnote', 'a8', 'gesamt','Note unbekannt','$1::numeric(5,2)<0.00 or $1::numeric(5,2)>4.50',80); --Zum Testen --INSERT INTO xcube_dims (id,apnr,name,sort1,parent,strukturstr)