package com.xisc.pm.domain.entity;

import com.fasterxml.jackson.annotation.JsonInclude;
import io.choerodon.mybatis.annotation.ModifyAudit;
import io.choerodon.mybatis.annotation.VersionAudit;
import io.choerodon.mybatis.domain.AuditDomain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Objects;


/**
 * 钢板厚度余量基准表(PmThickAddvBt)实体类
 *
 * @author 蒋雨航 yuhang.jiang02@hand-china.com
 * @since 2024-09-05 15:04:57
 */

@Getter
@Setter
@ApiModel("钢板厚度余量基准表")
@VersionAudit
@ModifyAudit
@JsonInclude(value = JsonInclude.Include.NON_NULL)
@Table(name = "PM_THICK_ADDV_BT")
public class PmThickAddvBt extends AuditDomain implements Serializable {
    private static final long serialVersionUID = -16606944529742566L;

    public static final String FIELD_PPTAB_ID = "pptabId";
    public static final String FIELD_TOL_TYPE_CODE = "tolTypeCode";
    public static final String FIELD_WHOLE_HEAT_TREATMENT_TYPE = "wholeHeatTreatmentType";
    public static final String FIELD_MSC_LINE_NO = "mscLineNo";
    public static final String FIELD_PLATE_THICK_FROM = "plateThickFrom";
    public static final String FIELD_PLATE_THICK_TO = "plateThickTo";
    public static final String FIELD_COMBINE_PLATE_WIDTH_FROM = "combinePlateWidthFrom";
    public static final String FIELD_COMBINE_PLATE_WIDTH_TO = "combinePlateWidthTo";
    public static final String FIELD_THICK_ADDV = "thickAddv";
    public static final String FIELD_TENANT_ID = "tenantId";
    public static final String FIELD_ATTRIBUTE1 = "attribute1";
    public static final String FIELD_ATTRIBUTE2 = "attribute2";
    public static final String FIELD_ATTRIBUTE3 = "attribute3";
    public static final String FIELD_ATTRIBUTE4 = "attribute4";
    public static final String FIELD_ATTRIBUTE5 = "attribute5";

    @ApiModelProperty("主键ID")
    @Id
    @GeneratedValue
    private Long pptabId;

    @ApiModelProperty(value = "公差类型代码", required = true)
    @NotBlank
    private String tolTypeCode;

    @ApiModelProperty(value = "全程热处理类型，Q（全程热处理类型含Q），* 匹配全部热处理类型", required = true)
    @NotBlank
    private String wholeHeatTreatmentType;

    @ApiModelProperty(value = "产线号", required = true)
    @NotBlank
    private String mscLineNo;

    @ApiModelProperty(value = "钢板厚度起", required = true)
    @NotNull
    private BigDecimal plateThickFrom;

    @ApiModelProperty(value = "钢板厚度止", required = true)
    @NotNull
    private BigDecimal plateThickTo;

    @ApiModelProperty(value = "组合板宽度起", required = true)
    @NotNull
    private BigDecimal combinePlateWidthFrom;

    @ApiModelProperty(value = "组合板宽度止", required = true)
    @NotNull
    private BigDecimal combinePlateWidthTo;

    @ApiModelProperty(value = "厚度余量", required = true)
    @NotNull
    private BigDecimal thickAddv;

    @ApiModelProperty(value = "租户ID", required = true)
    @NotNull
    private Long tenantId;

    private String attribute1;

    private String attribute2;

    private String attribute3;

    private String attribute4;

    private String attribute5;


    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        PmThickAddvBt that = (PmThickAddvBt) o;
        return Objects.equals(pptabId, that.pptabId) && Objects.equals(tolTypeCode, that.tolTypeCode) &&
                Objects.equals(wholeHeatTreatmentType, that.wholeHeatTreatmentType) && Objects.equals(mscLineNo, that.mscLineNo) &&
                Objects.equals(plateThickFrom, that.plateThickFrom) && Objects.equals(plateThickTo, that.plateThickTo) &&
                Objects.equals(combinePlateWidthFrom, that.combinePlateWidthFrom) &&
                Objects.equals(combinePlateWidthTo, that.combinePlateWidthTo) && Objects.equals(thickAddv, that.thickAddv) &&
                Objects.equals(tenantId, that.tenantId) && Objects.equals(attribute1, that.attribute1) &&
                Objects.equals(attribute2, that.attribute2) && Objects.equals(attribute3, that.attribute3) &&
                Objects.equals(attribute4, that.attribute4) && Objects.equals(attribute5, that.attribute5);
    }

    @Override
    public int hashCode() {
        return Objects.hash(pptabId, tolTypeCode, wholeHeatTreatmentType, mscLineNo, plateThickFrom, plateThickTo,
                combinePlateWidthFrom, combinePlateWidthTo, thickAddv, tenantId, attribute1, attribute2, attribute3,
                attribute4, attribute5);
    }
}
