@PostMapping("/addHealthSleepSum")
public ApiResult addHeartSleepSum(BackGroundHealthSleepSum healthSleepSum) {
int count = healthSleepSumService.count(Wrappers.<BackGroundHealthSleepSum>lambdaQuery()
.eq(BackGroundHealthSleepSum::getUserId, healthSleepSum.getUserId())
.eq(BackGroundHealthSleepSum::getCreateDate, healthSleepSum.getCreateDate()));
if(count>0) {
healthSleepSumService.update(healthSleepSum, Wrappers.<BackGroundHealthSleepSum>lambdaQuery()
.eq(BackGroundHealthSleepSum::getUserId, healthSleepSum.getUserId())
.eq(BackGroundHealthSleepSum::getCreateDate, healthSleepSum.getCreateDate()));
}else {
healthSleepSumService.save(healthSleepSum);
}
return ApiResult.ok(true);
}