package com.jiayue.insu.inclientqn.controller;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jiayue.insu.common.core.util.R;
import com.jiayue.insu.inclientqn.entity.BackForeForecastData;
import com.jiayue.insu.inclientqn.entity.CorrforeSt;
import com.jiayue.insu.inclientqn.service.BackForeForecastDataService;
import com.jiayue.insu.inclientqn.service.CorrforeStService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;


/**
 * backForeForecstData
 *
 * @author yh
 * @date 2022-03-18 15:48:48
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/backForeForecastData")
public class BackForeForecastDataController {

    private final BackForeForecastDataService backForeForecstDataService;

    /**
     * 分页查询
     *
     * @param page   分页对象
     * @param backForeForecastData backForeForecastData
     * @return
     */

    @GetMapping("/page")
    public R getPage(Page page, BackForeForecastData backForeForecastData) {
            LambdaQueryWrapper<BackForeForecastData> lambdaQueryWrapper = new LambdaQueryWrapper<>();


        if(backForeForecastData.getSignTime()!=null){
            lambdaQueryWrapper.eq(BackForeForecastData::getSignTime,backForeForecastData.getSignTime());

        }
        lambdaQueryWrapper.orderByAsc(BackForeForecastData::getForecastTime);

        return R.ok(backForeForecstDataService.page(page, lambdaQueryWrapper));
    }





}
