[後端] 針對cctv類別做處理

This commit is contained in:
dev02 2024-03-12 12:26:29 +08:00
parent 1bfea12fcc
commit 07b5ee41a2

View File

@ -211,7 +211,15 @@ namespace Backend.Controllers
JOIN variable mv ON d.device_system_tag = mv.system_value AND mv.system_type = @main_system_type and mv.deleted = 0 JOIN variable mv ON d.device_system_tag = mv.system_value AND mv.system_type = @main_system_type and mv.deleted = 0
JOIN variable sv ON d.device_name_tag = sv.system_value AND sv.system_type = @sub_system_type and sv.deleted = 0 JOIN variable sv ON d.device_name_tag = sv.system_value AND sv.system_type = @sub_system_type and sv.deleted = 0
JOIN floor f ON d.device_floor_tag = f.full_name AND d.device_building_tag = f.building_tag and f.deleted = 0 JOIN floor f ON d.device_floor_tag = f.full_name AND d.device_building_tag = f.building_tag and f.deleted = 0
LEFT JOIN device_kind dk ON dk.device_building_tag = d.device_building_tag AND dk.device_system_tag = d.device_system_tag AND dk.device_name_tag = d.device_name_tag and dk.is_link = 1 LEFT JOIN device_kind dk ON
dk.device_building_tag = d.device_building_tag
AND dk.device_system_tag = d.device_system_tag
AND dk.device_name_tag = d.device_name_tag
and dk.is_link = 1
and (
(dk.device_name_tag <> 'c' and dk.device_system_tag <> 's') or
(dk.device_name_tag = 'c' and dk.device_system_tag = 's' and dk.device_model_tag = d.device_model_tag)
)
ORDER BY d.priority ASC, d.device_number ASC"; ORDER BY d.priority ASC, d.device_number ASC";
var devices = await backendRepository.GetAllAsync<Device>(sql, new var devices = await backendRepository.GetAllAsync<Device>(sql, new