package com.ywt.outpatient.domain.entity.center;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;

@Entity
@Table(name = "user_unions")
public class UserUnions {

    /**
     * type = 1时，药商代表关联，后面统一更改成经销商，在drug_provider表里处理经销商的关系了，现在type=1的记录已经作废了
     *
     * type = 2时，user_id ：经销商ID， union_user_id ：医生ID    应用场景：经销商通过二维码邀请医生
     *
     * type = 3时，user_id ：医生ID，   union_user_id ：患者ID    应用场景：医生通过二维码邀请患者
     *
     * type = 4时，user_id ：患者ID，   union_user_id ：医生ID    应用场景：患者点击关注医生
     */

    /**
     * 主键
     */
    @Id
    private Integer id;

    /**
     * 用户ID，对应user表ID，角色可为医生，药商，代表
     */
    @Column(name = "user_id", nullable = false)
    private Integer userId;

    /**
     * 关联ID，对应user表ID，角色可为医生，代表，患者
     */
    @Column(name = "union_user_id", nullable = false)
    private Integer unionUserId;

    /**
     * 1-药商代表关联，2-药商、代表和医生关联，3-医生和患者关联,4-患者关注医生
     */
    @Column(name = "type", nullable = false)
    private Integer type;

    /**
     * 0-启用，1-禁用
     */
    @Column(name = "status", nullable = false)
    private Integer status;

    /**
     * 是否删除
     */
    @Column(name = "deleted", nullable = false)
    private Boolean deleted;

    /**
     * 创建时间
     */
    @Column(name = "create_time", nullable = false)
    private Date createTime;

    /**
     * 修改时间
     */
    @Column(name = "update_time", nullable = false)
    private Date updateTime;

    /**
     * 患者和医生关联中是否发生过处方业务：0-无，1-有
     */
    @Column(name = "has_presc", nullable = false)
    private int hasPresc;

    /**
     * 适用于type=2,用于判断医生扫码经销商的时候是否填写基本信息,0-没有填写，1-填写
     */
    @Column(name = "base_status")
    private Integer baseStatus;

    public Integer getId() {
        return id;
    }

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

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public Integer getUnionUserId() {
        return unionUserId;
    }

    public void setUnionUserId(Integer unionUserId) {
        this.unionUserId = unionUserId;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Boolean getDeleted() {
        return deleted;
    }

    public void setDeleted(Boolean deleted) {
        this.deleted = deleted;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public int getHasPresc() {
        return hasPresc;
    }

    public void setHasPresc(int hasPresc) {
        this.hasPresc = hasPresc;
    }
    public Integer getBaseStatus() {
        return baseStatus;
    }

    public void setBaseStatus(Integer baseStatus) {
        this.baseStatus = baseStatus;
    }
}
