diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/person/PersonController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/person/PersonController.java index c5856a0d33..16bcde7416 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/person/PersonController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/person/PersonController.java @@ -66,8 +66,10 @@ public class PersonController { } @GetMapping("/get-member-register-count") @Operation(summary = "时间范围获取会员数量") - public CommonResult< List>> getVipCountByDay(@RequestParam("startDate") String startDate, @RequestParam("endDate") String endDate) { - List> list = personService.getVipCountByDay(startDate, endDate); + public CommonResult< List>> getVipCountByDay(@RequestParam("startDate") String startDate, + @RequestParam("endDate") String endDate, + @RequestParam(value = "orgid", defaultValue = "0") Integer orgid) { + List> list = personService.getVipCountByDay(startDate, endDate, orgid); return success(list); } @GetMapping("/get") diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/person/PersonMapper.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/person/PersonMapper.java index 3ff560d328..0eabbfea3c 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/person/PersonMapper.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/person/PersonMapper.java @@ -61,7 +61,7 @@ public interface PersonMapper extends BaseMapperX { /** * 按天统计开通会员的人数 */ - List> countVipByDay(@Param("startDate") String startDate, @Param("endDate") String endDate); + List> countVipByDay(@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("orgid") Integer orgid); /* * 首页统计 会员增长趋势 一周 * */ diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/person/PersonService.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/person/PersonService.java index 1dfdb7e367..d5bfc27374 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/person/PersonService.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/person/PersonService.java @@ -40,7 +40,7 @@ public interface PersonService { /* * 根据日期范围查询会员数 * */ - List> getVipCountByDay(String startDate, String endDate); + List> getVipCountByDay(String startDate, String endDate, Integer orgid); /** * 删除用户基本信息 diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/person/PersonServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/person/PersonServiceImpl.java index 15854496f3..49688a3824 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/person/PersonServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/person/PersonServiceImpl.java @@ -70,8 +70,8 @@ public class PersonServiceImpl implements PersonService { return maxfamilyid; } @Override - public List> getVipCountByDay(String startDate, String endDate) { - return personMapper.countVipByDay(startDate, endDate); + public List> getVipCountByDay(String startDate, String endDate, Integer orgid) { + return personMapper.countVipByDay(startDate, endDate, orgid); } @Override public void deletePerson(Integer id) { diff --git a/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/person/PersonMapper.xml b/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/person/PersonMapper.xml index 8795c30850..81f7ab2a5f 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/person/PersonMapper.xml +++ b/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/person/PersonMapper.xml @@ -17,6 +17,9 @@ FROM tb_user WHERE isVip = 1 AND vipStartTime BETWEEN #{startDate} AND #{endDate} + + AND orgid = #{orgid} + GROUP BY DATE_FORMAT(vipStartTime, '%Y-%m-%d') ORDER BY date diff --git a/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/record/RecordMapper.xml b/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/record/RecordMapper.xml index 9ed65b6aee..7841459e76 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/record/RecordMapper.xml +++ b/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/record/RecordMapper.xml @@ -19,7 +19,9 @@ SUM(CASE WHEN visitstatus = 1 AND result = '不满意' THEN 1 ELSE 0 END) AS unsatisfiedCount FROM visit_record WHERE visittime BETWEEN #{startTime} AND #{endTime} - AND orgid = #{orgid} + + AND orgid = #{orgid} + GROUP BY DATE(visittime) ORDER BY date