Skip to content

Commit 64c8e6d

Browse files
authored
Merge pull request #854 from larsenle/main
Sprint 19 LG DB Scripting
2 parents 935428f + 146f8fd commit 64c8e6d

5 files changed

+3963
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/* STR DSS Sprint 19 Modified Function */
2+
3+
create or replace function dss_containing_organization_id(p_point public.geometry(point, 4326))
4+
returns bigint
5+
LANGUAGE sql
6+
immutable
7+
RETURNS NULL ON NULL input
8+
RETURN (
9+
select do1.organization_id
10+
from dss_organization do1
11+
where ST_Intersects(p_point,do1.area_geometry)
12+
and do1.is_active
13+
and not exists(
14+
select do2.organization_nm
15+
from dss_organization do2
16+
where ST_Intersects(p_point,do2.area_geometry)
17+
and do2.is_active
18+
and do2.organization_id != do1.organization_id
19+
and st_area(do2.area_geometry) < st_area(do1.area_geometry)));

0 commit comments

Comments
 (0)