-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #854 from larsenle/main
Sprint 19 LG DB Scripting
- Loading branch information
Showing
5 changed files
with
3,963 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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))); |
Oops, something went wrong.