| Line 59... |
Line 59... |
| 59 |
|
59 |
|
| 60 |
@NamedQuery(name = "FofoOrder.selectValueOfActivatedImeis", query = "select new com.spice.profitmandi.common.model.ActivatedImeisWithSellingPrice("
|
60 |
@NamedQuery(name = "FofoOrder.selectValueOfActivatedImeis", query = "select new com.spice.profitmandi.common.model.ActivatedImeisWithSellingPrice("
|
| 61 |
+ " fo.fofoId, foi.brand, sum(CAST(foi.mop AS int) * foi.quantity)) "
|
61 |
+ " fo.fofoId, foi.brand, sum(CAST(foi.mop AS int) * foi.quantity)) "
|
| 62 |
+ " from FofoOrder fo join FofoOrderItem foi on fo.id = foi.orderId join FofoLineItem fli on foi.id = fli.fofoOrderItemId join ActivatedImei ai on "
|
62 |
+ " from FofoOrder fo join FofoOrderItem foi on fo.id = foi.orderId join FofoLineItem fli on foi.id = fli.fofoOrderItemId join ActivatedImei ai on "
|
| 63 |
+ " fli.serialNumber = ai.serialNumber where fo.createTimestamp between :startDate and :endDate and fo.fofoId = :fofoId and fo.cancelledTimestamp is null group by foi.brand"),
|
63 |
+ " fli.serialNumber = ai.serialNumber where fo.createTimestamp between :startDate and :endDate and fo.fofoId = :fofoId and fo.cancelledTimestamp is null group by foi.brand"),
|
| 64 |
|
64 |
|
| 65 |
@NamedQuery(name = "FofoOrder.selectPartnersSaleByCatalogId", query = "select new com.spice.profitmandi.dao.model.FofoIdQtyModel("
|
65 |
@NamedQuery(name = "FofoOrder.selectPartnersSaleByCatalogId", query = "select new com.spice.profitmandi.dao.model.FofoIdQtyModel("
|
| 66 |
+ " fs.id,sum(case when foi.quantity is null then 0 else foi.quantity end))"
|
66 |
+ " fs.warehouseId, fs.id,sum(case when foi.quantity is null then 0 else foi.quantity end))"
|
| 67 |
+ " from FofoStore fs join FofoOrder fo on fs.id = fo.fofoId "
|
67 |
+ " from FofoStore fs join FofoOrder fo on fs.id = fo.fofoId "
|
| 68 |
+ " join FofoOrderItem foi on foi.orderId = fo.id join TagListing tl on tl.itemId = foi.itemId "
|
68 |
+ " join FofoOrderItem foi on foi.orderId = fo.id join TagListing tl on tl.itemId = foi.itemId "
|
| 69 |
+ " join Item i on i.id = tl.itemId"
|
69 |
+ " join Item i on i.id = tl.itemId"
|
| 70 |
+ " where fs.active = 1 and fs.internal = 0 and fo.cancelledTimestamp is null and fo.createTimestamp > :startDate and i.catalogItemId = :catalogItemId and i.categoryId=10006 group by fs.id"),
|
70 |
+ " where fs.active = 1 and fs.internal = 0 and fo.cancelledTimestamp is null and fo.createTimestamp > :startDate and i.catalogItemId in :catalogItemId and i.categoryId=10006 group by fs.id"),
|
| 71 |
|
71 |
|
| 72 |
@NamedQuery(name = "FofoOrder.selectPartnersSaleByRange", query = "select new com.spice.profitmandi.dao.model.FofoIdItemDetailModel("
|
72 |
@NamedQuery(name = "FofoOrder.selectPartnersSaleByRange", query = "select new com.spice.profitmandi.dao.model.FofoIdItemDetailModel("
|
| 73 |
+ " fs.id,sum(case when foi.quantity is null then 0 else foi.quantity end),i.brand,i.modelName,i.modelNumber,i.catalogItemId)"
|
73 |
+ " fs.warehouseId, fs.id,sum(case when foi.quantity is null then 0 else foi.quantity end),i.brand,i.modelName,i.modelNumber,i.catalogItemId)"
|
| 74 |
+ " from FofoStore fs join FofoOrder fo on fs.id = fo.fofoId "
|
74 |
+ " from FofoStore fs join FofoOrder fo on fs.id = fo.fofoId "
|
| 75 |
+ " join FofoOrderItem foi on foi.orderId = fo.id join TagListing tl on tl.itemId = foi.itemId "
|
75 |
+ " join FofoOrderItem foi on foi.orderId = fo.id join TagListing tl on tl.itemId = foi.itemId "
|
| 76 |
+ " join Item i on i.id = tl.itemId"
|
76 |
+ " join Item i on i.id = tl.itemId"
|
| 77 |
+ " where fs.active = 1 and fs.internal = 0 and fo.cancelledTimestamp is null "
|
77 |
+ " where fs.active = 1 and fs.internal = 0 and fo.cancelledTimestamp is null "
|
| 78 |
+ " and fo.createTimestamp > :startDate and tl.mop between :startPrice and :endPrice and i.categoryId=10006 group by fs.id,i.catalogItemId,i.brand,i.modelName,i.modelNumber"),
|
78 |
+ " and fo.createTimestamp > :startDate and tl.mop between :startPrice and :endPrice and i.categoryId=10006 group by fs.id,i.catalogItemId,i.brand,i.modelName,i.modelNumber"),
|