package com.cpp.web.service.station.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cpp.web.domain.station.WeatherStationInfo;
import com.cpp.web.mapper.station.WeatherStationInfoMapper;
import com.cpp.web.service.station.WeatherStationInfoService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * cpp_weather_station_info
 *
 * @author tl
 * @date 2024-09-23 15:28:33
 */
@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);
    }
}
