package com.sckw.system.dao;

import com.sckw.system.model.KwsUserLogin;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

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

/**
 * @desc: 用户登录
 * @author: czh
 * @date: 2023/6/19
 */
@Mapper
public interface KwsUserLoginDao {

    /**
     * @param kwsUserLogin 实体类
     * @return int
     * @desc: 插入
     * @author: czh
     * @date: 2023/6/21
     */
    int insert(KwsUserLogin kwsUserLogin);

    /**
     * 批量新增
     * @param list
     * @return
     */
    int saveBatch(@Param(value = "list") List<KwsUserLogin> list);

    /**
     * @param userId 用户id
     * @return List
     * @desc: 根据用户ID查
     * @author: czh
     * @date: 2023/6/13
     */
    List<KwsUserLogin> findAllByUserId(@Param(value = "userId") Long userId, @Param(value = "startTime") Date startTime, @Param(value = "endTime") Date endTime);

    /**
     * @param userId 用户id
     * @return KwsUserLogin
     * @desc: 当天登录次数
     * @author: czh
     * @date: 2023/6/19
     */
    KwsUserLogin currentDayLogin(@Param(value = "userId") Long userId);

}
