package com.szpg.db.dao;

import java.util.List;

import com.szpg.db.data.PgSbRt;
import com.szpg.db.data.PgSbStat;

/**
 * 水泵运行相关参数读写的数据库接口
 * @author admin
 *
 */
public interface PgSbDao {

	/******** 水泵累计运行时长 ********/
	public PgSbRt findLatestRtByDevice(Integer deviceid);
	
	public int addRtRecord(PgSbRt sbrt);
	public int addRtRecord(int second1, int hour1, String tm, int deviceid);
	public int addRtRecord(int second1, int hour1, int second2, int hour2, String tm, int deviceid);
	
	
	/******** 水泵运行状态 ********/
	public List<PgSbStat> findAllStat();
	public PgSbStat findStatById(Integer id);
	
	public List<PgSbStat> findStatByDevice(Integer deviceid);
	public List<PgSbStat> findStatByDeviceAndTm(Integer deviceid, String start, String end);
	public PgSbStat findLatestStatByDevice(Integer deviceid);
	
	public int addStatRecord(PgSbStat sbstat);
	public int addStatRecord(boolean run1, boolean flt1, String tm, int deviceid);
	public int addStatRecord(boolean run1, boolean run2, boolean flt1, boolean flt2, String tm, int deviceid);
}
