package com.zksy.environmentHJ212.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zksy.common.core.domain.Result;
import com.zksy.common.utils.SearchUtil;
import com.zksy.environmentHJ212.domain.po.MinuteDataInfo;
import com.zksy.environmentHJ212.domain.po.PsMonitorSz;
import com.zksy.environmentHJ212.service.MinuteDataInfoService;
import com.zksy.environmentHJ212.service.PsMonitorSzService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author Administrator
 * @version 1.0
 * @project zksy-iot-service
 * @description HJ212实时数据
 * @date 2025/5/6 16:51:27
 */
@RestController
@RequestMapping("/psMonitorSz")
@Api(tags = "实时数据", description = "实时数据")
public class PsMonitorSzController {
    @Autowired
    private PsMonitorSzService service;

    @GetMapping("/findByPage")
    @ApiOperation(value = "分页查询")
    public Result getPsMonitorSzPage(long pageNum, long pageSize, String conditionJson) throws Exception {
        Page<PsMonitorSz> page = service.page(new Page<>(pageNum, pageSize), SearchUtil.parseWhereSql(conditionJson));
        return Result.ok(page);
    }
    @GetMapping("/getAll")
    @ApiOperation(value = "查询所有")
    public Result getAllByConditionJson(String conditionJson) throws Exception {
        List<PsMonitorSz> list = service.list(SearchUtil.parseWhereSql(conditionJson));
        return Result.ok(list);
    }
}
