package com.szpg.db.data;

import java.util.Date;

import com.szpg.util.NumberFormat;
import com.szpg.util.TimeFormat;

/**
 * 水泵累计运行时长数据表
 * 
 * @author admin
 *
 */
public class PgSbRt implements java.io.Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -4326181749162467939L;
	
	private Integer id;
	private Date logtime;
	private Date uptime;
	private Integer pgdeviceid;
	private Integer runsecond1;
	private Integer runsecond2;
	private Integer runhour1;
	private Integer runhour2;

	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 Integer getRunsecond1() {
		return runsecond1;
	}

	public void setRunsecond1(Integer runsecond1) {
		this.runsecond1 = runsecond1;
	}

	public Integer getRunsecond2() {
		return runsecond2;
	}

	public void setRunsecond2(Integer runsecond2) {
		this.runsecond2 = runsecond2;
	}

	public Integer getRunhour1() {
		return runhour1;
	}

	public void setRunhour1(Integer runhour1) {
		this.runhour1 = runhour1;
	}

	public Integer getRunhour2() {
		return runhour2;
	}

	public void setRunhour2(Integer runhour2) {
		this.runhour2 = runhour2;
	}

	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 "";
		}
	}
	
	public String getAccRunTime1() {
		return NumberFormat.format(runhour1 + runsecond1 / 3600, "0.00");
	}
	
	public String getAccRunTime2() {
		return NumberFormat.format(runhour2 + runsecond2 / 3600, "0.00");
	}

	@Override
	public String toString() {
		return "PgFjRt[acc=" + getAccRunTime1() + "/" + getAccRunTime2() + ", logtime=" + TimeFormat.formatTimestamp(logtime) + "]";
	}
}
