查询时间段内的订单分账记录

This commit is contained in:
Guoqs
2025-01-17 16:40:33 +08:00
parent 2785d91b4f
commit 1683ccd968
6 changed files with 80 additions and 67 deletions

View File

@@ -20,6 +20,7 @@
<result column="electricity_split_amount" jdbcType="DECIMAL" property="electricitySplitAmount" />
<result column="service_split_ratio" jdbcType="DECIMAL" property="serviceSplitRatio" />
<result column="service_split_amount" jdbcType="DECIMAL" property="serviceSplitAmount" />
<result column="fee_amount" jdbcType="DECIMAL" property="feeAmount" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
@@ -31,8 +32,8 @@
<!--@mbg.generated-->
id, order_code, merchant_id, station_id, `status`, settle_amount, electricity_amount,
service_amount, trade_date, adapay_member_id, payment_id, payment_confirm_id, electricity_split_ratio,
electricity_split_amount, service_split_ratio, service_split_amount, remark, create_by,
create_time, update_by, update_time, del_flag
electricity_split_amount, service_split_ratio, service_split_amount, fee_amount,
remark, create_by, create_time, update_by, update_time, del_flag
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<!--@mbg.generated-->
@@ -95,6 +96,9 @@
<if test="serviceSplitAmount != null">
service_split_amount,
</if>
<if test="feeAmount != null">
fee_amount,
</if>
<if test="remark != null">
remark,
</if>
@@ -160,6 +164,9 @@
<if test="serviceSplitAmount != null">
#{serviceSplitAmount,jdbcType=DECIMAL},
</if>
<if test="feeAmount != null">
#{feeAmount,jdbcType=DECIMAL},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
@@ -229,6 +236,9 @@
<if test="serviceSplitAmount != null">
service_split_amount = #{serviceSplitAmount,jdbcType=DECIMAL},
</if>
<if test="feeAmount != null">
fee_amount = #{feeAmount,jdbcType=DECIMAL},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
@@ -359,6 +369,13 @@
</if>
</foreach>
</trim>
<trim prefix="fee_amount = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.feeAmount != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.feeAmount,jdbcType=DECIMAL}
</if>
</foreach>
</trim>
<trim prefix="remark = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.remark != null">
@@ -412,8 +429,8 @@
insert into order_split_record
(order_code, merchant_id, station_id, `status`, settle_amount, electricity_amount,
service_amount, trade_date, adapay_member_id, payment_id, payment_confirm_id, electricity_split_ratio,
electricity_split_amount, service_split_ratio, service_split_amount, remark, create_by,
create_time, update_by, update_time, del_flag)
electricity_split_amount, service_split_ratio, service_split_amount, fee_amount,
remark, create_by, create_time, update_by, update_time, del_flag)
values
<foreach collection="list" item="item" separator=",">
(#{item.orderCode,jdbcType=VARCHAR}, #{item.merchantId,jdbcType=VARCHAR}, #{item.stationId,jdbcType=VARCHAR},
@@ -422,9 +439,9 @@
#{item.paymentId,jdbcType=VARCHAR}, #{item.paymentConfirmId,jdbcType=VARCHAR},
#{item.electricitySplitRatio,jdbcType=DECIMAL}, #{item.electricitySplitAmount,jdbcType=DECIMAL},
#{item.serviceSplitRatio,jdbcType=DECIMAL}, #{item.serviceSplitAmount,jdbcType=DECIMAL},
#{item.remark,jdbcType=VARCHAR}, #{item.createBy,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP},
#{item.updateBy,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP}, #{item.delFlag,jdbcType=VARCHAR}
)
#{item.feeAmount,jdbcType=DECIMAL}, #{item.remark,jdbcType=VARCHAR}, #{item.createBy,jdbcType=VARCHAR},
#{item.createTime,jdbcType=TIMESTAMP}, #{item.updateBy,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
#{item.delFlag,jdbcType=VARCHAR})
</foreach>
</insert>
<insert id="insertOrUpdate" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.OrderSplitRecord" useGeneratedKeys="true">
@@ -449,6 +466,7 @@
electricity_split_amount,
service_split_ratio,
service_split_amount,
fee_amount,
remark,
create_by,
create_time,
@@ -476,6 +494,7 @@
#{electricitySplitAmount,jdbcType=DECIMAL},
#{serviceSplitRatio,jdbcType=DECIMAL},
#{serviceSplitAmount,jdbcType=DECIMAL},
#{feeAmount,jdbcType=DECIMAL},
#{remark,jdbcType=VARCHAR},
#{createBy,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP},
@@ -503,6 +522,7 @@
electricity_split_amount = #{electricitySplitAmount,jdbcType=DECIMAL},
service_split_ratio = #{serviceSplitRatio,jdbcType=DECIMAL},
service_split_amount = #{serviceSplitAmount,jdbcType=DECIMAL},
fee_amount = #{feeAmount,jdbcType=DECIMAL},
remark = #{remark,jdbcType=VARCHAR},
create_by = #{createBy,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
@@ -563,6 +583,9 @@
<if test="serviceSplitAmount != null">
service_split_amount,
</if>
<if test="feeAmount != null">
fee_amount,
</if>
<if test="remark != null">
remark,
</if>
@@ -632,6 +655,9 @@
<if test="serviceSplitAmount != null">
#{serviceSplitAmount,jdbcType=DECIMAL},
</if>
<if test="feeAmount != null">
#{feeAmount,jdbcType=DECIMAL},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
@@ -701,6 +727,9 @@
<if test="serviceSplitAmount != null">
service_split_amount = #{serviceSplitAmount,jdbcType=DECIMAL},
</if>
<if test="feeAmount != null">
fee_amount = #{feeAmount,jdbcType=DECIMAL},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>