package com.zioinfo.mall.member.mapper;

import com.zioinfo.mall.member.MallMember;
import com.zioinfo.mall.member.MallMemberSummary;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface MemberMapper {
    MallMember findByUsername(@Param("username") String username);
    int upsert(MallMember m);

    /** 관리자 회원 목록(검색·등급 필터). 주문수/매출 집계 포함, PII 비노출. */
    List<MallMemberSummary> adminList(@Param("keyword") String keyword,
                                      @Param("tier") String tier,
                                      @Param("limit") int limit);

    int countAdminList(@Param("keyword") String keyword, @Param("tier") String tier);
}
