package cn.cecep.talroad.controller.analysis;

import cn.cecep.talroad.common.core.utils.poi.ExcelUtil;
import cn.cecep.talroad.common.log.annotation.Log;
import cn.cecep.talroad.common.log.enums.BusinessType;
import cn.cecep.talroad.domain.analysis.SRaLowMonitoringGas;
import cn.cecep.talroad.service.analysis.SRaLowMonitoringGasService;
import cn.cecep.talroad.vo.query.analysis.SRaLowMonitoringQuery;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
* (s_ra_low_monitoring_gas)表控制层
*
* @author xxxxx
*/
@RestController
@RequestMapping("/lowMonitoringGas")
@Api(tags = "执法监测数据查询-废气数据查询",value = "废气数据查询")
public class SRaLowMonitoringGasController {
        /**
        * 服务对象
        */
        @Resource
        private SRaLowMonitoringGasService service;

        /**
         * 查询列表
         */
        @ApiOperation("查询废气数据列表")
        @GetMapping("/list")
        public IPage<SRaLowMonitoringGas> list(SRaLowMonitoringQuery param){
            Page<SRaLowMonitoringGas>   page = new Page<>(param.getPageNum(),param.getPageSize());
            return service.page(page,SRaLowMonitoringQuery.createGasWrapper(param,SRaLowMonitoringGas.class));
        }
    /**
     * 查询列表
     */
    @ApiOperation("导出废气数据")
    @Log(title = "任务调度日志", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response,@RequestBody SRaLowMonitoringQuery param){
        List<SRaLowMonitoringGas> list = service.list(SRaLowMonitoringQuery.createGasWrapper(param,SRaLowMonitoringGas.class));
        ExcelUtil<SRaLowMonitoringGas> util = new ExcelUtil<>(SRaLowMonitoringGas.class);
        util.exportExcel(response, list, "导出废气数据");
    }
}
