package com.szpg.db.data;

import java.io.Serializable;
import java.util.Date;

import com.szpg.util.TimeFormat;

public class PgTemphum implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -7715056787429107538L;
	
	private Integer id;
	private Float hum;
	private Float temp;
	private Date logtime;
	private Date uptime;
	private Integer pgdeviceid;

	public Integer getId() {
		return id;
	}

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

	public Float getHum() {
		return hum;
	}

	public void setHum(Float hum) {
		this.hum = hum;
	}

	public Float getTemp() {
		return temp;
	}

	public void setTemp(Float temp) {
		this.temp = temp;
	}

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