package com.casic.PgInterface.patroler.domain;

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

/**
 * Created by yxw on 2018/3/22.
 */
@Entity
@Table(name = "PG_INPG_PERSON")
@SequenceGenerator(name = "SEQ_PG_INPG_PERSON_ID", sequenceName = "SEQ_PG_INPG_PERSON_ID",allocationSize=1,initialValue=1)
public class PgInPgPerson implements Serializable {

    private static final long serialVersionUID = 1L;
    private long id;
    private String userName;//入廊人员
    private String userCode;//人员编号
    private String phoneNumber;//联系方式
    private String personType;//人员类别:工作人员、临时人员
    private int isInPg;//是否在廊内
    private String assetCode;//资产编号
    private List<PgInPgStatus> pgInPgStatuses;

    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_INPG_PERSON_ID")
    public long getId() {
        return id;
    }

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

    @Column(name = "USERNAME")
    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    @Column(name = "USERCODE")
    public String getUserCode() {
        return userCode;
    }

    public void setUserCode(String userCode) {
        this.userCode = userCode;
    }

    @Column(name = "PHONENUMBER")
    public String getPhoneNumber() {
        return phoneNumber;
    }

    public void setPhoneNumber(String phoneNumber) {
        this.phoneNumber = phoneNumber;
    }

    @Column(name = "PERSONTYPE")
    public String getPersonType() {
        return personType;
    }

    public void setPersonType(String personType) {
        this.personType = personType;
    }

    @Column(name = "ISINPG")
    public int getIsInPg() {
        return isInPg;
    }

    public void setIsInPg(int isInPg) {
        this.isInPg = isInPg;
    }

    @Column(name = "ASSETCODE")
    public String getAssetCode() {
        return assetCode;
    }

    public void setAssetCode(String assetCode) {
        this.assetCode = assetCode;
    }
    
    @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgInPgPersonId")
    public List<PgInPgStatus> getPgInPgStatuses() {
        return pgInPgStatuses;
    }

    public void setPgInPgStatuses(List<PgInPgStatus> pgInPgStatuses) {
        this.pgInPgStatuses = pgInPgStatuses;
    }

}