package cn.yw.operationcount.latandloncount.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.operationcount.latandloncount.dao.YwcountlalcollectDao;

@Service("ywcountlalcollectService")
public class YwcountlalcollectService extends BaseService {
	
	private static Log log = LogFactory.getLog(YwcountlalcollectService.class);
	
	@Autowired
	private YwcountlalcollectDao ywcountlalcollectDao;
	
	/**
	 * 保存记录
	 */
	public void insert_Ywcountlalcollect(Map map) throws SQLException{
		CommUtils.addParams(map, false);
		ywcountlalcollectDao.insert_Ywcountlalcollect(map);
	}

	
	/**
	 * 修改记录
	 */
	public Integer update_Ywcountlalcollect(Map map) throws SQLException{
		CommUtils.validateUpdateParams(map);
		CommUtils.addParams(map, true);
		return ywcountlalcollectDao.update_Ywcountlalcollect(map);
	}
	
	/**
	 * 删除记录
	 */
	public Integer delete_Ywcountlalcollect(Map map) throws SQLException{
		CommUtils.validateDeleteParams(map);
		return ywcountlalcollectDao.delete_Ywcountlalcollect(map);
	}
	
	/**
	 * 批处理删除记录
	 */
	public Integer batch_delete_Ywcountlalcollect(Map map) throws SQLException{
		return ywcountlalcollectDao.batch_delete_Ywcountlalcollect(map);
	}
	
	/**
	 * 查询总数
	 */
	public Integer count_Ywcountlalcollect(Map map) throws SQLException{
		return ywcountlalcollectDao.count_Ywcountlalcollect(map);
	}
	
	/**
	 * 查询列表记录SELECT
	 */
	public List<Map> query_Ywcountlalcollect(Map map) throws SQLException{
		return ywcountlalcollectDao.query_Ywcountlalcollect(map);
	}
	
	/**
	 * 查询一条
	 */
	 
	public Map get_Ywcountlalcollect(Map map) throws SQLException{
		return ywcountlalcollectDao.get_Ywcountlalcollect(map);
	}
	
	/**
	 * 导出EXCEL
	 */
	 
	/*
	public Map exportYwcountlalcollect(Map map) throws SQLException{
		return this.listYwcountlalcollectByPage(map);
	}
	*/
	
	/**
	 * Ywcountlalcollect 分页
	 */
	public Map listYwcountlalcollectByPage(Map map) throws SQLException {
		List<Map> list = ywcountlalcollectDao.query_Ywcountlalcollect(map);
		Integer totalCount = ywcountlalcollectDao.count_Ywcountlalcollect(map);
		map.clear();
		map.put("total", totalCount);
		map.put("rows", list);
		return map;
	}
}
