package com.hzs.member.detail.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hzs.common.domain.member.detail.CuMemberLevel;
import com.hzs.common.domain.sale.ext.SaOrderExt;
import org.apache.ibatis.annotations.Param;

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

/**
 * 会员信息-等级升级记录 Mapper 接口
 *
 * @author hzs
 * @since 2022-10-11
 */
public interface CuMemberLevelMapper extends BaseMapper<CuMemberLevel> {

    /**
     * 查询当天最大的等级
     *
     * @param saOrderExtList 订单
     * @param currentDate    日期，当天
     * @return: CuMemberLevel
     * @Author: sui q
     * @Date: 2023/2/13 10:36
     */
    List<CuMemberLevel> queryMaxLevelCurrentDate(@Param("saOrderExtList") List<SaOrderExt> saOrderExtList, @Param("currentDate") Date currentDate);

    /**
     * 查询手动升级的最新一条
     *
     * @param pkMember  会员ID
     * @param pkCountry 所属国家
     * @return
     */
    CuMemberLevel queryLastManualUpgrade(@Param("pkMember") Long pkMember, @Param("pkCountry") Integer pkCountry);

}
