Skip to content

Commit

Permalink
update single and loop queries to implement filled in boolean data fi…
Browse files Browse the repository at this point in the history
…elds for planetary/fleet/odyssey
  • Loading branch information
Daniel-J-Mason committed Jul 7, 2024
1 parent 5c97e55 commit d2f60a1
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ WITH stations_in_range AS (SELECT station.id,
FROM public.station
INNER JOIN system ON station.system_id = system.id
WHERE st_3ddwithin(st_makepoint(#{xCoordinate}, #{yCoordinate}, #{zCoordinate}), coordinates_geom, 300)
<if test='!includeFleetCarriers'>
AND station.name NOT SIMILAR TO '[A-Za-z0-9]{3}-[A-Za-z0-9]{3}'
</if>
AND station.fleet_carrier = #{includeFleetCarriers}
AND station.require_odyssey = #{includeOdyssey}
AND station.planetary = #{includeSurfaceStations}
<if test='maxLandingPadSize == "LARGE"'>AND max_landing_pad_size = 'LARGE'</if>
<if test='maxLandingPadSize == "MEDIUM"'>AND max_landing_pad_size IN ('MEDIUM', 'LARGE')</if>
AND #{maxArrivalDistance} >= arrival_distance
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ WITH stations_in_range AS MATERIALIZED (SELECT station.id,
WHERE st_3ddwithin((select coordinates_geom
from system
where system.name = #{sellToSystemName}), coordinates_geom, #{maxRouteDistance})
<if test='!includeFleetCarriers'>
AND station.name NOT SIMILAR TO '[A-Za-z0-9]{3}-[A-Za-z0-9]{3}'
</if>
AND station.fleet_carrier = #{includeFleetCarriers}
AND station.require_odyssey = #{includeOdyssey}
AND station.planetary = #{includeSurfaceStations}
<if test='maxLandingPadSize == "LARGE"'>AND max_landing_pad_size = 'LARGE'</if>
<if test='maxLandingPadSize == "MEDIUM"'>AND max_landing_pad_size IN ('MEDIUM', 'LARGE')</if>
AND #{maxArrivalDistance} >= arrival_distance),
Expand Down Expand Up @@ -128,9 +128,9 @@ WITH stations_in_range AS MATERIALIZED (SELECT station.id,
WHERE st_3ddwithin((select coordinates_geom
from system
where system.name = #{sellToSystemName}), coordinates_geom, #{maxRouteDistance})
<if test='!includeFleetCarriers'>
AND station.name NOT SIMILAR TO '[A-Za-z0-9]{3}-[A-Za-z0-9]{3}'
</if>
AND station.fleet_carrier = #{includeFleetCarriers}
AND station.require_odyssey = #{includeOdyssey}
AND station.planetary = #{includeSurfaceStations}
<if test='maxLandingPadSize == "LARGE"'>AND max_landing_pad_size = 'LARGE'</if>
<if test='maxLandingPadSize == "MEDIUM"'>AND max_landing_pad_size IN ('MEDIUM', 'LARGE')</if>
AND #{maxArrivalDistance} >= arrival_distance),
Expand Down Expand Up @@ -221,9 +221,9 @@ WITH stations_in_range AS MATERIALIZED (SELECT station.id,
WHERE st_3ddwithin((select coordinates_geom
from system
where system.name = #{buyFromSystemName}), coordinates_geom, #{maxRouteDistance})
<if test='!includeFleetCarriers'>
AND station.name NOT SIMILAR TO '[A-Za-z0-9]{3}-[A-Za-z0-9]{3}'
</if>
AND station.fleet_carrier = #{includeFleetCarriers}
AND station.require_odyssey = #{includeOdyssey}
AND station.planetary = #{includeSurfaceStations}
<if test='maxLandingPadSize == "LARGE"'>AND max_landing_pad_size = 'LARGE'</if>
<if test='maxLandingPadSize == "MEDIUM"'>AND max_landing_pad_size IN ('MEDIUM', 'LARGE')</if>
AND #{maxArrivalDistance} >= arrival_distance),
Expand Down Expand Up @@ -313,9 +313,9 @@ WITH stations_in_range AS MATERIALIZED (SELECT station.id,
WHERE st_3ddwithin((select coordinates_geom
from system
where system.name = #{buyFromSystemName}), coordinates_geom, #{maxRouteDistance})
<if test='!includeFleetCarriers'>
AND station.name NOT SIMILAR TO '[A-Za-z0-9]{3}-[A-Za-z0-9]{3}'
</if>
AND station.fleet_carrier = #{includeFleetCarriers}
AND station.require_odyssey = #{includeOdyssey}
AND station.planetary = #{includeSurfaceStations}
<if test='maxLandingPadSize == "LARGE"'>AND max_landing_pad_size = 'LARGE'</if>
<if test='maxLandingPadSize == "MEDIUM"'>AND max_landing_pad_size IN ('MEDIUM', 'LARGE')</if>
AND #{maxArrivalDistance} >= arrival_distance),
Expand Down Expand Up @@ -404,9 +404,9 @@ WITH buy_system AS MATERIALIZED (SELECT station.id,
FROM station
INNER JOIN system ON station.system_id = system.id
WHERE system.name = #{buyFromSystemName}
<if test='!includeFleetCarriers'>
AND station.name NOT SIMILAR TO '[A-Za-z0-9]{3}-[A-Za-z0-9]{3}'
</if>
AND station.fleet_carrier = #{includeFleetCarriers}
AND station.require_odyssey = #{includeOdyssey}
AND station.planetary = #{includeSurfaceStations}
<if test='maxLandingPadSize == "LARGE"'>AND max_landing_pad_size = 'LARGE'</if>
<if test='maxLandingPadSize == "MEDIUM"'>AND max_landing_pad_size IN ('MEDIUM', 'LARGE')</if>
AND #{maxArrivalDistance} >= arrival_distance),
Expand All @@ -417,9 +417,9 @@ sell_system AS (select station.id,
FROM station
INNER JOIN system ON station.system_id = system.id
WHERE system.name = #{sellToSystemName}
<if test='!includeFleetCarriers'>
AND station.name NOT SIMILAR TO '[A-Za-z0-9]{3}-[A-Za-z0-9]{3}'
</if>
AND station.fleet_carrier = #{includeFleetCarriers}
AND station.require_odyssey = #{includeOdyssey}
AND station.planetary = #{includeSurfaceStations}
<if test='maxLandingPadSize == "LARGE"'>AND max_landing_pad_size = 'LARGE'</if>
<if test='maxLandingPadSize == "MEDIUM"'>AND max_landing_pad_size IN ('MEDIUM', 'LARGE')</if>
AND #{maxArrivalDistance} >= arrival_distance),
Expand Down

0 comments on commit d2f60a1

Please sign in to comment.