package com.fs.course.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.fs.course.domain.FsCourseWatchLog;
import com.fs.course.param.*;
import com.fs.course.vo.FsCourseOverVO;
import com.fs.course.vo.FsCourseUserStatisticsListVO;
import com.fs.course.vo.FsCourseWatchLogListVO;
import com.fs.course.vo.FsCourseWatchLogStatisticsListVO;

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

/**
 * 短链课程看课记录Service接口
 *
 * @author fs
 * @date 2024-09-18
 */
public interface IFsCourseWatchLogService extends IService<FsCourseWatchLog> {
    /**
     * 查询短链课程看课记录
     *
     * @param logId 短链课程看课记录主键
     * @return 短链课程看课记录
     */
    public FsCourseWatchLog selectFsCourseWatchLogByLogId(Long logId);

    /**
     * 查询短链课程看课记录列表
     *
     * @param fsCourseWatchLog 短链课程看课记录
     * @return 短链课程看课记录集合
     */
    public List<FsCourseWatchLog> selectFsCourseWatchLogList(FsCourseWatchLog fsCourseWatchLog);


    /**
     * 查询短链课程看课记录
     *
     * @param param 短链课程看课记录
     * @return 短链课程看课记录
     */
    public FsCourseWatchLog selectFsCourseWatchLog(FsCourseWatchLogParam param);


    /**
     * 新增短链课程看课记录
     *
     * @param fsCourseWatchLog 短链课程看课记录
     * @return 结果
     */
    public int insertFsCourseWatchLog(FsCourseWatchLog fsCourseWatchLog);

    /**
     * 修改短链课程看课记录
     *
     * @param fsCourseWatchLog 短链课程看课记录
     * @return 结果
     */
    public int updateFsCourseWatchLog(FsCourseWatchLog fsCourseWatchLog);

    /**
     * 批量删除短链课程看课记录
     *
     * @param logIds 需要删除的短链课程看课记录主键集合
     * @return 结果
     */
    public int deleteFsCourseWatchLogByLogIds(Long[] logIds);

    /**
     * 删除短链课程看课记录信息
     *
     * @param logId 短链课程看课记录主键
     * @return 结果
     */
    public int deleteFsCourseWatchLogByLogId(Long logId);

    FsCourseWatchLog getWatchCourseVideo(Long userId,Long videoId,String qwUserId,Long externalId);

    FsCourseWatchLog getWatchCourseLogVideoBySop(Long videoId,String qwUserId,Long externalId);


    List<FsCourseWatchLogListVO> selectFsCourseWatchLogListVO(FsCourseWatchLogListParam param);
    List<FsCourseWatchLogListVO> selectFsCourseWatchLogListVONew(FsCourseWatchLogListParam param);
    Long selectFsCourseWatchLogListVOCount(FsCourseWatchLogListParam param);
    List<FsCourseWatchLogListVO> selectFsCourseWatchLogListVOExport(FsCourseWatchLogListParam param);

    List<FsCourseWatchLogListVO> selectFsCourseWatchLogListByParam(FsCourseWatchLogListParam param);

    void testFinishMsg();

    List<FsCourseWatchLogStatisticsListVO> selectFsCourseWatchLogStatisticsListVO(FsCourseWatchLogStatisticsListParam param);
    List<FsCourseWatchLogStatisticsListVO> selectFsCourseWatchLogStatisticsListVONew(FsCourseWatchLogStatisticsListParam param);
    Long selectFsCourseWatchLogStatisticsListVONewCount(FsCourseWatchLogStatisticsListParam param);

    void scheduleBatchUpdateToDatabase();

    void checkWatchStatus();

    List<FsCourseUserStatisticsListVO> selectFsCourseUserStatisticsListVO(FsCourseUserStatisticsListParam param);

    List<FsCourseOverVO> selectFsCourseWatchLogOverStatisticsListVO(FsCourseOverParam param);
    List<FsCourseOverVO> selectFsCourseWatchLogOverStatisticsListVONew(FsCourseOverParam param);

    void addCourseWatchLogDayNew();

    void addCourseWatchLogDay();


    FsCourseWatchLog getWatchCourseVideoH5(Long videoId,String qwUserId,Long externalId);

    /**
     * 根据条件查询数量
     * @param params    参数
     * @return  count
     */
    int countByMap(Map<String, Object> params);

    void del();

    /**
     * 通过视频id和用户id获取看课记录
     * @param videoId
     * @param fsUserId
     * @return
     */
    FsCourseWatchLog getWatchLogByFsUser(Long videoId, Long fsUserId, Long companyUserId);

    void scheduleUpdateDurationToDatabase();

    void checkFsUserWatchStatus();

}
