diff --git a/health-watch/health-watch-biz/src/main/java/com/renkang/watch/mapper/WatchStatUserInfoDaySleepMapper.java b/health-watch/health-watch-biz/src/main/java/com/renkang/watch/mapper/WatchStatUserInfoDaySleepMapper.java index 6069c71..321337e 100644 --- a/health-watch/health-watch-biz/src/main/java/com/renkang/watch/mapper/WatchStatUserInfoDaySleepMapper.java +++ b/health-watch/health-watch-biz/src/main/java/com/renkang/watch/mapper/WatchStatUserInfoDaySleepMapper.java @@ -5,7 +5,9 @@ import com.renkang.watch.entity.WatchStatUserInfoDaySleep; import com.renkang.watch.vo.UserData.res.sleep.WatchDataSleepRes; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; +import java.time.LocalDate; import java.util.Date; import java.util.List; @@ -28,4 +30,9 @@ public interface WatchStatUserInfoDaySleepMapper extends BaseMapper + insert into watch_stat_user_info_day_sleep(id, user_id, long_count, long_duration_max, long_duration_min, long_duration_total, short_count, short_duration_max, short_duration_min, @@ -127,4 +128,14 @@ where stat.user_id = #{userId,jdbcType=VARCHAR} and stat.data_date = #{dataDate,jdbcType=DATE}; + + \ No newline at end of file diff --git a/health-watch/health-watch-biz/src/main/java/com/renkang/watch/service/impl/WatchDataServiceImpl.java b/health-watch/health-watch-biz/src/main/java/com/renkang/watch/service/impl/WatchDataServiceImpl.java index dfe2d76..e6b2740 100644 --- a/health-watch/health-watch-biz/src/main/java/com/renkang/watch/service/impl/WatchDataServiceImpl.java +++ b/health-watch/health-watch-biz/src/main/java/com/renkang/watch/service/impl/WatchDataServiceImpl.java @@ -1,5 +1,6 @@ package com.renkang.watch.service.impl; +import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.date.DateField; import cn.hutool.core.date.DateUtil; @@ -1053,10 +1054,12 @@ public class WatchDataServiceImpl extends ServiceImpl sleepInfo = getSleep(dto); - //todo 查询存在睡眠数据的人数 - vo.setPeopleSum(0); + Integer userCount = watchStatUserInfoDaySleepMapper.countDistinctUser(startDate, endDate, dto.getOrgCode()); + vo.setPeopleSum(userCount == null ? 0 : userCount); vo.setSleepInfo(sleepInfo); return vo; } diff --git a/jeecg-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/HealthUserEmployeeExServiceImpl.java b/jeecg-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/HealthUserEmployeeExServiceImpl.java index a9ef24f..f55c22f 100644 --- a/jeecg-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/HealthUserEmployeeExServiceImpl.java +++ b/jeecg-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/HealthUserEmployeeExServiceImpl.java @@ -1111,7 +1111,12 @@ public class HealthUserEmployeeExServiceImpl extends ServiceImpl