| Line 112... |
Line 112... |
| 112 |
+ " sum(case when concat(year(ai.activationTimestamp), month(ai.activationTimestamp)) = :almtd then 1 else 0 end),"
|
112 |
+ " sum(case when concat(year(ai.activationTimestamp), month(ai.activationTimestamp)) = :almtd then 1 else 0 end),"
|
| 113 |
+ " sum(case when concat(year(ai.activationTimestamp), month(ai.activationTimestamp)) = :almtd then CAST(tl.sellingPrice AS int) else 0 end))"
|
113 |
+ " sum(case when concat(year(ai.activationTimestamp), month(ai.activationTimestamp)) = :almtd then CAST(tl.sellingPrice AS int) else 0 end))"
|
| 114 |
+ " from FofoStore fs join InventoryItem ii on fs.id = ii.fofoId join ActivatedImei ai on ai.serialNumber = ii.serialNumber join Item i on i.id = ii.itemId join TagListing tl on tl.itemId = i.id"
|
114 |
+ " from FofoStore fs join InventoryItem ii on fs.id = ii.fofoId join ActivatedImei ai on ai.serialNumber = ii.serialNumber join Item i on i.id = ii.itemId join TagListing tl on tl.itemId = i.id"
|
| 115 |
+ " where fs.active = true and ii.goodQuantity >= 1 and i.brand = :brand and fs.warehouseId in :warehouseId and fs.id in :fofoId group by i.id"),
|
115 |
+ " where fs.active = true and ii.goodQuantity >= 1 and i.brand = :brand and fs.warehouseId in :warehouseId and fs.id in :fofoId group by i.id"),
|
| 116 |
|
116 |
|
| 117 |
@NamedQuery(name = "FofoStore.selectGroupByBrandLms", query = "select new com.spice.profitmandi.dao.model.BrandWiseModel(foi.brand, DATE_FORMAT(fo.createTimestamp, '%m-%Y'),sum(cast(foi.mop*foi.quantity As int)))"
|
117 |
@NamedQuery(name = "FofoStore.selectGroupByBrandLms", query = "select new com.spice.profitmandi.dao.model.BrandWiseModel(foi.brand, DATE_FORMAT(fo.createTimestamp, :groupParameter),sum(cast(foi.mop*foi.quantity As int)))"
|
| 118 |
+ " from FofoStore fs join FofoOrder fo on fs.id = fo.fofoId join FofoOrderItem foi on foi.orderId = fo.id join Item i on i.id = foi.itemId where fo.cancelledTimestamp is null and fs.active = true "
|
118 |
+ " from FofoStore fs join FofoOrder fo on fs.id = fo.fofoId join FofoOrderItem foi on foi.orderId = fo.id join Item i on i.id = foi.itemId where fo.cancelledTimestamp is null and fs.active = true "
|
| 119 |
+ " and foi.createTimestamp >= :lmsStartDate and i.categoryId = :categoryId and fs.id in :fofoId and fs.warehouseId in :warehouseId"
|
119 |
+ " and (foi.createTimestamp between :lmsStartDate and :endDate) and i.categoryId = :categoryId and fs.id in :fofoId and fs.warehouseId in :warehouseId"
|
| 120 |
+ " group by foi.brand,DATE_FORMAT(fo.createTimestamp, '%m-%Y')"), })
|
120 |
+ " group by foi.brand,DATE_FORMAT(fo.createTimestamp, :groupParameter)"), })
|
| 121 |
|
121 |
|
| 122 |
public class FofoStore implements Serializable {
|
122 |
public class FofoStore implements Serializable {
|
| 123 |
|
123 |
|
| 124 |
private static final long serialVersionUID = 1L;
|
124 |
private static final long serialVersionUID = 1L;
|
| 125 |
|
125 |
|