package com.foreverwin.mesnac.equip.model;

import java.io.Serializable;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import java.time.LocalDateTime;

import java.util.ArrayList;
import java.util.List;

import com.baomidou.mybatisplus.annotation.IdType;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.foreverwin.mesnac.common.model.InspectionItemDetail;

/**
 * <p>
 * 设备检验计划表
 * </p>
 *
 * @author pavel.Liu
 * @since 2021-06-10
 */

@TableName("Z_RESOURCE_INSPECT_PLAN")
@JsonIgnoreProperties(ignoreUnknown = true)
public class ResourceInspectPlan extends Model<ResourceInspectPlan> {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
   @TableId(value = "HANDLE", type = IdType.INPUT)
   private String handle;
    /**
     * 站点
     */
   @TableField("SITE")
   private String site;
    /**
     * 设备检验计划编号
     */
   @TableField("PLAN_NO")
   private String planNo;
    /**
     * 版本
     */
   @TableField("REVISION")
   private String revision;
    /**
     * 是否当前版本(true/false)
     */
   @TableField("CURRENT_REVISION")
   private String currentRevision;
    /**
     * 任务数量
     */
   @TableField("PLAN_TASK_COUNT")
   private Long planTaskCount;
    /**
     * 设备检验计划描述
     */
   @TableField("DESCRIPTION")
   private String description;
    /**
     * 检验计划状态(新建、启动、禁用)
     */
   @TableField("STATUS")
   private String status;
    /**
     * 保养类别(日常保养/一级保养/二级保养/日点检/周点检/月点检/年点检)
     */
   @TableField("CATEGORY")
   private String category;
    /**
     * 排程方式（周期/执行间隔时间）
     */
   @TableField("SCHEDULE_TYPE")
   private String scheduleType;
    /**
     * 频率
     */
   @TableField("FREQUENCY")
   private Double frequency;
    /**
     * 频率单位(M月W周D日H时F分S秒)
     */
   @TableField("FREQUENCY_UNIT")
   private String frequencyUnit;
    /**
     * 前容差时间
     */
   @TableField("BEFORE_TOLERANCE")
   private Long beforeTolerance;
    /**
     * 后容差时间
     */
   @TableField("AFTER_TOLERANCE")
   private Long afterTolerance;
    /**
     * 检验计划有效期(开始时间)
     */
   @TableField("INDATE_START")
   private LocalDateTime indateStart;
    /**
     * 检验计划有效期(结束时间)
     */
   @TableField("INDATE_END")
   private LocalDateTime indateEnd;
    /**
     * 检验项目清单HANDLE
     */
   @TableField("INSPECTION_ITEM_BO")
   private String inspectionItemBo;
    /**
     * 创建人
     */
   @TableField("CREATE_USER")
   private String createUser;
    /**
     * 创建时间
     */
   @TableField("CREATED_DATE_TIME")
   private LocalDateTime createdDateTime;
    /**
     * 修改人
     */
   @TableField("MODIFY_USER")
   private String modifyUser;
    /**
     * 修改时间
     */
   @TableField("MODIFIED_DATE_TIME")
   private LocalDateTime modifiedDateTime;
   /**
    *  设备清单
    */
   @TableField(exist = false)
   private List<ResourceInspectResource> maintainPlanEquipList = new ArrayList<>();
   /**
    *  检验项目清单（检验项清单，与inspectionItemBo对应）
    *  因为会出现模块之间的循环依赖，故不提供该字段
    */
   @TableField(exist = false)
   private List<InspectionItemDetail> inspectionItemDetailList = new ArrayList<>();

   /**
    * 用户组清单
    */
   @TableField(exist = false)
   private List<InspectPlanUserGroup> inspectPlanUserGroupList = new ArrayList<>();

   public List<ResourceInspectResource> getMaintainPlanEquipList() {
      return maintainPlanEquipList;
   }

   public void setMaintainPlanEquipList(List<ResourceInspectResource> maintainPlanEquipList) {
      this.maintainPlanEquipList = maintainPlanEquipList;
   }

   public List<InspectionItemDetail> getInspectionItemDetailList() {
      return inspectionItemDetailList;
   }

   public void setInspectionItemDetailList(List<InspectionItemDetail> inspectionItemDetailList) {
      this.inspectionItemDetailList = inspectionItemDetailList;
   }

   public List<InspectPlanUserGroup> getInspectPlanUserGroupList() {
      return inspectPlanUserGroupList;
   }

   public void setInspectPlanUserGroupList(List<InspectPlanUserGroup> inspectPlanUserGroupList) {
      this.inspectPlanUserGroupList = inspectPlanUserGroupList;
   }

   public String getHandle() {
      return handle;
   }

   public void setHandle(String handle) {
      this.handle = handle;
   }

   public String getSite() {
      return site;
   }

   public void setSite(String site) {
      this.site = site;
   }

   public String getPlanNo() {
      return planNo;
   }

   public void setPlanNo(String planNo) {
      this.planNo = planNo;
   }

   public String getRevision() {
      return revision;
   }

   public void setRevision(String revision) {
      this.revision = revision;
   }

   public String getCurrentRevision() {
      return currentRevision;
   }

   public void setCurrentRevision(String currentRevision) {
      this.currentRevision = currentRevision;
   }

   public Long getPlanTaskCount() {
      return planTaskCount;
   }

   public void setPlanTaskCount(Long planTaskCount) {
      this.planTaskCount = planTaskCount;
   }

   public String getDescription() {
      return description;
   }

   public void setDescription(String description) {
      this.description = description;
   }

   public String getStatus() {
      return status;
   }

   public void setStatus(String status) {
      this.status = status;
   }

   public String getCategory() {
      return category;
   }

   public void setCategory(String category) {
      this.category = category;
   }

   public String getScheduleType() {
      return scheduleType;
   }

   public void setScheduleType(String scheduleType) {
      this.scheduleType = scheduleType;
   }

   public Double getFrequency() {
      return frequency;
   }

   public void setFrequency(Double frequency) {
      this.frequency = frequency;
   }

   public String getFrequencyUnit() {
      return frequencyUnit;
   }

   public void setFrequencyUnit(String frequencyUnit) {
      this.frequencyUnit = frequencyUnit;
   }

   public Long getBeforeTolerance() {
      return beforeTolerance;
   }

   public void setBeforeTolerance(Long beforeTolerance) {
      this.beforeTolerance = beforeTolerance;
   }

   public Long getAfterTolerance() {
      return afterTolerance;
   }

   public void setAfterTolerance(Long afterTolerance) {
      this.afterTolerance = afterTolerance;
   }

   public LocalDateTime getIndateStart() {
      return indateStart;
   }

   public void setIndateStart(LocalDateTime indateStart) {
      this.indateStart = indateStart;
   }

   public LocalDateTime getIndateEnd() {
      return indateEnd;
   }

   public void setIndateEnd(LocalDateTime indateEnd) {
      this.indateEnd = indateEnd;
   }

   public String getInspectionItemBo() {
      return inspectionItemBo;
   }

   public void setInspectionItemBo(String inspectionItemBo) {
      this.inspectionItemBo = inspectionItemBo;
   }

   public String getCreateUser() {
      return createUser;
   }

   public void setCreateUser(String createUser) {
      this.createUser = createUser;
   }

   public LocalDateTime getCreatedDateTime() {
      return createdDateTime;
   }

   public void setCreatedDateTime(LocalDateTime createdDateTime) {
      this.createdDateTime = createdDateTime;
   }

   public String getModifyUser() {
      return modifyUser;
   }

   public void setModifyUser(String modifyUser) {
      this.modifyUser = modifyUser;
   }

   public LocalDateTime getModifiedDateTime() {
      return modifiedDateTime;
   }

   public void setModifiedDateTime(LocalDateTime modifiedDateTime) {
      this.modifiedDateTime = modifiedDateTime;
   }

public static final String HANDLE = "HANDLE";

public static final String SITE = "SITE";

public static final String PLAN_NO = "PLAN_NO";

public static final String REVISION = "REVISION";

public static final String CURRENT_REVISION = "CURRENT_REVISION";

public static final String PLAN_TASK_COUNT = "PLAN_TASK_COUNT";

public static final String DESCRIPTION = "DESCRIPTION";

public static final String STATUS = "STATUS";

public static final String CATEGORY = "CATEGORY";

public static final String SCHEDULE_TYPE = "SCHEDULE_TYPE";

public static final String FREQUENCY = "FREQUENCY";

public static final String FREQUENCY_UNIT = "FREQUENCY_UNIT";

public static final String BEFORE_TOLERANCE = "BEFORE_TOLERANCE";

public static final String AFTER_TOLERANCE = "AFTER_TOLERANCE";

public static final String INDATE_START = "INDATE_START";

public static final String INDATE_END = "INDATE_END";

public static final String INSPECTION_ITEM_BO = "INSPECTION_ITEM_BO";

public static final String CREATE_USER = "CREATE_USER";

public static final String CREATED_DATE_TIME = "CREATED_DATE_TIME";

public static final String MODIFY_USER = "MODIFY_USER";

public static final String MODIFIED_DATE_TIME = "MODIFIED_DATE_TIME";


   @Override
   protected Serializable pkVal() {
      return this.handle;
   }

   @Override
   public String toString() {
      return "ResourceInspectPlan{" +
         "handle = " + handle +
         ", site = " + site +
         ", planNo = " + planNo +
         ", revision = " + revision +
         ", currentRevision = " + currentRevision +
         ", planTaskCount = " + planTaskCount +
         ", description = " + description +
         ", status = " + status +
         ", category = " + category +
         ", scheduleType = " + scheduleType +
         ", frequency = " + frequency +
         ", frequencyUnit = " + frequencyUnit +
         ", beforeTolerance = " + beforeTolerance +
         ", afterTolerance = " + afterTolerance +
         ", indateStart = " + indateStart +
         ", indateEnd = " + indateEnd +
         ", inspectionItemBo = " + inspectionItemBo +
         ", createUser = " + createUser +
         ", createdDateTime = " + createdDateTime +
         ", modifyUser = " + modifyUser +
         ", modifiedDateTime = " + modifiedDateTime +
         "}";
   }
}