package cn.yw.nhyw.nhywjksbtzxx.service;

 import cn.yw.nhyw.nhywjksbtzxx.dao.NhywjksbtzxxDao;

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

	
	/**
	 * 修改记录
	 */
	public Integer update_Nhywjksbtzxx(Map map) throws SQLException{
		CommUtils.validateUpdateParams(map);
		CommUtils.addParams(map, true);
		return nhywjksbtzxxDao.update_Nhywjksbtzxx(map);
	}
	
	/**
	 * 删除记录
	 */
	public Integer delete_Nhywjksbtzxx(Map map) throws SQLException{
		CommUtils.validateDeleteParams(map);
		return nhywjksbtzxxDao.delete_Nhywjksbtzxx(map);
	}
	
	/**
	 * 批处理删除记录
	 */
	/*
	public Integer batch_delete_Nhywjksbtzxx(Map map) throws SQLException{
		return nhywjksbtzxxDao.batch_delete_Nhywjksbtzxx(map);
	}
	*/
	
	/**
	 * 查询总数
	 */
	/*
	public Integer count_Nhywjksbtzxx(Map map) throws SQLException{
		return nhywjksbtzxxDao.count_Nhywjksbtzxx(map);
	}
	*/
	
	/**
	 * 查询列表记录SELECT
	 */
	public List<Map> query_Nhywjksbtzxx(Map map) throws SQLException{
		return nhywjksbtzxxDao.query_Nhywjksbtzxx(map);
	}
	
	/**
	 * 查询一条
	 */
	 
	/*
	public Map get_Nhywjksbtzxx(Map map) throws SQLException{
		return nhywjksbtzxxDao.get_Nhywjksbtzxx(map);
	}
	*/
	
	/**
	 * 导出EXCEL
	 */
	 
	/*
	public Map exportNhywjksbtzxx(Map map) throws SQLException{
		return this.listNhywjksbtzxxByPage(map);
	}
	*/
	
	/**
	 * Nhywjksbtzxx 分页
	 */
	public Map listNhywjksbtzxxByPage(Map map) throws SQLException {
		List<Map> list = nhywjksbtzxxDao.query_Nhywjksbtzxx(map);
		Integer totalCount = nhywjksbtzxxDao.count_Nhywjksbtzxx(map);
		map.clear();
		map.put("total", totalCount);
		map.put("rows", list);
		return map;
	}
}
