Subversion Repositories SmartDukaan

Rev

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

Rev 2293 Rev 2388
Line 23... Line 23...
23
    ON DUPLICATE KEY UPDATE value=values(value);
23
    ON DUPLICATE KEY UPDATE value=values(value);
24
  </insert>
24
  </insert>
25
 
25
 
26
  <update id="updatePayment" parameterType="payment">
26
  <update id="updatePayment" parameterType="payment">
27
    UPDATE payment
27
    UPDATE payment
-
 
28
    SET
-
 
29
    <if test="gatewayPaymentId != null">
28
    SET gatewayPaymentId = #{gatewayPaymentId},
30
      gatewayPaymentId = #{gatewayPaymentId},
-
 
31
    </if>
-
 
32
    <if test="sessionId != null">
29
    sessionId = #{sessionId},
33
      sessionId = #{sessionId},
-
 
34
    </if>
-
 
35
    <if test="gatewayTxnStatus != null">
30
    gatewayTxnStatus = #{gatewayTxnStatus},
36
      gatewayTxnStatus = #{gatewayTxnStatus},
-
 
37
    </if>
-
 
38
    <if test="description != null">
31
    description = #{description},
39
      description = #{description},
-
 
40
    </if>
-
 
41
    <if test="gatewayTxnId != null">
32
    gatewayTxnId = #{gatewayTxnId},
42
      gatewayTxnId = #{gatewayTxnId},
-
 
43
    </if>
-
 
44
    <if test="authCode != null">
33
    authCode = #{authCode},
45
      authCode = #{authCode},
-
 
46
    </if>
-
 
47
    <if test="referenceCode != null">
34
    referenceCode = #{referenceCode},
48
      referenceCode = #{referenceCode},
-
 
49
    </if> 
-
 
50
    <if test="gatewayTxnDate != null">
-
 
51
      gatewayTxnDate = #{gatewayTxnDate},
-
 
52
    </if>
-
 
53
    <if test="status != null">
-
 
54
      status = #{status},
-
 
55
    </if>
35
    errorCode = #{errorCode},
56
    errorCode = #{errorCode},
36
    status = #{status},
-
 
37
    gatewayTxnDate = #{gatewayTxnDate},
-
 
38
    successTimestamp = #{successTimestamp},
57
    successTimestamp = #{successTimestamp},
39
    errorTimestamp = #{errorTimestamp}
58
    errorTimestamp = #{errorTimestamp}
40
    WHERE id=#{id}
59
    WHERE id=#{id}
41
  </update>
60
  </update>
42
 
61
 
Line 50... Line 69...
50
  </select>
69
  </select>
51
  
70
  
52
  <select id="getPaymentForTxn" parameterType="int" resultMap="paymentResult">
71
  <select id="getPaymentForTxn" parameterType="int" resultMap="paymentResult">
53
    SELECT * FROM payment
72
    SELECT * FROM payment
54
    WHERE merchantTxnId=#{merchantTxnId}
73
    WHERE merchantTxnId=#{merchantTxnId}
-
 
74
    ORDER BY id DESC
-
 
75
    LIMIT 1
55
  </select>
76
  </select>
56
  
77
  
57
  <sql id="getPaymentsWhereClause">
78
  <sql id="getPaymentsWhereClause">
58
    <if test="fromTime != ''">
79
    <if test="fromTime != ''">
59
      initTimestamp &gt;= #{fromTime}
80
      initTimestamp &gt;= #{fromTime}