Skip to content

Commit

Permalink
Merge pull request #854 from larsenle/main
Browse files Browse the repository at this point in the history
Sprint 19 LG DB Scripting
  • Loading branch information
larsenle authored Dec 5, 2024
2 parents 935428f + 146f8fd commit 64c8e6d
Show file tree
Hide file tree
Showing 5 changed files with 3,963 additions and 0 deletions.
19 changes: 19 additions & 0 deletions database/ddl/STR_DSS_Functions_Sprint_19.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/* STR DSS Sprint 19 Modified Function */

create or replace function dss_containing_organization_id(p_point public.geometry(point, 4326))
returns bigint
LANGUAGE sql
immutable
RETURNS NULL ON NULL input
RETURN (
select do1.organization_id
from dss_organization do1
where ST_Intersects(p_point,do1.area_geometry)
and do1.is_active
and not exists(
select do2.organization_nm
from dss_organization do2
where ST_Intersects(p_point,do2.area_geometry)
and do2.is_active
and do2.organization_id != do1.organization_id
and st_area(do2.area_geometry) < st_area(do1.area_geometry)));
Loading

0 comments on commit 64c8e6d

Please sign in to comment.