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.TBusiHazIdenMwZ;
import com.goldenwater.slaj.hazard.service.ITBusiHazIdenMwZService;

/**
 * 辨识表MW_Z版
 */
@RestController
@RequestMapping("/hazard/tbusihazidenmwz")
public class TBusiHazIdenMwZController extends BaseController {
    @Autowired
    private ITBusiHazIdenMwZService tBusiHazIdenMwZService;

    @GetMapping("/list")
    public TableDataInfo list(TBusiHazIdenMwZ tBusiHazIdenMwZ) {
        startPage();
        List<TBusiHazIdenMwZ> list = tBusiHazIdenMwZService.selectTBusiHazIdenMwZList(tBusiHazIdenMwZ);
        return getDataTable(list);
    }

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

    @PostMapping
    public AjaxResult add(@RequestBody TBusiHazIdenMwZ tBusiHazIdenMwZ) {
        return toAjax(tBusiHazIdenMwZService.insertTBusiHazIdenMwZ(tBusiHazIdenMwZ));
    }

    @PutMapping
    public AjaxResult edit(@RequestBody TBusiHazIdenMwZ tBusiHazIdenMwZ) {
        return toAjax(tBusiHazIdenMwZService.updateTBusiHazIdenMwZ(tBusiHazIdenMwZ));
    }

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