package com.ssm.manage.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

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

@Table(name = "staff_works")
public class StaffWorks implements Serializable {
    /**
     * 作品号
     */
    @Id
    private Long id;

    /**
     * 员工编码
     */
    @Column(name = "staff_id")
    private Long staffId;

    /**
     * 员工名称
     */
    @Column(name = "staff_name")
    private String staffName;

    /**
     * 手机
     */
    @Column(name = "mobile_phone")
    private String mobilePhone;

    /**
     * 日期
     */
    @Column(name = "work_date")
    private Date workDate;

    /**
     * 作品
     */
    @Column(name = "picture_file")
    private String pictureFile;

    /**
     * 作品路径
     */
    @Column(name = "picture_file_path")
    private String pictureFilePath;

    /**
     * 上传时间
     */
    @Column(name = "upload_time")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date uploadTime;

    /**
     * 上传人
     */
    @Column(name = "upload_user")
    private String uploadUser;

    /**
     * 上传人手机号
     */
    @Column(name = "upload_telephone")
    private String uploadTelephone;

    /**
     * 作品名称
     */
    private String name;

    /**
     * 点赞数
     */
    @Column(name = "praise_num")
    private Integer praiseNum;

    /**
     * 说明
     */
    private String description;

    private static final long serialVersionUID = 1L;

    /**
     * 获取作品号
     *
     * @return id - 作品号
     */
    public Long getId() {
        return id;
    }

    /**
     * 设置作品号
     *
     * @param id 作品号
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * 获取员工编码
     *
     * @return staff_id - 员工编码
     */
    public Long getStaffId() {
        return staffId;
    }

    /**
     * 设置员工编码
     *
     * @param staffId 员工编码
     */
    public void setStaffId(Long staffId) {
        this.staffId = staffId;
    }

    /**
     * 获取员工名称
     *
     * @return staff_name - 员工名称
     */
    public String getStaffName() {
        return staffName;
    }

    /**
     * 设置员工名称
     *
     * @param staffName 员工名称
     */
    public void setStaffName(String staffName) {
        this.staffName = staffName;
    }

    /**
     * 获取手机
     *
     * @return mobile_phone - 手机
     */
    public String getMobilePhone() {
        return mobilePhone;
    }

    /**
     * 设置手机
     *
     * @param mobilePhone 手机
     */
    public void setMobilePhone(String mobilePhone) {
        this.mobilePhone = mobilePhone;
    }

    /**
     * 获取日期
     *
     * @return work_date - 日期
     */
    public Date getWorkDate() {
        return workDate;
    }

    /**
     * 设置日期
     *
     * @param workDate 日期
     */
    public void setWorkDate(Date workDate) {
        this.workDate = workDate;
    }

    /**
     * 获取作品
     *
     * @return picture_file - 作品
     */
    public String getPictureFile() {
        return pictureFile;
    }

    /**
     * 设置作品
     *
     * @param pictureFile 作品
     */
    public void setPictureFile(String pictureFile) {
        this.pictureFile = pictureFile;
    }

    /**
     * 获取作品路径
     *
     * @return picture_file_path - 作品路径
     */
    public String getPictureFilePath() {
        return pictureFilePath;
    }

    /**
     * 设置作品路径
     *
     * @param pictureFilePath 作品路径
     */
    public void setPictureFilePath(String pictureFilePath) {
        this.pictureFilePath = pictureFilePath;
    }

    /**
     * 获取上传时间
     *
     * @return upload_time - 上传时间
     */
    public Date getUploadTime() {
        return uploadTime;
    }

    /**
     * 设置上传时间
     *
     * @param uploadTime 上传时间
     */
    public void setUploadTime(Date uploadTime) {
        this.uploadTime = uploadTime;
    }

    /**
     * 获取上传人
     *
     * @return upload_user - 上传人
     */
    public String getUploadUser() {
        return uploadUser;
    }

    /**
     * 设置上传人
     *
     * @param uploadUser 上传人
     */
    public void setUploadUser(String uploadUser) {
        this.uploadUser = uploadUser;
    }

    /**
     * 获取上传人手机号
     *
     * @return upload_telephone - 上传人手机号
     */
    public String getUploadTelephone() {
        return uploadTelephone;
    }

    /**
     * 设置上传人手机号
     *
     * @param uploadTelephone 上传人手机号
     */
    public void setUploadTelephone(String uploadTelephone) {
        this.uploadTelephone = uploadTelephone;
    }

    /**
     * 获取作品名称
     *
     * @return name - 作品名称
     */
    public String getName() {
        return name;
    }

    /**
     * 设置作品名称
     *
     * @param name 作品名称
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * 获取点赞数
     *
     * @return praise_num - 点赞数
     */
    public Integer getPraiseNum() {
        return praiseNum;
    }

    /**
     * 设置点赞数
     *
     * @param praiseNum 点赞数
     */
    public void setPraiseNum(Integer praiseNum) {
        this.praiseNum = praiseNum;
    }

    /**
     * 获取说明
     *
     * @return description - 说明
     */
    public String getDescription() {
        return description;
    }

    /**
     * 设置说明
     *
     * @param description 说明
     */
    public void setDescription(String description) {
        this.description = description;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        StaffWorks other = (StaffWorks) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getStaffId() == null ? other.getStaffId() == null : this.getStaffId().equals(other.getStaffId()))
            && (this.getStaffName() == null ? other.getStaffName() == null : this.getStaffName().equals(other.getStaffName()))
            && (this.getMobilePhone() == null ? other.getMobilePhone() == null : this.getMobilePhone().equals(other.getMobilePhone()))
            && (this.getWorkDate() == null ? other.getWorkDate() == null : this.getWorkDate().equals(other.getWorkDate()))
            && (this.getPictureFile() == null ? other.getPictureFile() == null : this.getPictureFile().equals(other.getPictureFile()))
            && (this.getPictureFilePath() == null ? other.getPictureFilePath() == null : this.getPictureFilePath().equals(other.getPictureFilePath()))
            && (this.getUploadTime() == null ? other.getUploadTime() == null : this.getUploadTime().equals(other.getUploadTime()))
            && (this.getUploadUser() == null ? other.getUploadUser() == null : this.getUploadUser().equals(other.getUploadUser()))
            && (this.getUploadTelephone() == null ? other.getUploadTelephone() == null : this.getUploadTelephone().equals(other.getUploadTelephone()))
            && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
            && (this.getPraiseNum() == null ? other.getPraiseNum() == null : this.getPraiseNum().equals(other.getPraiseNum()))
            && (this.getDescription() == null ? other.getDescription() == null : this.getDescription().equals(other.getDescription()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getStaffId() == null) ? 0 : getStaffId().hashCode());
        result = prime * result + ((getStaffName() == null) ? 0 : getStaffName().hashCode());
        result = prime * result + ((getMobilePhone() == null) ? 0 : getMobilePhone().hashCode());
        result = prime * result + ((getWorkDate() == null) ? 0 : getWorkDate().hashCode());
        result = prime * result + ((getPictureFile() == null) ? 0 : getPictureFile().hashCode());
        result = prime * result + ((getPictureFilePath() == null) ? 0 : getPictureFilePath().hashCode());
        result = prime * result + ((getUploadTime() == null) ? 0 : getUploadTime().hashCode());
        result = prime * result + ((getUploadUser() == null) ? 0 : getUploadUser().hashCode());
        result = prime * result + ((getUploadTelephone() == null) ? 0 : getUploadTelephone().hashCode());
        result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
        result = prime * result + ((getPraiseNum() == null) ? 0 : getPraiseNum().hashCode());
        result = prime * result + ((getDescription() == null) ? 0 : getDescription().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(", staffId=").append(staffId);
        sb.append(", staffName=").append(staffName);
        sb.append(", mobilePhone=").append(mobilePhone);
        sb.append(", workDate=").append(workDate);
        sb.append(", pictureFile=").append(pictureFile);
        sb.append(", pictureFilePath=").append(pictureFilePath);
        sb.append(", uploadTime=").append(uploadTime);
        sb.append(", uploadUser=").append(uploadUser);
        sb.append(", uploadTelephone=").append(uploadTelephone);
        sb.append(", name=").append(name);
        sb.append(", praiseNum=").append(praiseNum);
        sb.append(", description=").append(description);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}