Subversion Repositories SmartDukaan

Rev

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

Rev 30017 Rev 30077
Line 161... Line 161...
161
		@NamedQuery(name = "Order.selectAllGrnPendingAccessoriesTvGroupByFofoId", query = "select new com.spice.profitmandi.dao.model.InStockAccessoriesTvFofoIdModel("
161
		@NamedQuery(name = "Order.selectAllGrnPendingAccessoriesTvGroupByFofoId", query = "select new com.spice.profitmandi.dao.model.InStockAccessoriesTvFofoIdModel("
162
				+ "  o.retailerId, SUM(case when c.parentCategoryId  = 10011 then CAST(o.totalAmount  AS integer) else 0 end), SUM(case when c.parentCategoryId  = 14200 then  CAST(o.totalAmount  AS integer) else 0 end))"
162
				+ "  o.retailerId, SUM(case when c.parentCategoryId  = 10011 then CAST(o.totalAmount  AS integer) else 0 end), SUM(case when c.parentCategoryId  = 14200 then  CAST(o.totalAmount  AS integer) else 0 end))"
163
				+ "	 from  Order o join LineItem li on o.id = li.orderId join Item i on i.id = li.itemId  join Category c on c.id = i.categoryId "
163
				+ "	 from  Order o join LineItem li on o.id = li.orderId join Item i on i.id = li.itemId  join Category c on c.id = i.categoryId "
164
				+ "  where o.retailerId in :fofoIds and o.billingTimestamp is not null and o.refundTimestamp is null and o.partnerGrnTimestamp is null and i.categoryId != 10006 group by o.retailerId"),
164
				+ "  where o.retailerId in :fofoIds and o.billingTimestamp is not null and o.refundTimestamp is null and o.partnerGrnTimestamp is null and i.categoryId != 10006 group by o.retailerId"),
165
 
165
 
-
 
166
		@NamedQuery(name = "Order.selectPartnerSecondaryGroupByBrand", query = "select new com.spice.profitmandi.dao.model.PartnerSecondaryPlanModel(o.retailerId,li.brand, "
-
 
167
				+ "  case when  psp.secondaryPlan is not null then cast(psp.secondaryPlan As long) else 0 end , sum(cast(o.totalAmount AS integer)) )"
-
 
168
				+ "	 from Order o join LineItem li on o.id = li.orderId join FofoStore fs on fs.id = o.retailerId "
-
 
169
				+ "  left join PartnerSecondaryPlan psp on (psp.fofoId = fs.id and li.brand = psp.brand and psp.createTimestamp > :startDate)"
-
 
170
				+ "	 where o.status in (7,9,10,12)"
-
 
171
				+ "	 and o.billingTimestamp >= :startDate and fs.id in :fofoIds group by li.brand,fs.id"),
-
 
172
 
166
})
173
})
167
public class Order implements Serializable {
174
public class Order implements Serializable {
168
 
175
 
169
	private static final long serialVersionUID = 1L;
176
	private static final long serialVersionUID = 1L;
170
 
177