package com.qxgmat.data.dao.entity;

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

@Table(name = "stat_day")
public class StatDay implements Serializable {
    @Id
    @Column(name = "`id`")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;

    /**
     * 用户id
     */
    @Column(name = "`user_id`")
    private Integer userId;

    /**
     * 统计项：exericse,examination
     */
    @Column(name = "`key`")
    private String key;

    /**
     * 时间
     */
    @Column(name = "`time`")
    private Integer time;

    @Column(name = "`create_time`")
    private Date createTime;

    private static final long serialVersionUID = 1L;

    /**
     * @return id
     */
    public Integer getId() {
        return id;
    }

    /**
     * @param id
     */
    public void setId(Integer id) {
        this.id = id;
    }

    /**
     * 获取用户id
     *
     * @return user_id - 用户id
     */
    public Integer getUserId() {
        return userId;
    }

    /**
     * 设置用户id
     *
     * @param userId 用户id
     */
    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    /**
     * 获取统计项：exericse,examination
     *
     * @return key - 统计项：exericse,examination
     */
    public String getKey() {
        return key;
    }

    /**
     * 设置统计项：exericse,examination
     *
     * @param key 统计项：exericse,examination
     */
    public void setKey(String key) {
        this.key = key;
    }

    /**
     * 获取时间
     *
     * @return time - 时间
     */
    public Integer getTime() {
        return time;
    }

    /**
     * 设置时间
     *
     * @param time 时间
     */
    public void setTime(Integer time) {
        this.time = time;
    }

    /**
     * @return create_time
     */
    public Date getCreateTime() {
        return createTime;
    }

    /**
     * @param createTime
     */
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @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(", userId=").append(userId);
        sb.append(", key=").append(key);
        sb.append(", time=").append(time);
        sb.append(", createTime=").append(createTime);
        sb.append("]");
        return sb.toString();
    }

    public static StatDay.Builder builder() {
        return new StatDay.Builder();
    }

    public static class Builder {
        private StatDay obj;

        public Builder() {
            this.obj = new StatDay();
        }

        /**
         * @param id
         */
        public Builder id(Integer id) {
            obj.setId(id);
            return this;
        }

        /**
         * 设置用户id
         *
         * @param userId 用户id
         */
        public Builder userId(Integer userId) {
            obj.setUserId(userId);
            return this;
        }

        /**
         * 设置统计项：exericse,examination
         *
         * @param key 统计项：exericse,examination
         */
        public Builder key(String key) {
            obj.setKey(key);
            return this;
        }

        /**
         * 设置时间
         *
         * @param time 时间
         */
        public Builder time(Integer time) {
            obj.setTime(time);
            return this;
        }

        /**
         * @param createTime
         */
        public Builder createTime(Date createTime) {
            obj.setCreateTime(createTime);
            return this;
        }

        public StatDay build() {
            return this.obj;
        }
    }
}