package com.fs.live.mapper;


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

import java.util.List;

/**
 * 直播观看奖励设置Mapper接口
 *
 * @author fs
 * @date 2025-07-08
 */
public interface LiveWatchConfigMapper {
    /**
     * 查询直播观看奖励设置
     *
     * @param id 直播观看奖励设置主键
     * @return 直播观看奖励设置
     */
    LiveWatchConfig selectLiveWatchConfigById(Long id);

    /**
     * 查询直播观看奖励设置列表
     *
     * @param liveWatchConfig 直播观看奖励设置
     * @return 直播观看奖励设置集合
     */
    List<LiveWatchConfig> selectLiveWatchConfigList(LiveWatchConfig liveWatchConfig);

    /**
     * 新增直播观看奖励设置
     *
     * @param liveWatchConfig 直播观看奖励设置
     * @return 结果
     */
    int insertLiveWatchConfig(LiveWatchConfig liveWatchConfig);

    /**
     * 修改直播观看奖励设置
     *
     * @param liveWatchConfig 直播观看奖励设置
     * @return 结果
     */
    int updateLiveWatchConfig(LiveWatchConfig liveWatchConfig);

    /**
     * 删除直播观看奖励设置
     *
     * @param id 直播观看奖励设置主键
     * @return 结果
     */
    int deleteLiveWatchConfigById(Long id);

    /**
     * 批量删除直播观看奖励设置
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    int deleteLiveWatchConfigByIds(Long[] ids);

    /**
     * 根据直播id查询直播观看奖励设置
     *
     * @param id 直播id
     * @return 直播观看奖励设置
     */
    @Select("SELECT " +
            "    id,live_id,participate_condition,watch_duration,action,receive_prompt," +
            "    red_packet_type,red_packet_amount,red_packet_random_amount,red_packet_count," +
            "    red_packet_receive_method,red_packet_receive_time_limit,red_packet_withdraw_condition," +
            "    red_packet_guide,red_packet_guide_text,score_amount,score_max_receiver,score_guide," +
            "    score_guide_link,score_guide_text,config_json from live_watch_config where live_id = #{id}")
    LiveWatchConfig selectLiveWatchConfigByLiveId(Long id);
}
