package com.yssh.controller;
|
|
import com.yssh.entity.YsshSuYuanFeedback;
|
import com.yssh.service.YsshSuYuanFeedbackService;
|
import com.yssh.utils.Result;
|
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;
|
|
/**
|
* @author wMeng
|
* @ClassName YsshSuYuanFeedbackController
|
* @Description TODO
|
* @date 2022/12/14 15:01
|
* @Version 1.0
|
*/
|
@Api(tags="溯源结果")
|
@RestController
|
@RequestMapping("/ysshSuYuanFeedbackController")
|
public class YsshSuYuanFeedbackController {
|
@Autowired
|
private YsshSuYuanFeedbackService ysshSuYuanFeedbackService;
|
|
@GetMapping("/query")
|
@ApiOperation("查询数据")
|
public Result query(Integer suYuanId,String name,String vocsName){
|
List<YsshSuYuanFeedback> data = ysshSuYuanFeedbackService.query(suYuanId,name,vocsName);
|
return Result.OK(data);
|
}
|
|
@PostMapping("/insert")
|
@ApiOperation("插入数据")
|
public Result insert(@RequestBody YsshSuYuanFeedback ysshSuYuanFeedback){
|
int i = ysshSuYuanFeedbackService.insert(ysshSuYuanFeedback);
|
if(i == 0){
|
return Result.error("插入失败");
|
}
|
return Result.OK("插入成功");
|
}
|
|
@PostMapping("/update")
|
@ApiOperation("更新数据")
|
public Result update(@RequestBody YsshSuYuanFeedback ysshSuYuanFeedback){
|
int i = ysshSuYuanFeedbackService.update(ysshSuYuanFeedback);
|
if(i == 0){
|
return Result.error("更新失败");
|
}
|
return Result.OK("更新成功");
|
}
|
|
@GetMapping("/statistics")
|
@ApiOperation("统计数据")
|
public Result statistics(){
|
Double data = ysshSuYuanFeedbackService.statistics();
|
return Result.OK(data);
|
}
|
}
|