package com.huigou.topsun.product.domain;

import java.io.Serializable;
import javax.persistence.*;

import lombok.Data;

/**
 * 产品外观
 * @TableName product_looked
 */
@Table(name="product_looked")
@Data
@Entity
public class ProductLooked implements Serializable {
    /**
     * 产品外观ID
     */
    @Id
//    @GeneratedValue(strategy = GenerationType.IDENTITY) // 使用自增策略
    @Column(name = "product_looked_id")
    private String productLookedId;

    /**
     * 产品ID
     */
    @Column(name = "product_id")
    private String productId;

    /**
     * 长;单位cm
     */
    @Column(name = "product_length")
    private Double productLength;

    /**
     * 宽;单位cm
     */
    @Column(name = "product_width")
    private Double productWidth;

    /**
     * 高;单位cm
     */
    @Column(name = "product_height")
    private Double productHeight;

    /**
     * 厚度;单位mm
     */
    @Column(name = "product_thick")
    private Double productThick;

    /**
     * 成品克重;单位g
     */
    @Column(name = "product_weight")
    private Double productWeight;

    /**
     * 角型
     */
    @Column(name = "product_angle_type")
    private String productAngleType;

    /**
     * 角度(单位mm)
     */
    @Column(name = "product_angle")
    private Double productAngle;

    /**
     * 孔径(单位mm)
     */
    @Column(name = "product_aperture")
    private Double productAperture;

    /**
     * 单层厚(单位丝)
     */
    @Column(name = "product_single_layer")
    private Integer productSingleLayer;

    /**
     * 单重(单位KG)
     */
    @Column(name = "product_single_weight")
    private Double productSingleWeight;

    /**
     * 层数
     */
    @Column(name = "product_layer_num")
    private Integer productLayerNum;

    /**
     * 是否防霉(is_open)
     */
    @Column(name = "product_mould")
    private String productMould;

    /**
     * 是否写码(is_open)
     */
    @Column(name = "product_coding")
    private String productCoding;

    /**
     * 体系认证(product_sys_certification)
     */
    @Column(name = "product_sys_certification")
    private String productSysCertification;

    /**
     * 仓库(store_name)
     */
    @Column(name = "store_name")
    private String storeName;

    /**
     * 采购单位(product_buy_unit)
     */
    @Column(name = "product_buy_unit")
    private String productBuyUnit;

    /**
     * 样品形状：RIGHT-直角；ALLOTYPE-异型；FILLET-圆角；
     */
    @Column(name = "product_shape")
    private String productShape;

    /**
     * 样品形状大小（mm）
     */
    @Column(name = "prodcut_shape_size")
    private Double prodcutShapeSize;

    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ProductLooked other = (ProductLooked) that;
        return (this.getProductLookedId() == null ? other.getProductLookedId() == null : this.getProductLookedId().equals(other.getProductLookedId()))
            && (this.getProductId() == null ? other.getProductId() == null : this.getProductId().equals(other.getProductId()))
            && (this.getProductLength() == null ? other.getProductLength() == null : this.getProductLength().equals(other.getProductLength()))
            && (this.getProductWidth() == null ? other.getProductWidth() == null : this.getProductWidth().equals(other.getProductWidth()))
            && (this.getProductHeight() == null ? other.getProductHeight() == null : this.getProductHeight().equals(other.getProductHeight()))
            && (this.getProductThick() == null ? other.getProductThick() == null : this.getProductThick().equals(other.getProductThick()))
            && (this.getProductWeight() == null ? other.getProductWeight() == null : this.getProductWeight().equals(other.getProductWeight()))
            && (this.getProductAngleType() == null ? other.getProductAngleType() == null : this.getProductAngleType().equals(other.getProductAngleType()))
            && (this.getProductAngle() == null ? other.getProductAngle() == null : this.getProductAngle().equals(other.getProductAngle()))
            && (this.getProductAperture() == null ? other.getProductAperture() == null : this.getProductAperture().equals(other.getProductAperture()))
            && (this.getProductSingleLayer() == null ? other.getProductSingleLayer() == null : this.getProductSingleLayer().equals(other.getProductSingleLayer()))
            && (this.getProductSingleWeight() == null ? other.getProductSingleWeight() == null : this.getProductSingleWeight().equals(other.getProductSingleWeight()))
            && (this.getProductLayerNum() == null ? other.getProductLayerNum() == null : this.getProductLayerNum().equals(other.getProductLayerNum()))
            && (this.getProductMould() == null ? other.getProductMould() == null : this.getProductMould().equals(other.getProductMould()))
            && (this.getProductCoding() == null ? other.getProductCoding() == null : this.getProductCoding().equals(other.getProductCoding()))
            && (this.getProductSysCertification() == null ? other.getProductSysCertification() == null : this.getProductSysCertification().equals(other.getProductSysCertification()))
            && (this.getStoreName() == null ? other.getStoreName() == null : this.getStoreName().equals(other.getStoreName()))
            && (this.getProductBuyUnit() == null ? other.getProductBuyUnit() == null : this.getProductBuyUnit().equals(other.getProductBuyUnit()))
            && (this.getProductShape() == null ? other.getProductShape() == null : this.getProductShape().equals(other.getProductShape()))
            && (this.getProdcutShapeSize() == null ? other.getProdcutShapeSize() == null : this.getProdcutShapeSize().equals(other.getProdcutShapeSize()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getProductLookedId() == null) ? 0 : getProductLookedId().hashCode());
        result = prime * result + ((getProductId() == null) ? 0 : getProductId().hashCode());
        result = prime * result + ((getProductLength() == null) ? 0 : getProductLength().hashCode());
        result = prime * result + ((getProductWidth() == null) ? 0 : getProductWidth().hashCode());
        result = prime * result + ((getProductHeight() == null) ? 0 : getProductHeight().hashCode());
        result = prime * result + ((getProductThick() == null) ? 0 : getProductThick().hashCode());
        result = prime * result + ((getProductWeight() == null) ? 0 : getProductWeight().hashCode());
        result = prime * result + ((getProductAngleType() == null) ? 0 : getProductAngleType().hashCode());
        result = prime * result + ((getProductAngle() == null) ? 0 : getProductAngle().hashCode());
        result = prime * result + ((getProductAperture() == null) ? 0 : getProductAperture().hashCode());
        result = prime * result + ((getProductSingleLayer() == null) ? 0 : getProductSingleLayer().hashCode());
        result = prime * result + ((getProductSingleWeight() == null) ? 0 : getProductSingleWeight().hashCode());
        result = prime * result + ((getProductLayerNum() == null) ? 0 : getProductLayerNum().hashCode());
        result = prime * result + ((getProductMould() == null) ? 0 : getProductMould().hashCode());
        result = prime * result + ((getProductCoding() == null) ? 0 : getProductCoding().hashCode());
        result = prime * result + ((getProductSysCertification() == null) ? 0 : getProductSysCertification().hashCode());
        result = prime * result + ((getStoreName() == null) ? 0 : getStoreName().hashCode());
        result = prime * result + ((getProductBuyUnit() == null) ? 0 : getProductBuyUnit().hashCode());
        result = prime * result + ((getProductShape() == null) ? 0 : getProductShape().hashCode());
        result = prime * result + ((getProdcutShapeSize() == null) ? 0 : getProdcutShapeSize().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", productLookedId=").append(productLookedId);
        sb.append(", productId=").append(productId);
        sb.append(", productLength=").append(productLength);
        sb.append(", productWidth=").append(productWidth);
        sb.append(", productHeight=").append(productHeight);
        sb.append(", productThick=").append(productThick);
        sb.append(", productWeight=").append(productWeight);
        sb.append(", productAngleType=").append(productAngleType);
        sb.append(", productAngle=").append(productAngle);
        sb.append(", productAperture=").append(productAperture);
        sb.append(", productSingleLayer=").append(productSingleLayer);
        sb.append(", productSingleWeight=").append(productSingleWeight);
        sb.append(", productLayerNum=").append(productLayerNum);
        sb.append(", productMould=").append(productMould);
        sb.append(", productCoding=").append(productCoding);
        sb.append(", productSysCertification=").append(productSysCertification);
        sb.append(", storeName=").append(storeName);
        sb.append(", productBuyUnit=").append(productBuyUnit);
        sb.append(", productShape=").append(productShape);
        sb.append(", prodcutShapeSize=").append(prodcutShapeSize);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}