Subversion Repositories SmartDukaan

Rev

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

Rev 30087 Rev 30137
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) FROM FofoStore fs"
15
				+ " sum(cast(uwh.amount AS int)),pcp.authId,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 and uwh.timestamp <= :endDate )"
19
				+ "	and uwh.timestamp >= :startDate )"
20
				+ " left join PartnerCollectionPlan pcp on (pcp.fofoId = fs.id and pcp.createTimestamp >= :startDate and "
20
				+ " left join PartnerCollectionPlan pcp on (pcp.fofoId = fs.id and pcp.commitedTimestamp >= :startDate"
21
				+ " pcp.createTimestamp <= :endDate and pcp.active = 1)"
-
 
22
				+ " 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"), })
23
public class UserWallet {
22
public class UserWallet {
24
 
23
 
25
	@Id
24
	@Id
26
	@GeneratedValue(strategy = GenerationType.IDENTITY)
25
	@GeneratedValue(strategy = GenerationType.IDENTITY)
27
	private int id;
26
	private int id;