package com.hzs.member.base.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hzs.common.domain.member.base.CuMemberUpgrade;
import com.hzs.member.base.mapper.CuMemberUpgradeMapper;
import com.hzs.member.base.service.ICuMemberUpgradeService;
import org.springframework.stereotype.Service;

/**
 * 会员升级权限表 服务实现类
 *
 * @author hzs
 * @since 2023-05-22
 */
@Service
public class CuMemberUpgradeServiceImpl extends ServiceImpl<CuMemberUpgradeMapper, CuMemberUpgrade> implements ICuMemberUpgradeService {

    @Override
    public CuMemberUpgrade queryCuMemberUpgradeByCondition(Integer pkCountry, Long pkMember) {
        LambdaQueryWrapper<CuMemberUpgrade> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(CuMemberUpgrade::getPkCountry, pkCountry)
                .eq(CuMemberUpgrade::getPkMember, pkMember)
                .ge(CuMemberUpgrade::getQuantity, 1);
        return baseMapper.selectOne(queryWrapper);
    }

}
