package com.fs.course.mapper;

import java.util.List;
import com.fs.course.domain.FsCourseTrafficLog;
import com.fs.course.param.FsCourseTrafficLogParam;
import com.fs.course.vo.FsCourseTrafficLogListVO;
import com.fs.statis.dto.TrafficLogDTO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 短链课程流量记录Mapper接口
 *
 * @author fs
 * @date 2024-10-31
 */
public interface FsCourseTrafficLogMapper
{
    /**
     * 查询短链课程流量记录
     *
     * @param logId 短链课程流量记录主键
     * @return 短链课程流量记录
     */
    public FsCourseTrafficLog selectFsCourseTrafficLogByLogId(Long logId);

    /**
     * 查询短链课程流量记录列表
     *
     * @param fsCourseTrafficLog 短链课程流量记录
     * @return 短链课程流量记录集合
     */
    public List<FsCourseTrafficLog> selectFsCourseTrafficLogList(FsCourseTrafficLog fsCourseTrafficLog);

    /**
     * 新增短链课程流量记录
     *
     * @param fsCourseTrafficLog 短链课程流量记录
     * @return 结果
     */
    public int insertFsCourseTrafficLog(FsCourseTrafficLog fsCourseTrafficLog);

    /**
     * 修改短链课程流量记录
     *
     * @param fsCourseTrafficLog 短链课程流量记录
     * @return 结果
     */
    public int updateFsCourseTrafficLog(FsCourseTrafficLog fsCourseTrafficLog);

    /**
     * 删除短链课程流量记录
     *
     * @param logId 短链课程流量记录主键
     * @return 结果
     */
    public int deleteFsCourseTrafficLogByLogId(Long logId);

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


    List<FsCourseTrafficLogListVO> selectTrafficByCompany(@Param("maps") FsCourseTrafficLogParam param);

    @Select("select * from fs_course_traffic_log where uu_id = #{uuId}")
    FsCourseTrafficLog selectFsCourseTrafficLogByuuId(@Param("uuId") String uuId);

    void insertOrUpdateTrafficLog(FsCourseTrafficLog trafficLog);

    List<FsCourseTrafficLogListVO> selectTrafficNew(FsCourseTrafficLogParam param);


    /**
     * 获取当天统计流量
     * @return Long
     */
    Long getTodayTrafficLog();
    Long getTodayTrafficLogCompanyId(@Param("companyId") Long companyId);

    /**
     * 获取当月统计流量
     * @return Long
     */
    Long getMonthTrafficLog();
    Long getMonthTrafficLogCompanyId(@Param("companyId") Long companyId);

    /**
     * 昨天
     * @return Long
     */
    Long getYesterdayTrafficLog();
    Long getYesterdayTrafficLogCompanyId(@Param("companyId") Long companyId);

}
