QueryWrapper<MessageWebPage> query = new QueryWrapper<>(); query.select(" DISTINCT customer_id ").lambda() .eq(MessageWebPage::getShopId, shopId) .ge(MessageWebPage::getSendDate, beginTime) .le(MessageWebPage::getSendDate, endTime) .isNotNull(MessageWebPage::getCustomerId); List<MessageWebPage> idListLo = messageWebPageService.list(query);