package com.hssx.pcbms.entity;

import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;

import java.time.LocalDateTime;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;

import java.io.Serializable;

/**
 * <p>
 *
 * </p>
 *
 * @author 吴涛涛
 * @since 2019-11-07
 */
public class Idea extends Model<Idea> {

    private static final long serialVersionUID = 1L;

    /**
     * 建议表主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 用户id
     */
    @TableField("uid")
    private Integer uid;

    /**
     * 发表时间
     */
    @TableField("indate")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime indate;

    /**
     * 建议内容
     */
    @TableField("content")
    private String content;

    /**
     * 得分
     */
    @TableField("score")
    private Double score;

    /**
     * 是否是草稿0-不是 1-是
     */
    @TableField("is_draft")
    private Integer isDraft;

    /**
     * 是否已评分 0-否 1-是
     */
    @TableField("is_evaluated")
    private Integer isEvaluated;

    /**
     * 评分外键
     * strategy = FieldStrategy.IGNORED,忽略全局配置策略，可以忽略全局配置的非null更新
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED,value = "score_id")
    private Integer scoreId;


    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getUid() {
        return uid;
    }

    public void setUid(Integer uid) {
        this.uid = uid;
    }

    public LocalDateTime getIndate() {
        return indate;
    }

    public void setIndate(LocalDateTime indate) {
        this.indate = indate;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Double getScore() {
        return score;
    }

    public void setScore(Double score) {
        this.score = score;
    }

    public Integer getIsDraft() {
        return isDraft;
    }

    public void setIsDraft(Integer isDraft) {
        this.isDraft = isDraft;
    }

    public Integer getIsEvaluated() {
        return isEvaluated;
    }

    public void setIsEvaluated(Integer isEvaluated) {
        this.isEvaluated = isEvaluated;
    }

    public Integer getScoreId() {
        return scoreId;
    }

    public void setScoreId(Integer scoreId) {
        this.scoreId = scoreId;
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "Idea{" +
                "id=" + id +
                ", uid=" + uid +
                ", indate=" + indate +
                ", content=" + content +
                ", score=" + score +
                ", isDraft=" + isDraft +
                ", isEvaluated=" + isEvaluated +
                ", scoreId=" + scoreId +
                "}";
    }
}
