package cn.yw.detector.dao;

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

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

@Repository("detectorDao")
public class DetectorDao extends BaseSqlMapDAO{


	/**
	 * 增加记录
	 */
	public void insert_Detector(Map map) throws SQLException{
		this.insert("insert_Detector",map);
	}

	/**
	 * 批处理增加记录
	 */
	public void batch_insert_Detector(List batch) throws SQLException{
		this.insert("batch_insert_Detector",batch);
	}

	/**
	 * 修改记录
	 */
	public Integer update_Detector(Map map) throws SQLException{
		return this.update("update_Detector",map);
	}
	/**
	 * 修改备注记录
	 */
	public Integer update_DetectorRemarks(Map map) throws SQLException{
		return this.update("update_DetectorRemarks",map);
	}



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

	/**
	 * 删除记录
	 */
	public Integer delete_Detector(Map map) throws SQLException{
		return this.delete("delete_Detector",map);
	}

	/**
	 * 批处理删除记录
	 */

	public Integer batch_delete_Detector(List l) throws SQLException{
		return this.delete("batch_delete_Detector",l);
	}
	public Integer batch_update_Detector(Map m) throws SQLException{
		return this.delete("batch_update_Detector",m);
	}

	/**
	 * 查询总数
	 */
	public Integer count_Detector(Map map) throws SQLException{
		return (Integer)this.queryForObject("count_Detector",map);
	}

	/**
	 * 查询列表记录
	 */

	public List<Map> query_Detector(Map map) throws SQLException{
		return this.queryForPage("query_Detector",map);
	}
	public List<Map> query_Detector_children(Map map) throws SQLException{
		return this.queryForList("query_Detector_children",map);
	}

	public List<Map> getApproveUser(Map map) throws SQLException{
		return this.queryForList("getApproveUser",map);
	}

	/**
	 * 查询列表记录
	 */
	public Map get_Detector(Map map) throws SQLException{
		return (Map) this.queryForObject("get_Detector",map);
	}
	public List<Map> query_DetectortaskByPage(Map map) throws SQLException{
		return this.queryForPage("query_Detectortask",map);
	}

	public List<Map> query_DetectorNotaskByPage(Map map) throws SQLException{
		return this.queryForPage("query_DetectorNotask",map);
	}
	public Integer count_DetectorNotask(Map map) throws SQLException{
		return (Integer)this.queryForObject("count_DetectorNotask",map);
	}


	public List<Map> query_NhywxlydptaskByPage(Map map) throws SQLException{
		return this.queryForPage("query_NhywxlydptaskByPage",map);
	}
	public Integer count_Nhywxlydptask(Map map) throws SQLException{
		return (Integer)this.queryForObject("count_Nhywxlydptask",map);
	}
	public Integer delete_Nhywxlydp(Map map) throws SQLException{
		return this.delete("delete_Nhywxlydp",map);
	}
	public Integer batchdelete_Nhywxlydp(Map map) throws SQLException{
		return this.delete("batchdelete_Nhywxlydp",map);
	}
	public void  batchinsert_Nhywxlydp(List map) throws SQLException{
		 this.insert("batchinsert_Nhywxlydp",map);
	}
	// 更新
	public Integer edit_Detector(Map map) throws SQLException{
		return this.update("edit_Detector",map);
	}
    //在线率统计
	public List<Map> statisticsDetectorRate() throws SQLException{
		return (List<Map>) this.queryForList("statisticsDetectorRate",null);
	}


	public List<Map>   listDetectorStatus (Map map) throws SQLException{
		return  this.queryForPage("listDetectorStatus",map);
	}

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


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


	public List<Map>   query_DetectorcurrentstateByPage (Map map) throws SQLException{
		return  this.queryForPage("query_Detectorcurrentstate",map);
	}

	public List<Map>   query_DetectorhistoryByPage (Map map) throws SQLException{
		return  this.queryForPage("query_Detectorhistory",map);
	}
	public Integer count_Detectorhistory(Map map) throws SQLException{
		return (Integer) this.queryForObject("count_Detectorhistory",map);
	}
	public List<Map>   query_Detectorcurrentstate (Map map) throws SQLException{
		return  this.queryForList("query_Detectorcurrentstate",map);
	}
	public Integer update_DetectorCurrentState(Map map) throws SQLException{
		return this.update("update_DetectorCurrentState",map);
	}

	public List<Map> query_DetectorStatusData(Map map)throws SQLException {
		return this.queryForPage("query_DetectorStatusData",map);
	}
	public Integer count_DetectorStatusData(Map map)throws SQLException {
		return (Integer)this.queryForObject("count_DetectorStatusData",map);
	}

}
