package cn.im.che.service;

 import cn.im.che.dao.CllkxxDao;

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

	
	/**
	 * 修改记录
	 */
	public Integer update_Cllkxx(Map map) throws SQLException{
		CommUtils.validateUpdateParams(map);
		CommUtils.addParams(map, true);
		return cllkxxDao.update_Cllkxx(map);
	}
	
	/**
	 * 删除记录
	 */
	public Integer delete_Cllkxx(Map map) throws SQLException{
		CommUtils.validateDeleteParams(map);
		return cllkxxDao.delete_Cllkxx(map);
	}

	/**
	 * Cllkxx 分页
	 */
	public Map listCllkxxByPage(Map map) throws SQLException {
		List<Map> list = cllkxxDao.query_Cllkxx(map);
		Integer totalCount = cllkxxDao.count_Cllkxx(map);
		map.clear();
		map.put("total", totalCount);
		map.put("rows", list);
		return map;
	}
}
