package cn.iocoder.yudao.module.system.dal.mysql.bank;

import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.system.dal.dataobject.bank.UserBankDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 用户和银行卡关联 Mapper
 *
 * @author 符溶馨
 */
@Mapper
public interface UserBankMapper extends BaseMapperX<UserBankDO> {

    default UserBankDO selectByBankId(Long userId, Long bankId) {

        return selectOne(new LambdaQueryWrapperX<UserBankDO>()
                .eq(UserBankDO::getUserId, userId)
                .eq(UserBankDO::getBankId, bankId));
    }
}