Subversion Repositories SmartDukaan

Rev

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

Rev 29578 Rev 29926
Line 28... Line 28...
28
				+ " sc.id = sio.schemeId join InventoryItem ii  on ii.id = sio.inventoryItemId"
28
				+ " sc.id = sio.schemeId join InventoryItem ii  on ii.id = sio.inventoryItemId"
29
				+ " join Item i on i.id = ii.itemId where sc.type = 'ACTIVATION' and sio.status ='PENDING' and sio.createTimestamp >= :startDate and ii.fofoId = :fofoId  "
29
				+ " join Item i on i.id = ii.itemId where sc.type = 'ACTIVATION' and sio.status ='PENDING' and sio.createTimestamp >= :startDate and ii.fofoId = :fofoId  "
30
				+ "  group by i.brand, DATE_FORMAT(sio.createTimestamp, '%m-%Y')"),
30
				+ "  group by i.brand, DATE_FORMAT(sio.createTimestamp, '%m-%Y')"),
31
 
31
 
32
		@NamedQuery(name = "SchemeInOut.selectByYearMonthActivationGroupByBrand", query = "select new com.spice.profitmandi.dao.model.ActivationBrandModel(i.brand, "
32
		@NamedQuery(name = "SchemeInOut.selectByYearMonthActivationGroupByBrand", query = "select new com.spice.profitmandi.dao.model.ActivationBrandModel(i.brand, "
33
				+ "  sum(cast(sio.amount As int)) ) from Scheme sc join  SchemeInOut sio  on"
33
				+ "  sum(cast(sio.amount As integer )) ) from Scheme sc join  SchemeInOut sio  on"
34
				+ " sc.id = sio.schemeId join InventoryItem ii  on ii.id = sio.inventoryItemId"
34
				+ " sc.id = sio.schemeId join InventoryItem ii  on ii.id = sio.inventoryItemId"
35
				+ " join Item i on i.id = ii.itemId where sc.type = 'ACTIVATION' and sio.status ='PENDING' and sio.createTimestamp <= :endDate and ii.fofoId = :fofoId  "
35
				+ " join Item i on i.id = ii.itemId where sc.type = 'ACTIVATION' and sio.status ='PENDING' and sio.createTimestamp <= :endDate and ii.fofoId = :fofoId  "
36
				+ "  group by i.brand"),
36
				+ "  group by i.brand"),
37
 
37
 
38
		@NamedQuery(name = "SchemeInOut.selectBrandPendingActivationItemDetails", query = "select new com.spice.profitmandi.dao.model.ActivationItemDetailModel(i.brand, "
38
		@NamedQuery(name = "SchemeInOut.selectBrandPendingActivationItemDetails", query = "select new com.spice.profitmandi.dao.model.ActivationItemDetailModel(i.brand, "
39
				+ "  i.modelName,i.modelNumber,cast(sio.amount As int),ii.serialNumber, ii.id) from Scheme sc join SchemeInOut sio  on"
39
				+ "  i.modelName,i.modelNumber,cast(sio.amount As integer ),ii.serialNumber, ii.id) from Scheme sc join SchemeInOut sio  on"
40
				+ "	 sc.id = sio.schemeId join InventoryItem ii  on ii.id = sio.inventoryItemId"
40
				+ "	 sc.id = sio.schemeId join InventoryItem ii  on ii.id = sio.inventoryItemId"
41
				+ "	 join Item i on i.id = ii.itemId where sc.type = 'ACTIVATION' and sio.status ='PENDING' and "
41
				+ "	 join Item i on i.id = ii.itemId where sc.type = 'ACTIVATION' and sio.status ='PENDING' and "
42
				+ "  ii.fofoId = :fofoId and i.brand = :brand and  DATE_FORMAT(sio.createTimestamp, '%m-%Y') = :yearMonthValue"),
42
				+ "  ii.fofoId = :fofoId and i.brand = :brand and  DATE_FORMAT(sio.createTimestamp, '%m-%Y') = :yearMonthValue"),
43
 
43
 
44
		@NamedQuery(name = "SchemeInOut.selectBrandPendingActivationItemDetailByYearMonth", query = "select new com.spice.profitmandi.dao.model.ActivationItemDetailModel(i.brand, "
44
		@NamedQuery(name = "SchemeInOut.selectBrandPendingActivationItemDetailByYearMonth", query = "select new com.spice.profitmandi.dao.model.ActivationItemDetailModel(i.brand, "
45
				+ "  i.modelName,i.modelNumber,cast(sio.amount As int),ii.serialNumber, ii.id) from Scheme sc join SchemeInOut sio  on"
45
				+ "  i.modelName,i.modelNumber,cast(sio.amount As integer ),ii.serialNumber, ii.id) from Scheme sc join SchemeInOut sio  on"
46
				+ "	 sc.id = sio.schemeId join InventoryItem ii  on ii.id = sio.inventoryItemId"
46
				+ "	 sc.id = sio.schemeId join InventoryItem ii  on ii.id = sio.inventoryItemId"
47
				+ "	 join Item i on i.id = ii.itemId where sc.type = 'ACTIVATION' and sio.status ='PENDING' and "
47
				+ "	 join Item i on i.id = ii.itemId where sc.type = 'ACTIVATION' and sio.status ='PENDING' and "
48
				+ "  ii.fofoId = :fofoId and i.brand = :brand and sio.createTimestamp <= :endDate"),
48
				+ "  ii.fofoId = :fofoId and i.brand = :brand and sio.createTimestamp <= :endDate"),
49
 
49
 
50
})
50
})