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.BisAcciAssess;
import com.goldenwater.slaj.acci.service.IBisAcciAssessService;

/**
 * 事故考核
 */
@RestController
@RequestMapping("/acci/bisacciassess")
public class BisAcciAssessController extends BaseController {
    @Autowired
    private IBisAcciAssessService bisAcciAssessService;

    @GetMapping("/list")
    public TableDataInfo list(BisAcciAssess bisAcciAssess) {
        startPage();
        List<BisAcciAssess> list = bisAcciAssessService.selectBisAcciAssessList(bisAcciAssess);
        return getDataTable(list);
    }

    @GetMapping("/{id}")
    public AjaxResult getInfo(@PathVariable Long id) {
        return AjaxResult.success(bisAcciAssessService.selectBisAcciAssessById(id));
    }

    @PostMapping
    public AjaxResult add(@RequestBody BisAcciAssess bisAcciAssess) {
        return toAjax(bisAcciAssessService.insertBisAcciAssess(bisAcciAssess));
    }

    @PutMapping
    public AjaxResult edit(@RequestBody BisAcciAssess bisAcciAssess) {
        return toAjax(bisAcciAssessService.updateBisAcciAssess(bisAcciAssess));
    }

    @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids) {
        return toAjax(bisAcciAssessService.deleteBisAcciAssessByIds(ids));
    }
}
