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.WindTowerInfo;
import com.cpp.web.mapper.station.WindTowerInfoMapper;
import com.cpp.web.service.station.WindTowerInfoService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * cpp_wind_tower_info
 *
 * @author tl
 * @date 2024-09-23 15:28:33
 */
@Service
public class WindTowerInfoServiceImpl extends ServiceImpl<WindTowerInfoMapper, WindTowerInfo> implements WindTowerInfoService {
    @Override
    public QueryWrapper<WindTowerInfo> findByStationCode(String stationCode) {
        QueryWrapper<WindTowerInfo> wrapper = new QueryWrapper<>();
        if (stationCode != null && !stationCode.equals("")) {
            wrapper.eq("station_code", stationCode);
        }
        return wrapper;
    }

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