package com.casic.PgInterface.devTable.domain;

import com.casic.PgInterface.devData.domain.*;

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

/**
 * Created by yxw on 2017/12/29.
 */
@Entity
@Table(name = "PG_DEVICE")
@SequenceGenerator(name = "SEQ_PG_DEVICE_ID", sequenceName = "SEQ_PG_DEVICE_ID", allocationSize = 1, initialValue = 1)
public class PgDevice implements Serializable {
    private static final long serialVersionUID = 1L;

    private long id;
    private String partition;//分区
    private String road;//路名
    private String pipeGallery;//仓位
    private String position;//设备位置
    private String devType;//设备类型
    private String devCode;//设备编号
    private String assetName;//资产名称
    private String assetCode;//资产编号
    private String assetBarCode;//资产条码
    private String ip;//IP地址
    private String modBus;//modBus地址
    private String mome;//备注
    private int isOpen;//设备开启状态
    private int active;//状态位

    private List<PgAlarm> pgAlarms;
    private List<PgCh4> pgCh4s;
    private List<PgCo> pgCos;
    private List<PgO2> pgO2s;
    private List<PgSh> pgShs;
    private List<PgTempHum> pgTempHums;

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

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

    @Column(name = "PARTITION")
    public String getPartition() {
        return partition;
    }

    public void setPartition(String partition) {
        this.partition = partition;
    }

    @Column(name = "ROAD")
    public String getRoad() {
        return road;
    }

    public void setRoad(String road) {
        this.road = road;
    }

    @Column(name = "PIPEGALLERY")
    public String getPipeGallery() {
        return pipeGallery;
    }

    public void setPipeGallery(String pipeGallery) {
        this.pipeGallery = pipeGallery;
    }

    @Column(name = "POSITION")
    public String getPosition() {
        return position;
    }

    public void setPosition(String position) {
        this.position = position;
    }

    @Column(name = "DEVTYPE")
    public String getDevType() {
        return devType;
    }

    public void setDevType(String devType) {
        this.devType = devType;
    }

    @Column(name = "DEVCODE")
    public String getDevCode() {
        return devCode;
    }

    public void setDevCode(String devCode) {
        this.devCode = devCode;
    }

    @Column(name = "ASSETNAME")
    public String getAssetName() {
        return assetName;
    }

    public void setAssetName(String assetName) {
        this.assetName = assetName;
    }

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

    public void setAssetCode(String assetCode) {
        this.assetCode = assetCode;
    }

    @Column(name = "ASSETBARCODE")
    public String getAssetBarCode() {
        return assetBarCode;
    }

    public void setAssetBarCode(String assetBarCode) {
        this.assetBarCode = assetBarCode;
    }

    @Column(name = "IP")
    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    @Column(name = "MODBUS")
    public String getModBus() {
        return modBus;
    }

    public void setModBus(String modBus) {
        this.modBus = modBus;
    }

    @Column(name = "MOME")
    public String getMome() {
        return mome;
    }

    public void setMome(String mome) {
        this.mome = mome;
    }

    @Column(name = "ISOPEN")
    public int getIsOpen() {
        return isOpen;
    }

    public void setIsOpen(int isOpen) {
        this.isOpen = isOpen;
    }

    @Column(name = "ACTIVE")
    public int getActive() {
        return active;
    }

    public void setActive(int active) {
        this.active = active;
    }

    @OneToMany(fetch = FetchType.LAZY, mappedBy = "alarmDevId")
    public List<PgAlarm> getPgAlarms() {
        return pgAlarms;
    }

    public void setPgAlarms(List<PgAlarm> pgAlarms) {
        this.pgAlarms = pgAlarms;
    }

    @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgDeviceId")
    public List<PgCh4> getPgCh4s() {
        return pgCh4s;
    }

    public void setPgCh4s(List<PgCh4> pgCh4s) {
        this.pgCh4s = pgCh4s;
    }

    @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgDeviceId")
    public List<PgCo> getPgCos() {
        return pgCos;
    }

    public void setPgCos(List<PgCo> pgCos) {
        this.pgCos = pgCos;
    }

    @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgDeviceId")
    public List<PgO2> getPgO2s() {
        return pgO2s;
    }

    public void setPgO2s(List<PgO2> pgO2s) {
        this.pgO2s = pgO2s;
    }

    @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgDeviceId")
    public List<PgSh> getPgShs() {
        return pgShs;
    }

    public void setPgShs(List<PgSh> pgShs) {
        this.pgShs = pgShs;
    }

    @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgDeviceId")
    public List<PgTempHum> getPgTempHums() {
        return pgTempHums;
    }

    public void setPgTempHums(List<PgTempHum> pgTempHums) {
        this.pgTempHums = pgTempHums;
    }
}