修改bug
This commit is contained in:
parent
86a287cf8b
commit
8d3c862719
@ -3,6 +3,7 @@ package com.zoo.controller;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.zoo.common.R;
|
import com.zoo.common.R;
|
||||||
|
import com.zoo.entity.Breedingplan;
|
||||||
import com.zoo.entity.Health;
|
import com.zoo.entity.Health;
|
||||||
import com.zoo.service.IHealthService;
|
import com.zoo.service.IHealthService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@ -51,8 +52,10 @@ public class HealthController {
|
|||||||
|
|
||||||
@PostMapping("/update")
|
@PostMapping("/update")
|
||||||
public R update(@RequestBody Health health){
|
public R update(@RequestBody Health health){
|
||||||
boolean update = iHealthService.save(health);
|
QueryWrapper<Health> queryWrapper = new QueryWrapper<>();
|
||||||
if (update){
|
queryWrapper.eq("id",health.getId());
|
||||||
|
boolean b = iHealthService.update(health,queryWrapper);
|
||||||
|
if (b){
|
||||||
return R.success("修改成功");
|
return R.success("修改成功");
|
||||||
}
|
}
|
||||||
return R.error("修改失败");
|
return R.error("修改失败");
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user