package org.wfc.user.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.wfc.user.domain.UCdr;
import org.wfc.user.domain.UClient;
import org.wfc.user.domain.bo.UCdrClientBo;
import org.wfc.user.domain.bo.UUCdrHistoryUserBo;
import org.wfc.user.domain.vo.UCdrClientVo;
import org.wfc.user.domain.vo.UCdrHistoryUserVo;
import org.wfc.user.domain.vo.UCdrLatestHistoryVo;
import org.wfc.user.domain.vo.UCdrUserVo;

import java.util.Date;
import java.util.List;

/**
 * <p>
 * 用户平台_用户话单表 Mapper 接口
 * </p>
 *
 * @author cyc
 * @since 2024-12-09
 */
public interface UCdrMapper extends BaseMapper<UCdr> {

    List<UCdrUserVo> getByUser(@Param("userId") Long userId, @Param("startTime") Long startTime, @Param("endTime") Long endTime);

    List<UCdrClientVo> getByClient(@Param("client") UCdrClientBo client);

    List<UCdrHistoryUserVo> getHistoryByUser(@Param("item") UUCdrHistoryUserBo item);

    List<UCdrLatestHistoryVo> getLatestHistory(@Param("userIds") List<Long> userIds, @Param("endTime") Date endTime);

    Long getCurrentTraffic(@Param("userId") Long userId);

    UClient getClientByFirstSeen(@Param("siteId") String siteId, @Param("clientMac") String clientMac, @Param("firstSeen") Long firstSeen);
}
