| Line 42... |
Line 42... |
| 42 |
+ "sum(case when foi.createTimestamp >= :mtdStartDate AND foi.createTimestamp < :mtdEndDate then CAST(foi.quantity*foi.mop AS integer ) else 0 end),"
|
42 |
+ "sum(case when foi.createTimestamp >= :mtdStartDate AND foi.createTimestamp < :mtdEndDate then CAST(foi.quantity*foi.mop AS integer ) else 0 end),"
|
| 43 |
+ "sum(case when foi.createTimestamp >= :mtdStartDate AND foi.createTimestamp < :mtdEndDate then foi.quantity else 0 end), "
|
43 |
+ "sum(case when foi.createTimestamp >= :mtdStartDate AND foi.createTimestamp < :mtdEndDate then foi.quantity else 0 end), "
|
| 44 |
+ "sum(case when foi.createTimestamp >= :lmtdStartDate AND foi.createTimestamp < :lmtdEndDate then CAST(foi.quantity*foi.mop AS int) else 0 end), "
|
44 |
+ "sum(case when foi.createTimestamp >= :lmtdStartDate AND foi.createTimestamp < :lmtdEndDate then CAST(foi.quantity*foi.mop AS int) else 0 end), "
|
| 45 |
+ "sum(case when foi.createTimestamp >= :lmtdStartDate AND foi.createTimestamp < :lmtdEndDate then foi.quantity else 0 end))"
|
45 |
+ "sum(case when foi.createTimestamp >= :lmtdStartDate AND foi.createTimestamp < :lmtdEndDate then foi.quantity else 0 end))"
|
| 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 |
|
49 |
|
| 49 |
@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("
|
| 50 |
+ "(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 7573 else fs.warehouseId end) AS col_0_0_,"
|
| 51 |
+ "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),"
|
| 52 |
+ "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),"
|