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.SRaLowMonitoringOther;
import cn.cecep.talroad.service.analysis.SRaLowMonitoringOtherService;
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_other)表控制层
*
* @author xxxxx
*/
@RestController
@RequestMapping("/lowMonitoringOther")
@Api(tags = "执法监测数据查询-其他数据查询",value = "其他数据查询")
public class SRaLowMonitoringOtherController {
    /**
    * 服务对象
    */
    @Resource
    private SRaLowMonitoringOtherService service;
    /**
     * 查询列表
     */
    @ApiOperation("查询其他数据列表")
    @GetMapping("/list")
    public IPage<SRaLowMonitoringOther> list(SRaLowMonitoringQuery param){
        Page<SRaLowMonitoringOther> page = new Page<>(param.getPageNum(),param.getPageSize());
        return service.page(page,SRaLowMonitoringQuery.createGasWrapper(param,SRaLowMonitoringOther.class));
    }
    /**
     * 查询列表
     */
    @ApiOperation("导出其他数据")
    @Log(title = "任务调度日志", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, @RequestBody SRaLowMonitoringQuery param){
        List<SRaLowMonitoringOther> list = service.list(SRaLowMonitoringQuery.createGasWrapper(param,SRaLowMonitoringOther.class));
        ExcelUtil<SRaLowMonitoringOther> util = new ExcelUtil<>(SRaLowMonitoringOther.class);
        util.exportExcel(response, list, "导出其他数据");
    }

}
