Newer
Older
huludao / src / main / java / com / newfiber / api / pc / controller / zhz / ManPumpstationController.java
package com.newfiber.api.pc.controller.zhz;

import com.newfiber.api.core.annotation.SysLog;
import com.newfiber.api.core.commons.PageRequestObject;
import com.newfiber.api.core.commons.PageResultObject;
import com.newfiber.api.core.commons.ResultCode;
import com.newfiber.api.core.commons.ResultObj;
import com.newfiber.api.pc.model.zhz.ManPumpstation;
import com.newfiber.api.pc.service.ManPumpstationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @description: 泵站基础信息控制层
 * @author: 张鸿志
 * @date: 2020/12/14 9:45
 * @version: v1.0
 */
@RestController
@RequestMapping("/manPump")
@Api(value = "ManPumpstationController",tags = "泵站基础信息控制层")
public class ManPumpstationController {

    @Autowired
    private ManPumpstationService manPumpstationService;

    @PostMapping("/queryPage")
    @ApiOperation("分页条件查询泵站基础信息数据")
    @SysLog(actionType = "4",value = "分页条件查询泵站基础信息数据")
    public ResultObj<PageResultObject<ManPumpstation>> queryPage(@RequestBody PageRequestObject<String> pageRequestObject){
        return new ResultObj<>(ResultCode.OK,manPumpstationService.queryPage(pageRequestObject));
    }

    @PostMapping("/queryAll")
    @ApiOperation("获取所有的泵站基础信息")
    @SysLog(actionType = "4",value = "查询全部泵站基础信息")
    public ResultObj<List<ManPumpstation>> queryAll(){
        return new ResultObj<>(ResultCode.OK,manPumpstationService.selectList(null));
    }


    @PostMapping("/deleteById")
    @ApiOperation("根据泵站信息表的主键id修改泵站信息")
    @SysLog(actionType = "2",value = "根据泵站信息表的主键id修改泵站信息")
    public ResultObj updatePumpstationInfoById(@RequestBody ManPumpstation manPumpstation){
        manPumpstationService.updatePumpstationInfoById(manPumpstation);
        return ResultObj.ok();
    }
}