package com.njcn.pojo.responsibility;

import com.njcn.utils.PubUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable;
import java.util.Date;

/**
 * @author hongawen
 * @Date: 2019/5/5 13:59
 */
@Table(name="pqs_responsibilityData")
public class ResponsibilityData implements Serializable {
    private static final Logger logger = LoggerFactory.getLogger(ResponsibilityData.class);
    @Id
    @Column(name="res_index")
    private String resIndex;

    @Column(name="gd_name")
    private String gdName;

    @Column(name="sub_name")
    private String subName;

    @Column(name="dev_name")
    private String devName;

    private String ip;

    @Column(name="line_name")
    private String lineName;

    @Column(name="res_type")
    private String resType;

    @Column(name="res_times")
    private String resTimes;



    @Column(name="user_data")
    private String userData;

    private Date updateTime;

    @Transient
    private String time;

    private String timeWin;

    private String lineIndex;

    public String getResIndex() {
        return resIndex;
    }

    public void setResIndex(String resIndex) {
        this.resIndex = resIndex;
    }

    public String getGdName() {
        return gdName;
    }

    public void setGdName(String gdName) {
        this.gdName = gdName;
    }

    public String getSubName() {
        return subName;
    }

    public void setSubName(String subName) {
        this.subName = subName;
    }

    public String getDevName() {
        return devName;
    }

    public void setDevName(String devName) {
        this.devName = devName;
    }

    public String getIp() {
        return ip;
    }

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

    public String getLineName() {
        return lineName;
    }

    public void setLineName(String lineName) {
        this.lineName = lineName;
    }

    public String getResType() {
        return resType;
    }

    public void setResType(String resType) {
        this.resType = resType;
    }

    public String getResTimes() {
        return resTimes;
    }

    public void setResTimes(String resTimes) {
        this.resTimes = resTimes;
    }

    public String getUserData() {
        return userData;
    }

    public void setUserData(String userData) {
        this.userData = userData;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
        try {
            this.time=PubUtils.date2String(updateTime,"yyyy-MM-dd HH:mm:ss");
        } catch (Exception e) {
            logger.error("时间转化发生异常，异常是"+e.getMessage());
        }
    }

    public String getTimeWin() {
        return timeWin;
    }

    public void setTimeWin(String timeWin) {
        this.timeWin = timeWin;
    }

    public String getLineIndex() {
        return lineIndex;
    }

    public void setLineIndex(String lineIndex) {
        this.lineIndex = lineIndex;
    }

    public String getTime() {
        return time;
    }

    public void setTime(String time) {
        this.time = time;
    }

    @Override
    public String toString() {
        return "ResponsibilityData{" +
                "resIndex='" + resIndex + '\'' +
                ", gdName='" + gdName + '\'' +
                ", subName='" + subName + '\'' +
                ", devName='" + devName + '\'' +
                ", ip='" + ip + '\'' +
                ", lineName='" + lineName + '\'' +
                ", resType='" + resType + '\'' +
                ", resTimes='" + resTimes + '\'' +
                ", userData='" + userData + '\'' +
                ", updateTime=" + updateTime +
                ", timeWin='" + timeWin + '\'' +
                ", lineIndex='" + lineIndex + '\'' +
                '}';
    }
}
