728x90
심박수
- 주별, 월별 리스트
Controller |
@GetMapping("/list") public List<HeartRateDTO> getListByUsernoAndCount(@RequestParam int user_no, @RequestParam int unit_min, @RequestParam int minutes) { System.out.println("HeartRateDTO getListByUsernoAndCount # user_no="+ user_no + ",unit_min=" + unit_min + ",minutes=" + minutes); if(unit_min == 60) // week return heartRateMapper.getListMaxByUsernoWeek(user_no, unit_min, minutes); else if(unit_min == 120) // month return heartRateMapper.getListMaxByUsernoMonth(user_no, unit_min, minutes); return heartRateMapper.getListByUsernoAndCount(user_no, unit_min, minutes); } |
Mapper 주별, 월별 리스트 |
@Select("SELECT \n" + " date_format(reg_dt , '%Y-%m-%d %H:%i:%s') as measure_date,\n" + " max(low_cnt) as low_cnt \n" + " from heart_rate where user_no = #{user_no} and adddate(sysdate,-7) < reg_dt\n" + " GROUP BY date_format(reg_dt, '%Y-%m-%d') \n" + " ORDER BY reg_dt desc;") List<HeartRateDTO> getListMaxByUsernoWeek(int user_no, int unit_min, int minutes); @Select("SELECT \n" + " date_format(reg_dt , '%Y-%m-%d %H:%i:%s') as measure_date,\n" + " max(low_cnt) as low_cnt \n" + " from heart_rate where user_no = #{user_no} and adddate(sysdate,-31) < reg_dt\n" + " GROUP BY date_format(reg_dt, '%Y-%m-%d') \n" + " ORDER BY reg_dt desc;") List<HeartRateDTO> getListMaxByUsernoMonth(int user_no, int unit_min, int minutes); |
걸음수
- 주별, 월별 리스트
Controller |
@GetMapping("/list") public List<ActivityVolDTO> getListByUsernoAndCount(@RequestParam int user_no, @RequestParam int unit_min, @RequestParam int minutes) { System.out.println("ActivityVolDTO getListByUsernoAndCount # user_no="+ user_no + ",unit_min=" + unit_min + ",minutes=" + minutes); if(unit_min == 60) { return activityVolMapper.getStatMaxByUsernoWeek(user_no); } else if(unit_min == 120) { return activityVolMapper.getStatMaxByUsernoMonth(user_no); } return activityVolMapper.getListByUsernoAndCount(user_no, unit_min, minutes); } |
Mapper |
@Select("SELECT \n" + " date_format(reg_dt , '%Y-%m-%d %h:%i:%s') as measure_date,\n" + " max(walk_steps) as steps, \n" + " max(calorie) as calorie \n" + " FROM activity_vol where user_no = #{user_no} and adddate(sysdate,-7) < reg_dt\n" + " GROUP BY date_format(reg_dt, '%Y-%m-%d') \n" + " ORDER BY reg_dt desc;") List<ActivityVolDTO> getStatMaxByUsernoWeek(int user_no); @Select("SELECT \n" + " date_format(reg_dt , '%Y-%m-%d %h:%i:%s') as measure_date,\n" + " max(walk_steps) as steps,\n" + " max(calorie) as calorie \n" + " FROM activity_vol where user_no = #{user_no} and adddate(sysdate,-31) < reg_dt\n" + " GROUP BY date_format(reg_dt, '%Y-%m-%d') \n" + " ORDER BY reg_dt desc;") List<ActivityVolDTO> getStatMaxByUsernoMonth(int user_no); @Select("SELECT \n" + " date_format(reg_dt , '%Y-%m-%d %h:%i:%s') as measure_date,\n" + " max(walk_steps) as steps,\n" + " max(calorie) as calorie \n" + " FROM activity_vol where user_no = #{user_no} and adddate(sysdate,-365) < reg_dt\n" + " GROUP BY date_format(reg_dt, '%Y-%m') \n" + " ORDER BY reg_dt desc;") List<ActivityVolDTO> getStatMaxByUsernoYear(int user_no); |
'M64' 카테고리의 다른 글
랭킹 적용 (0) | 2022.03.02 |
---|---|
티젠소프트 동영상 관리 (0) | 2022.02.22 |
CUBRID 데이터베이스 백업 (0) | 2022.02.22 |
Request for modification so that all members can be searched without limiting the exposure of cadet information to subscribers when entering official records input screen (0) | 2022.02.20 |
기획안 정리 및 수정사항 #3 (0) | 2021.07.30 |