修改api需求

This commit is contained in:
dev02 2022-12-27 10:10:55 +08:00
parent 799d3ddd6c
commit 3e149a2cd9
3 changed files with 9 additions and 1 deletions

View File

@ -682,7 +682,13 @@ namespace FrontendWebApi.ApiControllers
{ {
foreach (var p in post) foreach (var p in post)
{ {
var d = await backendRepository.GetOneAsync<DevForCor>($@"select * from device where deleted = 0 and device_number = @device_number and device_floor_tag = @device_floor_tag", new { @device_number = p.device_number, @device_floor_tag = p.device_floor_tag }); var param = new { @device_area_tag = p.device_area_tag, @device_building_tag = p.device_building_tag, @device_system_tag = p.device_system_tag, @device_name_tag = p.device_name_tag,
@device_floor_tag = p.device_floor_tag };
var d = await backendRepository.GetOneAsync<DevForCor>($@"select * from device where deleted = 0 and select * from device
where deleted = 0 and device_area_tag = @device_area_tag and device_building_tag = @device_building_tag
and device_system_tag = @device_system_tag and device_name_tag = @device_name_tag
and device_floor_tag = ifnull(@device_floor_tag, device_floor_tag) "
, param);
if (d != null) if (d != null)
device.Add(d); device.Add(d);
} }

View File

@ -156,6 +156,7 @@ namespace FrontendWebApi.Models
public string device_master_full_name { get; set; } public string device_master_full_name { get; set; }
public string device_master_icon { get; set; } public string device_master_icon { get; set; }
public string device_model { get; set; } public string device_model { get; set; }
public string device_area_tag { get; set; }
public string device_building_tag { get; set; } public string device_building_tag { get; set; }
public string device_system_tag { get; set; } public string device_system_tag { get; set; }
public string device_floor_tag { get; set; } public string device_floor_tag { get; set; }

View File

@ -125,6 +125,7 @@ namespace FrontendWebApi.Models
{ {
public string device_guid { get; set; } public string device_guid { get; set; }
public string device_number { get; set; } public string device_number { get; set; }
public string device_floor_tag { get; set; }
public string device_coordinate_3d { get; set; } public string device_coordinate_3d { get; set; }
public int forge_dbid { get; set; } public int forge_dbid { get; set; }
} }