package com.szpg.db.data;

import java.util.Date;

import com.szpg.util.TimeFormat;

/**
 * 甲烷浓度报警状态数据表
 * 
 * @author admin
 *
 */
public class PgCh4Alm implements java.io.Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -109172405679187040L;
	
	private Integer id;
	private Boolean ch4alm;
	private Date logtime;
	private Date uptime;
	private Integer pgdeviceid;

	public Integer getId() {
		return id;
	}

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

	public Boolean getCh4alm() {
		return ch4alm;
	}

	public void setCh4alm(Boolean ch4alm) {
		this.ch4alm = ch4alm;
	}

	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 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 "PgCh4[ch4=" + ch4alm + ", logtime=" + TimeFormat.formatTimestamp(logtime) + "]";
	}
}
