Subversion Repositories SmartDukaan

Rev

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

Rev 27586 Rev 27723
Line 26... Line 26...
26
		@NamedQuery(name = "FofoOrder.SelectItemWiseTertiary", query = "select new com.spice.profitmandi.dao.model.ItemWiseTertiaryModel(foi.brand,"
26
		@NamedQuery(name = "FofoOrder.SelectItemWiseTertiary", query = "select new com.spice.profitmandi.dao.model.ItemWiseTertiaryModel(foi.brand,"
27
				+ "foi.modelName, foi.modelNumber, foi.color, foi.quantity, foi.mop)"
27
				+ "foi.modelName, foi.modelNumber, foi.color, foi.quantity, foi.mop)"
28
				+ " from FofoOrder fo join FofoOrderItem foi on fo.id = foi.orderId where fo.cancelledTimestamp is null and fo.fofoId = :fofoId"
28
				+ " from FofoOrder fo join FofoOrderItem foi on fo.id = foi.orderId where fo.cancelledTimestamp is null and fo.fofoId = :fofoId"
29
				+ " and fo.createTimestamp between :startDate and :endDate"),
29
				+ " and fo.createTimestamp between :startDate and :endDate"),
30
 
30
 
-
 
31
		@NamedQuery(name = "FofoOrder.selectGroupByBrandPartnerTertiary", query = "select new com.spice.profitmandi.dao.model.BrandWiseTertiaryModel(foi.brand, "
-
 
32
				+ "sum(case when foi.createTimestamp >= :today then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
-
 
33
				+ "sum(case when foi.createTimestamp >= :threedays  and foi.createTimestamp <= :endDate  then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
-
 
34
				+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :mtd  then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
-
 
35
				+ "sum(case when foi.createTimestamp between  :lmtdStartDate and :lmtdEndDate  then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
-
 
36
				+ "sum(case when foi.createTimestamp >= :today then foi.quantity else 0 end),"
-
 
37
				+ "sum(case when foi.createTimestamp >= :threedays and foi.createTimestamp <= :endDate then foi.quantity else 0 end),"
-
 
38
				+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :mtd  then foi.quantity else 0 end), "
-
 
39
				+ "sum(case when foi.createTimestamp between  :lmtdStartDate and :lmtdEndDate then foi.quantity else 0 end))"
-
 
40
				+ " 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 "
-
 
41
				+ " and foi.createTimestamp >= :lmtdStartDate and fs.warehouseId in :warehouseId"
-
 
42
				+ " group by foi.brand"),
-
 
43
 
31
})
44
})
32
public class FofoOrder implements Serializable {
45
public class FofoOrder implements Serializable {
33
 
46
 
34
	private static final long serialVersionUID = 1L;
47
	private static final long serialVersionUID = 1L;
35
 
48