package com.jiayue.ipp.idp.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jiayue.ipp.common.data.entity.WeatherStationInfo;
import com.jiayue.ipp.idp.mapper.WeatherStationInfoMapper;
import com.jiayue.ipp.idp.service.WeatherStationInfoService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * idp_weather_station_info
 *
 * @author whc
 * @date 2022-03-18 15:49:41
 */
@Service
public class WeatherStationInfoServiceImpl extends ServiceImpl<WeatherStationInfoMapper, WeatherStationInfo> implements WeatherStationInfoService {
    @Override
    public QueryWrapper<WeatherStationInfo> findByStationCode(String stationCode) {
        QueryWrapper<WeatherStationInfo> wrapper = new QueryWrapper<>();
        if (stationCode != null && !stationCode.equals("")) {
            wrapper.eq("station_code", stationCode);
        }
        return wrapper;
    }

    @Override
    public List<WeatherStationInfo> getByStationCode(String stationCode) {
        QueryWrapper<WeatherStationInfo> wrapper = new QueryWrapper<>();
        if (stationCode != null && !stationCode.equals("")) {
            wrapper.eq("station_code", stationCode);
        }
        return baseMapper.selectList(wrapper);
    }
}
