package cn.yw.video.recordalarm.service;


import cn.base.bean.BaseService;
import cn.yw.video.recordalarm.dao.YwrecordcurrentstateDao;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

@Service("ywrecordcurrentstateService")
public class YwrecordcurrentstateService extends BaseService {
	
	private static Log log = LogFactory.getLog(YwrecordcurrentstateService.class);
	
	@Autowired
	private YwrecordcurrentstateDao ywrecordcurrentstateDao;
	
	
	/**
	 * 查询总数
	 */
	
	public Integer count_Ywrecordcurrentstate(Map map) throws SQLException{
		return ywrecordcurrentstateDao.count_Ywrecordcurrentstate(map);
	}
	
	
	/**
	 * 查询列表记录SELECT
	 */
	
	public List<Map> query_Ywrecordcurrentstate(Map map) throws SQLException{
		return ywrecordcurrentstateDao.query_Ywrecordcurrentstate(map);
	}
	
	
	/**
	 * 查询一条
	 */
	 
	
	public Map get_Ywrecordcurrentstate(Map map) throws SQLException{
		return ywrecordcurrentstateDao.get_Ywrecordcurrentstate(map);
	}
	
	
	
	
	/**
	 * Ywrecordcurrentstate 分页
	 */
	
	public Map listYwrecordcurrentstateByPage(Map map) throws SQLException {
		List<Map> list = ywrecordcurrentstateDao.query_Ywrecordcurrentstate(map);
		Integer totalCount = ywrecordcurrentstateDao.count_Ywrecordcurrentstate(map);
		map.clear();
		map.put("total", totalCount);
		map.put("rows", list);
		return map;
	}
	/**
	 * 历史录像概览
	 * @param map
	 * @return
	 * @throws SQLException
	 */
	public Map listYwrecordhistorystateByPage(Map map) throws SQLException {
		List<Map> list = ywrecordcurrentstateDao.query_Ywrecordhistorystate(map);
		Integer totalCount = ywrecordcurrentstateDao.count_Ywrecordhistorystate(map);
		map.clear();
		map.put("total", totalCount);
		map.put("rows", list);
		return map;
	}
	
	// 查询历史记录
	public List<Map> getYwrecordHisState(Map map) throws SQLException{
		return ywrecordcurrentstateDao.getYwrecordHisState(map);
	}

}
