package cn.iocoder.yudao.module.tkdata.service.countryInfo;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.iocoder.yudao.module.tkdata.controller.admin.countryInfo.vo.CountryInfoPageReqVO;
import cn.iocoder.yudao.module.tkdata.controller.admin.countryInfo.vo.CountryInfoRespVO;
import cn.iocoder.yudao.module.tkdata.controller.admin.countryInfo.vo.CountryInfoSaveReqVO;
import cn.iocoder.yudao.module.tkdata.dal.dataobject.countryinfo.CountryInfoDO;
import cn.iocoder.yudao.module.tkdata.dal.mysql.countryinfo.CountryInfoMapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;


import java.util.*;

import cn.iocoder.yudao.framework.common.util.object.BeanUtils;





/**
 * 国家与地区信息统计 Service 实现类
 *
 * @author 芋道源码
 */
@Service
@Validated
public class CountryInfoServiceImpl implements CountryInfoService {

    @Resource
    private CountryInfoMapper countryInfoMapper;


    @Override
    public List<CountryInfoRespVO> getCountryInfo(String region) {
        LambdaQueryWrapper<CountryInfoDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        countryInfoMapper.selectList(lambdaQueryWrapper.eq(CountryInfoDO::getCountryGroupName, region));
        return BeanUtils.toBean(countryInfoMapper.selectList(lambdaQueryWrapper), CountryInfoRespVO.class);
    }
}