package com.pcloud.book.keywords.dao;

import com.pcloud.book.keywords.dto.KeywordStatisticsDTO;
import com.pcloud.book.keywords.dto.KeywordUserCountDTO;
import com.pcloud.book.keywords.entity.BookKeywordRecord;
import com.pcloud.common.core.dao.BaseDao;

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

/**
 * @author lily
 * @date 2019/5/9 16:23
 */
public interface BookKeywordRecordDao extends BaseDao<BookKeywordRecord> {
    /**
     * @Author:lili
     * @Desr:获取关键词使用次数
     * @Date:2019/5/15 16:42
     */
    Map<Long, KeywordUserCountDTO> listKeywordUseCount(List<Long> qrcodeIds);

    /**
     * 获得统计
     * @param bookGroupId
     * @param weixinGroupId
     * @param keywordIds
     * @return
     */
    List<KeywordStatisticsDTO> getKeywordStatistics(Long bookGroupId, String weixinGroupId, List<Long> keywordIds);

    /**
     * 根据时间获取触发次数
     * @param bookGroupId
     * @param weixinGroupId
     * @param keywordIds
     * @param startDate
     * @return
     */
    List<KeywordStatisticsDTO> getKeywordStatisticsByTime(Long bookGroupId, String weixinGroupId, List<Long> keywordIds, Date startDate);
}
