package com.jiayue.insu.inclientqn.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jiayue.insu.inclientqn.entity.BackForeUsForecastData;
import com.jiayue.insu.inclientqn.entity.BackStatData;
import com.jiayue.insu.inclientqn.mapper.BackForeUsForecastDataMapper;
import com.jiayue.insu.inclientqn.mapper.BackStatDataMapper;
import com.jiayue.insu.inclientqn.service.BackForeUsForecastDataService;
import com.jiayue.insu.inclientqn.service.BackStatDataService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 修正数据业务实现
 *
 * @author yh
 * @version 1.0
 * @since 2022/5/22 11:29
 */
@Service
@Slf4j
public class BackForeUsForecastDataServiceImpl extends ServiceImpl<BackForeUsForecastDataMapper, BackForeUsForecastData> implements BackForeUsForecastDataService {


    @Override
    public List<BackForeUsForecastData> findBySignTime(LocalDateTime time) {
        LambdaQueryWrapper<BackForeUsForecastData> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper.eq(BackForeUsForecastData::getSignTime,time);
        return this.list(lambdaQueryWrapper);
    }

    @Override
    public List<BackForeUsForecastData> findBySignTimeAndStationCode(LocalDateTime time, String stationCode) {
        LambdaQueryWrapper<BackForeUsForecastData> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper.eq(BackForeUsForecastData::getSignTime,time);
        lambdaQueryWrapper.eq(BackForeUsForecastData::getStationCode,stationCode);
        return this.list(lambdaQueryWrapper);
    }
}
