package com.nantian.cloud.dbcapp.controller;


import com.nantian.cloud.dbcapp.service.MonitorOnlineService;
import com.nantian.sc.cloud.common.core.util.R;
import com.nantian.sc.cloud.common.log.annotation.SysLog;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
* @Description: 在线监测综合能耗controller (给在线监测提供数据来源)
* @Param: 
* @return: 
* @Author: zfw
* @Date: 2020/12/22
* @Date: 20:05
*/
@CrossOrigin
@RestController
@AllArgsConstructor
@RequestMapping("/monitorOnline")
@Api(value = "monitorOnline", tags = "在线监测综合能耗")

public class MonitorOnlineController {

   private final MonitorOnlineService monitorOnlineService;
    /**
     * 查询综合能耗值(按企业)
     *
     * @param
     * @return R
     */
    @GetMapping("/getZHNHByCompany")
    @SysLog("根据条件获取综合能耗(按企业)")
    @ApiOperation(value = "根据条件获取综合能耗", notes = "根据条件获取综合能耗")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "area", value = "地区", required = false, dataType = "string ", paramType = "path"),
            @ApiImplicitParam(name = "industry", value = "行业", required = false, dataType = "string ", paramType = "path"),
            @ApiImplicitParam(name = "time", value = "周期", required = false, dataType = "string", paramType = "path")
                })
    public R getTotal( String  area ,String   industry,String time) {
        return R.ok(monitorOnlineService.getZHNHByCompany(area ,industry, time),"查询成功");
    }



  /**
     * 在线监测综合能耗
     *
     * @param
     * @return R
     */
    @GetMapping("/getTotalZHNH")
    @SysLog("根据条件获取总在线监测综合能耗")
    @ApiOperation(value = "根据条件获取总综合能耗", notes = "根据条件获取总综合能耗")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "area", value = "地区", required = false, dataType = "string []", paramType = "path"),
            @ApiImplicitParam(name = "industry", value = "行业", required = false, dataType = "string []", paramType = "path"),
            @ApiImplicitParam(name = "time", value = "周期", required = false, dataType = "string", paramType = "path")
    })
    public R getTotalZHNH( String [] area ,String  [] industry,String time) {
        return R.ok(monitorOnlineService.getTotalZHNH(area,industry,time),"查询成功");
    }



}
