| Line 46... |
Line 46... |
| 46 |
+ " 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 "
|
46 |
+ " 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 "
|
| 47 |
+ "and foi.createTimestamp >= :lmtdStartDate and i.categoryId != :categoryId and fs.id in :fofoId"
|
47 |
+ "and foi.createTimestamp >= :lmtdStartDate and i.categoryId != :categoryId and fs.id in :fofoId"
|
| 48 |
+ " group by foi.brand"),
|
48 |
+ " group by foi.brand"),
|
| 49 |
|
49 |
|
| 50 |
@NamedQuery(name = "FofoStore.selectGroupByWarehouseBrandWisePartnerSale", query = "select new com.spice.profitmandi.dao.model.WarehouseWiseBrandSaleModel("
|
50 |
@NamedQuery(name = "FofoStore.selectGroupByWarehouseBrandWisePartnerSale", query = "select new com.spice.profitmandi.dao.model.WarehouseWiseBrandSaleModel("
|
| 51 |
+ "(case when a.city in ('Noida', 'Ghaziabad') and foi.brand = 'Vivo' then 7573 else fs.warehouseId end) AS col_0_0_,"
|
51 |
+ "(case when a.city in ('Noida', 'Ghaziabad') and foi.brand = 'Vivo' then 13370 else fs.warehouseId end) AS col_0_0_,"
|
| 52 |
+ "sum(case when foi.createTimestamp >= :lmsStartDate AND foi.createTimestamp < :lmsEndDate then CAST(foi.quantity*foi.mop AS int) else 0 end),"
|
52 |
+ "sum(case when foi.createTimestamp >= :lmsStartDate AND foi.createTimestamp < :lmsEndDate then CAST(foi.quantity*foi.mop AS int) else 0 end),"
|
| 53 |
+ "sum(case when foi.createTimestamp >= :lmsStartDate AND foi.createTimestamp < :lmsEndDate then foi.quantity else 0 end),"
|
53 |
+ "sum(case when foi.createTimestamp >= :lmsStartDate AND foi.createTimestamp < :lmsEndDate then foi.quantity else 0 end),"
|
| 54 |
+ "sum(case when foi.createTimestamp >= :mtdStartDate AND foi.createTimestamp < :mtdEndDate then CAST(foi.quantity*foi.mop AS int) else 0 end),"
|
54 |
+ "sum(case when foi.createTimestamp >= :mtdStartDate AND foi.createTimestamp < :mtdEndDate then CAST(foi.quantity*foi.mop AS int) else 0 end),"
|
| 55 |
+ "sum(case when foi.createTimestamp >= :mtdStartDate AND foi.createTimestamp < :mtdEndDate then foi.quantity else 0 end), "
|
55 |
+ "sum(case when foi.createTimestamp >= :mtdStartDate AND foi.createTimestamp < :mtdEndDate then foi.quantity else 0 end), "
|
| 56 |
+ "sum(case when foi.createTimestamp >= :lmtdStartDate AND foi.createTimestamp < :lmtdEndDate then CAST(foi.quantity*foi.mop AS int) else 0 end), "
|
56 |
+ "sum(case when foi.createTimestamp >= :lmtdStartDate AND foi.createTimestamp < :lmtdEndDate then CAST(foi.quantity*foi.mop AS int) else 0 end), "
|