package com.zioinfo.mall.admin.mapper;

import com.zioinfo.mall.auth.MallUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/** 관리자 사용자 관리 매퍼. mall_account 테이블 사용. */
@Mapper
public interface AdminUserMapper {

    List<MallUser> findAll();

    MallUser findById(@Param("id") Long id);

    int insert(MallUser user);

    int updateRole(@Param("id") Long id, @Param("role") String role);

    int updateActive(@Param("id") Long id, @Param("active") boolean active);

    int updatePassword(@Param("id") Long id, @Param("passwordHash") String passwordHash);

    int deleteById(@Param("id") Long id);

    int countAdmins();

    int countByUsername(@Param("username") String username);
}
