package com.nantian.cloud.jly.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.nantian.cloud.jly.entity.CheckBasis;
import com.nantian.cloud.jly.entity.CheckDev;
import com.nantian.cloud.jly.entity.ConfigureDevice;
import com.nantian.cloud.jly.entity.ConfigureGridding;
import com.nantian.cloud.jly.service.ConfigureDeviceService;
import com.nantian.cloud.jly.service.ConfigureGriddingService;
import com.nantian.sc.cloud.common.core.util.R;
import com.nantian.sc.cloud.common.log.annotation.SysLog;
import com.nantian.sc.cloud.common.security.service.ScUser;
import com.nantian.sc.cloud.common.security.util.SecurityUtils;
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.*;

import java.util.Date;
import java.util.List;


/**
 * 主要用能设备
 *
 * @author
 * @date 2021-02-24 10:20:44
 */
@RestController
@AllArgsConstructor
@Api(value = "configureDevice", tags = "主要用能设备")
@RequestMapping("/configureDevice")
public class ConfigureDeviceController {
    private final ConfigureDeviceService configureDeviceService;

    @SysLog("主要用能设备-查询")
    @GetMapping("/getDevList")
    public R getDevList(String epc) {
        QueryWrapper<ConfigureDevice> queryWrapper = new QueryWrapper<ConfigureDevice>();
        queryWrapper.eq("enterprise_code",epc);
        List<ConfigureDevice> list = configureDeviceService.list(queryWrapper);
        return R.ok(list);
    }

    @SysLog("主要用能设备-分页查询")
    @GetMapping("/getDevPage")
    public R getDevPage(Page page, ConfigureDevice configureDevice) {
        IPage<ConfigureDevice> pageScope = configureDeviceService.getDevPage(page, configureDevice);
        return R.ok(pageScope);
    }


}
