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.WindTowerInfo;
import com.jiayue.ipp.idp.mapper.WindTowerInfoMapper;
import com.jiayue.ipp.idp.service.WindTowerInfoService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * idp_wind_tower_info
 *
 * @author whc
 * @date 2022-03-18 15:49:56
 */
@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);
    }
}
