using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Models
{
    [SugarIndex("index_{table}_code", nameof(Step.Code), OrderByType.Asc, isUnique: true)]
    public class Step:BaseTable
    {  
        /// <summary>
        /// 0-主控台 1-修复台
        /// </summary>
        public int Tag { get; set; }
        public string Code { get; set; }
        public string Name { get; set; }
        /// <summary>
        /// 开始计时工序索引1-n（0则不计时）
        /// </summary>
        public int StartTimeIndex { get; set; }

        [Navigate(NavigateType.OneToMany, nameof(StepProcess.Pid))]
        public List<StepProcess> ProcessList { get; set; }//注意禁止给books手动赋值,也不能new初始化，否则导航查询不到

    } 
    public class StepProcess : BaseTable
    {
        public int Pid { get; set; }
        public int Order { get; set; } = 1;
        public string ProcessCode { get; set; }
        public string ProcessName { get; set; }
        /// <summary>
        /// json
        /// </summary>
        [SugarColumn(IsNullable = true, Length =2048)]
        public string ProcessParams { get; set; }
         
    }
}
