package cn.yw.nhyw.nhywjtjzwxxb.service;

 import cn.yw.nhyw.nhywjtjzwxxb.dao.NhywjtjzwxxbDao;

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

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 cn.base.bean.BaseService;
import cn.base.util.CommUtils;

@Service("nhywjtjzwxxbService")
public class NhywjtjzwxxbService extends BaseService {
	
	private static Log log = LogFactory.getLog(NhywjtjzwxxbService.class);
	
	@Autowired
	private NhywjtjzwxxbDao nhywjtjzwxxbDao;
	
	/**
	 * 保存记录
	 */
	public void insert_Nhywjtjzwxxb(Map map) throws SQLException{
		CommUtils.addParams(map, false);
		nhywjtjzwxxbDao.insert_Nhywjtjzwxxb(map);
	}

	
	/**
	 * 修改记录
	 */
	public Integer update_Nhywjtjzwxxb(Map map) throws SQLException{
		CommUtils.validateUpdateParams(map);
		CommUtils.addParams(map, true);
		return nhywjtjzwxxbDao.update_Nhywjtjzwxxb(map);
	}
	
	/**
	 * 修改经纬度
	 */
	public Integer updateJtjzwJdWdByXh(Map map) throws SQLException{
		CommUtils.addParams(map, true);
		return nhywjtjzwxxbDao.updateJtjzwJdWdByXh(map);
	}
	
	/**
	 * 删除记录
	 */
	public Integer delete_Nhywjtjzwxxb(Map map) throws SQLException{
		CommUtils.validateDeleteParams(map);
		return nhywjtjzwxxbDao.delete_Nhywjtjzwxxb(map);
	}
	
	/**
	 * 批处理删除记录
	 */
	/*
	public Integer batch_delete_Nhywjtjzwxxb(Map map) throws SQLException{
		return nhywjtjzwxxbDao.batch_delete_Nhywjtjzwxxb(map);
	}
	*/
	
	/**
	 * 查询总数
	 */
	/*
	public Integer count_Nhywjtjzwxxb(Map map) throws SQLException{
		return nhywjtjzwxxbDao.count_Nhywjtjzwxxb(map);
	}
	*/
	
	/**
	 * 查询列表记录SELECT
	 */
	public List<Map> query_Nhywjtjzwxxb(Map map) throws SQLException{
		return nhywjtjzwxxbDao.query_Nhywjtjzwxxb(map);
	}
	
	/**
	 * 查询一条
	 */
	 
	public Map get_Nhywjtjzwxxb(Map map) throws SQLException{
		return nhywjtjzwxxbDao.get_Nhywjtjzwxxb(map);
	}
	
	/**
	 * 导出EXCEL
	 */
	 
	/*
	public Map exportNhywjtjzwxxb(Map map) throws SQLException{
		return this.listNhywjtjzwxxbByPage(map);
	}
	*/
	
	/**
	 * 加载地图建筑物
	 */
	public List<Map> listNhywjtjzwxxbByLoadMap(Map map) throws SQLException {
		return nhywjtjzwxxbDao.listNhywjtjzwxxbByLoadMap(map);
	}
	
	/**
	 * Nhywjtjzwxxb 分页
	 */
	public Map listNhywjtjzwxxbByPage(Map map) throws SQLException {
		List<Map> list = nhywjtjzwxxbDao.query_Nhywjtjzwxxb(map);
		Integer totalCount = nhywjtjzwxxbDao.count_Nhywjtjzwxxb(map);
		map.clear();
		map.put("total", totalCount);
		map.put("rows", list);
		return map;
	}
}
