package com.qxgmat.data.dao.entity;

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

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

    /**
     * 题目编号：人工
     */
    @Column(name = "`no`")
    private String no;

    /**
     * 机经版本：关联换库表
     */
    @Column(name = "`version`")
    private String version;

    /**
     * 题目id
     */
    @Column(name = "`question_id`")
    private Integer questionId;

    /**
     * 学科
     */
    @Column(name = "`category`")
    private Integer category;

    /**
     * 总做题时间
     */
    @Column(name = "`total_time`")
    private Integer totalTime;

    /**
     * 总做题次数
     */
    @Column(name = "`total_number`")
    private Integer totalNumber;

    /**
     * 总正确次数
     */
    @Column(name = "`total_correct`")
    private Integer totalCorrect;

    private static final long serialVersionUID = 1L;

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

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

    /**
     * 获取题目编号：人工
     *
     * @return no - 题目编号：人工
     */
    public String getNo() {
        return no;
    }

    /**
     * 设置题目编号：人工
     *
     * @param no 题目编号：人工
     */
    public void setNo(String no) {
        this.no = no;
    }

    /**
     * 获取机经版本：关联换库表
     *
     * @return version - 机经版本：关联换库表
     */
    public String getVersion() {
        return version;
    }

    /**
     * 设置机经版本：关联换库表
     *
     * @param version 机经版本：关联换库表
     */
    public void setVersion(String version) {
        this.version = version;
    }

    /**
     * 获取题目id
     *
     * @return question_id - 题目id
     */
    public Integer getQuestionId() {
        return questionId;
    }

    /**
     * 设置题目id
     *
     * @param questionId 题目id
     */
    public void setQuestionId(Integer questionId) {
        this.questionId = questionId;
    }

    /**
     * 获取学科
     *
     * @return category - 学科
     */
    public Integer getCategory() {
        return category;
    }

    /**
     * 设置学科
     *
     * @param category 学科
     */
    public void setCategory(Integer category) {
        this.category = category;
    }

    /**
     * 获取总做题时间
     *
     * @return total_time - 总做题时间
     */
    public Integer getTotalTime() {
        return totalTime;
    }

    /**
     * 设置总做题时间
     *
     * @param totalTime 总做题时间
     */
    public void setTotalTime(Integer totalTime) {
        this.totalTime = totalTime;
    }

    /**
     * 获取总做题次数
     *
     * @return total_number - 总做题次数
     */
    public Integer getTotalNumber() {
        return totalNumber;
    }

    /**
     * 设置总做题次数
     *
     * @param totalNumber 总做题次数
     */
    public void setTotalNumber(Integer totalNumber) {
        this.totalNumber = totalNumber;
    }

    /**
     * 获取总正确次数
     *
     * @return total_correct - 总正确次数
     */
    public Integer getTotalCorrect() {
        return totalCorrect;
    }

    /**
     * 设置总正确次数
     *
     * @param totalCorrect 总正确次数
     */
    public void setTotalCorrect(Integer totalCorrect) {
        this.totalCorrect = totalCorrect;
    }

    @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(", no=").append(no);
        sb.append(", version=").append(version);
        sb.append(", questionId=").append(questionId);
        sb.append(", category=").append(category);
        sb.append(", totalTime=").append(totalTime);
        sb.append(", totalNumber=").append(totalNumber);
        sb.append(", totalCorrect=").append(totalCorrect);
        sb.append("]");
        return sb.toString();
    }

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

    public static class Builder {
        private TextbookQuestion obj;

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

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

        /**
         * 设置题目编号：人工
         *
         * @param no 题目编号：人工
         */
        public Builder no(String no) {
            obj.setNo(no);
            return this;
        }

        /**
         * 设置机经版本：关联换库表
         *
         * @param version 机经版本：关联换库表
         */
        public Builder version(String version) {
            obj.setVersion(version);
            return this;
        }

        /**
         * 设置题目id
         *
         * @param questionId 题目id
         */
        public Builder questionId(Integer questionId) {
            obj.setQuestionId(questionId);
            return this;
        }

        /**
         * 设置学科
         *
         * @param category 学科
         */
        public Builder category(Integer category) {
            obj.setCategory(category);
            return this;
        }

        /**
         * 设置总做题时间
         *
         * @param totalTime 总做题时间
         */
        public Builder totalTime(Integer totalTime) {
            obj.setTotalTime(totalTime);
            return this;
        }

        /**
         * 设置总做题次数
         *
         * @param totalNumber 总做题次数
         */
        public Builder totalNumber(Integer totalNumber) {
            obj.setTotalNumber(totalNumber);
            return this;
        }

        /**
         * 设置总正确次数
         *
         * @param totalCorrect 总正确次数
         */
        public Builder totalCorrect(Integer totalCorrect) {
            obj.setTotalCorrect(totalCorrect);
            return this;
        }

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