id, app_id, create_ip, order_id, order_subject,
order_description, order_memo, price, status, expire_time,
finish_time, notify_url, extension_id, pay_channel, payment_time,
notify_time, trade_no, refund_total, create_time
INSERT INTO transaction (
app_id, create_ip, order_id, order_subject,
order_description, order_memo, price, status, expire_time,
finish_time, notify_url, extension_id, pay_channel, payment_time,
notify_time, trade_no, create_time
) VALUES (
#{appId}, #{createIp}, #{orderId}, #{orderSubject},
#{orderDescription}, #{orderMemo}, #{price}, #{status}, #{expireTime},
#{finishTime}, #{notifyUrl}, #{extensionId}, #{payChannel}, #{paymentTime},
#{notifyTime}, #{tradeNo}, #{createTime}
)
UPDATE transaction
, status = #{entity.status}
, extension_id = #{entity.extensionId}
, pay_channel = #{entity.payChannel}
, payment_time = #{entity.paymentTime}
, finish_time = #{entity.finishTime}
, notify_time = #{entity.notifyTime}
, trade_no = #{entity.tradeNo}
WHERE id = #{entity.id}
AND status = #{whereStatus}
UPDATE `transaction`
SET refund_total = refund_total + ${refundTotalIncr}
WHERE price >= refund_total + ${refundTotalIncr}