DD.WellWorkover.Cloud/AsbCloudDb/Model/GTR/WitsItemBase.cs

38 lines
1.2 KiB
C#
Raw Permalink Normal View History

using Microsoft.EntityFrameworkCore;
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-17 18:02:36 +05:00
[Column("value")]
public T Value { get; set; } = default!;
2023-03-31 11:10:16 +05:00
[ForeignKey(nameof(IdTelemetry))]
public virtual Telemetry? Telemetry { get; set; }
}
[Table("t_wits_string"), Comment("таблица данных ГТИ с типом значения string")]
2023-03-31 11:10:16 +05:00
public class WitsItemString : WitsItemBase<string> { }
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-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> { }
}