package cn.cecep.talroad.controller;

import cn.cecep.talroad.common.core.web.controller.BasesController;
import cn.cecep.talroad.common.core.web.domain.AjaxResults;
import cn.cecep.talroad.domain.PcFactoryWasteEmissionsRank;
import cn.cecep.talroad.service.IPcFactoryWasteEmissionsRankService;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
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;


/**
 * * 开发公司：中节能天融科技有限公司
 * 危废排放跟踪-实际产生-计划申报Controller 控制层
 *
 * @author szhpt
 * @date 2023-02-13*/
@Api(tags = "危废排放跟踪-实际产生-计划申报")
@RestController
@RequestMapping("/pcFactoryWasteEmissionsRank")
public class PcFactoryWasteEmissionsRankController extends BasesController
{
    @Autowired
    private IPcFactoryWasteEmissionsRankService pcFactoryWasteEmissionsRankService;

    /**
     * 查询危废排放跟踪-实际产生-计划申报列表
     */
    @ApiOperation(value = "查询危废排放跟踪-实际产生-计划申报")
    @GetMapping("/list")
    public AjaxResults<List<PcFactoryWasteEmissionsRank>> list(PcFactoryWasteEmissionsRank query)
    {
        List<PcFactoryWasteEmissionsRank> list = pcFactoryWasteEmissionsRankService.list(new QueryWrapper<PcFactoryWasteEmissionsRank>().eq(ObjectUtil.isNotNull(query.getFactoryId()), "factory_id", query.getFactoryId()).eq(ObjectUtil.isNotNull(query.getDataSource()), "data_source", query.getDataSource()).orderByDesc("emissions_rank"));
        return AjaxResults.success(list);
    }

}
