using SqlSugar;
using System;
using System.ComponentModel.DataAnnotations.Schema;

namespace WCS.Entity
{
    /// <summary>
    /// 任务流转表
    /// </summary>
    [SugarTable(nameof(WCS_TaskDtl) + "_{year}{month}{day}", "任务流转表")]
    [SplitTable(SplitType.Month)]//按年分表 （自带分表支持 年、季、月、周、日）
    public class WCS_TaskDtl
    {
        /// <summary>
        /// ID
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, ColumnDescription = "ID")]
        [Column(Order = 0)]
        public Guid ID { get; set; }

        /// <summary>
        /// 父级任务号
        /// </summary>
        [SugarColumn(ColumnDescription = "父级任务号")]
        public int ParentTaskCode { get; set; }

        /// <summary>
        /// 当前位置
        /// </summary>
        [SugarColumn(ColumnDescription = "当前位置")]
        public string CurPoint { get; set; }

        /// <summary>
        /// 下一个地址
        /// </summary>
        [SugarColumn(ColumnDescription = "下一个地址", IsNullable = true)]
        public string NextPoint { get; set; }

        /// <summary>
        /// 描述
        /// </summary>
        [SugarColumn(ColumnDescription = "描述")]
        public string Desc { get; set; }

        /// <summary>
        /// 是否可用
        /// </summary>
        [SugarColumn(ColumnDescription = "是否可用")]
        public bool Enabled { get; set; } = true;

        /// <summary>
        /// 创建用户
        /// 仅记录用户ID
        /// </summary>
        [SugarColumn(ColumnDescription = "创建用户", Length = 50)]
        public string AddWho { get; set; }

        /// <summary>
        /// 创建时间
        /// 新增数据时自动获取服务器时间
        /// </summary>
        [SugarColumn(ColumnDescription = "创建时间", InsertServerTime = true)]
        public DateTime AddTime { get; set; }

        /// <summary>
        /// 版本号
        /// </summary>
        [SugarColumn(ColumnDescription = "版本号", ColumnDataType = "timestamp", IsNullable = true, IsOnlyIgnoreInsert = true, IsOnlyIgnoreUpdate = true)]
        public byte[] VER { get; set; }
    }
}
