package cn.yw.video.videotask.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.video.videotask.dao.YwvideotaskcatalogDao;

@Service("ywvideotaskcatalogService")
public class YwvideotaskcatalogService extends BaseService {
	
	private static Log log = LogFactory.getLog(YwvideotaskcatalogService.class);
	
	@Autowired
	private YwvideotaskcatalogDao ywvideotaskcatalogDao;
	
	/**
	 * 保存记录
	 */
	public void insert_Ywvideotaskcatalog(Map map) throws SQLException{
		CommUtils.addParams(map, false);
		ywvideotaskcatalogDao.insert_Ywvideotaskcatalog(map);
	}

	
	/**
	 * 修改记录
	 */
	public Integer update_Ywvideotaskcatalog(Map map) throws SQLException{
		CommUtils.validateUpdateParams(map);
		CommUtils.addParams(map, true);
		return ywvideotaskcatalogDao.update_Ywvideotaskcatalog(map);
	}
	
	/**
	 * 删除记录
	 */
	public Integer delete_Ywvideotaskcatalog(Map map) throws SQLException{
		CommUtils.validateDeleteParams(map);
		return ywvideotaskcatalogDao.delete_Ywvideotaskcatalog(map);
	}
	
	/**
	 * 批处理删除记录
	 */
	public Integer batch_delete_Ywvideotaskcatalog(Map map) throws SQLException{
		return ywvideotaskcatalogDao.batch_delete_Ywvideotaskcatalog(map);
	}
	
	/**
	 * 查询总数
	 */
	public Integer count_Ywvideotaskcatalog(Map map) throws SQLException{
		return ywvideotaskcatalogDao.count_Ywvideotaskcatalog(map);
	}
	
	/**
	 * 查询列表记录SELECT
	 */
	public List<Map> query_Ywvideotaskcatalog(Map map) throws SQLException{
		return ywvideotaskcatalogDao.query_Ywvideotaskcatalog(map);
	}
	
	/**
	 * 查询一条
	 */
	 
	public Map get_Ywvideotaskcatalog(Map map) throws SQLException{
		return ywvideotaskcatalogDao.get_Ywvideotaskcatalog(map);
	}
	
	/**
	 * 导出EXCEL
	 */
	 
	/*
	public Map exportYwvideotaskcatalog(Map map) throws SQLException{
		return this.listYwvideotaskcatalogByPage(map);
	}
	*/
	
	/**
	 * Ywvideotaskcatalog 分页
	 */
	public List<Map> listYwvideotaskcatalogByPage(Map map) throws SQLException {
		List<Map> list = ywvideotaskcatalogDao.query_Ywvideotaskcatalog(map);
//		Integer totalCount = ywvideotaskcatalogDao.count_Ywvideotaskcatalog(map);
//		map.clear();
//		map.put("total", totalCount);
//		map.put("rows", list);
		return list;
	}
}
