package com.goldenwater.slaj.acci.controller;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.goldenwater.common.core.controller.BaseController;
import com.goldenwater.common.core.domain.AjaxResult;
import com.goldenwater.common.core.page.TableDataInfo;
import com.goldenwater.slaj.acci.domain.BisAcciRecRep;
import com.goldenwater.slaj.acci.service.IBisAcciRecRepService;

/**
 * 事故督办
 */
@RestController
@RequestMapping("/acci/bisaccirecrep")
public class BisAcciRecRepController extends BaseController {
    @Autowired
    private IBisAcciRecRepService bisAcciRecRepService;

    @GetMapping("/list")
    public TableDataInfo list(BisAcciRecRep bisAcciRecRep) {
        startPage();
        List<BisAcciRecRep> list = bisAcciRecRepService.selectBisAcciRecRepList(bisAcciRecRep);
        return getDataTable(list);
    }

    @GetMapping("/{guid}")
    public AjaxResult getInfo(@PathVariable String guid) {
        return AjaxResult.success(bisAcciRecRepService.selectBisAcciRecRepByGuid(guid));
    }

    @PostMapping
    public AjaxResult add(@RequestBody BisAcciRecRep bisAcciRecRep) {
        return toAjax(bisAcciRecRepService.insertBisAcciRecRep(bisAcciRecRep));
    }

    @PutMapping
    public AjaxResult edit(@RequestBody BisAcciRecRep bisAcciRecRep) {
        return toAjax(bisAcciRecRepService.updateBisAcciRecRep(bisAcciRecRep));
    }

    @DeleteMapping("/{guids}")
    public AjaxResult remove(@PathVariable String[] guids) {
        return toAjax(bisAcciRecRepService.deleteBisAcciRecRepByGuids(guids));
    }
}
