package cn.yw.nhyw.nhywjtxcrzgl.service;

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;
import cn.yw.nhyw.nhywjtxcrzgl.dao.NhywjtssxcdDao;

@Service("nhywjtssxcdService")
public class NhywjtssxcdService extends BaseService {
	
	private static Log log = LogFactory.getLog(NhywjtssxcdService.class);
	
	@Autowired
	private NhywjtssxcdDao nhywjtssxcdDao;
	
	/**
	 * 保存记录
	 */
	public void insert_Nhywjtssxcd(Map map) throws SQLException{
		CommUtils.addParams(map, false);
		nhywjtssxcdDao.insert_Nhywjtssxcd(map);
	}

	
	/**
	 * 修改记录
	 */
	public Integer update_Nhywjtssxcd(Map map) throws SQLException{
		CommUtils.validateUpdateParams(map);
		CommUtils.addParams(map, true);
		return nhywjtssxcdDao.update_Nhywjtssxcd(map);
	}
	
	/**
	 * 删除记录
	 */
	public Integer delete_Nhywjtssxcd(Map map) throws SQLException{
		CommUtils.validateDeleteParams(map);
		return nhywjtssxcdDao.delete_Nhywjtssxcd(map);
	}
	
	/**
	 * 批处理删除记录
	 */
	public Integer batch_delete_Nhywjtssxcd(Map map) throws SQLException{
		return nhywjtssxcdDao.batch_delete_Nhywjtssxcd(map);
	}
	
	/**
	 * 查询总数
	 */
	public Integer count_Nhywjtssxcd(Map map) throws SQLException{
		return nhywjtssxcdDao.count_Nhywjtssxcd(map);
	}
	
	/**
	 * 查询列表记录SELECT
	 */
	public List<Map> query_Nhywjtssxcd(Map map) throws SQLException{
		return nhywjtssxcdDao.query_Nhywjtssxcd(map);
	}
	
	/**
	 * 查询一条
	 */
	 
	public Map get_Nhywjtssxcd(Map map) throws SQLException{
		return nhywjtssxcdDao.get_Nhywjtssxcd(map);
	}
	
	/**
	 * 导出EXCEL
	 */
	 
	/*
	public Map exportNhywjtssxcd(Map map) throws SQLException{
		return this.listNhywjtssxcdByPage(map);
	}
	*/
	
	/**
	 * Nhywjtssxcd 分页
	 */
	public Map listNhywjtssxcdByPage(Map map) throws SQLException {
		List<Map> list = nhywjtssxcdDao.query_Nhywjtssxcd(map);
		Integer totalCount = nhywjtssxcdDao.count_Nhywjtssxcd(map);
		map.clear();
		map.put("total", totalCount);
		map.put("rows", list);
		return map;
	}
}
