Page<CustomerResponse> customerResponsePage =
CollectionUtils.toPage(
page(
queryColumn ->
queryColumn
.getConditions()
.eq(AbstractEntityPoJo::getCompanyId, companyId)
.eq(CustomerPoJo::getIsCaller, false)
.in(ObjectUtils.isNotNull(customerIds1), CustomerPoJo::getId, customerIds1)
.in(ObjectUtils.isNotNull(customerIds2), CustomerPoJo::getId, customerIds2)
.and(
ObjectUtils.isNotNull(vipId)
? Conditions.of(queryColumn)
.and(
Conditions.of(queryColumn)
.eq(CustomerPoJo::getVipId, vipId))
: null)
.and(
StringUtils.hasText(keywords)
? Conditions.of(queryColumn)
.and(
Conditions.of(queryColumn)
.like(CustomerPoJo::getName, keywords)
.or(
Conditions.of(queryColumn)
.like(CustomerPoJo::getWxNickname, keywords)))
: null)
.and(
StringUtils.hasText(tel)
? Conditions.of(queryColumn)
.and(Conditions.of(queryColumn).like(CustomerPoJo::getTel, tel))
: null),
page,
size,
SortColumn.builder().add(SortColumn.desc("update_time")).build(),
CustomerPoJo.class),
this::getCustomerResponse,
null);
条件查询.and()
最新推荐文章于 2023-01-12 16:35:43 发布