diff --git a/FrontendWebApi/ApiControllers/HydroMeterController.cs b/FrontendWebApi/ApiControllers/HydroMeterController.cs index 4d823d9..141766d 100644 --- a/FrontendWebApi/ApiControllers/HydroMeterController.cs +++ b/FrontendWebApi/ApiControllers/HydroMeterController.cs @@ -83,9 +83,9 @@ namespace FrontendWebApi.ApiControllers string tag_quantity = await backendRepository.GetOneAsync("select system_value from variable where system_type = 'obixConfig' and system_key = 'tag_quantity' and deleted = 0"); if (tag_quantity == "5") - buildingSql = " and SUBSTRING_INDEX(device_number, '_', 1) = @building_tag "; + buildingSql = " and SUBSTRING_INDEX(device_number, '_', 1) in (@building_tag) "; else - buildingSql = " and SUBSTRING_INDEX(SUBSTRING_INDEX(device_number, '_', 2), '_', -1) = @building_tag "; + buildingSql = " and SUBSTRING_INDEX(SUBSTRING_INDEX(device_number, '_', 2), '_', -1) in (@building_tag) "; //if (input.floor_tag.Count > 0) //{ @@ -256,9 +256,9 @@ namespace FrontendWebApi.ApiControllers string tag_quantity = await backendRepository.GetOneAsync("select system_value from variable where system_type = 'obixConfig' and system_key = 'tag_quantity' and deleted = 0"); if (tag_quantity == "5") - buildingSql = " and SUBSTRING_INDEX(device_number, '_', 1) = @building_tag "; + buildingSql = " and SUBSTRING_INDEX(device_number, '_', 1) in (@building_tag) "; else - buildingSql = " and SUBSTRING_INDEX(SUBSTRING_INDEX(device_number, '_', 2), '_', -1) = @building_tag "; + buildingSql = " and SUBSTRING_INDEX(SUBSTRING_INDEX(device_number, '_', 2), '_', -1) in (@building_tag) "; if (input.floor_tag.Count > 0) {