package com.cool.store.dao;

import com.cool.store.entity.RegionQrcodeConfigDO;
import com.cool.store.mapper.RegionQrcodeConfigMapper;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.Objects;

/**
 * @author wxp
 * @ClassName RegionDao
 * @Description 用一句话描述什么
 */
@Repository
public class RegionQrcodeConfigDao {

    @Resource
    private RegionQrcodeConfigMapper regionQrcodeConfigMapper;

    public String getPayPicByRegionId(Long regionId) {
        if ( Objects.isNull(regionId)) {
            return "";
        }
        RegionQrcodeConfigDO regionQrcodeConfigDO =  regionQrcodeConfigMapper.getByRegionId(regionId);
        if(regionQrcodeConfigDO != null){
            return regionQrcodeConfigDO.getPayPic();
        }
        return "";
    }

}
