package cn.yw.nhyw.nhywjthlgl.service;

 import cn.yw.nhyw.nhywjthlgl.dao.NhywjthlglDao;

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("nhywjthlglService")
public class NhywjthlglService extends BaseService {
	
	private static Log log = LogFactory.getLog(NhywjthlglService.class);
	
	@Autowired
	private NhywjthlglDao nhywjthlglDao;
	
	/**
	 * 保存记录
	 */
	public void insert_Nhywjthlgl(Map map) throws SQLException{
		CommUtils.addParams(map, false);
		nhywjthlglDao.insert_Nhywjthlgl(map);
	}

	
	/**
	 * 修改记录
	 */
	public Integer update_Nhywjthlgl(Map map) throws SQLException{
		CommUtils.validateUpdateParams(map);
		CommUtils.addParams(map, true);
		return nhywjthlglDao.update_Nhywjthlgl(map);
	}

	/**
	 * 修改经纬度
	 */
	public Integer updateJthlJdWdByXh(Map map) throws SQLException{
		CommUtils.addParams(map, true);
		return nhywjthlglDao.updateJthlJdWdByXh(map);
	}
	
	/**
	 * 删除记录
	 */
	public Integer delete_Nhywjthlgl(Map map) throws SQLException{
		CommUtils.validateDeleteParams(map);
		return nhywjthlglDao.delete_Nhywjthlgl(map);
	}
	
	/**
	 * 批处理删除记录
	 */
	/*
	public Integer batch_delete_Nhywjthlgl(Map map) throws SQLException{
		return nhywjthlglDao.batch_delete_Nhywjthlgl(map);
	}
	*/
	
	/**
	 * 查询总数
	 */
	/*
	public Integer count_Nhywjthlgl(Map map) throws SQLException{
		return nhywjthlglDao.count_Nhywjthlgl(map);
	}
	*/
	
	/**
	 * 查询列表记录SELECT
	 */
	public List<Map> query_Nhywjthlgl(Map map) throws SQLException{
		return nhywjthlglDao.query_Nhywjthlgl(map);
	}

	/**
	 * 查询全部记录
	 */
	public List<Map> query_AllNhywjthlgl(Map map) throws SQLException{
		return nhywjthlglDao.query_AllNhywjthlgl(map);
	}
	
	/**
	 * 查询一条
	 */
	public Map get_Nhywjthlgl(Map map) throws SQLException{
		return nhywjthlglDao.get_Nhywjthlgl(map);
	}
	
	/**
	 * 导出EXCEL
	 */
	 
	/*
	public Map exportNhywjthlgl(Map map) throws SQLException{
		return this.listNhywjthlglByPage(map);
	}
	*/
	
	/**
	 * Nhywjthlgl 分页
	 */
	public Map listNhywjthlglByPage(Map map) throws SQLException {
		List<Map> list = nhywjthlglDao.query_Nhywjthlgl(map);
		Integer totalCount = nhywjthlglDao.count_Nhywjthlgl(map);
		map.clear();
		map.put("total", totalCount);
		map.put("rows", list);
		return map;
	}
}
