| Line 22... |
Line 22... |
| 22 |
+ "sum(case when ai.activationTimestamp between :lmtdStartDate and :lmtdEndDate then 1 else 0 end), "
|
22 |
+ "sum(case when ai.activationTimestamp between :lmtdStartDate and :lmtdEndDate then 1 else 0 end), "
|
| 23 |
+ "sum(case when ai.activationTimestamp between :lmtdStartDate and :lmtdEndDate then CAST(li.unitPrice AS int) else 0 end))"
|
23 |
+ "sum(case when ai.activationTimestamp between :lmtdStartDate and :lmtdEndDate then CAST(li.unitPrice AS int) else 0 end))"
|
| 24 |
+ " from ActivatedImei ai join LineItemImeiView lim on ai.serialNumber = lim.serialNumber join LineItem li on li.id = lim.lineItemId join Order o on o.id = li.orderId "
|
24 |
+ " from ActivatedImei ai join LineItemImeiView lim on ai.serialNumber = lim.serialNumber join LineItem li on li.id = lim.lineItemId join Order o on o.id = li.orderId "
|
| 25 |
+ " join FofoStore fs on fs.id = o.retailerId where (fs.fofoType = 'FRANCHISE' or fs.fofoType = 'THIRD_PARTY') and fs.id in :fofoIds group by li.brand"),
|
25 |
+ " join FofoStore fs on fs.id = o.retailerId where (fs.fofoType = 'FRANCHISE' or fs.fofoType = 'THIRD_PARTY') and fs.id in :fofoIds group by li.brand"),
|
| 26 |
|
26 |
|
| 27 |
@NamedQuery(name = "ActivatedImei.selectActivatedModelGroupByWarehouse", query = "select new com.spice.profitmandi.dao.model.WarehouseWiseActivatedModel(fs.warehouseId, "
|
27 |
@NamedQuery(name = "ActivatedImei.selectActivatedModelGroupByWarehouse", query = "select new com.spice.profitmandi.dao.model.WarehouseWiseActivatedModel(o.warehouseId, "
|
| 28 |
+ "sum(case when concat(year(ai.activationTimestamp), month(ai.activationTimestamp))= :lms then 1 else 0 end),"
|
28 |
+ "sum(case when concat(year(ai.activationTimestamp), month(ai.activationTimestamp))= :lms then 1 else 0 end),"
|
| 29 |
+ "sum(case when concat(year(ai.activationTimestamp), month(ai.activationTimestamp))= :lms then CAST(li.unitPrice AS int) else 0 end),"
|
29 |
+ "sum(case when concat(year(ai.activationTimestamp), month(ai.activationTimestamp))= :lms then CAST(li.unitPrice AS int) else 0 end),"
|
| 30 |
+ "sum(case when concat(year(ai.activationTimestamp), month(ai.activationTimestamp))= :mtd then 1 else 0 end),"
|
30 |
+ "sum(case when concat(year(ai.activationTimestamp), month(ai.activationTimestamp))= :mtd then 1 else 0 end),"
|
| 31 |
+ "sum(case when concat(year(ai.activationTimestamp), month(ai.activationTimestamp))= :mtd then CAST(li.unitPrice AS int) else 0 end), "
|
31 |
+ "sum(case when concat(year(ai.activationTimestamp), month(ai.activationTimestamp))= :mtd then CAST(li.unitPrice AS int) else 0 end), "
|
| 32 |
+ "sum(case when ai.activationTimestamp between :lmtdStartDate and :lmtdEndDate then 1 else 0 end), "
|
32 |
+ "sum(case when ai.activationTimestamp between :lmtdStartDate and :lmtdEndDate then 1 else 0 end), "
|