<?xml version="1.0" encoding="UTF-8" ?>
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<mapper namespace="com.ruoyi.payment.infrastructure.persistence.mapper.PaymentOrderMapper">
|
|
<resultMap id="PaymentOrderResult" type="com.ruoyi.payment.domain.model.PaymentOrder">
|
<id property="id" column="id"/>
|
<result property="bizOrderId" column="biz_order_id"/>
|
<result property="amount" column="amount"/>
|
<result property="currency" column="currency"/>
|
<result property="channel" column="channel"/>
|
<result property="status" column="status"/>
|
<result property="subject" column="subject"/>
|
<result property="description" column="description"/>
|
<result property="callbackUrl" column="callback_url"/>
|
<result property="expireAt" column="expire_at"/>
|
<result property="latestTransactionId" column="latest_transaction_id"/>
|
<result property="channelTradeNo" column="channel_trade_no"/>
|
<result property="paidAt" column="paid_at"/>
|
<result property="version" column="version"/>
|
<result property="createdAt" column="created_at"/>
|
<result property="updatedAt" column="updated_at"/>
|
</resultMap>
|
|
<insert id="insert" parameterType="com.ruoyi.payment.domain.model.PaymentOrder">
|
INSERT INTO pay_order (
|
id, biz_order_id, amount, currency, channel, status,
|
subject, description, callback_url, expire_at,
|
latest_transaction_id, channel_trade_no, paid_at,
|
version, created_at, updated_at
|
) VALUES (
|
#{id}, #{bizOrderId}, #{amount}, #{currency}, #{channel}, #{status},
|
#{subject}, #{description}, #{callbackUrl}, #{expireAt},
|
#{latestTransactionId}, #{channelTradeNo}, #{paidAt},
|
#{version}, #{createdAt}, #{updatedAt}
|
)
|
</insert>
|
|
<update id="update" parameterType="com.ruoyi.payment.domain.model.PaymentOrder">
|
UPDATE pay_order
|
<set>
|
<if test="bizOrderId != null">biz_order_id = #{bizOrderId},</if>
|
<if test="amount != null">amount = #{amount},</if>
|
<if test="currency != null">currency = #{currency},</if>
|
<if test="channel != null">channel = #{channel},</if>
|
<if test="status != null">status = #{status},</if>
|
<if test="subject != null">subject = #{subject},</if>
|
<if test="description != null">description = #{description},</if>
|
<if test="callbackUrl != null">callback_url = #{callbackUrl},</if>
|
<if test="expireAt != null">expire_at = #{expireAt},</if>
|
<if test="latestTransactionId != null">latest_transaction_id = #{latestTransactionId},</if>
|
<if test="channelTradeNo != null">channel_trade_no = #{channelTradeNo},</if>
|
<if test="paidAt != null">paid_at = #{paidAt},</if>
|
<if test="version != null">version = #{version},</if>
|
<if test="updatedAt != null">updated_at = #{updatedAt},</if>
|
</set>
|
WHERE id = #{id}
|
</update>
|
|
<select id="selectById" resultMap="PaymentOrderResult">
|
SELECT * FROM pay_order
|
WHERE id = #{id}
|
</select>
|
|
<select id="selectByBizOrderIdAndChannel" resultMap="PaymentOrderResult">
|
SELECT * FROM pay_order
|
WHERE biz_order_id = #{bizOrderId}
|
AND channel = #{channel}
|
LIMIT 1
|
</select>
|
|
<select id="selectByChannelTradeNo" resultMap="PaymentOrderResult">
|
SELECT * FROM pay_order
|
WHERE channel_trade_no = #{channelTradeNo}
|
LIMIT 1
|
</select>
|
|
</mapper>
|