package com.szpg.db.data;

import java.util.Date;

import com.szpg.util.TimeFormat;

/**
 * 水泵运行状态数据表
 * 
 * @author admin
 *
 */
public class PgSbStat implements java.io.Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -7911323818400671285L;
	
	private Integer id;
	private Date logtime;
	private Date uptime;
	private Integer pgdeviceid;
	private Boolean run1; //水泵1运行状态
	private Boolean run2; //水泵2运行状态
	private Boolean flt1; //水泵1故障报警
	private Boolean flt2; //水泵2故障报警

	public Integer getId() {
		return id;
	}

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

	public Date getLogtime() {
		return logtime;
	}

	public void setLogtime(Date logtime) {
		this.logtime = logtime;
	}

	public Date getUptime() {
		return uptime;
	}

	public void setUptime(Date uptime) {
		this.uptime = uptime;
	}
	
	public Integer getPgdeviceid() {
		return pgdeviceid;
	}

	public void setPgdeviceid(Integer pgdeviceid) {
		this.pgdeviceid = pgdeviceid;
	}

	public Boolean getRun1() {
		return run1;
	}

	public void setRun1(Boolean run1) {
		this.run1 = run1;
	}

	public Boolean getRun2() {
		return run2;
	}

	public void setRun2(Boolean run2) {
		this.run2 = run2;
	}

	public Boolean getFlt1() {
		return flt1;
	}

	public void setFlt1(Boolean flt1) {
		this.flt1 = flt1;
	}

	public Boolean getFlt2() {
		return flt2;
	}

	public void setFlt2(Boolean flt2) {
		this.flt2 = flt2;
	}

	public void setTm(Date tm) {
		this.logtime = tm;
		this.uptime = tm;
	}
	
	public String getTmStr() {
		if (null != this.logtime) {
			return TimeFormat.formatTimestamp(logtime);
		} else {
			return "";
		}
	}
	
	public String getTmStrGB() {
		if (null != this.logtime) {
			return TimeFormat.format(logtime, "yyyyMMddHHmmss");
		} else {
			return "";
		}
	}

	@Override
	public String toString() {
		return "PgSbStat[run=" + run1 + "/" + run2 + ", flt=" + flt1 + "/" + flt2 + ", logtime=" + TimeFormat.formatTimestamp(logtime) + "]";
	}
}
