package com.fs.course.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.fs.course.domain.FsVideoResource;
import com.fs.course.vo.FsVideoResourceVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

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

public interface FsVideoResourceMapper extends BaseMapper<FsVideoResource> {

    /**
     * 查询素材库列表
     *
     * @param params    参数
     * @return  list
     */
    List<FsVideoResourceVO> selectVideoResourceListByMap(@Param("params") Map<String, Object> params);

    @Select("select * from fs_video_resource where line1 is not null and is_transcode = 0 and is_del = 0")
    List<FsVideoResource> selectVideoNotTranscode();


    @Select("select * from fs_video_resource where file_key = 'course/20251020/1760932918788.mp4'")
    List<FsVideoResource> selectVideoNotTranscodeTest();


    @Select("select * from fs_video_resource where is_transcode = 1 and is_del = 0 and transcode_file_key is null")
    List<FsVideoResource> selectVideoIsTranscode();

    @Select("select * from fs_video_resource where file_key = #{fileKey} limit 1")
    FsVideoResource selectByFileKey(String fileKey);

    List<FsVideoResource> selectByIds(@Param("ids") long[] ids);
}
