package com.fs.live.mapper;


import com.fs.live.domain.LiveSensitiveWords;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 直播间敏感词过滤Mapper接口
 *
 * @author fs
 * @date 2025-07-08
 */
public interface LiveSensitiveWordsMapper {
    /**
     * 查询直播间敏感词过滤
     *
     * @param wordId 直播间敏感词过滤主键
     * @return 直播间敏感词过滤
     */
    LiveSensitiveWords selectLiveSensitiveWordsByWordId(Long wordId);

    /**
     * 查询直播间敏感词过滤列表
     *
     * @param liveSensitiveWords 直播间敏感词过滤
     * @return 直播间敏感词过滤集合
     */
    List<LiveSensitiveWords> selectLiveSensitiveWordsList(LiveSensitiveWords liveSensitiveWords);

    /**
     * 新增直播间敏感词过滤
     *
     * @param liveSensitiveWords 直播间敏感词过滤
     * @return 结果
     */
    int insertLiveSensitiveWords(LiveSensitiveWords liveSensitiveWords);

    /**
     * 修改直播间敏感词过滤
     *
     * @param liveSensitiveWords 直播间敏感词过滤
     * @return 结果
     */
    int updateLiveSensitiveWords(LiveSensitiveWords liveSensitiveWords);

    /**
     * 删除直播间敏感词过滤
     *
     * @param wordId 直播间敏感词过滤主键
     * @return 结果
     */
    int deleteLiveSensitiveWordsByWordId(Long wordId);

    /**
     * 批量删除直播间敏感词过滤
     *
     * @param wordIds 需要删除的数据主键集合
     * @return 结果
     */
    int deleteLiveSensitiveWordsByWordIds(Long[] wordIds);

    /**
     * 查询所有敏感词
     * @return
     */
    List<String> selectAllWords();

    @Select("select count(1) from live_sensitive_words where word=#{word}")
    int selectWordsByName(@Param("word") String word);
}
