package com.ruoyi.base.mapper;

import java.util.List;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.base.domain.BaseCardRights;
import com.ruoyi.base.vo.CardRightsVO;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;

/**
 * 会员卡权益Mapper接口
 *
 * @author vinjor-m
 * @date 2025-03-17
 */
@Mapper
public interface BaseCardRightsMapper extends BaseMapper<BaseCardRights> {
    IPage<BaseCardRights> queryListPage(@Param("entity") BaseCardRights entity, Page<BaseCardRights> page);

    /**
     * 查询会员卡权益
     *
     * @param cardId   会员卡id
     * @param userType 用户类型
     * @return java.util.List<com.ruoyi.base.domain.BaseCardRights>
     * @author vinjor-M
     * @date 15:24 2025/3/18
     **/
    List<CardRightsVO> getByIdAndType(@Param("cardId") String cardId, @Param("userType") String userType);

    int removeByCardId(@Param("cardId") String cardId);

    /**
     * 通过会员卡id查询会员卡权益
     *
     * @param cardId 会员卡id
     * @return java.util.List<com.ruoyi.base.vo.CardRightsVO>
     * @author PQZ
     * @date 10:36 2025/3/27
     **/
    List<CardRightsVO> queryByCardId(@Param("cardId") String cardId);
}
