package com.pcloud.book.keywords.dao;

import com.pcloud.book.group.vo.SyncKeyworsVO;
import com.pcloud.book.keywords.dto.KeywordDTO;
import com.pcloud.book.keywords.dto.ReplyKeywordDTO;
import com.pcloud.book.keywords.entity.BookKeyword;
import com.pcloud.book.keywords.vo.KeywordVO;
import com.pcloud.book.keywords.vo.ListKeywordVO;
import com.pcloud.common.core.dao.BaseDao;

import java.util.List;

/**
 * @author lily
 * @date 2019/4/25 11:33
 */
public interface BookKeywordDao extends BaseDao<BookKeyword> {
    
    /**
     * @Author:lili
     * @Desr:删除社群码配置关键词
     * @Date:2019/4/25 14:48
     */
    void deleteById(Long keywordId, Long partyId);

    /**
     * @Author:lili
     * @Desr:设置排序值
     * @Date:2019/4/25 14:51
     */
    void setRank(BookKeyword bookKeyword);

    /**
     * @Author:lili
     * @Desr:获取最大的排序值
     * @Date:2019/4/25 14:53
     */
    Integer getMaxRank(Long bookGroupId, Long classifyId);

    /**
     * @Author:lili
     * @Desr:获取5个关键词
     * @Date:2019/5/5 15:16
     */
    List<KeywordDTO> listFiveKeyword(Long classifyId, Long bookGroupId);

    /**
     * @Author:lili
     * @Desr:获取匹配的关键词
     * @Date:2019/5/6 10:15
     */
    ReplyKeywordDTO getKeywordId(Long classifyId, Long bookGroupId, String content);

    /**
     * @Author:lili
     * @Desr:校验关键词
     * @Date:2019/5/6 14:47
     */
    Boolean checkKeyword(String keywords, Long classifyId, Long bookGroupId, Long keywordId);

    /**
     * @Author:lili
     * @Desr:获取关键词基本信息
     * @Date:2019/5/6 15:03
     */
    KeywordVO getByBookKeyword(Long bookKeywordId);

    /**
     * 更新仓库值
     * @param bookKeywordId
     */
    void updateIsWarehouse(Long bookKeywordId, Long warehouseId);

    /**
     * @Author:lili
     * @Desr:获取关键词数量
     * @Date:2019/5/14 16:46
     */
    Integer getKeywordCount(Long bookGroupId, Long classifyId);

    /**
     * 根据分类id集合获取
     * @param classifyIds
     * @return
     */
    List<ListKeywordVO> getKeywordsByClassifyIds(List<Long> classifyIds, Long bookId);

    /**
    * @description 根据booGroupId获取关键词id
    * @author 戴兴
    * @date 2019/7/16 15:28
    */
    List<SyncKeyworsVO> getKeywordsIdsByBookGroupId(Long bookGroupId,Long classifyId);

    /**
    * @description 按群删除关键词
    * @author 戴兴
    * @date 2019/7/16 17:18
    */
    void deleteKeywords(Long keywordId, Long bookGroupId, Long classifyId, Long partyId);
}
