Subversion Repositories SmartDukaan

Rev

Rev 27889 | Rev 28008 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 27889 Rev 28004
Line 55... Line 55...
55
				+ " i.modelNumber, i.color, foi.quantity*foi.mop, foi.quantity)"
55
				+ " i.modelNumber, i.color, foi.quantity*foi.mop, foi.quantity)"
56
				+ " from FofoStore fs join FofoOrder fo on fs.id = fo.fofoId join FofoOrderItem foi on foi.orderId = fo.id  join "
56
				+ " from FofoStore fs join FofoOrder fo on fs.id = fo.fofoId join FofoOrderItem foi on foi.orderId = fo.id  join "
57
				+ " Item i on i.id = foi.itemId where fo.cancelledTimestamp is null and fs.active = true "
57
				+ " Item i on i.id = foi.itemId where fo.cancelledTimestamp is null and fs.active = true "
58
				+ " and foi.createTimestamp >= :startDate and fs.warehouseId in :warehouseId and foi.brand in :brand order by foi.itemId desc"),
58
				+ " and foi.createTimestamp >= :startDate and fs.warehouseId in :warehouseId and foi.brand in :brand order by foi.itemId desc"),
59
 
59
 
60
		@NamedQuery(name = "FofoOrder.selectValueOfActivatedImeis", query = "select new com.spice.profitmandi.common.model.ActivatedImeisWithSellingPrice("
60
		@NamedQuery(name = "FofoOrder.selectPartnersSaleByCatalogId", query = "select new com.spice.profitmandi.dao.model.FofoIdQtyModel("
61
				+ "  fo.fofoId, foi.brand, sum(CAST(foi.mop  AS int) * foi.quantity)) "
61
				+ " fs.id,sum(case when foi.quantity is null then 0 else  foi.quantity end))"
-
 
62
				+ " from FofoStore fs  join FofoOrder fo on fs.id = fo.fofoId  "
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
				+ " join FofoOrderItem foi on foi.orderId = fo.id join  TagListing tl on tl.itemId = foi.itemId "
-
 
64
				+ " join Item i on i.id = tl.itemId"
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")  
65
				+ " 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"),
-
 
66
 
-
 
67
		@NamedQuery(name = "FofoOrder.selectPartnersSaleByRange", query = "select new com.spice.profitmandi.dao.model.FofoIdItemDetailModel("
-
 
68
				+ " fs.id,sum(case when foi.quantity is null then 0 else  foi.quantity end),i.brand,i.modelName,i.modelNumber,i.catalogItemId)"
-
 
69
				+ " from FofoStore fs  join FofoOrder fo on fs.id = fo.fofoId  "
-
 
70
				+ " join FofoOrderItem foi on foi.orderId = fo.id join TagListing tl on tl.itemId = foi.itemId "
-
 
71
				+ " join Item i on i.id = tl.itemId"
-
 
72
				+ " where fs.active = 1 and fs.internal = 0 and fo.cancelledTimestamp is null "
-
 
73
				+ " 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"),
64
 
74
 
65
})
75
})
66
public class FofoOrder implements Serializable {
76
public class FofoOrder implements Serializable {
67
 
77
 
68
	private static final long serialVersionUID = 1L;
78
	private static final long serialVersionUID = 1L;