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

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cpp.web.domain.cloud.NwpCloud;
import com.cpp.web.mapper.cloud.NwpCloudMapper;
import com.cpp.web.service.cloud.NwpCloudService;
import org.springframework.stereotype.Service;

import java.util.Date;

/**
 * idp_nwp
 *
 * @author tl
 * @date 2024-09-23 15:28:33
 */
@Service
public class NwpCloudServiceImpl extends ServiceImpl<NwpCloudMapper, NwpCloud> implements NwpCloudService {


    @Override
    public QueryWrapper<NwpCloud> getPageByStationCodeAndeTimeBetween(String stationCode, Date startTime, Date endTime, String forecastManufactor) {
        QueryWrapper<NwpCloud> wrapper = new QueryWrapper<>();

        if (stationCode != null && !stationCode.equals("")) {
            wrapper.eq("station_code", stationCode);
        }
        if (startTime != null && !startTime.equals("") && endTime != null && !endTime.equals("")) {
            wrapper.between("pre_time", startTime, endTime);
        }
        if (forecastManufactor != null && !forecastManufactor.equals("")) {
            wrapper.eq("forecast_manufactor", forecastManufactor);
        }
        return wrapper;
    }
}
