定时任务处理未分帐订单

This commit is contained in:
Guoqs
2025-04-16 15:50:26 +08:00
parent 42f828a812
commit b7f04d2159
6 changed files with 100 additions and 14 deletions

View File

@@ -16,12 +16,12 @@
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, payment_id, `status`, order_code, pay_amount, refund_amount, settle_amount, order_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-->
select
select
<include refid="Base_Column_List" />
from order_unsplit_record
where id = #{id,jdbcType=INTEGER}
@@ -237,12 +237,12 @@
<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, refund_amount, settle_amount, order_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.refundAmount,jdbcType=DECIMAL}, #{item.settleAmount,jdbcType=DECIMAL},
(#{item.paymentId,jdbcType=VARCHAR}, #{item.status,jdbcType=VARCHAR}, #{item.orderCode,jdbcType=VARCHAR},
#{item.payAmount,jdbcType=DECIMAL}, #{item.refundAmount,jdbcType=DECIMAL}, #{item.settleAmount,jdbcType=DECIMAL},
#{item.orderTime,jdbcType=TIMESTAMP}, #{item.createTime,jdbcType=TIMESTAMP})
</foreach>
</insert>
@@ -276,7 +276,7 @@
#{orderTime,jdbcType=TIMESTAMP},
#{createTime,jdbcType=TIMESTAMP},
</trim>
on duplicate key update
on duplicate key update
<trim suffixOverrides=",">
<if test="id != null">
id = #{id,jdbcType=INTEGER},
@@ -353,7 +353,7 @@
#{createTime,jdbcType=TIMESTAMP},
</if>
</trim>
on duplicate key update
on duplicate key update
<trim suffixOverrides=",">
<if test="id != null">
id = #{id,jdbcType=INTEGER},
@@ -384,4 +384,13 @@
</if>
</trim>
</insert>
</mapper>
<select id="queryUnsplitOrders" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from order_unsplit_record
where status = 'unsplit'
and order_time between #{startTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
order by order_time
</select>
</mapper>