修改同步只讀取8段

This commit is contained in:
dev02 2023-01-06 14:12:47 +08:00
parent 01caf2df06
commit f8160779a8

View File

@ -70,6 +70,8 @@ namespace Repository.BackendRepository.Implement
if (string.IsNullOrEmpty(row.tag_name)) continue;
string[] arrTag = row.tag_name.Split('_');
if (arrTag.Length == 8)
{
sb.Append($@" insert import_niagara_tag(niagara_tags, device_area_tag, device_building_tag, device_system_tag,
device_name_tag, device_floor_tag, device_master_tag, device_last_name_tag, device_serial_tag, atDateTime) values('" +
row.tag_name + "', '" +
@ -83,6 +85,7 @@ namespace Repository.BackendRepository.Implement
arrTag[7] + "', " +
"now());");
}
}
if (sb.Length > 0)
{
await conn.ExecuteAsync(sb.ToString());
@ -140,6 +143,8 @@ namespace Repository.BackendRepository.Implement
string[] arrTag = row.tag_name.Split('_');
#region for item
if (arrTag.Length == 8)
{
Device_item8 row_item = new Device_item8();
row_item.tag_name = row.tag_name;
row_item.device_area_tag = arrTag[0];
@ -152,6 +157,7 @@ namespace Repository.BackendRepository.Implement
row_item.device_serial_tag = arrTag[7];
row_item.point_name = row.point_name;
dt_item.Add(row_item);
}
#endregion
}