package com.cloudcross.ssp.service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.cloudcross.ssp.base.service.IDspGenericService;
import com.cloudcross.ssp.common.utils.Pager;
import com.cloudcross.ssp.model.DspBanner;

/**
 * 创建人：rongying
 * 创建时间：2015.12.11
 * dsp-广告主-创意服务接口
 */

public interface IDspBannerService extends IDspGenericService<DspBanner>{
	
	/**
	 * 查询最大的id - 插入时获取
	 * 
	 * @param paramMap
	 * 				dspId和advertiserId
	 * @return 下一个id的值
	 */
	public Long selectMaxId(Map<String,Long> paramMap);
	
	/**
	 * 批量查询创意审核的状态
	 * 
	 * @param paramMap
	 * 				bannerIds
	 * @return 符合条件的记录
	 */
	public List<Map<String,Object>> queryState(Map<String,Object> paramMap);
	/**
	 * 
	 * 
	 * @param paramMap
	 * 				bannerIds
	 * @return 云联后台符合条件的数目
	 */
	public int countByParams(HashMap<String, Object> paramMap);

	// 符合条件的dsp创意
	public List<Map<String, Object>> findByParams(
			HashMap<String, Object> paramMap, Pager pager);
	
	//状态审核通过
	public boolean updatePass(List<Long> auditIdList, int state);
	//状态审核不通过
	public boolean updateNoPass(List<Long> auditIdList, int state, String memo);
	//查找符合条件的dsp创意（不叫page）
	public List<Map<String, Object>> findByParamMap(Map<String, Object> paramMap);
	/**
	 * 
	 * 运营商素材审核功能
	 * @param operatorId 
	 * */
	public int countByParamsOperator(Long operatorId, HashMap<String, Object> paramMap);

	public List<Map<String, Object>> findByParamsOpeator(
			Long operatorId, HashMap<String, Object> paramMap, Pager pager);

	public boolean updateOperatorPass(long id, int checked);
	
	public boolean updateOperatorNoPass(long auditIdList, int checked, String memo);

	public int getState(long operatorId, long id);

	public void addBannerOperator(long operatorId, long id);

	public DspBanner findById(long id);
}