package com.rongwei.bscommon.sys.dao;

import com.rongwei.bsentity.vo.KBDictDataVo;
import com.rongwei.bsentity.vo.KBResultVo;
import com.rongwei.bsentity.vo.KBSearchVo;
import com.rongwei.bsentity.vo.KnowledgeBaseVo;
import org.apache.ibatis.annotations.*;

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

/**
 * KbKnowledgebaseSearchKeywordsDao class
 *
 * @author XH
 * @date 2024/01/11
 */
@Mapper
public interface KbKnowledgebaseSearchKeywordsDao {
    @Insert("INSERT INTO kb_knowledgebase_search_keywords (ID, CONTENT,COUNT) VALUES (UUID(), #{searchCount},1)\n" +
            "ON DUPLICATE KEY UPDATE COUNT = COUNT+1 ")
    void  insertOrUpdateSearchCount(@Param("searchCount") String searchCount);

    List<KnowledgeBaseVo> getSearchBasicInfo(@Param("systemId")String systemId);

    List<KBDictDataVo> getSelectInfo(@Param("datas") List<KnowledgeBaseVo> knowledgeBaseVos);

    List<KBResultVo> getKbData(@Param("searchVos")List<KBSearchVo> searchVos, @Param("systemId")String systemId,
                               @Param("orderRules") String orderRules,@Param("pageNum") int pageNum,
                               @Param("pageSize") int pageSize,@Param("searchContent") String searchContent
    );
    Integer getKbDataLength(@Param("searchVos")List<KBSearchVo> searchVos, @Param("systemId")String systemId,
                            @Param("searchContent") String searchContent);
}

