using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WCS.BLL.HardWare;

namespace WCS.DAL.DbModels
{
    [SugarTable("wcs_shelf_info")]
    public class ShelfInfo
    {

        /// <summary>
        /// 主键 自增Id
        /// </summary>
        [SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsNullable = false, IsIdentity = true)]
        public int Id { get; set; }

        /// <summary>
        /// 货架编码;货架一般按照报警灯来区分 一个报警灯指示的是一个货架
        /// </summary>       
        [SugarColumn(ColumnName = "shelf_code", Length = 50, IsNullable = false, ColumnDescription = "货架编码;货架一般按照报警灯来区分 一个报警灯指示的是一个货架")]
        public string ShelfCode { get; set; }

        /// <summary>
        /// 货架类型Id
        /// </summary>
        [SugarColumn(ColumnName = "shelf_type_id", IsNullable = false, ColumnDescription = "货架类型Id")]
        public int ShelfTypeId { get; set; }

        /// <summary>
        /// 货架类型名称
        /// </summary>
        [SugarColumn(ColumnName = "shelf_type_name", Length = 50, IsNullable = false, ColumnDescription = "货架类型名称")]
        public string ShelfTypeName { get; set; }

        /// <summary>
        /// 货架当前状态
        /// </summary>
        [SugarColumn(ColumnName = "current_mode", IsNullable = false, ColumnDescription = "货架当前状态")]
        public Mode CurrentMode { get; set; }

        /// <summary>
        /// 货架设置当前模式的时间
        /// </summary>
        [SugarColumn(ColumnName = "set_current_mode_time", IsNullable = true, ColumnDescription = "设置货架当前模式的时间")]
        public DateTime SetCurrentModeTime { get; set; }

        /// <summary>
        /// 货架行数
        /// </summary>
        [SugarColumn(ColumnName = "row_counts", IsNullable = false, ColumnDescription = "货架行数")]
        public int Rowcounts { get; set; }

        /// <summary>
        /// 货架列数
        /// </summary>
        [SugarColumn(ColumnName = "column_counts", IsNullable = false, ColumnDescription = "货架列数")]
        public int Columncounts { get; set; }

        /// <summary>
        /// 货架对应警示灯的Id
        /// </summary>
        [SugarColumn(ColumnName = "light_id", IsNullable = false, ColumnDescription = "货架对应警示灯的Id")]
        public int LightId { get; set; }

        /// <summary>
        /// 货架对应Can模块的Ip
        /// </summary>
        [SugarColumn(ColumnName = "client_ip", Length = 50, IsNullable = false, ColumnDescription = "货架对应Can模块的Ip")]
        public string ClientIp { get; set; }

        /// <summary>
        /// 连接Can模块的端口号
        /// </summary>
        [SugarColumn(ColumnName = "port", Length = 50, IsNullable = true, ColumnDescription = "连接Can模块的端口号")]
        public string Port { get; set; }

        /// <summary>
        /// 货架对应后端的Ip
        /// </summary>
        [SugarColumn(ColumnName = "server_ip", Length = 50, IsNullable = false, ColumnDescription = "货架对应后端服务的Ip")]
        public string ServerIp { get; set; }

        /// <summary>
        /// 货架的组别、区域（区分单个软件管哪些货架的，前端的配置文件配置一个组别，查询时只显示当前组别的货架）
        /// </summary>
        [SugarColumn(ColumnName = "group_name", Length = 50, IsNullable = false, ColumnDescription = "货架的组别、区域（区分单个软件管哪些货架的，前端的配置文件配置一个组别，查询时只显示当前组别的货架）")]
        public string GroupName { get; set; }


        /// <summary>
        /// 是否串联绑定
        /// </summary>
        [SugarColumn(ColumnName = "is_bind", IsNullable = false, ColumnDescription = "是否串联绑定")]
        public bool IsBind { get; set; }

        /// <summary>
        /// 串联绑定后的大货架编码
        /// </summary>
        [SugarColumn(ColumnName = "Bind_shelf_code", IsNullable = true, ColumnDescription = "串联绑定后的大货架编码")]
        public string? BigShelfCode { get; set; } = string.Empty;

        /// <summary>
        /// 序号
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public int RowNumber { get; set; }
        /// <summary>
        /// 是否已经选择
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public bool IsSelected { get; set; }
    }
}
