package com.gyee.runeconomy.controller;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gyee.common.config.R;
import com.gyee.runeconomy.model.auto.ProEconTargetdataCopy;
import com.gyee.runeconomy.service.auto.IProEconTargetdataCopyService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author wang
 * @since 2023-07-24
 */
@RestController
@RequestMapping("//pro-econ-targetdata-copy")
public class ProEconTargetdataCopyController {

    @Resource
    private IProEconTargetdataCopyService proEconTargetdataCopyService;

    @GetMapping(value = "/list")
    @ApiOperation(value = "后台查询-列表", notes = "后台查询-列表")
    public R findList(@RequestParam(value = "windpowerstationid", required = false) String windpowerstationid,
                      @RequestParam(value = "windpowerstationName", required = false) String windpowerstationName,
                      @RequestParam(value = "recorddate", required = false) String recorddate,
                      @RequestParam(value = "pageNum", required = true) String pageNum,
                      @RequestParam(value = "pageSize", required = true) String pageSize) {
        IPage<ProEconTargetdataCopy> list = proEconTargetdataCopyService.getList(windpowerstationid, windpowerstationName, recorddate, pageNum, pageSize);
        if (null != list) {
            return R.ok().data(list);
        } else {
            return R.error().data("查询失败！");
        }
    }


}
