package com.sqx.modules.material.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 物料包表
 */
@TableName(value ="material")
@Data
public class Material implements Serializable {
	private String id;
	/** 物料包名称 */
	private String materialName;
	/** 物料包最低数量 */
	private BigDecimal materialMinimum;
	/** 物料包类别（1，中医类2，精油类） */
	private Integer status;
	/** 备注 */
	private String detail;
	/** 假删字段 */
	private Integer isDeleted;
	/** 商品id */
	private Integer goodsId;
	/** 创建者ID */
	private Long createUser;
	/** 创建时间 */
	@DateTimeFormat(pattern = "yyyy-MM-dd")
	@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
	private Date createTime;
	/** 创建者ID */
	private Long updateUser;
	/** 创建时间 */
	@DateTimeFormat(pattern = "yyyy-MM-dd")
	@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
	private Date updateTime;
	//商品名称
	@TableField(exist = false)
	private String goodsName;


	@Override
    public boolean equals(Object o) {
        if (this == o) { return true; }
        if (o == null || getClass() != o.getClass()) {return false;}
        Material that = (Material) o;
        return id.equals(that.id);
    }

    @Override
    public int hashCode() {
        return java.util.Objects.hash(id);
    }
    
    @Override
    public String toString() {
        return "Material{" +
				"id=" + id +
						",materialName='" + materialName + "'" + 
						",materialMinimum='" + materialMinimum + "'" + 
						",status='" + status + "'" + 
						",createUser='" + createUser + "'" + 
						",createTime='" + createTime + "'" + 
						",updateUser='" + updateUser + "'" + 
						",updateTime='" + updateTime + "'" + 
		                '}';
    }
	
}