Compare commits
2 Commits
ba9202e6ca
...
c49bb4cdb3
Author | SHA1 | Date | |
---|---|---|---|
c49bb4cdb3 | |||
bb98a34fa6 |
@@ -61,4 +61,7 @@ public interface PlantsRentalOrderMapper extends BaseMapperPlus<PlantsRentalOrde
|
|||||||
"FROM plants_rental_order")
|
"FROM plants_rental_order")
|
||||||
Map<String, Object> countOrderAndAmount();
|
Map<String, Object> countOrderAndAmount();
|
||||||
|
|
||||||
|
@Select("SELECT COUNT(DISTINCT customer_name) FROM plants_rental_order")
|
||||||
|
Integer countDistinctCustomerName();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -406,10 +406,9 @@ public class PlantsRentalOrderServiceImpl implements IPlantsRentalOrderService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Integer> countCustomers() {
|
public Map<String, Integer> countCustomers() {
|
||||||
LambdaQueryWrapper<PlantsRentalOrder> lqw = Wrappers.lambdaQuery();
|
Integer count= baseMapper.countDistinctCustomerName();
|
||||||
lqw.groupBy(PlantsRentalOrder::getCustomerName);
|
|
||||||
Map<String, Integer> map = new HashMap<>();
|
Map<String, Integer> map = new HashMap<>();
|
||||||
map.put("count",baseMapper.selectVoList(lqw).size());
|
map.put("count",count);
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user