经费预算新增-根据年份查询数据

master
yangzhe123 2026-01-30 10:43:06 +08:00
parent c384d2c74c
commit 33052f4e7c
2 changed files with 13 additions and 2 deletions

View File

@ -30,8 +30,12 @@ public class FundBudgetController extends AbstractCommonFileController {
@Operation(description = "根据年份查询")
@GetMapping("/get/{year}")
public R<FundBudget> get(@PathVariable("year") String year){
public R<FundBudget> get(@PathVariable("year") Integer year){
FundBudget res = fundBudgetService.getByYear(year);
if(res!=null){
List<FileAssociations> files = fileService.getFiles(getGroupId(), res.getId().toString());
}
return R.ok(res);
}
@Operation(description = "分页")

View File

@ -60,4 +60,11 @@ public class FundBudgetService extends ServiceImpl<FundBudgetMapper, FundBudget
boolean update = updateById(fundBudget);
return update;
}
public FundBudget getByYear(Integer year) {
LambdaQueryWrapper<FundBudget> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(FundBudget::getBudgetYear, year);
FundBudget one = baseMapper.selectOne(queryWrapper);
return one;
}
}