package cn.yw.video.videochannelset.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.videochannelset.dao.YwvideochannelsetDao;

@Service("ywvideochannelsetService")
public class YwvideochannelsetService extends BaseService {
	
	private static Log log = LogFactory.getLog(YwvideochannelsetService.class);
	
	@Autowired
	private YwvideochannelsetDao ywvideochannelsetDao;
	
	/**
	 * 保存记录
	 */
	public void insert_Ywvideochannelset(Map map) throws SQLException{
		CommUtils.addParams(map, false);
		ywvideochannelsetDao.insert_Ywvideochannelset(map);
	}

	
	/**
	 * 修改记录
	 */
	public Integer update_Ywvideochannelset(Map map) throws SQLException{
		CommUtils.validateUpdateParams(map);
		CommUtils.addParams(map, true);
		return ywvideochannelsetDao.update_Ywvideochannelset(map);
	}
	
	/**
	 * 删除记录
	 */
	public Integer delete_Ywvideochannelset(Map map) throws SQLException{
		CommUtils.validateDeleteParams(map);
		return ywvideochannelsetDao.delete_Ywvideochannelset(map);
	}
	
	/**
	 * 批处理删除记录
	 */
	public Integer batch_delete_Ywvideochannelset(Map map) throws SQLException{
		return ywvideochannelsetDao.batch_delete_Ywvideochannelset(map);
	}
	
	/**
	 * 查询总数
	 */
	public Integer count_Ywvideochannelset(Map map) throws SQLException{
		return ywvideochannelsetDao.count_Ywvideochannelset(map);
	}
	
	/**
	 * 查询列表记录SELECT
	 */
	public List<Map> query_Ywvideochannelset(Map map) throws SQLException{
		return ywvideochannelsetDao.query_Ywvideochannelset(map);
	}
	
	/**
	 * 查询一条
	 */
	 
	public Map get_Ywvideochannelset(Map map) throws SQLException{
		return ywvideochannelsetDao.get_Ywvideochannelset(map);
	}
	
	/**
	 * 导出EXCEL
	 */
	 
	public Map exportYwvideochannelset(Map map) throws SQLException{
		return this.listYwvideochannelsetByPage(map);
	}
	
	/**
	 * Ywvideochannelset 分页
	 */
	public Map listYwvideochannelsetByPage(Map map) throws SQLException {
		List<Map> list = ywvideochannelsetDao.query_Ywvideochannelset(map);
		Integer totalCount = ywvideochannelsetDao.count_Ywvideochannelset(map);
		map.clear();
		map.put("total", totalCount);
		map.put("rows", list);
		return map;
	}
	public Map query_Ywvideochannelset_taskselect(Map map) throws SQLException {
		List<Map> list = ywvideochannelsetDao.query_Ywvideochannelset_taskselect(map);
		Integer totalCount = ywvideochannelsetDao.count_Ywvideochannelset_taskselect(map);
		map.clear();
		map.put("total", totalCount);
		map.put("rows", list);
		System.out.println(map);
		return map;
	}
	public Map query_Ywvideochannelset_taskunselect(Map map) throws SQLException {
		List<Map> list = ywvideochannelsetDao.query_Ywvideochannelset_taskunselect(map);
		Integer totalCount = ywvideochannelsetDao.count_Ywvideochannelset_taskunselect(map);
		map.clear();
		map.put("total", totalCount);
		map.put("rows", list);
		System.out.println(map);
		return map;
	}
}
