2024-07-04 11:02:45 +05:00
|
|
|
using Microsoft.EntityFrameworkCore;
|
2021-09-10 11:28:57 +05:00
|
|
|
using System;
|
2021-07-27 14:43:30 +05:00
|
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
using System.Text.Json.Serialization;
|
|
|
|
|
|
|
|
namespace AsbCloudDb.Model
|
|
|
|
{
|
2021-08-16 10:38:48 +05:00
|
|
|
[Table("t_well_operation"), Comment("Данные по операциям на скважине")]
|
2023-04-04 12:52:11 +05:00
|
|
|
public class WellOperation : ItemInfo, IId
|
2021-07-27 14:43:30 +05:00
|
|
|
{
|
2022-12-28 17:38:53 +05:00
|
|
|
public const int IdOperationTypePlan = 0;
|
|
|
|
public const int IdOperationTypeFact = 1;
|
|
|
|
|
2021-07-27 14:43:30 +05:00
|
|
|
[Key]
|
|
|
|
[Column("id")]
|
|
|
|
public int Id { get; set; }
|
|
|
|
|
2021-08-13 17:25:06 +05:00
|
|
|
[Column("id_well"), Comment("Id скважины")]
|
2021-07-27 14:43:30 +05:00
|
|
|
public int IdWell { get; set; }
|
|
|
|
|
2021-08-16 10:21:46 +05:00
|
|
|
[Column("id_well_section_type"), Comment("Id тип секции скважины")]
|
|
|
|
public int IdWellSectionType { get; set; }
|
2021-08-13 17:25:06 +05:00
|
|
|
|
|
|
|
[Column("id_category"), Comment("Id категории операции")]
|
2021-08-18 16:57:20 +05:00
|
|
|
public int IdCategory { get; set; }
|
2021-08-13 17:25:06 +05:00
|
|
|
|
2022-12-28 17:38:53 +05:00
|
|
|
/// <summary>
|
|
|
|
/// Тип 0 = План или 1 = Факт
|
|
|
|
/// </summary>
|
2021-08-18 16:57:20 +05:00
|
|
|
[Column("id_type"), Comment("0 = План или 1 = Факт")]
|
|
|
|
public int IdType { get; set; }
|
2021-08-13 17:25:06 +05:00
|
|
|
|
2023-02-15 17:02:43 +05:00
|
|
|
[Column("id_plan"), Comment("Id плановой операции")]
|
|
|
|
public int? IdPlan { get; set; }
|
|
|
|
|
2021-10-08 11:30:06 +05:00
|
|
|
[Column("depth_start"), Comment("Глубина на начало операции, м")]
|
|
|
|
public double DepthStart { get; set; }
|
2021-07-27 14:43:30 +05:00
|
|
|
|
2021-10-08 11:30:06 +05:00
|
|
|
[Column("depth_end"), Comment("Глубина после завершения операции, м")]
|
|
|
|
public double DepthEnd { get; set; }
|
2021-07-27 14:43:30 +05:00
|
|
|
|
2021-12-27 10:53:18 +05:00
|
|
|
[Column("date_start", TypeName = "timestamp with time zone"), Comment("Дата начала операции")]
|
2021-12-30 10:45:06 +05:00
|
|
|
public DateTimeOffset DateStart { get; set; }
|
2021-10-08 11:30:06 +05:00
|
|
|
|
|
|
|
[Column("duration_hours"), Comment("Продолжительность, часы")]
|
2021-08-16 10:21:46 +05:00
|
|
|
public double DurationHours { get; set; }
|
2021-07-27 14:43:30 +05:00
|
|
|
|
2021-08-18 16:57:20 +05:00
|
|
|
[Column("category_info"), Comment("Доп. информация к выбраной категории")]
|
2023-02-17 15:30:17 +05:00
|
|
|
public string? CategoryInfo { get; set; }
|
2021-08-13 17:25:06 +05:00
|
|
|
|
|
|
|
[Column("comment"), Comment("Комментарий")]
|
2023-02-17 15:30:17 +05:00
|
|
|
public string? Comment { get; set; }
|
2021-08-13 17:25:06 +05:00
|
|
|
|
|
|
|
[JsonIgnore]
|
2021-08-16 10:21:46 +05:00
|
|
|
[ForeignKey(nameof(IdWell))]
|
2023-02-17 15:30:17 +05:00
|
|
|
public virtual Well Well { get; set; } = null!;
|
2021-08-16 10:21:46 +05:00
|
|
|
|
|
|
|
[JsonIgnore]
|
|
|
|
[ForeignKey(nameof(IdWellSectionType))]
|
2023-02-17 15:30:17 +05:00
|
|
|
public virtual WellSectionType WellSectionType { get; set; } = null!;
|
2021-07-27 14:43:30 +05:00
|
|
|
|
|
|
|
[JsonIgnore]
|
2021-08-18 16:57:20 +05:00
|
|
|
[ForeignKey(nameof(IdCategory))]
|
2023-02-17 15:30:17 +05:00
|
|
|
public virtual WellOperationCategory OperationCategory { get; set; } = null!;
|
2023-02-15 17:02:43 +05:00
|
|
|
|
|
|
|
[JsonIgnore]
|
|
|
|
[ForeignKey(nameof(IdPlan))]
|
2024-04-16 13:09:11 +05:00
|
|
|
public virtual WellOperation? OperationPlan { get; set; }
|
2021-07-27 14:43:30 +05:00
|
|
|
}
|
2022-05-06 10:58:52 +05:00
|
|
|
|
2021-07-27 14:43:30 +05:00
|
|
|
}
|