package com.sptg.permissions.biz.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.sptg.permissions.api.entity.Street;
import com.sptg.permissions.biz.mapper.StreetMapper;
import com.sptg.permissions.biz.service.StreetServiceInterface;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created By lidexi in 2020/12/23
 * 全国街道 - 服务层实现类
 **/
@Service
public class StreetServiceImpl extends ServiceImpl<StreetMapper,Street> implements StreetServiceInterface {

    @Override
    public List<Street> selectStreetByAreaCode(String areaCode) {
        return this.baseMapper.selectStreetByAreaCode(areaCode);
    }

    @Override
    public Street getStreetDetail(String streetCode) {
        Wrapper<Street> wrapper = new EntityWrapper<>();
        wrapper.eq("s_code",streetCode);
        return this.selectOne(wrapper);
    }
}
