EquipmentProperty.cs 1.42 KB
using DataAcquisition.Common.Enums;
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations.Schema;
using IndexAttribute = Microsoft.EntityFrameworkCore.IndexAttribute;

namespace DataAcquisition.Models
{
    [Comment("设备属性表")]
    [Table("EquipmentProperty")]
    [Index(nameof(EquipmentId), nameof(Code), IsUnique = true)]
    public class EquipmentProperty
    {
        [Comment("设备属性Id")]
        public int Id { get; set; }

        [Comment("设备Id")]
        [ForeignKey(nameof(Equipment))]
        public int EquipmentId { get; set; }

        public virtual Equipment Equipment { get; set; } = null!;

        [Comment("设备属性编号")]
        public string Code { get; set; } = null!;

        [Comment("设备属性名称")]
        public string Name { get; set; } = null!;

        [Comment("数据地址")]
        public string DataAddress { get; set; } = null!;

        [Comment("数据类型")]
        public DataTypeConst DataType { get; set; }

        [Comment("设备属性值")]
        public string? Value { get; set; }

        [Comment("是否启用")]
        public bool Enable { get; set; }

        [Comment("备注")]
        public string? Remark { get; set; }

        [Comment("创建时间")]
        public DateTime? CreateTime { get; set; } = DateTime.Now;

        [Comment("更新时间")]
        public DateTime? UpdateTime { get; set; } = null!;
    }
}