[ForntedWebApi][運維管理] API調整

This commit is contained in:
dev01 2022-11-12 12:04:36 +08:00
parent 84eecefd2d
commit 21a17b9067
2 changed files with 7 additions and 6 deletions

View File

@ -140,7 +140,7 @@ namespace FrontendWebApi.ApiControllers
from device d from device d
join building b on d.device_building_tag = b.building_tag join building b on d.device_building_tag = b.building_tag
where d.deleted = 0 and d.device_area_tag = @device_area_tag where d.deleted = 0 and d.device_area_tag = @device_area_tag
group by b.building_name, d.device_building_tag"; group by b.full_name, d.device_building_tag";
bl = await backendRepository.GetAllAsync<BuildingList>(sqlString, new { @device_area_tag = b.device_area_tag }); bl = await backendRepository.GetAllAsync<BuildingList>(sqlString, new { @device_area_tag = b.device_area_tag });
@ -675,11 +675,11 @@ namespace FrontendWebApi.ApiControllers
sWhere += $@" and (of.device_system_category_layer2 = ifnull(@main_system_tag, device_system_category_layer2) AND of.device_system_category_layer3 = ifnull(@sub_system_tag, device_system_category_layer3))"; sWhere += $@" and (of.device_system_category_layer2 = ifnull(@main_system_tag, device_system_category_layer2) AND of.device_system_category_layer3 = ifnull(@sub_system_tag, device_system_category_layer3))";
} }
var sqlString = @$"select of.*, v2.system_key var sqlString = @$"select ofi.*, v2.system_key
from operation_firm of from operation_firm ofi
left join variable v1 on of.device_system_category_layer2 = v1.system_value and v1.system_type = @main_system_type and v1.delted = 0 left join variable v1 on ofi.device_system_category_layer2 = v1.system_value and v1.system_type = @main_system_type and v1.deleted = 0
left join variable v2 on v1.id = v2.system_parent_id and of.device_system_category_layer3 = v2.system_value and v2.system_type = @sub_system_type and v2.deleted = 0 left join variable v2 on v1.id = v2.system_parent_id and ofi.device_system_category_layer3 = v2.system_value and v2.system_type = @sub_system_type and v2.deleted = 0
where of.deleted = 0" + sWhere; where ofi.deleted = 0" + sWhere;
var param = new { @sub_system_type = sub_system_type, @start_created_at = ofl.start_created_at, @end_created_at = ofl.end_created_at, @sub_system_tag = ofl.sub_system_tag, @main_system_tag = ofl.main_system_tag }; var param = new { @sub_system_type = sub_system_type, @start_created_at = ofl.start_created_at, @end_created_at = ofl.end_created_at, @sub_system_tag = ofl.sub_system_tag, @main_system_tag = ofl.main_system_tag };

View File

@ -50,6 +50,7 @@ namespace FrontendWebApi.Models
public class BuildingList public class BuildingList
{ {
public string device_area_tag { get; set; }
public string device_building_tag { get; set; } public string device_building_tag { get; set; }
public string device_floor_tag { get; set; } public string device_floor_tag { get; set; }
public string full_name { get; set; } public string full_name { get; set; }