2025-12-24 17:49:39 -07:00
|
|
|
-- Code generated by BobGen psql v0.0.4-0.20251216163753-8e325b7c773a+dirty. DO NOT EDIT.
|
2025-11-20 20:59:28 +00:00
|
|
|
-- This file is meant to be re-generated in place and/or deleted at any time.
|
|
|
|
|
|
|
|
|
|
-- TrapLocationBySourceID
|
|
|
|
|
SELECT
|
|
|
|
|
tl.globalid AS trap_location_globalid,
|
2025-12-24 17:49:39 -07:00
|
|
|
ST_Distance(pl.geospatial, tl.geospatial) AS distance
|
2025-11-20 20:59:28 +00:00
|
|
|
FROM
|
2025-12-24 17:49:39 -07:00
|
|
|
fieldseeker.pointlocation pl
|
2025-11-20 20:59:28 +00:00
|
|
|
CROSS JOIN
|
2025-12-24 17:49:39 -07:00
|
|
|
fieldseeker.traplocation tl
|
2025-11-20 20:59:28 +00:00
|
|
|
WHERE
|
|
|
|
|
tl.organization_id = $1 AND
|
|
|
|
|
pl.globalid = $2
|
|
|
|
|
ORDER BY
|
2025-12-24 17:49:39 -07:00
|
|
|
ST_Distance(pl.geospatial, tl.geospatial)
|
2025-11-20 20:59:28 +00:00
|
|
|
LIMIT 4;
|