From e6068da47c1bef5517c9e5fdc8c726766867ad4e Mon Sep 17 00:00:00 2001 From: buli <137736985@qq.com> Date: 星期五, 14 七月 2023 15:10:02 +0800 Subject: [PATCH] Merge branch 'master' into LEXUpgrade2023-Deloitte --- force-app/main/default/classes/LexConsumableAccountSOQL.cls | 34 +++++++++++++++++----------------- 1 files changed, 17 insertions(+), 17 deletions(-) diff --git a/force-app/main/default/classes/LexConsumableAccountSOQL.cls b/force-app/main/default/classes/LexConsumableAccountSOQL.cls index eef1437..3249366 100644 --- a/force-app/main/default/classes/LexConsumableAccountSOQL.cls +++ b/force-app/main/default/classes/LexConsumableAccountSOQL.cls @@ -1,27 +1,27 @@ public with sharing class LexConsumableAccountSOQL { - public static AggregateResult[] getAccountBySales(Datetime thisDatetime ,Datetime nextDatetime){ - AggregateResult[] arList = new List<AggregateResult>([ - SELECT count(id), Consumable_order__r.Order_ForHospital__r.name hospitalName, sum(Sale_amount__c) thisAmount - FROM Consumable_Orderdetails__c - WHERE - CreatedDate >= :thisDatetime - AND CreatedDate < :nextDatetime - AND Consumable_order__r.Order_ForHospital__r.name != '' - GROUP BY Consumable_order__r.Order_ForHospital__r.Name - ORDER BY sum(Sale_amount__c) DESC - LIMIT 10 - ]); + public static AggregateResult[] getAccountBySales(Datetime thisDatetime, Datetime nextDatetime) { + AggregateResult[] arList = new List<AggregateResult>( + [ + SELECT + Consumable_order__r.Order_ForHospital__c, + Consumable_order__r.Order_ForHospital__r.name hospitalName, + sum(Sale_amount__c) thisAmount + FROM Consumable_Orderdetails__c + WHERE CreatedDate >= :thisDatetime AND CreatedDate < :nextDatetime AND Consumable_order__r.Order_ForHospital__r.name != '' + GROUP BY Consumable_order__r.Order_ForHospital__c, Consumable_order__r.Order_ForHospital__r.name + ORDER BY sum(Sale_amount__c) DESC + LIMIT 10 + ] + ); return arList; } - public static AggregateResult[] getAccountTotalSales(Datetime thisDatetime ,Datetime nextDatetime){ + public static AggregateResult[] getAccountTotalSales(Datetime thisDatetime, Datetime nextDatetime) { AggregateResult[] saleAmountList = [ SELECT sum(Sale_amount__c) saleAmount FROM Consumable_Orderdetails__c - WHERE CreatedDate >= :thisDatetime AND CreatedDate < :nextDatetime + WHERE CreatedDate >= :thisDatetime AND CreatedDate < :nextDatetime AND Consumable_order__r.Order_ForHospital__r.name != '' ]; return saleAmountList; } - - -} \ No newline at end of file +} -- Gitblit v1.9.1