package com.szpg.db.data;

import java.util.Date;

import com.szpg.util.TimeFormat;

/**
 * 氧气浓度值监测数据表
 * 
 * @author admin
 *
 */
public class PgO2 implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -975909697697886705L;
	
	private Integer id;
	private Float o2;
	private Date logtime;
	private Date uptime;
	private Integer pgdeviceid;

	public Integer getId() {
		return id;
	}

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

	public Float getO2() {
		return o2;
	}

	public void setO2(Float o2) {
		this.o2 = o2;
	}

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