package com.ann.demo.entity.interfaceEntity;

import com.ann.demo.entity.interfaceEntity.ids.CommonTableIds;
import lombok.Data;
import org.hibernate.annotations.GenericGenerator;

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

/**
 * @Author: LeiJiaXin
 * @Date: 2019/8/6 9:44
 */
@Data
@Entity
@Table(name = "commomtable")
@IdClass(CommonTableIds.class)
public class CommonTable {

    /**
     * masterId
     */
    @Id
    @Column(name = "patient_id")
//    @GenericGenerator(name = "system-uuid", strategy = "uuid2")
//    @GeneratedValue(generator = "system-uuid")
    private String masterId;

    /**
     * 3 患者ID 病案号
     */
    @Column(name = "admiss_id", length = 30)
    private String patientId;

    /**
     * 年龄 (岁)
     */
    @Column(name = "age")
    private Integer age;

    /**
     * 6 性别
     */
    @Column(name = "sex")
    private String sex;


    /**
     * 14 住院次数
     */
    @Id
    @Column(name = "admiss_times", length = 10)
    private String visitId;

    /**
     * 16 姓名
     */
    @Id
    @Column(name = "name", length = 20)
    private String name;

    /**
     * 88 入院时间
     */
    @Column(name = "admiss_date")
    private Date admissDate;

    /**
     * 89 出院时间
     */
    @Column(name = "dis_Date")
    private Date disDate;


    /**
     * 90 出院科别
     */
    @Column(name = "dis_Dept")
    private String disDept;
    /**
     *  103 主治医师
     */
    @Column(name = "attending")
    private String attending;

    /**
     * 住院号
     */
    @Id
    @Column(name = "inpatient_no", length = 30)
    private String inpNo;

    @Column(name = "remark")
    private String remark;


    public CommonTable(String masterId,String patientId, Integer age, String sex, String visitId, String name, Date admissDate, Date disDate, String disDept, String attending, String inpNo,String remark) {
        this.masterId = masterId;
        this.patientId = patientId;
        this.age = age;
        this.sex = sex;
        this.visitId = visitId;
        this.name = name;
        this.admissDate = admissDate;
        this.disDate = disDate;
        this.disDept = disDept;
        this.attending = attending;
        this.inpNo = inpNo;
        this.remark = remark;
    }

    public CommonTable() {
    }
}
