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.InverterInfo;
import com.cpp.web.mapper.station.InverterInfoMapper;
import com.cpp.web.service.station.InverterInfoService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * cpp_inverter_info
 *
 * @author tl
 * @date 2024-09-23 15:28:33
 */
@Service
public class InverterInfoServiceImpl extends ServiceImpl<InverterInfoMapper, InverterInfo> implements InverterInfoService {
    @Override
    public QueryWrapper<InverterInfo> getByStationCode(String stationCode) {
        QueryWrapper<InverterInfo> wrapper = new QueryWrapper<>();
        if (stationCode != null && !stationCode.equals("")) {
            wrapper.eq("station_code", stationCode);
        }
        return wrapper;
    }

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