| Line 27... |
Line 27... |
| 27 |
@Entity
|
27 |
@Entity
|
| 28 |
@Table(name = "fofo.fofo_store", schema = "fofo")
|
28 |
@Table(name = "fofo.fofo_store", schema = "fofo")
|
| 29 |
|
29 |
|
| 30 |
@NamedQueries({
|
30 |
@NamedQueries({
|
| 31 |
|
31 |
|
| - |
|
32 |
@NamedQuery(name="FofoStore.selectAllDtrUserIds", query = "select ua.userId from FofoStore fs join UserAccount ua on fs.id=ua.accountKey " +
|
| - |
|
33 |
"where ua='saholic' and fs.internal=false and fs.active=true"),
|
| - |
|
34 |
|
| 32 |
@NamedQuery(name = "FofoStore.selectGroupByBrandWarehousePartnerSale", query = "select new com.spice.profitmandi.dao.model.BrandWisePartnerSaleModel(foi.brand, "
|
35 |
@NamedQuery(name = "FofoStore.selectGroupByBrandWarehousePartnerSale", query = "select new com.spice.profitmandi.dao.model.BrandWisePartnerSaleModel(foi.brand, "
|
| 33 |
+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :lms then CAST(foi.quantity*foi.mop AS int) else 0 end),"
|
36 |
+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :lms then CAST(foi.quantity*foi.mop AS integer ) else 0 end),"
|
| 34 |
+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :lms then foi.quantity else 0 end),"
|
37 |
+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :lms then foi.quantity else 0 end),"
|
| 35 |
+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :mtd then CAST(foi.quantity*foi.mop AS int) else 0 end),"
|
38 |
+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :mtd then CAST(foi.quantity*foi.mop AS integer ) else 0 end),"
|
| 36 |
+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :mtd then foi.quantity else 0 end), "
|
39 |
+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :mtd then foi.quantity else 0 end), "
|
| 37 |
+ "sum(case when foi.createTimestamp between :lmtdStartDate and :lmtdEndDate then CAST(foi.quantity*foi.mop AS int) else 0 end), "
|
40 |
+ "sum(case when foi.createTimestamp between :lmtdStartDate and :lmtdEndDate then CAST(foi.quantity*foi.mop AS int) else 0 end), "
|
| 38 |
+ "sum(case when foi.createTimestamp between :lmtdStartDate and :lmtdEndDate then foi.quantity else 0 end))"
|
41 |
+ "sum(case when foi.createTimestamp between :lmtdStartDate and :lmtdEndDate then foi.quantity else 0 end))"
|
| 39 |
+ " 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 "
|
42 |
+ " 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 "
|
| 40 |
+ "and foi.createTimestamp >= :lmtdStartDate and i.categoryId = :categoryId and fs.id in :fofoId"
|
43 |
+ "and foi.createTimestamp >= :lmtdStartDate and i.categoryId = :categoryId and fs.id in :fofoId"
|