package cn.yw.nhyw.ksh_kkxx.service;


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

import cn.yw.nhyw.ksh_kkxx.dao.KSH_KKXXDao;
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("kSH_KKXXService")
public class KSH_KKXXService extends BaseService {

	private static Log log = LogFactory.getLog(KSH_KKXXService.class);

	@Autowired
	private KSH_KKXXDao Ksh_kkxxDao;

	/**
	 * 保存记录
	 */
	public void insert_Ksh_kkxx(Map map) throws SQLException{
		CommUtils.addParams(map, false);
		Ksh_kkxxDao.insert_Ksh_kkxx(map);
	}


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

	/**
	 * 修改经纬度
	 */
	public Integer updateJtbzJdWdByXh(Map map) throws SQLException{
		return Ksh_kkxxDao.updateJtbzJdWdByXh(map);
	}

	/**
	 * 删除记录
	 */
	public Integer delete_Ksh_kkxx(Map map) throws SQLException{
		CommUtils.validateDeleteParams(map);
		return Ksh_kkxxDao.delete_Ksh_kkxx(map);
	}

	/**
	 * 批处理删除记录
	 */
	/*
	public Integer batch_delete_Ksh_kkxx(Map map) throws SQLException{
		return Ksh_kkxxDao.batch_delete_Ksh_kkxx(map);
	}
	*/

	/**
	 * 查询总数
	 */
	/*
	public Integer count_Ksh_kkxx(Map map) throws SQLException{
		return Ksh_kkxxDao.count_Ksh_kkxx(map);
	}
	*/

	/**
	 * 查询列表记录SELECT
	 */
	public List<Map> query_Ksh_kkxx(Map map) throws SQLException{
		return Ksh_kkxxDao.query_Ksh_kkxx(map);
	}

	/**
	 * 查询全部记录
	 */
	public List<Map> query_AllKsh_kkxx(Map map) throws SQLException {
		return Ksh_kkxxDao.query_AllKsh_kkxx(map);
	}

	/**
	 * 查询一条
	 */
	public Map get_Ksh_kkxx(Map map) throws SQLException{
		return Ksh_kkxxDao.get_Ksh_kkxx(map);
	}

	/**
	 * 导出EXCEL
	 */

	/*
	public Map exportKsh_kkxx(Map map) throws SQLException{
		return this.listKsh_kkxxByPage(map);
	}
	*/

	/**
	 * Ksh_kkxx 分页
	 */
	public Map listKsh_kkxxByPage(Map map) throws SQLException {
		List<Map> list = Ksh_kkxxDao.query_Ksh_kkxx(map);
		Integer totalCount = Ksh_kkxxDao.count_Ksh_kkxx(map);
		map.clear();
		map.put("total", totalCount);
		map.put("rows", list);
		return map;
	}
}
