Subversion Repositories SmartDukaan

Rev

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

Rev 28477 Rev 28486
Line 100... Line 100...
100
				+ "	 from FofoStore fs  join  Order o on fs.id = o.retailerId"
100
				+ "	 from FofoStore fs  join  Order o on fs.id = o.retailerId"
101
				+ "  join LineItem li on o.id = li.orderId " + "  join TagListing tl on tl.itemId = li.itemId "
101
				+ "  join LineItem li on o.id = li.orderId " + "  join TagListing tl on tl.itemId = li.itemId "
102
				+ "  join Item i on i.id = tl.itemId  where "
102
				+ "  join Item i on i.id = tl.itemId  where "
103
				+ "	 fs.active = 1 and fs.internal = 0 and o.status in (3,4) and i.catalogItemId in :catalogItemId group by fs.id"),
103
				+ "	 fs.active = 1 and fs.internal = 0 and o.status in (3,4) and i.catalogItemId in :catalogItemId group by fs.id"),
104
 
104
 
105
		@NamedQuery(name = "Order.selectGrnPendingOrderByCatalogId", query = "select new com.spice.profitmandi.dao.model.FofoIdCatalogQtyModel("
105
		@NamedQuery(name = "Order.selectGrnPendingOrdersByCatalogId", query = "select new com.spice.profitmandi.dao.model.FofoIdCatalogQtyModel("
106
				+ "  fs.warehouseId,fs.id,i.catalogItemId,sum(li.quantity )) from FofoStore fs join  Order o on fs.id = o.retailerId "
106
				+ "  fs.warehouseId,fs.id,i.catalogItemId,sum(li.quantity )) from FofoStore fs join  Order o on fs.id = o.retailerId "
107
				+ "  join LineItem li on o.id = li.orderId  join TagListing tl on tl.itemId = li.itemId "
107
				+ "  join LineItem li on o.id = li.orderId  join TagListing tl on tl.itemId = li.itemId "
108
				+ "  join Item i on (i.id = tl.itemId ) where " + "	 fs.active = 1 and fs.internal = 0 and"
108
				+ "  join Item i on (i.id = tl.itemId ) where " + "	 fs.active = 1 and fs.internal = 0 and"
109
				+ "  o.billingTimestamp is not null and o.refundTimestamp is null and o.deliveryTimestamp is null"
109
				+ "  o.billingTimestamp is not null and o.refundTimestamp is null and o.deliveryTimestamp is null"
110
				+ "  and i.catalogItemId in :catalogItemId and fs.warehouseId in :warehouseId group by i.catalogItemId, fs.id"),
110
				+ "  and i.catalogItemId in :catalogItemId and fs.warehouseId in :warehouseId group by i.catalogItemId, fs.id"),
111
 
111
 
112
		@NamedQuery(name = "Order.selectPendingIndentOrderByCatalogId", query = "select new com.spice.profitmandi.dao.model.FofoIdCatalogQtyModel("
112
		@NamedQuery(name = "Order.selectPendingIndentOrdersByCatalogId", query = "select new com.spice.profitmandi.dao.model.FofoIdCatalogQtyModel("
113
				+ "  fs.warehouseId,fs.id,i.catalogItemId,sum(case when li.quantity is null then 0 else  li.quantity end))"
113
				+ "  fs.warehouseId,fs.id,i.catalogItemId,sum(case when li.quantity is null then 0 else  li.quantity end))"
114
				+ "	 from FofoStore fs  join  Order o on fs.id = o.retailerId"
114
				+ "	 from FofoStore fs  join  Order o on fs.id = o.retailerId"
115
				+ "  join LineItem li on o.id = li.orderId " + "  join TagListing tl on tl.itemId = li.itemId "
115
				+ "  join LineItem li on o.id = li.orderId " + "  join TagListing tl on tl.itemId = li.itemId "
116
				+ "  join Item i on i.id = tl.itemId  where "
116
				+ "  join Item i on i.id = tl.itemId  where "
117
				+ "	 fs.active = 1 and fs.internal = 0 and o.status in (3,4) and i.catalogItemId in :catalogItemId and fs.warehouseId in :warehouseId group by i.catalogItemId, fs.id"),
117
				+ "	 fs.active = 1 and fs.internal = 0 and o.status in (3,4) and i.catalogItemId in :catalogItemId and fs.warehouseId in :warehouseId group by i.catalogItemId, fs.id"),
Line 147... Line 147...
147
		@NamedQuery(name = "Order.selectGroupByBrandLmp", query = "select new com.spice.profitmandi.dao.model.BrandWiseModel(li.brand,"
147
		@NamedQuery(name = "Order.selectGroupByBrandLmp", query = "select new com.spice.profitmandi.dao.model.BrandWiseModel(li.brand,"
148
				+ " DATE_FORMAT(o.billingTimestamp, '%m-%Y'),sum(cast(o.totalAmount As int)))"
148
				+ " DATE_FORMAT(o.billingTimestamp, '%m-%Y'),sum(cast(o.totalAmount As int)))"
149
				+ "	 from Order o join LineItem li on o.id = li.orderId join FofoStore fs on fs.id = o.retailerId where o.status in (7,9,10,12)"
149
				+ "	 from Order o join LineItem li on o.id = li.orderId join FofoStore fs on fs.id = o.retailerId where o.status in (7,9,10,12)"
150
				+ "	and o.billingTimestamp >= :lmsStartDate and fs.id in :fofoId and fs.warehouseId in :warehouseId and fs.internal = 0 group by li.brand,DATE_FORMAT(o.billingTimestamp, '%m-%Y')"),
150
				+ "	and o.billingTimestamp >= :lmsStartDate and fs.id in :fofoId and fs.warehouseId in :warehouseId and fs.internal = 0 group by li.brand,DATE_FORMAT(o.billingTimestamp, '%m-%Y')"),
151
 
151
 
-
 
152
		@NamedQuery(name = "Order.selectGrnPendingOrderQtyByCatalogId", query = "select sum(case when li.quantity is null then 0 else  li.quantity end)"
-
 
153
				+ "  from FofoStore fs join  Order o on fs.id = o.retailerId "
-
 
154
				+ "  join LineItem li on o.id = li.orderId  join TagListing tl on tl.itemId = li.itemId "
-
 
155
				+ "  join Item i on (i.id = tl.itemId ) where " + "	 fs.active = 1 and fs.internal = 0 and"
-
 
156
				+ "  o.billingTimestamp is not null and o.refundTimestamp is null and o.deliveryTimestamp is null"
-
 
157
				+ "  and i.catalogItemId = :catalogItemId and fs.id = :fofoId group by i.catalogItemId, fs.id"),
-
 
158
 
-
 
159
		@NamedQuery(name = "Order.selectPendingIndentOrderQtyByCatalogId", query = "select sum(case when li.quantity is null then 0 else  li.quantity end)"
-
 
160
				+ "	 from FofoStore fs  join  Order o on fs.id = o.retailerId"
-
 
161
				+ "  join LineItem li on o.id = li.orderId " + "  join TagListing tl on tl.itemId = li.itemId "
-
 
162
				+ "  join Item i on i.id = tl.itemId  where "
-
 
163
				+ "	 fs.active = 1 and fs.internal = 0 and o.status in (3,4)and i.catalogItemId = :catalogItemId and fs.id = :fofoId group by i.catalogItemId, fs.id"),
-
 
164
 
152
})
165
})
153
public class Order implements Serializable {
166
public class Order implements Serializable {
154
 
167
 
155
	private static final long serialVersionUID = 1L;
168
	private static final long serialVersionUID = 1L;
156
 
169