[後台] Niagara 資料同步功能成功

把資料表的編碼全部改成 utf8mb4_unicode_ci
將 ibms_dome_dome.import_niagara_tag.niagara_tags 跟 ibms_dome_dome.device.device_number 改成索引
This commit is contained in:
keke 2023-08-09 17:13:03 +08:00
parent 2cd214f545
commit cf23000450
3 changed files with 6 additions and 3 deletions

View File

@ -164,7 +164,7 @@ namespace Backend.Controllers
var urlSlots = backendRepository.GetAllAsync<string>("select obixSlot from building where deleted = 0").Result; var urlSlots = backendRepository.GetAllAsync<string>("select obixSlot from building where deleted = 0").Result;
//foreach(var us in urlSlots) //foreach(var us in urlSlots)
//{ //{
var data = svc.obixHisQuery(obixApiConfig.ApiBase + "obix/config/Program/ObixQuery/query/", obixApiConfig.ApiBase + "obix/histories", "", var data = svc.obixHisQuery_v2(obixApiConfig.ApiBase + "obix/config/Program/ObixQuery/query/", obixApiConfig.ApiBase + "obix/histories", "",
obixApiConfig.UserName, obixApiConfig.Password); obixApiConfig.UserName, obixApiConfig.Password);
ds.AddRange(data); ds.AddRange(data);
// } // }

View File

@ -130,7 +130,10 @@
{ {
v.value = v.value.replace("$3", ""); v.value = v.value.replace("$3", "");
v.tag_name = v.tag_name.replace("$3", ""); v.tag_name = v.tag_name.replace("$3", "");
v.point_name = v.point_name.replace("$3", ""); if (v.point_name != null)
{
v.point_name = v.point_name.replace("$3", "");
}
} }
}) })
//console.log(ds) //console.log(ds)

View File

@ -132,7 +132,7 @@ namespace Repository.BackendRepository.Implement
where (device_system_tag <> 'S' and device_system_tag <> 'CWB'); where (device_system_tag <> 'S' and device_system_tag <> 'CWB');
update import_niagara_tag a join dic_system b update import_niagara_tag a join dic_system b
on a.device_name_tag COLLATE utf8mb4_general_ci = b.s2_code on a.device_name_tag COLLATE utf8mb4_unicode_ci = b.s2_code COLLATE utf8mb4_unicode_ci
set device_system_tag = b.s1_code -- tag () set device_system_tag = b.s1_code -- tag ()
where (device_system_tag <> 'S' and device_system_tag <> 'CWB'); -- "); where (device_system_tag <> 'S' and device_system_tag <> 'CWB'); -- ");
await conn.ExecuteAsync(sb.ToString()); await conn.ExecuteAsync(sb.ToString());