package cn.estsh.i3plus.pojo.ptl.bean;

import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;

/**
 * @Description:
 * @Reference:
 * @Author: adair.song
 * @CreateDate:2019-04-22-17:20
 * @Modify:
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name = "PTL_PCN")
@Api("PCN节点")
public class PtlPcn extends BaseBean implements Serializable {

    private static final long serialVersionUID = -4320051898730968719L;

    @Column(name = "PCN_CODE")
    @ApiParam("PCN代码")
    private String pcnCode;

    @Column(name = "PCN_NAME")
    @ApiParam("PCN节点名称")
    private String pcnName;

    @Column(name = "AREA_NO")
    @ApiParam("区域")
    private String areaNo;

    @Column(name = "AREA_NAME")
    @ApiParam("区域名称")
    private String areaName;

    @Column(name = "PCN_VERSION")
    @ApiParam("PCN版本")
    private String pcnVersion;

    @Column(name = "CONNECT_IP")
    @ApiParam("连接IP")
    private String connectIp;

    @Column(name = "CONNECT_COUNT")
    @ApiParam("连接次数")
    private Integer connectCount;

    @Column(name = "IS_CONNECT")
    @ApiParam("是否连接")
    private Integer isConnect;

    @Column(name = "CONNECT_TIME")
    @ApiParam("连接时间")
    private String connectTime;

    @Column(name = "CODE_SPECIFIC")
    @ApiParam("编码规则特殊符")
    private String codeSpecific;

    public int getConnectCountVal() {
        return this.connectCount == null ? 0 : this.connectCount;
    }

    public int getIsConnectVal() {
        return this.isConnect == null ? 0 : this.isConnect;
    }
}
