package com.jiayue.insu.inclientqn.controller;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jiayue.insu.common.core.util.R;
import com.jiayue.insu.inclientqn.entity.BackStatData;
import com.jiayue.insu.inclientqn.entity.CorrectUltraShortTerm;
import com.jiayue.insu.inclientqn.service.BackStatDataService;
import com.jiayue.insu.inclientqn.service.CorrectUltraShortTermService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


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

    private final CorrectUltraShortTermService correctUltraShortTermService;

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

    @GetMapping("/page")
    public R getPage(Page page, CorrectUltraShortTerm correctUltraShortTerm) {

        LambdaQueryWrapper<CorrectUltraShortTerm> lambdaQueryWrapper = new LambdaQueryWrapper<>();


        if(correctUltraShortTerm.getSignTime()!=null ){
            lambdaQueryWrapper.eq(CorrectUltraShortTerm::getSignTime, correctUltraShortTerm.getSignTime());
        }

        lambdaQueryWrapper.orderByAsc(CorrectUltraShortTerm::getSignTime);

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





}
