Subversion Repositories SmartDukaan

Rev

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

Rev 30137 Rev 30330
Line 10... Line 10...
10
				+ " join UserWallet uw on uw.userId = fs.id " + "join UserWalletHistory uwh on uwh.walletId = uw.id "
10
				+ " join UserWallet uw on uw.userId = fs.id " + "join UserWalletHistory uwh on uwh.walletId = uw.id "
11
				+ "where uwh.referenceType in ('ADVANCE_AMOUNT', 'AUTOMATED_ADVANCE', 'PAYMENT_GATEWAY') "
11
				+ "where uwh.referenceType in ('ADVANCE_AMOUNT', 'AUTOMATED_ADVANCE', 'PAYMENT_GATEWAY') "
12
				+ "and uwh.timestamp between :startDate and :endDate and fs.internal=false group by fs.warehouseId"),
12
				+ "and uwh.timestamp between :startDate and :endDate and fs.internal=false group by fs.warehouseId"),
13
 
13
 
14
		@NamedQuery(name = "UserWallet.getPartnerWiseTargetCollections", query = "SELECT new com.spice.profitmandi.dao.model.PartnerCollectionPlanModel(fs.id,case when pcp.collectionPlan is not null then cast(pcp.collectionPlan As long) else 0 end,"
14
		@NamedQuery(name = "UserWallet.getPartnerWiseTargetCollections", query = "SELECT new com.spice.profitmandi.dao.model.PartnerCollectionPlanModel(fs.id,case when pcp.collectionPlan is not null then cast(pcp.collectionPlan As long) else 0 end,"
15
				+ " sum(cast(uwh.amount AS int)),pcp.authId,pcp.commitedTimestamp) FROM FofoStore fs"
15
				+ " sum(cast(uwh.amount AS int)),pcp.authId,pcp.createTimestamp, pcp.commitedTimestamp) FROM FofoStore fs"
16
				+ " left join UserWallet uw on uw.userId = fs.id "
16
				+ " left join UserWallet uw on uw.userId = fs.id "
17
				+ " left join UserWalletHistory uwh on (uwh.walletId = uw.id and"
17
				+ " left join UserWalletHistory uwh on (uwh.walletId = uw.id and"
18
				+ " uwh.referenceType in ('ADVANCE_AMOUNT', 'AUTOMATED_ADVANCE', 'PAYMENT_GATEWAY')"
18
				+ " uwh.referenceType in ('ADVANCE_AMOUNT', 'AUTOMATED_ADVANCE', 'PAYMENT_GATEWAY')"
19
				+ "	and uwh.timestamp >= :startDate )"
19
				+ "	and uwh.timestamp >= :startDate )"
20
				+ " left join PartnerCollectionPlan pcp on (pcp.fofoId = fs.id and pcp.commitedTimestamp >= :startDate"
20
				+ " left join PartnerCollectionPlan pcp on (pcp.fofoId = fs.id and pcp.commitedTimestamp >= :startDate"
21
				+ "  and pcp.active = 1)" + " where  fs.id in :fofoIds and fs.internal=0 group by fs.id"), })
21
				+ "  and pcp.active = 1)" + " where  fs.id in :fofoIds and fs.internal=0 group by fs.id"),
-
 
22
 
-
 
23
		@NamedQuery(name = "UserWallet.getPartnerWiseCollectionAchievement", query = "SELECT new com.spice.profitmandi.dao.model.PartnerCollectionAchievementModel(fs.id,"
-
 
24
				+ " sum(cast(uwh.amount AS int))) FROM FofoStore fs" + " left join UserWallet uw on uw.userId = fs.id "
-
 
25
				+ " left join UserWalletHistory uwh on (uwh.walletId = uw.id and"
-
 
26
				+ " uwh.referenceType in ('ADVANCE_AMOUNT', 'AUTOMATED_ADVANCE', 'PAYMENT_GATEWAY')"
-
 
27
				+ "	and uwh.timestamp >= :startDate )"
-
 
28
				+ " where  fs.id in :fofoIds and fs.internal=0 group by fs.id"), })
-
 
29
 
22
public class UserWallet {
30
public class UserWallet {
23
 
31
 
24
	@Id
32
	@Id
25
	@GeneratedValue(strategy = GenerationType.IDENTITY)
33
	@GeneratedValue(strategy = GenerationType.IDENTITY)
26
	private int id;
34
	private int id;