添加饲养计划与档案关联

This commit is contained in:
dongjie 2024-06-23 07:34:10 +08:00
parent 8d3c862719
commit 3bbeea672d
4 changed files with 33 additions and 0 deletions

View File

@ -5,7 +5,9 @@ package com.zoo.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zoo.common.R;
import com.zoo.entity.Archive;
import com.zoo.entity.Breedingplan;
import com.zoo.service.IArchiveService;
import com.zoo.service.IBreedingplanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -25,6 +27,8 @@ public class ArchiveController {
@Autowired
IArchiveService iArchiveService;
@Autowired
IBreedingplanService iBreedingplanService;
@GetMapping("info")
public R info(Integer id,Integer animallId){
QueryWrapper<Archive> queryWrapper = new QueryWrapper<>();
@ -70,4 +74,11 @@ public class ArchiveController {
}
return R.error("删除失败");
}
@GetMapping("/selectByBreedingId")
public R selectByBreedingId(Integer breedingId){
QueryWrapper<Archive> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("breeding_id",breedingId);
return R.success(iArchiveService.list(queryWrapper));
}
}

View File

@ -3,6 +3,7 @@ package com.zoo.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zoo.common.R;
import com.zoo.entity.Breedingplan;
import com.zoo.service.IArchiveService;
import com.zoo.service.IBreedingplanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -14,6 +15,8 @@ import java.util.List;
public class BreedingplanController {
@Autowired
IBreedingplanService iBreedingplanService;
@GetMapping("/info")
public R info(Integer id){
if (id != null){
@ -54,4 +57,6 @@ public class BreedingplanController {
}
return R.error("删除失败");
}
}

View File

@ -68,6 +68,14 @@ public class Archive implements Serializable {
*/
private String description;
/**
* 关联的饲养计划id
* @return
*/
private Integer breedingId;
public Integer getId() {
return id;
}
@ -79,6 +87,14 @@ public class Archive implements Serializable {
return animallId;
}
public Integer getBreedingId() {
return breedingId;
}
public void setBreedingId(Integer breedingId) {
this.breedingId = breedingId;
}
public void setAnimallId(Integer animallId) {
this.animallId = animallId;
}
@ -152,6 +168,7 @@ public class Archive implements Serializable {
", time=" + time +
", roleId=" + roleId +
", description=" + description +
",breedingId="+breedingId+
"}";
}
}