package cn.com.countrygarden.bi.main.dao.mediaResource;

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

import javax.transaction.Transactional;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import cn.com.countrygarden.bi.main.core.Mapper;
import cn.com.countrygarden.bi.main.dto.AdvertisingResourcesDto;
import cn.com.countrygarden.bi.main.model.mediaResource.AdvertisingResources;

@Repository
@Transactional
public interface AdvertisingResourcesMapper extends Mapper<AdvertisingResources>{

	List<Map<String,Object>> findAdvertisingPage(AdvertisingResourcesDto dto);
  
	long findAdvertisingCount(AdvertisingResourcesDto dto);

	int updateState(@Param("state")String state,@Param("ids")String[] idJoin);

	List<Map<String, Object>> findAdvertising(AdvertisingResourcesDto dto);

	String findNextMediaCode(@Param("str")String str);

	String findExportNextSerial(@Param("area")String propertyArea,@Param("project")String propertyProject,@Param("variate")String variate);

	int insertCallBack(AdvertisingResources po);

	@Select("select ifnull(max(sort),0) from t_media_resource")
	Integer getNextSort();

	int dels(@Param("mediaIds")String[] mediaIds);
   
	List<String> findMediaCode(@Param("cycleaList")List<String> cycleaList);

	Map<String,String> findOrgAndAddess(String commId);

	int verifyCommIdAndSite(String cot);

	int verifyCommIdAndSiteById(@Param("cot")String cot,@Param("id")Long mediaId);

	int insertOne(AdvertisingResources po);

	int verifyLocation(@Param("commId")String commId,@Param("siteOne")String siteOne,@Param("siteTwo")String siteTwo);

	String findNextCode2(String mediaCode);

	Map<String,String> findOne(Long mediaId);

	int verifyLocation2(@Param("commId")String commId,@Param("siteOne")String siteOne,@Param("siteTwo")String siteTwo,@Param("mediaId")Long mediaId);


}
