Subversion Repositories SmartDukaan

Rev

Rev 2976 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1946 chandransh 1
package in.shop2020.payment.persistence;
2
 
3
import java.util.List;
4
import java.util.Map;
5
 
6
import org.apache.ibatis.annotations.Param;
7
 
8
import in.shop2020.payment.domain.Payment;
9
//import in.shop2020.payments.Payment;
10
import in.shop2020.payment.domain.PaymentAttribute;
11
 
12
public interface PaymentMapper {
13
	int insertPayment(Payment payment);
14
 
15
	void updatePayment(Payment payment);
16
 
17
	// TODO: All getPayment methods currently employ the simple N+1 strategy to
18
	// load the attributes. This is not desirable. Instead, more labour should
19
	// be spent into writing the long result maps which will use a single query.
20
	Payment getPayment(long id);
21
 
22
	List<Payment> getPaymentsForUser(@Param("userId") long userId,
23
			@Param("fromTime") String fromTime, @Param("toTime") String toTime,
24
			@Param("status") int status, @Param("gatewayId") long gatewayId);
25
 
26
	List<Payment> getPayments(@Param("fromTime") String fromTime, @Param("toTime") String toTime,
27
			@Param("status") int status, @Param("gatewayId") long gatewayId);
28
 
29
	List<Payment> getPaymentForTxn(long merchantTxnId);
30
 
31
	Map<String, Float> getMinMaxPaymentAmount();
32
 
33
	List<PaymentAttribute> getAttributesForPayment(long id);
34
 
35
	void insertPaymentAttribute(@Param("paymentId") long paymentId,
36
			@Param("name") String name, @Param("value") String value);
37
}