package com.ruoyi.system.mapper;

import java.time.LocalDate;
import java.util.Date;
import java.util.List;
import com.ruoyi.system.domain.DailyUser;
import com.ruoyi.system.domain.SysUserOnlineTime;
import com.ruoyi.system.domain.dto.DailyUserDto;
import org.apache.ibatis.annotations.Param;

/**
 * userDailyMapper接口
 * 
 * @author 昊天
 * @date 2024-11-04
 */
public interface DailyUserMapper 
{
    /**
     * 查询userDaily
     * 
     * @param dailyUserId userDaily主键
     * @return userDaily
     */
    public DailyUser selectDailyUserByDailyUserId(Long dailyUserId);

    /**
     * 查询userDaily列表
     * 
     * @param dailyUser userDaily
     * @return userDaily集合
     */
    public List<DailyUser> selectDailyUserList(DailyUser dailyUser);

    /**
     * 新增userDaily
     * 
     * @param dailyUser userDaily
     * @return 结果
     */
    public int insertDailyUser(DailyUser dailyUser);

    /**
     * 修改userDaily
     * 
     * @param dailyUser userDaily
     * @return 结果
     */
    public int updateDailyUser(DailyUser dailyUser);


    public int updateByUserIdAndDate(@Param("onlineTime")Long onlineTime, @Param("userId") Long userId, @Param("date") LocalDate date, @Param("updateTime") Date updateTime);

    /**
     * 删除userDaily
     * 
     * @param dailyUserId userDaily主键
     * @return 结果
     */
    public int deleteDailyUserByDailyUserId(Long dailyUserId);

    /**
     * 批量删除userDaily
     * 
     * @param dailyUserIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteDailyUserByDailyUserIds(Long[] dailyUserIds);

    public DailyUser selectByUserIdAndDate(@Param("userId") Long userId, @Param("date") LocalDate date);

    public Long getTotalOnlineTime(@Param("date") LocalDate date);

    public Long getTotalMRTime(@Param("date") LocalDate date);

    /*
     * 返回每天资源位总的被购买次数
     * */
    public Long getTotalBought(@Param("date") LocalDate date);

    /*
     * 系统每天统计用户相关信息
     * */
    public DailyUserDto getStDailyUser(@Param("date") LocalDate date);
}
