package cn.pluss.platform.mapper;

import cn.pluss.platform.entity.MerchantMemberCode;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * 动态商户会员卡生成记录 Mapper 接口
 * </p>
 *
 * @author crystal
 * @since 2022-06-07
 */
public interface MerchantMemberCodeMapper extends BaseMapper<MerchantMemberCode> {

    @Select("SELECT * FROM tb_pluss_merchant_member_code WHERE `code` = #{code}")
    MerchantMemberCode getByCode(String code);

    @Delete("DELETE FROM tb_pluss_merchant_member_code WHERE `cardNo` = #{cardNo}")
    void removeByCardNo(String cardNo);
}
