package com.goldenwater.slaj.hazard.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.hazard.domain.TBusiHazIdenMw;
import com.goldenwater.slaj.hazard.service.ITBusiHazIdenMwService;

/**
 * 辨识表MW版
 */
@RestController
@RequestMapping("/hazard/tbusihazidenmw")
public class TBusiHazIdenMwController extends BaseController {
    @Autowired
    private ITBusiHazIdenMwService tBusiHazIdenMwService;

    @GetMapping("/list")
    public TableDataInfo list(TBusiHazIdenMw tBusiHazIdenMw) {
        startPage();
        List<TBusiHazIdenMw> list = tBusiHazIdenMwService.selectTBusiHazIdenMwList(tBusiHazIdenMw);
        return getDataTable(list);
    }

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

    @PostMapping
    public AjaxResult add(@RequestBody TBusiHazIdenMw tBusiHazIdenMw) {
        return toAjax(tBusiHazIdenMwService.insertTBusiHazIdenMw(tBusiHazIdenMw));
    }

    @PutMapping
    public AjaxResult edit(@RequestBody TBusiHazIdenMw tBusiHazIdenMw) {
        return toAjax(tBusiHazIdenMwService.updateTBusiHazIdenMw(tBusiHazIdenMw));
    }

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