package com.ssm.manage.entity;

import lombok.Getter;
import lombok.Setter;

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

@Table(name = "cash_signature_file")
public class CashSignatureFile implements Serializable {
    @Transient
    @Getter
    @Setter
    private Integer courseRestCount;
    /**
     * 主键ID
     */
    @Id
    private Long id;

    /**
     * 收银单据号
     */
    @Column(name = "cash_num")
    private String cashNum;

    /**
     * 收银签名文件名称
     */
    @Column(name = "file_name")
    private String fileName;

    /**
     * 收银签名文件保存路径
     */
    @Column(name = "file_path")
    private String filePath;

    private static final long serialVersionUID = 1L;

    /**
     * 获取主键ID
     *
     * @return id - 主键ID
     */
    public Long getId() {
        return id;
    }

    /**
     * 设置主键ID
     *
     * @param id 主键ID
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * 获取收银单据号
     *
     * @return cash_num - 收银单据号
     */
    public String getCashNum() {
        return cashNum;
    }

    /**
     * 设置收银单据号
     *
     * @param cashNum 收银单据号
     */
    public void setCashNum(String cashNum) {
        this.cashNum = cashNum;
    }

    /**
     * 获取收银签名文件名称
     *
     * @return file_name - 收银签名文件名称
     */
    public String getFileName() {
        return fileName;
    }

    /**
     * 设置收银签名文件名称
     *
     * @param fileName 收银签名文件名称
     */
    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    /**
     * 获取收银签名文件保存路径
     *
     * @return file_path - 收银签名文件保存路径
     */
    public String getFilePath() {
        return filePath;
    }

    /**
     * 设置收银签名文件保存路径
     *
     * @param filePath 收银签名文件保存路径
     */
    public void setFilePath(String filePath) {
        this.filePath = filePath;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        CashSignatureFile other = (CashSignatureFile) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getCashNum() == null ? other.getCashNum() == null : this.getCashNum().equals(other.getCashNum()))
            && (this.getFileName() == null ? other.getFileName() == null : this.getFileName().equals(other.getFileName()))
            && (this.getFilePath() == null ? other.getFilePath() == null : this.getFilePath().equals(other.getFilePath()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getCashNum() == null) ? 0 : getCashNum().hashCode());
        result = prime * result + ((getFileName() == null) ? 0 : getFileName().hashCode());
        result = prime * result + ((getFilePath() == null) ? 0 : getFilePath().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", cashNum=").append(cashNum);
        sb.append(", fileName=").append(fileName);
        sb.append(", filePath=").append(filePath);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}