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.WindTurbineInfo;
import com.jiayue.ipp.idp.mapper.WindTurbineInfoMapper;
import com.jiayue.ipp.idp.service.WindTurbineInfoService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * idp_wind_turbine_info
 *
 * @author whc
 * @date 2022-03-18 15:50:00
 */
@Service
public class WindTurbineInfoServiceImpl extends ServiceImpl<WindTurbineInfoMapper, WindTurbineInfo> implements WindTurbineInfoService {
    @Override
    public QueryWrapper<WindTurbineInfo> getByStationCode(String stationCode) {
        QueryWrapper<WindTurbineInfo> wrapper = new QueryWrapper<>();
        if (stationCode != null && !stationCode.equals("")) {
            wrapper.eq("station_code", stationCode);
        }
        return wrapper;
    }

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