package com.starry.admin.modules.withdraw.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.starry.admin.modules.withdraw.entity.TenantAlipayConfigEntity;
import com.starry.admin.modules.withdraw.mapper.TenantAlipayConfigMapper;
import com.starry.admin.modules.withdraw.service.ITenantAlipayConfigService;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;

@Service
public class TenantAlipayConfigServiceImpl implements ITenantAlipayConfigService {

    @Resource
    private TenantAlipayConfigMapper mapper;

    @Override
    public boolean hasConfig(String tenantId) {
        LambdaQueryWrapper<TenantAlipayConfigEntity> q = new LambdaQueryWrapper<>();
        q.eq(TenantAlipayConfigEntity::getTenantId, tenantId);
        return mapper.selectCount(q) > 0;
    }
}
