Subversion Repositories SmartDukaan

Rev

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

Rev 35084 Rev 35104
Line 34... Line 34...
34
						"and foi.createTimestamp >= :startDate " +
34
						"and foi.createTimestamp >= :startDate " +
35
						"and foi.createTimestamp < :endDate " +
35
						"and foi.createTimestamp < :endDate " +
36
						"and ca.categoryId =  10006 " +
36
						"and ca.categoryId =  10006 " +
37
						"group by foi.brand, foi.modelName, foi.modelNumber,ca.categoryId, fo.fofoId,DATE_FORMAT(foi.createTimestamp, '%m-%Y')"
37
						"group by foi.brand, foi.modelName, foi.modelNumber,ca.categoryId, fo.fofoId,DATE_FORMAT(foi.createTimestamp, '%m-%Y')"
38
		),
38
		),
-
 
39
        @NamedQuery(
-
 
40
                name = "FofoOrderItem.selectBrandItemsByRegionAndDate",
-
 
41
                query = "select new com.spice.profitmandi.dao.model.EligibleRewardItemsModel(" +
-
 
42
                        "o.fofoId, pr.regionId, o.id, li.serialNumber, oi.brand, oi.dp, oi.quantity, i.catalogItemId) " +
-
 
43
                        "from ActivatedImei ai " +
-
 
44
                        "join FofoLineItem li on li.serialNumber = ai.serialNumber " +
-
 
45
                        "join FofoOrderItem oi on oi.id = li.fofoOrderItemId " +
-
 
46
                        "join FofoOrder o on o.id = oi.orderId " +
-
 
47
                        "join Item i on i.id = oi.itemId " +
-
 
48
                        "join PartnerRegion pr on pr.fofoId = o.fofoId " +
-
 
49
                        "where pr.regionId = :regionId " +
-
 
50
                        "and i.brand = :brand " +
-
 
51
                        "and o.createTimestamp between :orderStartDate and :orderEndDate " +
-
 
52
                        "and not exists (select 1 from SaleRewardHistory srh where srh.imeis = ai.serialNumber) " +
-
 
53
                        "group by li.serialNumber"
-
 
54
        )
39
 
55
 
40
})
56
})
41
public class FofoOrderItem implements Serializable {
57
public class FofoOrderItem implements Serializable {
42
 
58
 
43
	private static final long serialVersionUID = 1L;
59
	private static final long serialVersionUID = 1L;