feat: 客户支持type字段,按种类过滤
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Agent
2026-03-29 05:44:36 +00:00
parent 69365e076e
commit 02383f1f3a
4 changed files with 12 additions and 4 deletions

View File

@@ -11,7 +11,7 @@ public interface CustomerService {
/**
* 客户列表
*/
Page<Customer> getCustomers(String keyword, Integer page, Integer pageSize);
Page<Customer> getCustomers(String keyword, String type, Integer page, Integer pageSize);
/**
* 客户详情

View File

@@ -25,7 +25,7 @@ public class CustomerServiceImpl implements CustomerService {
* 客户列表
*/
@Override
public Page<Customer> getCustomers(String keyword, Integer page, Integer pageSize) {
public Page<Customer> getCustomers(String keyword, String type, Integer page, Integer pageSize) {
Page<Customer> pageParam = new Page<>(page, pageSize);
LambdaQueryWrapper<Customer> wrapper = new LambdaQueryWrapper<>();
if (StringUtils.hasText(keyword)) {
@@ -33,7 +33,9 @@ public class CustomerServiceImpl implements CustomerService {
.or()
.like(Customer::getPhone, keyword);
}
wrapper.orderByDesc(Customer::getLastLoginAt);
if (StringUtils.hasText(type)) {
wrapper.eq(Customer::getType, type);
}
wrapper.orderByDesc(Customer::getLastLoginAt);
wrapper.orderByDesc(Customer::getCreatedAt);
return customerMapper.selectPage(pageParam, wrapper);