package com.rf.psychological.scale.dao.model;

import com.rf.psychological.base.model.BaseEntity;
import com.rf.psychological.security.EncryptDecodeConverter;
import lombok.*;

import javax.persistence.Column;
import javax.persistence.Convert;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * @author zzf
 * @description:量表和认知任务列表
 * @date 2021/5/17 9:25
 */
@Entity
@EqualsAndHashCode(callSuper=false)
@Data
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "t_subject_info")
@org.hibernate.annotations.Table(appliesTo = "t_subject_info", comment = "量表和认知任务列表信息表")
public class SubjectEntity extends BaseEntity {

    @Column(name = "no", columnDefinition = "int(10) comment '编号，用于排序'")
    private int no;

    @Column(name = "flag", columnDefinition = "varchar(50) comment '查询标志'")
    private String flag;

    @Column(name = "name", columnDefinition = "varchar(255) comment '量表/认知任务名称'")
    private String name;

    @Column(name = "type", columnDefinition = "varchar(10) comment '类型：0-量表；1-认知任务'")
    private String type;

    @Convert(converter = EncryptDecodeConverter.class)
    @Column(name = "description", columnDefinition = "text comment'描述文字信息'")
    private String description;

    @Column(name = "is_hot", columnDefinition = "varchar(1) comment '是否热门测试'")
    private String isHot;

    @Column(name = "test_num", columnDefinition = "int(10) comment '测试次数'")
    private int testNum;

    @Column(name = "is_new", columnDefinition = "varchar(1) comment '最新测试'")
    private int isNew;

    @Column(name = "image_url", columnDefinition = "varchar(200) comment '图片路径'")
    private String imageUrl;

    @Column(name = "uploader", columnDefinition = "varchar(50) comment '上传人'")
    private String uploader;

    @Column(name = "ename", columnDefinition = "varchar(255) comment '量表英文名称'")
    private String eName;

    @Column(name = "file_name", columnDefinition = "varchar(50) comment '量表文件名称'")
    private String fileName;

    @Column(name = "scoring_principle", columnDefinition = "text comment '计分原则'")
    private String scoringPrinciple;

    @Column(name = "status", columnDefinition = "varchar(1) comment '状态：0-可用(未检测)；1-不可用;2-通过；3-未通过'")
    private int status;

    @Column(name = "scale_limit", columnDefinition = "varchar(10) comment '量表权限:private 私密  public 公开'")
    private String scaleLimit;

    @Column(name = "men",columnDefinition = "varchar(20) comment '适用人群 ：0 全部  1 儿童 2 小学生 3中学及以上 4军警 5老年人'")
    private String men;

    @Column(name = "icon_info", columnDefinition = "varchar(10) default '无' comment '图表信息(若量表需要展示图表，不展示则显示无)'")
    private String iconInfo;

    @Column(name = "report_version", columnDefinition = "int default 1 comment '报告版本信息，默认为1---第一版本报告，详见SubjectConstant.class'")
    private Integer reportVersion;

    @Column(name = "reference", columnDefinition = "varchar(1000) comment '参考文献'")
    private String reference;

    @Column(name = "report_reference", columnDefinition = "varchar(1000) comment '报告参考文献'")
    private String reportReference;

    @Column(name = "report_keyboarder", columnDefinition = "varchar(50) comment '报告录入人'")
    private String reportKeyboarder;
}
