This commit is contained in:
Guoqs
2025-04-16 11:57:59 +08:00
parent 6e8cd51cb4
commit 21772ca796
3 changed files with 63 additions and 21 deletions

View File

@@ -9,13 +9,15 @@
<result column="status" jdbcType="VARCHAR" property="status" />
<result column="order_code" jdbcType="VARCHAR" property="orderCode" />
<result column="pay_amount" jdbcType="DECIMAL" property="payAmount" />
<result column="refund_amount" jdbcType="DECIMAL" property="refundAmount" />
<result column="settle_amount" jdbcType="DECIMAL" property="settleAmount" />
<result column="order_time" jdbcType="TIMESTAMP" property="orderTime" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, payment_id, `status`, order_code, pay_amount, settle_amount, order_time, create_time
id, payment_id, `status`, order_code, pay_amount, refund_amount, settle_amount, order_time,
create_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<!--@mbg.generated-->
@@ -45,6 +47,9 @@
<if test="payAmount != null">
pay_amount,
</if>
<if test="refundAmount != null">
refund_amount,
</if>
<if test="settleAmount != null">
settle_amount,
</if>
@@ -68,6 +73,9 @@
<if test="payAmount != null">
#{payAmount,jdbcType=DECIMAL},
</if>
<if test="refundAmount != null">
#{refundAmount,jdbcType=DECIMAL},
</if>
<if test="settleAmount != null">
#{settleAmount,jdbcType=DECIMAL},
</if>
@@ -95,6 +103,9 @@
<if test="payAmount != null">
pay_amount = #{payAmount,jdbcType=DECIMAL},
</if>
<if test="refundAmount != null">
refund_amount = #{refundAmount,jdbcType=DECIMAL},
</if>
<if test="settleAmount != null">
settle_amount = #{settleAmount,jdbcType=DECIMAL},
</if>
@@ -131,6 +142,11 @@
when id = #{item.id,jdbcType=INTEGER} then #{item.payAmount,jdbcType=DECIMAL}
</foreach>
</trim>
<trim prefix="refund_amount = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.refundAmount,jdbcType=DECIMAL}
</foreach>
</trim>
<trim prefix="settle_amount = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.settleAmount,jdbcType=DECIMAL}
@@ -184,6 +200,13 @@
</if>
</foreach>
</trim>
<trim prefix="refund_amount = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.refundAmount != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.refundAmount,jdbcType=DECIMAL}
</if>
</foreach>
</trim>
<trim prefix="settle_amount = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.settleAmount != null">
@@ -214,13 +237,13 @@
<insert id="batchInsert" keyColumn="id" keyProperty="id" parameterType="map" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into order_unsplit_record
(payment_id, `status`, order_code, pay_amount, settle_amount, order_time, create_time
)
(payment_id, `status`, order_code, pay_amount, refund_amount, settle_amount, order_time,
create_time)
values
<foreach collection="list" item="item" separator=",">
(#{item.paymentId,jdbcType=VARCHAR}, #{item.status,jdbcType=VARCHAR}, #{item.orderCode,jdbcType=VARCHAR},
#{item.payAmount,jdbcType=DECIMAL}, #{item.settleAmount,jdbcType=DECIMAL}, #{item.orderTime,jdbcType=TIMESTAMP},
#{item.createTime,jdbcType=TIMESTAMP})
#{item.payAmount,jdbcType=DECIMAL}, #{item.refundAmount,jdbcType=DECIMAL}, #{item.settleAmount,jdbcType=DECIMAL},
#{item.orderTime,jdbcType=TIMESTAMP}, #{item.createTime,jdbcType=TIMESTAMP})
</foreach>
</insert>
<insert id="insertOrUpdate" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.OrderUnsplitRecord" useGeneratedKeys="true">
@@ -234,6 +257,7 @@
`status`,
order_code,
pay_amount,
refund_amount,
settle_amount,
order_time,
create_time,
@@ -247,6 +271,7 @@
#{status,jdbcType=VARCHAR},
#{orderCode,jdbcType=VARCHAR},
#{payAmount,jdbcType=DECIMAL},
#{refundAmount,jdbcType=DECIMAL},
#{settleAmount,jdbcType=DECIMAL},
#{orderTime,jdbcType=TIMESTAMP},
#{createTime,jdbcType=TIMESTAMP},
@@ -260,6 +285,7 @@
`status` = #{status,jdbcType=VARCHAR},
order_code = #{orderCode,jdbcType=VARCHAR},
pay_amount = #{payAmount,jdbcType=DECIMAL},
refund_amount = #{refundAmount,jdbcType=DECIMAL},
settle_amount = #{settleAmount,jdbcType=DECIMAL},
order_time = #{orderTime,jdbcType=TIMESTAMP},
create_time = #{createTime,jdbcType=TIMESTAMP},
@@ -284,6 +310,9 @@
<if test="payAmount != null">
pay_amount,
</if>
<if test="refundAmount != null">
refund_amount,
</if>
<if test="settleAmount != null">
settle_amount,
</if>
@@ -311,6 +340,9 @@
<if test="payAmount != null">
#{payAmount,jdbcType=DECIMAL},
</if>
<if test="refundAmount != null">
#{refundAmount,jdbcType=DECIMAL},
</if>
<if test="settleAmount != null">
#{settleAmount,jdbcType=DECIMAL},
</if>
@@ -338,6 +370,9 @@
<if test="payAmount != null">
pay_amount = #{payAmount,jdbcType=DECIMAL},
</if>
<if test="refundAmount != null">
refund_amount = #{refundAmount,jdbcType=DECIMAL},
</if>
<if test="settleAmount != null">
settle_amount = #{settleAmount,jdbcType=DECIMAL},
</if>