package cn.yw.video.videostate.dao;

import cn.base.dao.BaseSqlMapDAO;
import org.springframework.stereotype.Repository;

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

@Repository("ywvideocurrentstateDao")
public class YwvideocurrentstateDao   extends BaseSqlMapDAO{

	public Map statisticsVideoOnlineRate(Map param) throws SQLException{
		return (Map) this.queryForObject("statisticsVideoOnlineRate", param);
	}
	public Map statisticsVideoIntactRate() throws SQLException{
		return (Map) this.queryForObject("statisticsVideoIntactRate",new HashMap());
	}
	public List<Map> getDpIntact(Map map) throws SQLException{
		return (List<Map>) this.queryForList("getDpIntact",map);
	}
	public List<Map> getDpVideoByXzbh(Map map) throws SQLException{
		return (List<Map>) this.queryForList("getDpVideoByXzbh",map);
	}
	public Map statisticsRecordIntactRate() throws SQLException{
		return (Map) this.queryForObject("statisticsRecordIntactRate",new HashMap());
	}
	public List<Map> videoCurrentStateStatistics(Map map) throws SQLException{
		return (List<Map>) this.queryForList("videoCurrentStateStatistics",map);
	}
	public List<Map> vdqStatisticsRegion(Map map) throws SQLException{
		return (List<Map>) this.queryForPage("vdqStatisticsRegion",map);
	}
	/**
	 * 增加记录
	 */
	/*
	public void insert_Ywvideocurrentstate(Map map) throws SQLException{
		this.insert("insert_Ywvideocurrentstate",map);
	}
	*/
	
	/**
	 * 批处理增加记录
	 */
	/*
	public void batch_insert_Ywvideocurrentstate(List batch) throws SQLException{
		this.insert("batch_insert_Ywvideocurrentstate",batch);
	}
	*/
	 
	/**
	 * 修改记录
	 */
	public Integer update_Ywvideocurrentstate(Map map) throws SQLException{
		return this.update("update_Ywvideocurrentstate",map);
	}
	public Integer update_Ywvideocurrentstate_WorkOrder(Map map) throws SQLException{
		return this.update("update_Ywvideocurrentstate_WorkOrder",map);
	}
	
	
	/**
	 * 删除记录
	 */
	/*
	public Integer delete_Ywvideocurrentstate(Map map) throws SQLException{
		return this.delete("delete_Ywvideocurrentstate",map);
	}
	*/
	
	/**
	 * 批处理删除记录
	 */
	
	/*
	public Integer batch_delete_Ywvideocurrentstate(Map map) throws SQLException{
		return this.delete("batch_delete_Ywvideocurrentstate",map);
	}
	*/
	
	/**
	 * 查询总数
	 */
	public Integer count_Ywvideocurrentstate(Map map) throws SQLException{
		return (Integer)this.queryForObject("count_Ywvideocurrentstate",map);
	}
	public Integer count_Ywvideocurrentstate_detail(Map map) throws SQLException{
		return (Integer)this.queryForObject("count_Ywvideocurrentstate_detail",map);
	}
	public Integer count_vdqStatisticsRegion(Map map) throws SQLException{
		return (Integer)this.queryForObject("count_vdqStatisticsRegion",map);
	}
	
	/**
	 * 查询列表记录
	 */
	
	public List<Map> query_Ywvideocurrentstate(Map map) throws SQLException{
		return this.queryForPage("query_Ywvideocurrentstate",map);
	}
	public List<Map> query_Ywvideocurrentstate_detail(Map map) throws SQLException{
		return this.queryForPage("query_Ywvideocurrentstate_detail",map);
	}
	
	/**
	 * 查询列表记录
	 */
	public Map get_Ywvideocurrentstate(Map map) throws SQLException{
		return (Map) this.queryForObject("query_Ywvideocurrentstate",map);
	}
	
	// 区域在线率统计        ================== start
	public List<Map> query_areaOnline(Map map) throws SQLException{
		return this.queryForPage("query_areaOnline",map);
	}	
	public Integer count_areaOnline(Map map) throws SQLException{
		return (Integer)this.queryForObject("count_areaOnline",map);
	}
	//@DS("datasource2")
	public List<Map> query_xhdareaOnline(Map map) throws SQLException{
		return this.queryForPage("query_areaOnline",map);
	}
	public Integer count_xhdareaOnline(Map map) throws SQLException{
		return (Integer)this.queryForObject("count_areaOnline",map);
	}


	public List<Map> query_AreaNotonlineDetail(Map map) throws SQLException{
		return this.queryForPage("query_AreaNotonlineDetail",map);
	}	
	public Integer count_AreaNotonlineDetail(Map map) throws SQLException{
		return (Integer)this.queryForObject("count_AreaNotonlineDetail",map);
	}
	// 区域在线率统计        ================== end

//根據區域編號 查詢信號燈，服務器，led
	public List<Map> query_AreaNotonlineDeviceDetail(Map map) throws SQLException{
		return this.queryForPage("query_AreaNotonlineDeviceDetail",map);
	}
	public Integer count_AreaNotonlineDeviceDetail(Map map) throws SQLException{
		return (Integer)this.queryForObject("count_AreaNotonlineDeviceDetail",map);
	}

	// 首页统计
	public Map count_HomepageFalultType(Map map) throws SQLException{
		return (Map)this.queryForObject("count_HomepageFalultType",map);
	}
	// 首页  中间查询设备
	public List<Map> query_videoState(Map map) throws SQLException{
		return this.queryForPage("query_videoState",map);
	}	
	public Integer count_videoState(Map map) throws SQLException{
		return (Integer)this.queryForObject("count_videoState", map);
	}

	public Map queryjsgs (Map map) throws SQLException{
		return (Map)this.queryForObject("query_jsgs",map);
	}

	public Integer updatejsgs (Map map) throws SQLException{
		return this.update("update_jsgs",map);
	}
	public Integer update_sbtdspsrRemarks (Map map) throws SQLException{
		return this.update("update_sbtdspsrRemarks",map);
	}

	public Integer update_ywvideocurrentstateRepairState (Map map) throws SQLException{
		return this.update("update_ywvideocurrentstateRepairState",map);
	}

}
