2024-07-04 11:02:45 +05:00
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
2023-04-04 21:21:06 +05:00
|
|
|
|
using System;
|
2023-03-31 11:10:16 +05:00
|
|
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
|
|
|
|
|
|
namespace AsbCloudDb.Model.GTR
|
|
|
|
|
{
|
|
|
|
|
public class WitsItemBase<T> : ITelemetryData
|
2023-04-17 18:02:36 +05:00
|
|
|
|
where T: notnull
|
2023-03-31 11:10:16 +05:00
|
|
|
|
{
|
|
|
|
|
[Column("id_telemetry")]
|
|
|
|
|
public int IdTelemetry { get; set; }
|
|
|
|
|
|
|
|
|
|
[Column("id_record")]
|
|
|
|
|
public int IdRecord { get; set; }
|
|
|
|
|
|
|
|
|
|
[Column("id_item")]
|
|
|
|
|
public int IdItem { get; set; }
|
|
|
|
|
|
|
|
|
|
[Column("date", TypeName = "timestamp with time zone")]
|
|
|
|
|
public DateTimeOffset DateTime { get; set; }
|
2023-04-11 13:27:42 +05:00
|
|
|
|
|
2023-04-17 18:02:36 +05:00
|
|
|
|
[Column("value")]
|
2023-04-11 13:27:42 +05:00
|
|
|
|
public T Value { get; set; } = default!;
|
2023-03-31 11:10:16 +05:00
|
|
|
|
|
|
|
|
|
[ForeignKey(nameof(IdTelemetry))]
|
|
|
|
|
public virtual Telemetry? Telemetry { get; set; }
|
|
|
|
|
}
|
|
|
|
|
|
2023-04-04 21:21:06 +05:00
|
|
|
|
[Table("t_wits_string"), Comment("таблица данных ГТИ с типом значения string")]
|
2023-03-31 11:10:16 +05:00
|
|
|
|
public class WitsItemString : WitsItemBase<string> { }
|
2023-04-04 21:21:06 +05:00
|
|
|
|
|
2023-04-18 16:07:29 +05:00
|
|
|
|
[Table("t_wits_float"), Comment("таблица данных ГТИ с типом значения float")]
|
2023-03-31 11:10:16 +05:00
|
|
|
|
public class WitsItemFloat : WitsItemBase<float> { }
|
2023-04-04 21:21:06 +05:00
|
|
|
|
|
2023-04-18 16:07:29 +05:00
|
|
|
|
[Table("t_wits_int"), Comment("таблица данных ГТИ с типом значения int")]
|
2023-03-31 11:10:16 +05:00
|
|
|
|
public class WitsItemInt : WitsItemBase<int> { }
|
|
|
|
|
}
|