package com.ruoyi.system.controller;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.domain.ActSuppliesHistorydata;
import com.ruoyi.system.service.IActSuppliesHistorydataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import java.util.List;


/**
 *  清洗规则Controller
 *
 * @author
 * @date 2023-08-30
 */
@RestController
@RequestMapping("/system/cleaningrule")
public class ActSuppliesCleaningRuleController extends BaseController
{

    @Autowired
    private IActSuppliesHistorydataService actSuppliesHistorydataService;

    /**
     * 获取所有历史数据
     */
    @PreAuthorize("@ss.hasPermi('system:cleaningrule:queryAll')")
    @GetMapping("/queryAll/{tylkStatus}")
    public AjaxResult selectActSuppliesHistorydata(@PathVariable("tylkStatus") Integer tylkStatus)
    {

        List<ActSuppliesHistorydata> s = actSuppliesHistorydataService.selectActSuppliesHistorydata(tylkStatus);
        return AjaxResult.success(s);

    }

    /**
     * 获取所有历史数据
     */
    @PreAuthorize("@ss.hasPermi('system:cleaningrule:queryAllAcc')")
    @PutMapping("/queryAllAcc")
    public AjaxResult selectActSuppliesHistorydataAcc(@RequestBody ActSuppliesHistorydata actSuppliesHistorydata)
    {

        List<ActSuppliesHistorydata> s = actSuppliesHistorydataService.selectActSuppliesHistorydataAcc(actSuppliesHistorydata);
        return AjaxResult.success(s);

    }

}

