[WebApi]修改設備點位是否顯示在歷史紀錄的邏輯

This commit is contained in:
張家睿 2025-02-04 11:22:50 +08:00
parent b60530974f
commit a794808d49
2 changed files with 2 additions and 3 deletions

View File

@ -637,7 +637,7 @@ namespace FrontendWebApi.ApiControllers
and a.device_building_tag COLLATE utf8mb4_unicode_ci = b.device_building_tag
and a.device_name_tag COLLATE utf8mb4_unicode_ci = b.device_name_tag
join building c on c.building_tag = b.device_building_tag
join import_niagara_item_history h on b.device_number = h.device_number and a.points = h.device_point_name
-- join import_niagara_item_history h on b.device_number = h.device_number and a.points = h.device_point_name
join variable v1 on v1.system_value = b.device_system_tag and v1.deleted = 0 and v1.system_type = 'device_system_category_layer2'
join variable v2 on v2.system_value = b.device_name_tag and v2.deleted = 0 and v2.system_type = 'device_system_category_layer3'
where a.deleted = 0 and b.deleted = 0 and v2.deleted = 0 and v1.deleted = 0

View File

@ -951,8 +951,7 @@ namespace Repository.BackendRepository.Implement
AND d.device_name_tag = subquery.device_name_tag
AND d.points = subquery.device_point_name
AND d.device_building_tag = subquery.device_building_tag
SET d.is_show_history = CASE WHEN subquery.device_point_name IS NULL THEN 0 ELSE 1 END
where date(d.created_at) = subquery.created_at;");
SET d.is_show_history = CASE WHEN subquery.device_point_name IS NULL THEN 0 ELSE 1 END");
using (TransactionScope scope = new TransactionScope(TransactionScopeAsyncFlowOption.Enabled))
{