package com.pcloud.book.adnews.dao.impl;

import com.pcloud.book.adnews.dao.AdNewsDao;
import com.pcloud.book.adnews.entity.AdNews;
import com.pcloud.common.core.dao.BaseDaoImpl;
import org.springframework.stereotype.Repository;

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

/**
 * @Description
 * @Author ruansiyuan
 * @Date 2019/7/17 16:16
 **/
@Repository("adNewsDao")
public class AdNewsDaoImpl extends BaseDaoImpl<AdNews> implements AdNewsDao {
    @Override
    public List<AdNews> getNewsToSendBySetIdAndAdviser(Long adNewsSetId, Long adviserId, Integer top) {
        Map<String, Object> map = new HashMap<>();
        map.put("adNewsSetId", adNewsSetId);
        map.put("adviserId", adviserId);
        map.put("top", top);
        return super.getSqlSession().selectList(getStatement("getNewsToSendBySetIdAndAdviser"), map);
    }
}
