using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Siger.Middlelayer.Repository.Data.Tpm
{
    public class GetPlanResult : EntityBase
    {
        public int id { get; set; }

        /// <summary>
        /// planid
        /// </summary>
        public int planid { get; set; } = 0;
        public string work_order { get; set; } = "";

        /// <summary>
        /// plan_time_id
        /// </summary>
        public int plan_time_id { get; set; } = 0;

        /// <summary>
        /// itemid
        /// </summary>
        public int itemid { get; set; } = 0;

        /// <summary>
        /// 值（如果为勾选确定型的为TRUE/FALSE;如果为数值，就为所记录的数值）
        /// </summary>
        public string value { get; set; } = string.Empty;

        /// <summary>
        /// create_time
        /// </summary>
        public int create_time { get; set; } = 0;

        /// <summary>
        /// 创建人的mid
        /// </summary>
        public int create_mid { get; set; } = 0;

        /// <summary>
        /// 计划维修微信上传图片url
        /// </summary>
        public string imgurl { get; set; } = string.Empty;

        /// <summary>
        /// 出库单号，以逗号隔开
        /// </summary>
        public string sparepartout { get; set; } = string.Empty;

        /// <summary>
        /// 实际执行人
        /// </summary>
        public int actual_mid { get; set; }


        public string time { get; set; }
        public string actualtime { get; set; }

        public string name { get; set; }

        public int value_type { get; set; }

        public string up { get; set; }

        public string lower { get; set; }


        public int machineid { get; set; }

        public int mode { get; set; }

        //接口属性
        public string record_code { get; set; }

        public string keep_remark { get; set; }

        public int hit_type { get; set; }

        public double maintain_time { get; set; }

        public int standard_time { get; set; }
        public int actual_standard_time { get; set; }

        public string corepair { get; set; }
        public List<string> mids { get { return corepair.Split(',').ToList(); } }

        public int act_standard_time { get; set; }
        public int information { get; set; }
        /// 1=>已执行   2=>未执行  3=>逾期
        public int state
        {
            get
            {
                if (information == 1)
                {
                    return 1;
                }
                if (instruction_mid == 0)
                {
                    if (instruction_mid == 0)
                    {
                        return 3;
                    }
                    return 2;
                }
                else
                {
                    return 1;
                }
            }
        }
        public string state_name { get; set; }
        public int instruction_mid { get; set; }
        public int instruction_time { get; set; }

    }
}
