From ca5cad4771266b32743edee3faf7c96334dcc9b7 Mon Sep 17 00:00:00 2001 From: Daniel-J-Mason Date: Tue, 14 May 2024 22:25:36 -0700 Subject: [PATCH] hotpatch removing cases of cargocapity from single hop queries to use supply and demand inline with changes from #51 --- ...isLocateSingleHopTradeRouteRepository.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/trade-module/src/main/java/io/edpn/backend/trade/adapter/persistence/repository/MybatisLocateSingleHopTradeRouteRepository.java b/trade-module/src/main/java/io/edpn/backend/trade/adapter/persistence/repository/MybatisLocateSingleHopTradeRouteRepository.java index 87db5ebf..efa23c8d 100644 --- a/trade-module/src/main/java/io/edpn/backend/trade/adapter/persistence/repository/MybatisLocateSingleHopTradeRouteRepository.java +++ b/trade-module/src/main/java/io/edpn/backend/trade/adapter/persistence/repository/MybatisLocateSingleHopTradeRouteRepository.java @@ -63,7 +63,7 @@ buy_market AS (SELECT commodity_id, INNER JOIN stations_in_range ON station_id = stations_in_range.id INNER JOIN system ON stations_in_range.system_id = system.id INNER JOIN commodity_list ON commodity_id = commodity_list.id AND display_name IS NOT null - WHERE stock > #{cargoCapacity} + WHERE stock > #{minSupply} AND commodity_list.is_rare = false AND timestamp >= (now() - INTERVAL '1 hour' * #{maxPriceAgeHours}) AND buy_price IS NOT null), @@ -79,7 +79,7 @@ sell_market AS (SELECT commodity_id, INNER JOIN stations_in_system ON station_id = stations_in_system.id INNER JOIN system on stations_in_system.system_id = system.id INNER JOIN commodity ON commodity_id = commodity.id AND display_name IS NOT null - WHERE (demand = 0 OR demand > (#{cargoCapacity} * 4)) + WHERE (demand = 0 OR demand > #{minDemand}) AND commodity.is_rare = false AND timestamp >= (now() - INTERVAL '1 hour' * #{maxPriceAgeHours})) @@ -167,7 +167,7 @@ buy_market AS (SELECT commodity_id, INNER JOIN stations_in_range ON station_id = stations_in_range.id INNER JOIN system ON stations_in_range.system_id = system.id INNER JOIN commodity_list ON commodity_id = commodity_list.id AND display_name IS NOT null - WHERE stock > #{cargoCapacity} + WHERE stock > #{minSupply} AND commodity_list.is_rare = false AND timestamp >= (now() - INTERVAL '1 hour' * #{maxPriceAgeHours}) AND buy_price IS NOT null), @@ -183,7 +183,7 @@ sell_market AS (SELECT commodity_id, INNER JOIN reference_station ON station_id = reference_station.id INNER JOIN system on reference_station.system_id = system.id INNER JOIN commodity ON commodity_id = commodity.id AND display_name IS NOT null - WHERE (demand = 0 OR demand > (#{cargoCapacity} * 4)) + WHERE (demand = 0 OR demand > #{minDemand}) AND commodity.is_rare = false AND timestamp >= (now() - INTERVAL '1 hour' * #{maxPriceAgeHours})) @@ -255,7 +255,7 @@ buy_market AS (SELECT commodity_id, INNER JOIN reference_station ON station_id = reference_station.id INNER JOIN system ON reference_station.system_id = system.id INNER JOIN commodity_list ON commodity_id = commodity_list.id AND display_name IS NOT null - WHERE stock > #{cargoCapacity} + WHERE stock > #{minSupply} AND commodity_list.is_rare = false AND timestamp >= (now() - INTERVAL '1 hour' * #{maxPriceAgeHours}) AND buy_price IS NOT null), @@ -273,7 +273,7 @@ sell_market AS (SELECT commodity_id, INNER JOIN stations_in_range ON station_id = stations_in_range.id INNER JOIN system on stations_in_range.system_id = system.id INNER JOIN commodity ON commodity_id = commodity.id AND display_name IS NOT null - WHERE (demand = 0 OR demand > (#{cargoCapacity} * 4)) + WHERE (demand = 0 OR demand > #{minDemand}) AND commodity.is_rare = false AND timestamp >= (now() - INTERVAL '1 hour' * #{maxPriceAgeHours})) @@ -346,7 +346,7 @@ buy_market AS (SELECT commodity_id, INNER JOIN reference_station ON station_id = reference_station.id INNER JOIN system ON reference_station.system_id = system.id INNER JOIN commodity_list ON commodity_id = commodity_list.id AND display_name IS NOT null - WHERE stock > #{cargoCapacity} + WHERE stock > #{minSupply} AND commodity_list.is_rare = false AND timestamp >= (now() - INTERVAL '1 hour' * #{maxPriceAgeHours}) AND buy_price IS NOT null), @@ -364,7 +364,7 @@ sell_market AS (SELECT commodity_id, INNER JOIN stations_in_range ON station_id = stations_in_range.id INNER JOIN system on stations_in_range.system_id = system.id INNER JOIN commodity ON commodity_id = commodity.id AND display_name IS NOT null - WHERE (demand = 0 OR demand > (#{cargoCapacity} * 4)) + WHERE (demand = 0 OR demand > #{minDemand}) AND commodity.is_rare = false AND timestamp >= (now() - INTERVAL '1 hour' * #{maxPriceAgeHours})) @@ -441,7 +441,7 @@ buy_market AS (SELECT commodity_id, INNER JOIN buy_system ON station_id = buy_system.id INNER JOIN system ON buy_system.system_id = system.id INNER JOIN commodity_list ON commodity_id = commodity_list.id AND display_name IS NOT null - WHERE stock > #{cargoCapacity} + WHERE stock > #{minSupply} AND commodity_list.is_rare = false AND timestamp >= (now() - INTERVAL '1 hour' * #{maxPriceAgeHours}) AND buy_price IS NOT null), @@ -457,7 +457,7 @@ sell_market AS (SELECT commodity_id, INNER JOIN sell_system ON station_id = sell_system.id INNER JOIN system on sell_system.system_id = system.id INNER JOIN commodity ON commodity_id = commodity.id AND display_name IS NOT null - WHERE (demand = 0 OR demand > (#{cargoCapacity} * 4)) + WHERE (demand = 0 OR demand > #{minDemand}) AND commodity.is_rare = false AND timestamp >= (now() - INTERVAL '1 hour' * #{maxPriceAgeHours}))