package cn.yw.nhyw.nhywjtledydpgl.dao;
import cn.base.dao.BaseSqlMapDAO;
import org.springframework.stereotype.Repository;

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

@Repository("nhywjtledydpglDao")
public class NhywjtledydpglDao  extends BaseSqlMapDAO{

	/**
	 * 增加记录
	 */
	public void insert_Nhywjtledydpgl(Map map) throws SQLException{
		this.insert("insert_Nhywjtledydpgl",map);
	}
	
	/**
	 * 批处理增加记录
	 */
	/*
	public void batch_insert_Nhywjtledydpgl(List batch) throws SQLException{
		this.insert("batch_insert_Nhywjtledydpgl",batch);
	}
	*/
	 
	/**
	 * 修改记录
	 */
	public Integer update_Nhywjtledydpgl(Map map) throws SQLException{
		return this.update("update_Nhywjtledydpgl",map);
	}
	
	/**
	 * 修改经纬度
	 */
	public Integer updateJtydpJdWdByXh(Map map) throws SQLException{
		return this.update("updateJtydpJdWdByXh",map);
	}
	
	/**
	 * 删除记录
	 */
	public Integer delete_Nhywjtledydpgl(Map map) throws SQLException{
		return this.delete("delete_Nhywjtledydpgl",map);
	}
	/**
	 * 更新备注，维修状态记录
	 */
	public Integer update_NhywjtledydpglRemarks(Map map) throws SQLException{
		return this.delete("update_NhywjtledydpglRemarks",map);
	}


	/**
	 * 批处理删除记录
	 */
	
	/*
	public Integer batch_delete_Nhywjtledydpgl(Map map) throws SQLException{
		return this.delete("batch_delete_Nhywjtledydpgl",map);
	}
	*/
	
	/**
	 * 查询总数
	 */
	public Integer count_Nhywjtledydpgl(Map map) throws SQLException{
		return (Integer)this.queryForObject("count_Nhywjtledydpgl",map);
	}
	
	/**
	 * 查询列表记录
	 */
	
	public List<Map> query_Nhywjtledydpgl(Map map) throws SQLException{
		return this.queryForPage("query_Nhywjtledydpgl",map);
	}

	/**
	 * 查询全部列表记录
	 */
	public List<Map> query_AllNhywjtledydpgl(Map map) throws SQLException{
		return this.queryForList("query_Nhywjtledydpgl", map);
	}
	
	/**
	 * 查询列表记录
	 */
	public Map get_Nhywjtledydpgl(Map map) throws SQLException{
		return (Map) this.queryForObject("get_Nhywjtledydpgl",map);
	}


	public List<Map> statisticsYDPOnlineRate() throws SQLException{
		return (List<Map>) this.queryForList("statisticsYDPOnlineRate",null);
	}
	public List<Map> query_NhywjtledydpglStatus(Map map) throws SQLException{
		return (List<Map>) this.queryForPage("query_NhywjtledydpglStatus",map);
	}
	public Integer count_NhywjtledydpglStatus(Map map) throws SQLException{
		return (Integer) this.queryForObject("count_NhywjtledydpglStatus",map);
	}

	/***
	 * 查询不在线的和状态未知的
	 * @param map
	 * @return
	 * @throws SQLException
	 */
	public List<Map> query_NhywjtledydpglStatusUnonline(Map map) throws SQLException{
		return (List<Map>) this.queryForPage("query_NhywjtledydpglStatusUnonline",map);
	}
	public Integer count_NhywjtledydpglStatusUnonline(Map map) throws SQLException{
		return (Integer) this.queryForObject("count_NhywjtledydpglStatusUnonline",map);
	}

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


	public List<Map> query_Ywydpstatusinfo(Map map) throws SQLException{
		return  this.queryForPage("query_Ywydpstatusinfo",map);
	}
	public Integer count_Ywydpstatusinfo(Map map) throws SQLException{
		return  (Integer)this.queryForObject("count_Ywydpstatusinfo",map);
	}
	public  List<Map> get_YwNoTaskydpstatusinfo(Map map)throws SQLException{
		return this.queryForPage("get_YwNoTaskydpestatusinfo",map);
	}

	public Integer get_YwNoTaskydpstatusCount(Map map) throws SQLException{
		return (Integer)this.queryForObject("get_YwNoTaskydpstatusCount",map);
	}
	// 更新
	public Integer edit_Ywydpinfo(Map map) throws SQLException{
		return this.update("edit_Ywydpinfo",map);
	}

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

	public Integer count_YwAllydpstatusinfo(Map map) throws SQLException{
		return (Integer)this.queryForObject("count_YwAllydpstatusinfo",map);
	}
	/**
	 * 修改记录
	 */
	public Integer update_NhywledydpCurrentState(Map map) throws SQLException{
		return this.update("update_NhywledydpCurrentState",map);
	}

}
