package com.trade.service.system.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.trade.service.system.domain.SysCountry;
import com.trade.service.system.mapper.SysCountryMapper;
import com.trade.service.system.service.SysCountryService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 国家地区表 服务实现类
 * </p>
 *
 * @author baomidou
 * @since 2024-06-12
 */
@Service
public class SysCountryServiceImp extends ServiceImpl<SysCountryMapper, SysCountry> implements SysCountryService {

    @Override
    public List<SysCountry> queryCountryList() {
        return this.baseMapper.selectList(null);
    }

    @Override
    public List<SysCountry> queryCountryListByContinent(String continent) {
        return this.baseMapper.selectList(new QueryWrapper<SysCountry>().eq("continent", continent));
    }

    @Override
    public SysCountry queryCountryByCode(String code) {
        return this.baseMapper.selectOne(new QueryWrapper<SysCountry>().eq("code", code));
    }
}
