package com.mortals.xhx.module.datum.model;
import java.util.List;
import java.util.ArrayList;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.datum.model.vo.DatumCategoryVo;
import lombok.Data;
/**
* 材料分类实体对象
*
* @author zxfei
* @date 2023-06-21
*/
@Data
public class DatumCategoryEntity extends DatumCategoryVo {
    private static final long serialVersionUID = 1L;

    /**
    * 分类id
    */
    private Long categoryId;
    /**
    * 分类名称
    */
    private String categoryName;
    /**
    * 材料Id
    */
    private Long materialId;
    /**
    * 材料名称
    */
    private String materialName;
    /**
    * 排序字段
    */
    private Integer sort;
    @Override
    public int hashCode() {
         return this.getId().hashCode();
    }
    @Override
    public boolean equals(Object obj) {
        if (obj == null) return false;
        if (obj instanceof DatumCategoryEntity) {
            DatumCategoryEntity tmp = (DatumCategoryEntity) obj;
            if (this.getId() == tmp.getId()) {
                 return true;
            }
        }
        return false;
    }

    public void initAttrValue(){

            this.categoryId = -1L;

            this.categoryName = "";

            this.materialId = -1L;

            this.materialName = "";

            this.sort = 0;
    }
}