| Line 47... |
Line 47... |
| 47 |
+ "sum(case when o.billingTimestamp >= :today then CAST(o.totalAmount AS int) else 0 end),"
|
47 |
+ "sum(case when o.billingTimestamp >= :today then CAST(o.totalAmount AS int) else 0 end),"
|
| 48 |
+ "sum(case when o.billingTimestamp >= :threedays and o.billingTimestamp <= :endDate then CAST(o.totalAmount AS int) else 0 end),"
|
48 |
+ "sum(case when o.billingTimestamp >= :threedays and o.billingTimestamp <= :endDate then CAST(o.totalAmount AS int) else 0 end),"
|
| 49 |
+ "sum(case when concat(year(o.billingTimestamp ), month(o.billingTimestamp ))= :mtd then CAST(o.totalAmount AS int) else 0 end),"
|
49 |
+ "sum(case when concat(year(o.billingTimestamp ), month(o.billingTimestamp ))= :mtd then CAST(o.totalAmount AS int) else 0 end),"
|
| 50 |
+ "sum(case when o.billingTimestamp between :lmtdStartDate and :lmtdEndDate then CAST(o.totalAmount AS int) else 0 end),"
|
50 |
+ "sum(case when o.billingTimestamp between :lmtdStartDate and :lmtdEndDate then CAST(o.totalAmount AS int) else 0 end),"
|
| 51 |
+ " sum(case when o.billingTimestamp >= :today then li.quantity else 0 end),"
|
51 |
+ " sum(case when o.billingTimestamp >= :today then li.quantity else 0 end),"
|
| 52 |
+ " sum(case when o.billingTimestamp >= :threedays and o.billingTimestamp <= :endDate then li.quantity else 0 end),"
|
52 |
+ " sum(case when o.billingTimestamp >= :threedays and o.billingTimestamp < :endDate then li.quantity else 0 end),"
|
| 53 |
+ " sum(case when concat(year(o.billingTimestamp), month(o.billingTimestamp))= :mtd then li.quantity else 0 end),"
|
53 |
+ " sum(case when concat(year(o.billingTimestamp), month(o.billingTimestamp))= :mtd then li.quantity else 0 end),"
|
| 54 |
+ " sum(case when o.billingTimestamp between :lmtdStartDate and :lmtdEndDate then li.quantity else 0 end))"
|
54 |
+ " sum(case when o.billingTimestamp between :lmtdStartDate and :lmtdEndDate then li.quantity else 0 end))"
|
| 55 |
+ " from Order o join LineItem li on o.id = li.orderId where o.billingTimestamp is not null"
|
55 |
+ " from Order o join LineItem li on o.id = li.orderId where o.billingTimestamp is not null"
|
| 56 |
+ " and o.billingTimestamp >= :lmtdStartDate and o.warehouseId in :warehouseId group by li.brand")
|
56 |
+ " and o.billingTimestamp >= :lmtdStartDate and o.warehouseId in :warehouseId group by li.brand")
|
| 57 |
|
57 |
|