diff --git a/Backend/Controllers/DeviceManageController.cs b/Backend/Controllers/DeviceManageController.cs index ceb04f3..0875c61 100644 --- a/Backend/Controllers/DeviceManageController.cs +++ b/Backend/Controllers/DeviceManageController.cs @@ -55,8 +55,8 @@ namespace Backend.Controllers sv.system_priority AS sPriority FROM building_menu bm LEFT JOIN building b ON bm.building_tag = b.building_tag AND b.deleted = 0 - LEFT JOIN variable mv ON bm.main_system_tag = mv.system_value AND mv.deleted = 0 - LEFT JOIN variable sv ON bm.sub_system_tag = sv.system_value AND sv.deleted = 0"; + LEFT JOIN variable mv ON bm.main_system_tag = mv.system_value AND mv.deleted = 0 and mv.system_type = '{main_system_type}' + LEFT JOIN variable sv ON bm.sub_system_tag = sv.system_value AND sv.deleted = 0 and sv.system_type = '{sub_system_type}'"; if (!string.IsNullOrEmpty(filter)) {