package com.gameplatform.server.mapper.account;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gameplatform.server.model.entity.account.UserAccount;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface UserAccountMapper extends BaseMapper<UserAccount> {
    UserAccount findByUsernameAndType(@Param("username") String username,
                                      @Param("userType") String userType);
    UserAccount findByUsername(@Param("username") String username);
    int setStatus(@Param("id") Long id, @Param("status") String status);
    int updatePassword(@Param("id") Long id, @Param("passwordHash") String passwordHash);

    long countByFilter(@Param("userType") String userType,
                       @Param("status") String status,
                       @Param("keyword") String keyword);

    java.util.List<UserAccount> listByFilter(@Param("userType") String userType,
                                             @Param("status") String status,
                                             @Param("keyword") String keyword,
                                             @Param("size") int size,
                                             @Param("offset") int offset);
}
