diff --git a/src/main/java/com/kiisoo/ic/customer/mapper/OpCustomerDOMapper.java b/src/main/java/com/kiisoo/ic/customer/mapper/OpCustomerDOMapper.java index 6a6a405..d6cd7c4 100644 --- a/src/main/java/com/kiisoo/ic/customer/mapper/OpCustomerDOMapper.java +++ b/src/main/java/com/kiisoo/ic/customer/mapper/OpCustomerDOMapper.java @@ -65,5 +65,5 @@ public interface OpCustomerDOMapper extends BaseMapper { */ List selectAddCustomerTopShop(@Param("shopIds")List shopIds, @Param("startDate")String startDate, @Param("endDate")String endDate); - Integer countCustomerByDate(@Param("startDate")String startDate, @Param("endDate") String endDate); + Integer countCustomerByDate(@Param("shopIds") List shopIds,@Param("startDate")String startDate, @Param("endDate") String endDate); } diff --git a/src/main/java/com/kiisoo/ic/customer/service/CustomerViewService.java b/src/main/java/com/kiisoo/ic/customer/service/CustomerViewService.java index 9727df7..e9e7ba2 100644 --- a/src/main/java/com/kiisoo/ic/customer/service/CustomerViewService.java +++ b/src/main/java/com/kiisoo/ic/customer/service/CustomerViewService.java @@ -221,7 +221,7 @@ public class CustomerViewService { //新增好友 // Long newCustomerCount = customerList.stream().filter(customerDO -> filterCustomerByRegisterTime(customerDO, selectStartTime, selectEndTime)).count(); - Integer newCustomerCount = opCustomerDOMapper.countCustomerByDate(selectStartTime, selectEndTime); + Integer newCustomerCount = opCustomerDOMapper.countCustomerByDate(shopIdList,selectStartTime, selectEndTime); customerViewVO.setNewCustomer(new Long(newCustomerCount)); //新增好友(去重) Long newValidCustomerCount = validCustomerList.stream().filter(customerDO -> filterCustomerByRegisterTime(customerDO, selectStartTime, selectEndTime)).count(); diff --git a/src/main/resources/mapper/OpCustomerDOMapper.xml b/src/main/resources/mapper/OpCustomerDOMapper.xml index dbd5d82..391724b 100644 --- a/src/main/resources/mapper/OpCustomerDOMapper.xml +++ b/src/main/resources/mapper/OpCustomerDOMapper.xml @@ -184,7 +184,13 @@ join poi_store t0 on t0.id = t1.store_id left join poi_store_staff t5 ON t5.store_id = t0.id and t1.user_id = t5.id JOIN op_customer t2 ON t2.id = t1.customer_id - where t2.create_time >= #{startDate} - and t2.create_time <= #{endDate} + where t1.create_time >= #{startDate} + and t1.create_time <= #{endDate} + + and t1.store_id in + + #{item} + +