[FrontedWebApi][運維管理] 命名 of 改為 ofi

This commit is contained in:
dev01 2022-11-12 15:05:42 +08:00
parent 1aa48f5297
commit 7ef789693e
2 changed files with 16 additions and 16 deletions

View File

@ -273,11 +273,11 @@ namespace FrontendWebApi.ApiControllers
if (string.IsNullOrEmpty(work_type.ToString())) if (string.IsNullOrEmpty(work_type.ToString()))
{ {
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.delted = 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"; where ofi.deleted = 0";
var sheet = workbook.CreateSheet("廠商資料"); var sheet = workbook.CreateSheet("廠商資料");
var operation_firm = backendRepository.GetAllAsync<Operation_Firm>(sqlString, null); var operation_firm = backendRepository.GetAllAsync<Operation_Firm>(sqlString, null);
int RowPosition = 0; int RowPosition = 0;
@ -659,7 +659,7 @@ namespace FrontendWebApi.ApiControllers
{ {
if (ofl.start_created_at != null || ofl.end_created_at != null) if (ofl.start_created_at != null || ofl.end_created_at != null)
{ {
sWhere += $@" and (of.created_at >= ifnull(@start_created_at, of.created_at) AND of.created_at <= ifnull(@end_created_at, of.created_at))"; sWhere += $@" and (ofi.created_at >= ifnull(@start_created_at, ofi.created_at) AND ofi.created_at <= ifnull(@end_created_at, ofi.created_at))";
} }
//else if (ofl.today) //else if (ofl.today)
//{ //{
@ -672,7 +672,7 @@ namespace FrontendWebApi.ApiControllers
if (ofl.sub_system_tag != null || ofl.main_system_tag != null) if (ofl.sub_system_tag != null || ofl.main_system_tag != null)
{ {
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 (ofi.device_system_category_layer2 = ifnull(@main_system_tag, device_system_category_layer2) AND ofi.device_system_category_layer3 = ifnull(@sub_system_tag, device_system_category_layer3))";
} }
var sqlString = @$"select ofi.*, v2.system_key var sqlString = @$"select ofi.*, v2.system_key
@ -686,7 +686,7 @@ namespace FrontendWebApi.ApiControllers
} }
else else
{ {
var sqlString = $@"select of.id, of.name from operation_firm where deleted = 0"; var sqlString = $@"select ofi.id, ofi.name from operation_firm where deleted = 0";
opList = await backendRepository.GetAllAsync<Operation_Firm>(sqlString); opList = await backendRepository.GetAllAsync<Operation_Firm>(sqlString);
} }
@ -714,11 +714,11 @@ namespace FrontendWebApi.ApiControllers
Operation_Firm opList = new Operation_Firm(); Operation_Firm opList = new Operation_Firm();
try try
{ {
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.deleted = 0 and of.device_system_category_layer2 = v1.system_value left join variable v1 on ofi.device_system_category_layer2 = v1.system_value and v1.system_type = @main_system_type and v1.deleted = 0 and ofi.device_system_category_layer2 = v1.system_value
left join variable v2 on v1.id = v2.system_parent_id and of.device_system_category_layer3 = v2.system_value 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.deleted = 0
where of.deleted = 0 and of.id = @id"; where ofi.deleted = 0 and ofi.id = @id";
var param = new { @id = ofl.id }; var param = new { @id = ofl.id };
opList = await backendRepository.GetOneAsync<Operation_Firm>(sqlString, param); opList = await backendRepository.GetOneAsync<Operation_Firm>(sqlString, param);
@ -962,7 +962,7 @@ namespace FrontendWebApi.ApiControllers
return apiResult; return apiResult;
} }
#endregion
#region / #region /
/// <summary> /// <summary>
/// 維修/保養 讀取(work_type) /// 維修/保養 讀取(work_type)

View File

@ -46,7 +46,7 @@ namespace FrontendWebApi.Models
//public bool yesterday { get; set; }//昨天建立时间 //public bool yesterday { get; set; }//昨天建立时间
public string main_system_tag { get; set; }//大类tag public string main_system_tag { get; set; }//大类tag
public string sub_system_tag { get; set; }//小类tag public string sub_system_tag { get; set; }//小类tag
public byte work_type { get; set; } // 1:保養, 2:維修 public byte? work_type { get; set; } // 1:保養, 2:維修
} }
public class BuildingList public class BuildingList