This commit is contained in:
feng
2026-01-23 17:14:36 +08:00
parent 654a842ed9
commit b580502f48
@@ -669,7 +669,7 @@ public class WatchServiceImpl implements IWatchService {
wrapper.eq(WatchStatUserInfoDaySleep::getUserId, userId); wrapper.eq(WatchStatUserInfoDaySleep::getUserId, userId);
wrapper.isNotNull(WatchStatUserInfoDaySleep::getLongDurationTotal); wrapper.isNotNull(WatchStatUserInfoDaySleep::getLongDurationTotal);
WatchIndexVo vo = daySleepMapper.selectJoinOne(WatchIndexVo.class,wrapper); WatchIndexVo vo = daySleepMapper.selectJoinOne(WatchIndexVo.class,wrapper);
return vo.getAveSleep(); return null != vo ? vo.getAveSleep() : 0;
} }
private Integer queryTotalDistance(String userId) { private Integer queryTotalDistance(String userId) {
@@ -677,7 +677,7 @@ public class WatchServiceImpl implements IWatchService {
wrapper.selectSum(WatchStatUserInfoDaySdc::getDistanceValue,WatchIndexVo::getDistance); wrapper.selectSum(WatchStatUserInfoDaySdc::getDistanceValue,WatchIndexVo::getDistance);
wrapper.eq(WatchStatUserInfoDaySdc::getUserId, userId); wrapper.eq(WatchStatUserInfoDaySdc::getUserId, userId);
WatchIndexVo vo = statSdcMapper.selectJoinOne(WatchIndexVo.class,wrapper); WatchIndexVo vo = statSdcMapper.selectJoinOne(WatchIndexVo.class,wrapper);
return vo.getDistance(); return null != vo ? vo.getDistance() : 0;
} }
@Override @Override