From da7ff3e0c29224a2a94bcc243f4652f315c924c8 Mon Sep 17 00:00:00 2001 From: Xavier Torret Date: Mon, 23 Dec 2024 20:01:55 +0100 Subject: [PATCH] feat(arc,node,connec, gully) Add streetname & streetname2 --- ud/ftrg/ud_gw_trg_edit_arc.sql | 12 ++++++------ ud/ftrg/ud_gw_trg_edit_connec.sql | 12 ++++++------ ud/ftrg/ud_gw_trg_edit_gully.sql | 12 ++++++------ ud/ftrg/ud_gw_trg_edit_node.sql | 13 +++++++------ updates/36/36017/changelog.txt | 3 ++- updates/36/36017/ud/ddl.sql | 12 ++++++++++++ updates/36/36017/ud/dml.sql | 11 +++++++++++ updates/36/36017/ud/tablect.sql | 16 ++++++++++++++++ updates/36/36017/utils/ddl.sql | 20 ++++++++++++++++++++ updates/36/36017/utils/dml.sql | 14 ++++++++++++++ updates/36/36017/utils/tablect.sql | 21 +++++++++++++++++++++ ws/ftrg/ws_gw_trg_edit_arc.sql | 6 +++--- ws/ftrg/ws_gw_trg_edit_connec.sql | 6 +++--- ws/ftrg/ws_gw_trg_edit_node.sql | 6 +++--- 14 files changed, 130 insertions(+), 34 deletions(-) create mode 100644 updates/36/36017/ud/ddl.sql create mode 100644 updates/36/36017/ud/dml.sql create mode 100644 updates/36/36017/ud/tablect.sql create mode 100644 updates/36/36017/utils/ddl.sql create mode 100644 updates/36/36017/utils/dml.sql create mode 100644 updates/36/36017/utils/tablect.sql diff --git a/ud/ftrg/ud_gw_trg_edit_arc.sql b/ud/ftrg/ud_gw_trg_edit_arc.sql index 47659c44f3..c33538da07 100644 --- a/ud/ftrg/ud_gw_trg_edit_arc.sql +++ b/ud/ftrg/ud_gw_trg_edit_arc.sql @@ -426,7 +426,7 @@ BEGIN annotation, observ, "comment", inverted_slope, custom_length, dma_id, soilcat_id, function_type, category_type, fluid_type, location_type, workcat_id, workcat_id_end, workcat_id_plan, buildercat_id, builtdate, enddate, ownercat_id, muni_id, streetaxis_id, postcode, district_id, streetaxis2_id, postnumber, postnumber2, postcomplement, postcomplement2, descript, link, verified, the_geom,undelete,label_x,label_y, label_rotation, expl_id, publish, inventory, uncertain, num_value, lastupdate, lastupdate_user, asset_id, pavcat_id, - drainzone_id, parent_id, expl_id2, adate, adescript, visitability, label_quadrant, brand_id, model_id, serial_number) + drainzone_id, parent_id, expl_id2, adate, adescript, visitability, label_quadrant, brand_id, model_id, serial_number, streetname, streetname2) VALUES (NEW.arc_id, NEW.code, NEW.node_1, NEW.node_2, NEW.y1, NEW.y2, NEW.custom_y1, NEW.custom_y2, NEW.elev1, NEW.elev2, NEW.custom_elev1, NEW.custom_elev2,NEW.arc_type, NEW.arccat_id, NEW.epa_type, NEW.sector_id, NEW.state, NEW.state_type, NEW.annotation, NEW.observ, NEW.comment, NEW.inverted_slope, NEW.custom_length, NEW.dma_id, NEW.soilcat_id, NEW.function_type, NEW.category_type, NEW.fluid_type, @@ -434,13 +434,13 @@ BEGIN NEW.muni_id, v_streetaxis, NEW.postcode, NEW.district_id, v_streetaxis2, NEW.postnumber, NEW.postnumber2, NEW.postcomplement, NEW.postcomplement2, NEW.descript, NEW.link, NEW.verified, NEW.the_geom,NEW.undelete,NEW.label_x, NEW.label_y, NEW.label_rotation, NEW.expl_id, NEW.publish, NEW.inventory, NEW.uncertain, NEW.num_value, NEW.lastupdate, NEW.lastupdate_user, NEW.asset_id, NEW.pavcat_id, - NEW.drainzone_id, NEW.parent_id, NEW.expl_id2, NEW.adate, NEW.adescript, NEW.visitability, NEW.label_quadrant, NEW.brand_id, NEW.model_id, NEW.serial_number); + NEW.drainzone_id, NEW.parent_id, NEW.expl_id2, NEW.adate, NEW.adescript, NEW.visitability, NEW.label_quadrant, NEW.brand_id, NEW.model_id, NEW.serial_number, NEW.streetname, NEW.streetname2); ELSE INSERT INTO arc (arc_id, code, y1, y2, custom_y1, custom_y2, elev1, elev2, custom_elev1, custom_elev2, arc_type, arccat_id, epa_type, sector_id, "state", state_type, annotation, observ, "comment", inverted_slope, custom_length, dma_id, soilcat_id, function_type, category_type, fluid_type, location_type, workcat_id, workcat_id_end, workcat_id_plan, buildercat_id, builtdate, enddate, ownercat_id, muni_id, streetaxis_id, postcode, district_id, streetaxis2_id, postnumber, postnumber2, postcomplement, postcomplement2, descript, link, verified, the_geom,undelete,label_x,label_y, label_rotation, expl_id, publish, inventory, uncertain, num_value, matcat_id, lastupdate, lastupdate_user, asset_id, pavcat_id, - drainzone_id, parent_id, expl_id2, adate, adescript, visitability, label_quadrant, brand_id, model_id, serial_number) + drainzone_id, parent_id, expl_id2, adate, adescript, visitability, label_quadrant, brand_id, model_id, serial_number, streetname, streetname2) VALUES (NEW.arc_id, NEW.code, NEW.y1, NEW.y2, NEW.custom_y1, NEW.custom_y2, NEW.elev1, NEW.elev2, NEW.custom_elev1, NEW.custom_elev2,NEW.arc_type, NEW.arccat_id, NEW.epa_type, NEW.sector_id, NEW.state, NEW.state_type, NEW.annotation, NEW.observ, NEW.comment, NEW.inverted_slope, NEW.custom_length, NEW.dma_id, NEW.soilcat_id, NEW.function_type, NEW.category_type, NEW.fluid_type, @@ -448,7 +448,7 @@ BEGIN NEW.muni_id, v_streetaxis, NEW.postcode, NEW.district_id, v_streetaxis2, NEW.postnumber, NEW.postnumber2, NEW.postcomplement, NEW.postcomplement2, NEW.descript, NEW.link, NEW.verified, NEW.the_geom,NEW.undelete,NEW.label_x, NEW.label_y, NEW.label_rotation, NEW.expl_id, NEW.publish, NEW.inventory, NEW.uncertain, NEW.num_value, NEW.matcat_id, NEW.lastupdate, NEW.lastupdate_user, - NEW.asset_id, NEW.pavcat_id, NEW.drainzone_id, NEW.parent_id, NEW.expl_id2, NEW.adate, NEW.adescript, NEW.visitability, NEW.label_quadrant, NEW.brand_id, NEW.model_id, NEW.serial_number); + NEW.asset_id, NEW.pavcat_id, NEW.drainzone_id, NEW.parent_id, NEW.expl_id2, NEW.adate, NEW.adescript, NEW.visitability, NEW.label_quadrant, NEW.brand_id, NEW.model_id, NEW.serial_number, NEW.streetname, NEW.streetname2); END IF; -- this overwrites triger topocontrol arc values (triggered before insertion) just in that moment: In order to make more profilactic this issue only will be overwrited in case of NEW.node_* not nulls @@ -679,7 +679,7 @@ BEGIN label_y=NEW.label_y, label_rotation=NEW.label_rotation,workcat_id_end=NEW.workcat_id_end, workcat_id_plan=NEW.workcat_id_plan, code=NEW.code, publish=NEW.publish, inventory=NEW.inventory, enddate=NEW.enddate, uncertain=NEW.uncertain, expl_id=NEW.expl_id, num_value = NEW.num_value,lastupdate=now(), lastupdate_user=current_user, asset_id=NEW.asset_id, pavcat_id=NEW.pavcat_id, drainzone_id=NEW.drainzone_id, parent_id=NEW.parent_id, expl_id2=NEW.expl_id2, adate=NEW.adate, adescript=NEW.adescript, - visitability=NEW.visitability, label_quadrant=NEW.label_quadrant, brand_id=NEW.brand_id, model_id=NEW.model_id, serial_number=NEW.serial_number + visitability=NEW.visitability, label_quadrant=NEW.label_quadrant, brand_id=NEW.brand_id, model_id=NEW.model_id, serial_number=NEW.serial_number, streetname = NEW.streetname, streetname2 = NEW.streetname2 WHERE arc_id=OLD.arc_id; ELSE UPDATE arc @@ -692,7 +692,7 @@ BEGIN label_y=NEW.label_y, label_rotation=NEW.label_rotation,workcat_id_end=NEW.workcat_id_end, workcat_id_plan=NEW.workcat_id_plan, code=NEW.code, publish=NEW.publish, inventory=NEW.inventory, enddate=NEW.enddate, uncertain=NEW.uncertain, expl_id=NEW.expl_id, num_value = NEW.num_value,lastupdate=now(), lastupdate_user=current_user, matcat_id=NEW.matcat_id, asset_id=NEW.asset_id, pavcat_id=NEW.pavcat_id, drainzone_id=NEW.drainzone_id, parent_id=NEW.parent_id, expl_id2=NEW.expl_id2, adate=NEW.adate, adescript=NEW.adescript, - visitability=NEW.visitability, label_quadrant=NEW.label_quadrant, brand_id=NEW.brand_id, model_id=NEW.model_id, serial_number=NEW.serial_number + visitability=NEW.visitability, label_quadrant=NEW.label_quadrant, brand_id=NEW.brand_id, model_id=NEW.model_id, serial_number=NEW.serial_number, streetname = NEW.streetname, streetname2 = NEW.streetname2 WHERE arc_id=OLD.arc_id; END IF; diff --git a/ud/ftrg/ud_gw_trg_edit_connec.sql b/ud/ftrg/ud_gw_trg_edit_connec.sql index cd42c7a1aa..78cf723094 100644 --- a/ud/ftrg/ud_gw_trg_edit_connec.sql +++ b/ud/ftrg/ud_gw_trg_edit_connec.sql @@ -483,7 +483,7 @@ BEGIN builtdate, enddate, ownercat_id, muni_id, postcode, district_id, streetaxis2_id, streetaxis_id, postnumber, postnumber2, postcomplement, postcomplement2, descript, rotation, link, verified, the_geom, undelete, label_x, label_y, label_rotation, accessibility,diagonal, expl_id, publish, inventory, uncertain, num_value, private_connecat_id, - lastupdate, lastupdate_user, asset_id, drainzone_id, expl_id2, adate, adescript, plot_code, placement_type, label_quadrant, access_type) + lastupdate, lastupdate_user, asset_id, drainzone_id, expl_id2, adate, adescript, plot_code, placement_type, label_quadrant, access_type, streetname, streetname2) VALUES (NEW.connec_id, NEW.code, NEW.customer_code, NEW.top_elev, NEW.y1, NEW.y2, NEW.connecat_id, NEW.connec_type, NEW.sector_id, NEW.demand,NEW."state", NEW.state_type, NEW.connec_depth, NEW.connec_length, NEW.arc_id, NEW.annotation, NEW."observ", NEW."comment", NEW.dma_id, NEW.soilcat_id, NEW.function_type, NEW.category_type, NEW.fluid_type, NEW.location_type, NEW.workcat_id, NEW.workcat_id_end, NEW.workcat_id_plan, NEW.buildercat_id, NEW.builtdate, NEW.enddate, NEW.ownercat_id, NEW.muni_id, NEW.postcode, NEW.district_id, @@ -491,14 +491,14 @@ BEGIN NEW.descript, NEW.rotation, NEW.link, NEW.verified, NEW.the_geom, NEW.undelete, NEW.label_x, NEW.label_y, NEW.label_rotation, NEW.accessibility, NEW.diagonal, NEW.expl_id, NEW.publish, NEW.inventory, NEW.uncertain, NEW.num_value, NEW.private_connecat_id, NEW.lastupdate, NEW.lastupdate_user, NEW.asset_id, NEW.drainzone_id, NEW.expl_id2, NEW.adate, NEW.adescript, NEW.plot_code, NEW.placement_type, - NEW.label_quadrant, NEW.access_type); + NEW.label_quadrant, NEW.access_type, NEW.streetname, NEW.streetname2); ELSE INSERT INTO connec (connec_id, code, customer_code, top_elev, y1, y2,connecat_id, connec_type, sector_id, demand, "state", state_type, connec_depth, connec_length, arc_id, annotation, "observ","comment", dma_id, soilcat_id, function_type, category_type, fluid_type, location_type, workcat_id, workcat_id_end, workcat_id_plan, buildercat_id, builtdate, enddate, ownercat_id, muni_id,postcode,district_id, streetaxis2_id, streetaxis_id, postnumber, postnumber2, postcomplement, postcomplement2, descript, rotation, link, verified, the_geom, undelete, label_x, label_y, label_rotation, accessibility,diagonal, expl_id, publish, inventory, uncertain, num_value, private_connecat_id, matcat_id, - lastupdate, lastupdate_user, asset_id, drainzone_id, expl_id2, adate, adescript, plot_code, placement_type, label_quadrant, access_type) + lastupdate, lastupdate_user, asset_id, drainzone_id, expl_id2, adate, adescript, plot_code, placement_type, label_quadrant, access_type, streetname, streetname2) VALUES (NEW.connec_id, NEW.code, NEW.customer_code, NEW.top_elev, NEW.y1, NEW.y2, NEW.connecat_id, NEW.connec_type, NEW.sector_id, NEW.demand,NEW."state", NEW.state_type, NEW.connec_depth, NEW.connec_length, NEW.arc_id, NEW.annotation, NEW."observ", NEW."comment", NEW.dma_id, NEW.soilcat_id, NEW.function_type, NEW.category_type, NEW.fluid_type, NEW.location_type, NEW.workcat_id, NEW.workcat_id_end, NEW.workcat_id_plan, NEW.buildercat_id, NEW.builtdate, NEW.enddate, NEW.ownercat_id, NEW.muni_id, NEW.postcode, NEW.district_id, @@ -506,7 +506,7 @@ BEGIN NEW.descript, NEW.rotation, NEW.link, NEW.verified, NEW.the_geom, NEW.undelete, NEW.label_x, NEW.label_y, NEW.label_rotation, NEW.accessibility, NEW.diagonal, NEW.expl_id, NEW.publish, NEW.inventory, NEW.uncertain, NEW.num_value, NEW.private_connecat_id, NEW.matcat_id, NEW.lastupdate, NEW.lastupdate_user, NEW.asset_id, NEW.drainzone_id, NEW.expl_id2, NEW.adate, NEW.adescript, NEW.plot_code, NEW.placement_type, - NEW.label_quadrant, NEW.access_type); + NEW.label_quadrant, NEW.access_type, NEW.streetname, NEW.streetname2); END IF; --check if feature is double geom @@ -758,7 +758,7 @@ BEGIN rotation=NEW.rotation, link=NEW.link, verified=NEW.verified, undelete=NEW.undelete, label_x=NEW.label_x, label_y=NEW.label_y, label_rotation=NEW.label_rotation, accessibility=NEW.accessibility, diagonal=NEW.diagonal, publish=NEW.publish, pjoint_id=NEW.pjoint_id, pjoint_type = NEW.pjoint_type, inventory=NEW.inventory, uncertain=NEW.uncertain, expl_id=NEW.expl_id,num_value=NEW.num_value, private_connecat_id=NEW.private_connecat_id, lastupdate=now(), lastupdate_user=current_user, asset_id=NEW.asset_id, drainzone_id=NEW.drainzone_id, expl_id2=NEW.expl_id2, adate=NEW.adate, adescript=NEW.adescript, - plot_code=NEW.plot_code, placement_type=NEW.placement_type, label_quadrant=NEW.label_quadrant, access_type=NEW.access_type + plot_code=NEW.plot_code, placement_type=NEW.placement_type, label_quadrant=NEW.label_quadrant, access_type=NEW.access_type, streetname = NEW.streetname, streetname2 = NEW.streetname2 WHERE connec_id = OLD.connec_id; ELSE UPDATE connec @@ -771,7 +771,7 @@ BEGIN label_x=NEW.label_x, label_y=NEW.label_y, label_rotation=NEW.label_rotation, accessibility=NEW.accessibility, diagonal=NEW.diagonal, publish=NEW.publish, pjoint_id=NEW.pjoint_id, pjoint_type = NEW.pjoint_type, inventory=NEW.inventory, uncertain=NEW.uncertain, expl_id=NEW.expl_id,num_value=NEW.num_value, private_connecat_id=NEW.private_connecat_id, lastupdate=now(), lastupdate_user=current_user, matcat_id = NEW.matcat_id, asset_id=NEW.asset_id, drainzone_id=NEW.drainzone_id, expl_id2=NEW.expl_id2, adate=NEW.adate, adescript=NEW.adescript, - plot_code=NEW.plot_code, placement_type=NEW.placement_type, label_quadrant=NEW.label_quadrant, access_type=NEW.access_type + plot_code=NEW.plot_code, placement_type=NEW.placement_type, label_quadrant=NEW.label_quadrant, access_type=NEW.access_type, streetname = NEW.streetname, streetname2 = NEW.streetname2 WHERE connec_id = OLD.connec_id; END IF; diff --git a/ud/ftrg/ud_gw_trg_edit_gully.sql b/ud/ftrg/ud_gw_trg_edit_gully.sql index a01ec5204d..bd0212f9e6 100644 --- a/ud/ftrg/ud_gw_trg_edit_gully.sql +++ b/ud/ftrg/ud_gw_trg_edit_gully.sql @@ -585,7 +585,7 @@ BEGIN postcode, district_id, streetaxis_id, postnumber, postcomplement, streetaxis2_id, postnumber2, postcomplement2, descript, rotation, link,verified, the_geom, undelete,label_x, label_y,label_rotation, expl_id, publish, inventory,uncertain, num_value, lastupdate, lastupdate_user, asset_id, gratecat2_id, epa_type, units_placement, groove_height, groove_length, drainzone_id, expl_id2, adate, adescript, - siphon_type, odorflap, connec_y2, placement_type, label_quadrant, access_type) + siphon_type, odorflap, connec_y2, placement_type, label_quadrant, access_type, streetname, streetname2) VALUES (NEW.gully_id, NEW.code, NEW.top_elev, NEW."ymax",NEW.sandbox, NEW.matcat_id, NEW.gully_type, NEW.gratecat_id, NEW.units, NEW.groove, NEW.connec_arccat_id, NEW.connec_length, NEW.connec_depth, NEW.siphon, NEW.arc_id, NEW.sector_id, NEW."state", NEW.state_type, NEW.annotation, NEW."observ", NEW."comment", NEW.dma_id, NEW.soilcat_id, NEW.function_type, NEW.category_type, @@ -595,7 +595,7 @@ BEGIN NEW.label_x, NEW.label_y, NEW.label_rotation, NEW.expl_id , NEW.publish, NEW.inventory, NEW.uncertain, NEW.num_value,NEW.lastupdate, NEW.lastupdate_user, NEW.asset_id, NEW.gratecat2_id, NEW.epa_type, NEW.units_placement, NEW.groove_height, NEW.groove_length, NEW.drainzone_id,NEW.expl_id2, NEW.adate, NEW.adescript, NEW.siphon_type, NEW.odorflap, - NEW.connec_y2, NEW.placement_type, NEW.label_quadrant, NEW.access_type); + NEW.connec_y2, NEW.placement_type, NEW.label_quadrant, NEW.access_type, NEW.streetname, NEW.streetname2); ELSE INSERT INTO gully (gully_id, code, top_elev, "ymax",sandbox, matcat_id, gully_type, gratecat_id, units, groove, connec_arccat_id, connec_length, @@ -604,7 +604,7 @@ BEGIN postcode, district_id, streetaxis_id, postnumber, postcomplement, streetaxis2_id, postnumber2, postcomplement2, descript, rotation, link,verified, the_geom, undelete,label_x, label_y,label_rotation, expl_id, publish, inventory,uncertain, num_value, lastupdate, lastupdate_user, asset_id, connec_matcat_id, gratecat2_id, epa_type, units_placement, groove_height, groove_length, drainzone_id, expl_id2, adate, adescript, - siphon_type, odorflap, connec_y2, placement_type, label_quadrant, access_type) + siphon_type, odorflap, connec_y2, placement_type, label_quadrant, access_type, streetname, streetname2) VALUES (NEW.gully_id, NEW.code, NEW.top_elev, NEW."ymax",NEW.sandbox, NEW.matcat_id, NEW.gully_type, NEW.gratecat_id, NEW.units, NEW.groove, NEW.connec_arccat_id, NEW.connec_length, NEW.connec_depth, NEW.siphon, NEW.arc_id, NEW.sector_id, NEW."state", NEW.state_type, NEW.annotation, NEW."observ", NEW."comment", NEW.dma_id, NEW.soilcat_id, NEW.function_type, NEW.category_type, @@ -614,7 +614,7 @@ BEGIN NEW.label_x, NEW.label_y, NEW.label_rotation, NEW.expl_id , NEW.publish, NEW.inventory, NEW.uncertain, NEW.num_value,NEW.lastupdate, NEW.lastupdate_user, NEW.asset_id, NEW.connec_matcat_id, NEW.gratecat2_id, NEW.epa_type, NEW.units_placement, NEW.groove_height, NEW.groove_length, NEW.drainzone_id,NEW.expl_id2, NEW.adate, NEW.adescript, - NEW.siphon_type, NEW.odorflap, NEW.connec_y2, NEW.placement_type, NEW.label_quadrant, NEW.access_type); + NEW.siphon_type, NEW.odorflap, NEW.connec_y2, NEW.placement_type, NEW.label_quadrant, NEW.access_type, NEW.streetname, NEW.streetname2); END IF; @@ -917,7 +917,7 @@ BEGIN postnumber=NEW.postnumber, expl_id=NEW.expl_id, uncertain=NEW.uncertain, num_value=NEW.num_value, lastupdate=now(), lastupdate_user=current_user, asset_id=NEW.asset_id, gratecat2_id = NEW.gratecat2_id, epa_type=NEW.epa_type, units_placement=NEW.units_placement, groove_height=NEW.groove_height, groove_length=NEW.groove_length, drainzone_id=NEW.drainzone_id, expl_id2=NEW.expl_id2, adate=NEW.adate, adescript=NEW.adescript, siphon_type=NEW.siphon_type, odorflap=NEW.odorflap, connec_y2=NEW.connec_y2, - placement_type=NEW.placement_type, label_quadrant=NEW.label_quadrant, access_type=NEW.access_type + placement_type=NEW.placement_type, label_quadrant=NEW.label_quadrant, access_type=NEW.access_type, streetname = NEW.streetname, streetname2 = NEW.streetname2 WHERE gully_id = OLD.gully_id; ELSE @@ -933,7 +933,7 @@ BEGIN postnumber=NEW.postnumber, expl_id=NEW.expl_id, uncertain=NEW.uncertain, num_value=NEW.num_value, lastupdate=now(), lastupdate_user=current_user, asset_id=NEW.asset_id, gratecat2_id = NEW.gratecat2_id, epa_type=NEW.epa_type, units_placement=NEW.units_placement, groove_height=NEW.groove_height, groove_length=NEW.groove_length, drainzone_id=NEW.drainzone_id, expl_id2=NEW.expl_id2, adate=NEW.adate, adescript=NEW.adescript, siphon_type=NEW.siphon_type, odorflap=NEW.odorflap, connec_y2=NEW.connec_y2, - placement_type=NEW.placement_type, label_quadrant=NEW.label_quadrant, access_type=NEW.access_type + placement_type=NEW.placement_type, label_quadrant=NEW.label_quadrant, access_type=NEW.access_type, streetname = NEW.streetname, streetname2 = NEW.streetname2 WHERE gully_id = OLD.gully_id; END IF; diff --git a/ud/ftrg/ud_gw_trg_edit_node.sql b/ud/ftrg/ud_gw_trg_edit_node.sql index b4557711fb..f82dcf6a9c 100644 --- a/ud/ftrg/ud_gw_trg_edit_node.sql +++ b/ud/ftrg/ud_gw_trg_edit_node.sql @@ -602,7 +602,7 @@ BEGIN dma_id,soilcat_id, function_type, category_type,fluid_type,location_type,workcat_id, workcat_id_end, workcat_id_plan, buildercat_id, builtdate, enddate, ownercat_id, muni_id, streetaxis_id, postcode, district_id, streetaxis2_id,postnumber, postnumber2, postcomplement, postcomplement2, descript,rotation,link,verified, undelete,label_x,label_y,label_rotation,the_geom, expl_id, publish, inventory, uncertain, xyz_date, unconnected, num_value, lastupdate, lastupdate_user, - asset_id, drainzone_id, parent_id, arc_id, expl_id2, adate, adescript, placement_type, label_quadrant, access_type, brand_id, model_id, serial_number) + asset_id, drainzone_id, parent_id, arc_id, expl_id2, adate, adescript, placement_type, label_quadrant, access_type, brand_id, model_id, serial_number, streetname, streetname2) VALUES (NEW.node_id,NEW.code, NEW.top_elev,NEW.custom_top_elev, NEW.ymax, NEW. custom_ymax, NEW. elev, NEW. custom_elev, NEW.node_type,NEW.nodecat_id,NEW.epa_type,NEW.sector_id, NEW.state, NEW.state_type, NEW.annotation,NEW.observ, NEW.comment,NEW.dma_id,NEW.soilcat_id, NEW. function_type, NEW.category_type,NEW.fluid_type,NEW.location_type, NEW.workcat_id, NEW.workcat_id_end, NEW.workcat_id_plan, NEW.buildercat_id,NEW.builtdate, NEW.enddate, NEW.ownercat_id, @@ -610,13 +610,13 @@ BEGIN NEW.descript, NEW.rotation,NEW.link, NEW.verified, NEW.undelete, NEW.label_x,NEW.label_y,NEW.label_rotation,NEW.the_geom, NEW.expl_id, NEW.publish, NEW.inventory, NEW.uncertain, NEW.xyz_date, NEW.unconnected, NEW.num_value, NEW.lastupdate, NEW.lastupdate_user, NEW.asset_id, NEW.drainzone_id, NEW.parent_id, NEW.arc_id, NEW.expl_id2, NEW.adate, NEW.adescript, NEW.placement_type, NEW.label_quadrant, - NEW.access_type, NEW.brand_id, NEW.model_id, NEW.serial_number); + NEW.access_type, NEW.brand_id, NEW.model_id, NEW.serial_number, NEW.streetname, NEW.streetname2); ELSE INSERT INTO node (node_id, code, top_elev, custom_top_elev, ymax, custom_ymax, elev, custom_elev, node_type,nodecat_id,epa_type,sector_id,"state", state_type, annotation,observ,"comment", dma_id,soilcat_id, function_type, category_type,fluid_type,location_type,workcat_id, workcat_id_end, workcat_id_plan, buildercat_id, builtdate, enddate, ownercat_id, muni_id, streetaxis_id, postcode, district_id, streetaxis2_id,postnumber, postnumber2, postcomplement, postcomplement2, descript,rotation,link,verified, undelete,label_x,label_y,label_rotation,the_geom, expl_id, publish, inventory, uncertain, xyz_date, unconnected, num_value, lastupdate, lastupdate_user, matcat_id, - asset_id, drainzone_id, parent_id, arc_id, expl_id2, adate, adescript, placement_type, label_quadrant, access_type, brand_id, model_id, serial_number) + asset_id, drainzone_id, parent_id, arc_id, expl_id2, adate, adescript, placement_type, label_quadrant, access_type, brand_id, model_id, serial_number, streetname, streetname2) VALUES (NEW.node_id,NEW.code, NEW.top_elev,NEW.custom_top_elev, NEW.ymax, NEW. custom_ymax, NEW. elev, NEW. custom_elev, NEW.node_type,NEW.nodecat_id,NEW.epa_type,NEW.sector_id, NEW.state, NEW.state_type, NEW.annotation,NEW.observ, NEW.comment,NEW.dma_id,NEW.soilcat_id, NEW. function_type, NEW.category_type,NEW.fluid_type,NEW.location_type, NEW.workcat_id, NEW.workcat_id_end, NEW.workcat_id_plan, NEW.buildercat_id,NEW.builtdate, NEW.enddate, NEW.ownercat_id, @@ -624,7 +624,7 @@ BEGIN NEW.descript, NEW.rotation,NEW.link, NEW.verified, NEW.undelete, NEW.label_x,NEW.label_y,NEW.label_rotation,NEW.the_geom, NEW.expl_id, NEW.publish, NEW.inventory, NEW.uncertain, NEW.xyz_date, NEW.unconnected, NEW.num_value, NEW.lastupdate, NEW.lastupdate_user,NEW.matcat_id, NEW.asset_id, NEW.drainzone_id, NEW.parent_id, NEW.arc_id, NEW.expl_id2, NEW.adate, NEW.adescript, NEW.placement_type, - NEW.label_quadrant, NEW.access_type, NEW.brand_id, NEW.model_id, NEW.serial_number); + NEW.label_quadrant, NEW.access_type, NEW.brand_id, NEW.model_id, NEW.serial_number, NEW.streetname, NEW.streetname2); END IF; --check if feature is double geom @@ -899,7 +899,7 @@ BEGIN xyz_date=NEW.xyz_date, unconnected=NEW.unconnected, expl_id=NEW.expl_id, num_value=NEW.num_value, lastupdate=now(), lastupdate_user=current_user, asset_id=NEW.asset_id, drainzone_id=NEW.drainzone_id, parent_id=NEW.parent_id, arc_id = NEW.arc_id, expl_id2=NEW.expl_id2, adate=NEW.adate, adescript=NEW.adescript, placement_type=NEW.placement_type, label_quadrant=NEW.label_quadrant, - access_type=NEW.access_type, brand_id=NEW.brand_id, model_id=NEW.model_id, serial_number=NEW.serial_number + access_type=NEW.access_type, brand_id=NEW.brand_id, model_id=NEW.model_id, serial_number=NEW.serial_number, streetname = NEW.streetname, streetname2 = NEW.streetname2 WHERE node_id = OLD.node_id; ELSE UPDATE node @@ -912,7 +912,8 @@ BEGIN label_x=NEW.label_x, label_y=NEW.label_y, label_rotation=NEW.label_rotation, publish=NEW.publish, inventory=NEW.inventory, rotation=NEW.rotation, uncertain=NEW.uncertain, xyz_date=NEW.xyz_date, unconnected=NEW.unconnected, expl_id=NEW.expl_id, num_value=NEW.num_value, lastupdate=now(), lastupdate_user=current_user, matcat_id = NEW.matcat_id, asset_id=NEW.asset_id, drainzone_id=NEW.drainzone_id, parent_id=NEW.parent_id, arc_id = NEW.arc_id, expl_id2=NEW.expl_id2, adate=NEW.adate, adescript=NEW.adescript, - placement_type=NEW.placement_type, label_quadrant=NEW.label_quadrant, access_type=NEW.access_type, brand_id=NEW.brand_id, model_id=NEW.model_id, serial_number=NEW.serial_number + placement_type=NEW.placement_type, label_quadrant=NEW.label_quadrant, access_type=NEW.access_type, brand_id=NEW.brand_id, model_id=NEW.model_id, serial_number=NEW.serial_number, + streetname = NEW.streetname, streetname2 = NEW.streetname2 WHERE node_id = OLD.node_id; END IF; diff --git a/updates/36/36017/changelog.txt b/updates/36/36017/changelog.txt index 1a8f3afdaa..94a061fbe2 100644 --- a/updates/36/36017/changelog.txt +++ b/updates/36/36017/changelog.txt @@ -1,3 +1,4 @@ 3.6.017 ************* -- Enable inserting a node at the vertex of an arc to correct its topology. \ No newline at end of file +- Enable inserting a node at the vertex of an arc to correct its topology. +- New columns streetname & streename2 for arc, node, connec, gully to materialice values and increase the performance for big projects \ No newline at end of file diff --git a/updates/36/36017/ud/ddl.sql b/updates/36/36017/ud/ddl.sql new file mode 100644 index 0000000000..4517d7a726 --- /dev/null +++ b/updates/36/36017/ud/ddl.sql @@ -0,0 +1,12 @@ +/* +This file is part of Giswater 3 +The program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +This version of Giswater is provided by Giswater Association +*/ + + +SET search_path = SCHEMA_NAME, public, pg_catalog; + +--23/12/2024 +SELECT gw_fct_admin_manage_fields($${"data":{"action":"ADD","table":"gully", "column":"streetname", "dataType":"varchar(100)"}}$$); +SELECT gw_fct_admin_manage_fields($${"data":{"action":"ADD","table":"gully", "column":"streetname2", "dataType":"varchar(100)"}}$$); \ No newline at end of file diff --git a/updates/36/36017/ud/dml.sql b/updates/36/36017/ud/dml.sql new file mode 100644 index 0000000000..f323271fa7 --- /dev/null +++ b/updates/36/36017/ud/dml.sql @@ -0,0 +1,11 @@ +/* +This file is part of Giswater 3 +The program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +This version of Giswater is provided by Giswater Association +*/ + + +SET search_path = SCHEMA_NAME, public, pg_catalog; + +--23/12/2024 +update gully set streetname = s.descript from v_ext_streetaxis s where streetaxis_id = id; \ No newline at end of file diff --git a/updates/36/36017/ud/tablect.sql b/updates/36/36017/ud/tablect.sql new file mode 100644 index 0000000000..477a56b273 --- /dev/null +++ b/updates/36/36017/ud/tablect.sql @@ -0,0 +1,16 @@ +/* +This file is part of Giswater 3 +The program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +This version of Giswater is provided by Giswater Association +*/ + + +SET search_path = SCHEMA_NAME, public, pg_catalog; + + +-- 23/12/2024 +CREATE INDEX gully_streetname ON arc USING btree (streetname); +CREATE INDEX gully_streetname2 ON arc USING btree (streetname2); + + + diff --git a/updates/36/36017/utils/ddl.sql b/updates/36/36017/utils/ddl.sql new file mode 100644 index 0000000000..89e35688cb --- /dev/null +++ b/updates/36/36017/utils/ddl.sql @@ -0,0 +1,20 @@ +/* +This file is part of Giswater 3 +The program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +This version of Giswater is provided by Giswater Association +*/ + + +SET search_path = SCHEMA_NAME, public, pg_catalog; + + +-- 23/12/2024 +SELECT gw_fct_admin_manage_fields($${"data":{"action":"ADD","table":"arc", "column":"streetname", "dataType":"varchar(100)"}}$$); +SELECT gw_fct_admin_manage_fields($${"data":{"action":"ADD","table":"arc", "column":"streetname2", "dataType":"varchar(100)"}}$$); + +SELECT gw_fct_admin_manage_fields($${"data":{"action":"ADD","table":"node", "column":"streetname", "dataType":"varchar(100)"}}$$); +SELECT gw_fct_admin_manage_fields($${"data":{"action":"ADD","table":"node", "column":"streetname2", "dataType":"varchar(100)"}}$$); + +SELECT gw_fct_admin_manage_fields($${"data":{"action":"ADD","table":"connec", "column":"streetname", "dataType":"varchar(100)"}}$$); +SELECT gw_fct_admin_manage_fields($${"data":{"action":"ADD","table":"connec", "column":"streetname2", "dataType":"varchar(100)"}}$$); + diff --git a/updates/36/36017/utils/dml.sql b/updates/36/36017/utils/dml.sql new file mode 100644 index 0000000000..58beed1232 --- /dev/null +++ b/updates/36/36017/utils/dml.sql @@ -0,0 +1,14 @@ +/* +This file is part of Giswater 3 +The program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +This version of Giswater is provided by Giswater Association +*/ + + +SET search_path = SCHEMA_NAME, public, pg_catalog; + + +-- 23/12/2024 +update arc set streetname = s.descript from v_ext_streetaxis s where streetaxis_id = id; +update node set streetname = s.descript from v_ext_streetaxis s where streetaxis_id = id; +update connec set streetname = s.descript from v_ext_streetaxis s where streetaxis_id = id; diff --git a/updates/36/36017/utils/tablect.sql b/updates/36/36017/utils/tablect.sql new file mode 100644 index 0000000000..e0e248d5d3 --- /dev/null +++ b/updates/36/36017/utils/tablect.sql @@ -0,0 +1,21 @@ +/* +This file is part of Giswater 3 +The program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +This version of Giswater is provided by Giswater Association +*/ + + +SET search_path = SCHEMA_NAME, public, pg_catalog; + + +-- 23/12/2024 +CREATE INDEX arc_streetname ON arc USING btree (streetname); +CREATE INDEX arc_streetname2 ON arc USING btree (streetname2); + +CREATE INDEX node_streetname ON node USING btree (streetname); +CREATE INDEX node_streetname2 ON node USING btree (streetname2); + +CREATE INDEX connec_streetname ON conec USING btree (streetname); +CREATE INDEX connec_streetname2 ON connec USING btree (streetname2); + + diff --git a/ws/ftrg/ws_gw_trg_edit_arc.sql b/ws/ftrg/ws_gw_trg_edit_arc.sql index 17da7bc885..9a7051f78e 100644 --- a/ws/ftrg/ws_gw_trg_edit_arc.sql +++ b/ws/ftrg/ws_gw_trg_edit_arc.sql @@ -421,13 +421,13 @@ BEGIN INSERT INTO arc (arc_id, code, arccat_id, epa_type, sector_id, "state", state_type, annotation, observ,"comment",custom_length,dma_id, presszone_id, soilcat_id, function_type, category_type, fluid_type, location_type, workcat_id, workcat_id_end, workcat_id_plan, buildercat_id, builtdate,enddate, ownercat_id, muni_id, postcode, district_id, streetaxis_id, postnumber, postcomplement, streetaxis2_id,postnumber2, postcomplement2,descript,link,verified,the_geom,undelete,label_x,label_y,label_rotation, publish, inventory, expl_id, num_value, - depth, adate, adescript, lastupdate, lastupdate_user, asset_id, pavcat_id, om_state, conserv_state, parent_id,expl_id2, brand_id, model_id, serial_number, label_quadrant) + depth, adate, adescript, lastupdate, lastupdate_user, asset_id, pavcat_id, om_state, conserv_state, parent_id,expl_id2, brand_id, model_id, serial_number, label_quadrant, streetname, streetname2) VALUES (NEW.arc_id, NEW.code, NEW.arccat_id, NEW.epa_type, NEW.sector_id, NEW."state", NEW.state_type, NEW.annotation, NEW.observ, NEW.comment, NEW.custom_length,NEW.dma_id,NEW. presszone_id, NEW.soilcat_id, NEW.function_type, NEW.category_type, NEW.fluid_type, NEW.location_type, NEW.workcat_id, NEW.workcat_id_end, NEW.workcat_id_plan, NEW.buildercat_id, NEW.builtdate,NEW.enddate, NEW.ownercat_id, NEW.muni_id, NEW.postcode, NEW.district_id,v_streetaxis,NEW.postnumber, NEW.postcomplement, v_streetaxis2, NEW.postnumber2, NEW.postcomplement2, NEW.descript,NEW.link, NEW.verified, NEW.the_geom,NEW.undelete,NEW.label_x,NEW.label_y,NEW.label_rotation, NEW.publish, NEW.inventory, NEW.expl_id, NEW.num_value, NEW.depth, NEW.adate, NEW.adescript, NEW.lastupdate, NEW.lastupdate_user, NEW.asset_id, NEW.pavcat_id, NEW.om_state, NEW.conserv_state, - NEW.parent_id, NEW.expl_id2, NEW.brand_id, NEW.model_id, NEW.serial_number, NEW.label_quadrant); + NEW.parent_id, NEW.expl_id2, NEW.brand_id, NEW.model_id, NEW.serial_number, NEW.label_quadrant, NEW.streetname, NEW.streetname2); -- this overwrites triger topocontrol arc values (triggered before insertion) just in that moment: In order to make more profilactic this issue only will be overwrited in case of NEW.node_* not nulls IF v_edit_enable_arc_nodes_update IS TRUE THEN @@ -622,7 +622,7 @@ BEGIN expl_id=NEW.expl_id,num_value=NEW.num_value, link=NEW.link, lastupdate=now(), lastupdate_user=current_user, depth=NEW.depth, adate=NEW.adate, adescript=NEW.adescript, asset_id=NEW.asset_id, pavcat_id=NEW.pavcat_id, om_state=NEW.om_state, conserv_state=NEW.conserv_state, parent_id = NEW.parent_id,expl_id2 =NEW.expl_id2, brand_id=NEW.brand_id, model_id=NEW.model_id, serial_number=NEW.serial_number, - label_quadrant=NEW.label_quadrant + label_quadrant=NEW.label_quadrant, streetname = NEW.streetname, streetname2 = NEW.streetname2 WHERE arc_id=OLD.arc_id; -- childtable update diff --git a/ws/ftrg/ws_gw_trg_edit_connec.sql b/ws/ftrg/ws_gw_trg_edit_connec.sql index 483b646d93..28034aa038 100644 --- a/ws/ftrg/ws_gw_trg_edit_connec.sql +++ b/ws/ftrg/ws_gw_trg_edit_connec.sql @@ -536,7 +536,7 @@ BEGIN muni_id, streetaxis2_id, postcode, district_id, postcomplement, postcomplement2, descript, link, verified, rotation, the_geom, undelete, label_x,label_y,label_rotation, expl_id, publish, inventory,num_value, connec_length, arc_id, minsector_id, dqa_id, pjoint_id, pjoint_type, adate, adescript, accessibility, lastupdate, lastupdate_user, asset_id, epa_type, om_state, conserv_state, priority, - valve_location, valve_type, shutoff_valve, access_type, placement_type, crmzone_id, expl_id2, plot_code, brand_id, model_id, serial_number, cat_valve, label_quadrant) + valve_location, valve_type, shutoff_valve, access_type, placement_type, crmzone_id, expl_id2, plot_code, brand_id, model_id, serial_number, cat_valve, label_quadrant, streetname, streetname2) VALUES (NEW.connec_id, NEW.code, NEW.elevation, NEW.depth, NEW.connecat_id, NEW.sector_id, NEW.customer_code, NEW.state, NEW.state_type, NEW.annotation, NEW.observ, NEW.comment, NEW.dma_id, NEW.presszone_id, NEW.soilcat_id, NEW.function_type, NEW.category_type, NEW.fluid_type, NEW.location_type, NEW.workcat_id, NEW.workcat_id_end, NEW.workcat_id_plan, NEW.buildercat_id, NEW.builtdate, NEW.enddate, NEW.ownercat_id, v_streetaxis, NEW.postnumber, NEW.postnumber2, NEW.muni_id, v_streetaxis2, NEW.postcode, NEW.district_id, NEW.postcomplement, @@ -544,7 +544,7 @@ BEGIN NEW.num_value, NEW.connec_length, NEW.arc_id, NEW.minsector_id, NEW.dqa_id, NEW.pjoint_id, NEW.pjoint_type, NEW.adate, NEW.adescript, NEW.accessibility, NEW.lastupdate, NEW.lastupdate_user, NEW.asset_id, NEW.epa_type, NEW.om_state, NEW.conserv_state, NEW.priority, NEW.valve_location, NEW.valve_type, NEW.shutoff_valve, NEW.access_type, NEW.placement_type, NEW.crmzone_id, NEW.expl_id2, NEW.plot_code, NEW.brand_id, NEW.model_id, NEW.serial_number, - NEW.cat_valve, NEW.label_quadrant); + NEW.cat_valve, NEW.label_quadrant, NEW.streetname, NEW.streetname2); SELECT system_id, cat_feature.id INTO v_system_id, v_featurecat_id FROM cat_feature @@ -879,7 +879,7 @@ BEGIN om_state = NEW.om_state, conserv_state = NEW.conserv_state, priority = NEW.priority, valve_location = NEW.valve_location, valve_type = NEW.valve_type, shutoff_valve = NEW.shutoff_valve, access_type = NEW.access_type, placement_type = NEW.placement_type, crmzone_id=NEW.crmzone_id, expl_id2=NEW.expl_id2, plot_code=NEW.plot_code, brand_id=NEW.brand_id, model_id=NEW.model_id, serial_number=NEW.serial_number, cat_valve=NEW.cat_valve, - label_quadrant=NEW.label_quadrant + label_quadrant=NEW.label_quadrant, streetname = NEW.streetname, streetname2 = NEW.streetname2 WHERE connec_id=OLD.connec_id; IF v_man_table ='man_greentap' THEN diff --git a/ws/ftrg/ws_gw_trg_edit_node.sql b/ws/ftrg/ws_gw_trg_edit_node.sql index 1679259e39..53941e4519 100644 --- a/ws/ftrg/ws_gw_trg_edit_node.sql +++ b/ws/ftrg/ws_gw_trg_edit_node.sql @@ -539,14 +539,14 @@ BEGIN soilcat_id, function_type, category_type, fluid_type, location_type, workcat_id, workcat_id_end, workcat_id_plan, buildercat_id, builtdate, enddate, ownercat_id, muni_id,streetaxis_id, streetaxis2_id, postcode, postnumber, postnumber2, postcomplement, district_id, postcomplement2, descript, link, rotation,verified, undelete,label_x,label_y,label_rotation, expl_id, publish, inventory, the_geom, hemisphere, num_value, adate, adescript, accessibility, lastupdate, lastupdate_user, asset_id, - om_state, conserv_state, access_type, placement_type, expl_id2, brand_id, model_id, serial_number, label_quadrant) + om_state, conserv_state, access_type, placement_type, expl_id2, brand_id, model_id, serial_number, label_quadrant, streetname, streetname2) VALUES (NEW.node_id, NEW.code, NEW.elevation, NEW.depth, NEW.nodecat_id, NEW.epa_type, NEW.sector_id, NEW.arc_id, NEW.parent_id, NEW.state, NEW.state_type, NEW.annotation, NEW.observ, NEW.comment,NEW.dma_id, NEW.presszone_id, NEW.soilcat_id, NEW.function_type, NEW.category_type, NEW.fluid_type, NEW.location_type,NEW.workcat_id, NEW.workcat_id_end, NEW.workcat_id_plan, NEW.buildercat_id, NEW.builtdate, NEW.enddate, NEW.ownercat_id, NEW.muni_id, v_streetaxis, v_streetaxis2, NEW.postcode, NEW.postnumber ,NEW.postnumber2, NEW.postcomplement, NEW.district_id, NEW.postcomplement2, NEW.descript, NEW.link, NEW.rotation, NEW.verified, NEW.undelete,NEW.label_x,NEW.label_y,NEW.label_rotation, NEW.expl_id, NEW.publish, NEW.inventory, NEW.the_geom, NEW.hemisphere,NEW.num_value, NEW.adate, NEW.adescript, NEW.accessibility, NEW.lastupdate, NEW.lastupdate_user, NEW.asset_id, - NEW.om_state, NEW.conserv_state, NEW.access_type, NEW.placement_type, NEW.expl_id2, NEW.brand_id, NEW.model_id, NEW.serial_number, NEW.label_quadrant); + NEW.om_state, NEW.conserv_state, NEW.access_type, NEW.placement_type, NEW.expl_id2, NEW.brand_id, NEW.model_id, NEW.serial_number, NEW.label_quadrant, NEW.streetname, NEW.streetname2); SELECT system_id, cat_feature.id INTO v_system_id, v_featurecat_id FROM cat_feature @@ -953,7 +953,7 @@ BEGIN publish=NEW.publish, inventory=NEW.inventory, expl_id=NEW.expl_id, num_value=NEW.num_value, link=NEW.link, lastupdate=now(), lastupdate_user=current_user, adate=NEW.adate, adescript=NEW.adescript, accessibility = NEW.accessibility, asset_id=NEW.asset_id, om_state=NEW.om_state, conserv_state=NEW.conserv_state, access_type=NEW.access_type, placement_type=NEW.placement_type, expl_id2=NEW.expl_id2, - brand_id=NEW.brand_id, model_id=NEW.model_id, serial_number=NEW.serial_number, label_quadrant=NEW.label_quadrant + brand_id=NEW.brand_id, model_id=NEW.model_id, serial_number=NEW.serial_number, label_quadrant=NEW.label_quadrant, streetname = NEW.streetname, streetname2 = NEW.streetname2 WHERE node_id = OLD.node_id;