订单分账记录表 加字段

This commit is contained in:
Guoqs
2025-01-13 16:15:35 +08:00
parent 76ebd65c05
commit 6269524b97
3 changed files with 122 additions and 15 deletions

View File

@@ -8,6 +8,9 @@
<result column="order_code" jdbcType="VARCHAR" property="orderCode" />
<result column="status" jdbcType="VARCHAR" property="status" />
<result column="settle_amount" jdbcType="DECIMAL" property="settleAmount" />
<result column="electricity_amount" jdbcType="DECIMAL" property="electricityAmount" />
<result column="service_amount" jdbcType="DECIMAL" property="serviceAmount" />
<result column="trade_date" jdbcType="VARCHAR" property="tradeDate" />
<result column="adapay_member_id" jdbcType="VARCHAR" property="adapayMemberId" />
<result column="payment_id" jdbcType="VARCHAR" property="paymentId" />
<result column="payment_confirm_id" jdbcType="VARCHAR" property="paymentConfirmId" />
@@ -24,9 +27,10 @@
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, order_code, `status`, settle_amount, 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
id, order_code, `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
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<!--@mbg.generated-->
@@ -53,6 +57,15 @@
<if test="settleAmount != null">
settle_amount,
</if>
<if test="electricityAmount != null">
electricity_amount,
</if>
<if test="serviceAmount != null">
service_amount,
</if>
<if test="tradeDate != null">
trade_date,
</if>
<if test="adapayMemberId != null">
adapay_member_id,
</if>
@@ -103,6 +116,15 @@
<if test="settleAmount != null">
#{settleAmount,jdbcType=DECIMAL},
</if>
<if test="electricityAmount != null">
#{electricityAmount,jdbcType=DECIMAL},
</if>
<if test="serviceAmount != null">
#{serviceAmount,jdbcType=DECIMAL},
</if>
<if test="tradeDate != null">
#{tradeDate,jdbcType=VARCHAR},
</if>
<if test="adapayMemberId != null">
#{adapayMemberId,jdbcType=VARCHAR},
</if>
@@ -157,6 +179,15 @@
<if test="settleAmount != null">
settle_amount = #{settleAmount,jdbcType=DECIMAL},
</if>
<if test="electricityAmount != null">
electricity_amount = #{electricityAmount,jdbcType=DECIMAL},
</if>
<if test="serviceAmount != null">
service_amount = #{serviceAmount,jdbcType=DECIMAL},
</if>
<if test="tradeDate != null">
trade_date = #{tradeDate,jdbcType=VARCHAR},
</if>
<if test="adapayMemberId != null">
adapay_member_id = #{adapayMemberId,jdbcType=VARCHAR},
</if>
@@ -224,6 +255,27 @@
</if>
</foreach>
</trim>
<trim prefix="electricity_amount = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.electricityAmount != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.electricityAmount,jdbcType=DECIMAL}
</if>
</foreach>
</trim>
<trim prefix="service_amount = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.serviceAmount != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.serviceAmount,jdbcType=DECIMAL}
</if>
</foreach>
</trim>
<trim prefix="trade_date = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.tradeDate != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.tradeDate,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="adapay_member_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.adapayMemberId != null">
@@ -324,18 +376,20 @@
<insert id="batchInsert" keyColumn="id" keyProperty="id" parameterType="map" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into order_split_record
(order_code, `status`, settle_amount, 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)
(order_code, `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)
values
<foreach collection="list" item="item" separator=",">
(#{item.orderCode,jdbcType=VARCHAR}, #{item.status,jdbcType=VARCHAR}, #{item.settleAmount,jdbcType=DECIMAL},
#{item.adapayMemberId,jdbcType=VARCHAR}, #{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.electricityAmount,jdbcType=DECIMAL}, #{item.serviceAmount,jdbcType=DECIMAL},
#{item.tradeDate,jdbcType=VARCHAR}, #{item.adapayMemberId,jdbcType=VARCHAR}, #{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})
</foreach>
</insert>
<insert id="insertOrUpdate" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.OrderSplitRecord" useGeneratedKeys="true">
@@ -348,6 +402,9 @@
order_code,
`status`,
settle_amount,
electricity_amount,
service_amount,
trade_date,
adapay_member_id,
payment_id,
payment_confirm_id,
@@ -370,6 +427,9 @@
#{orderCode,jdbcType=VARCHAR},
#{status,jdbcType=VARCHAR},
#{settleAmount,jdbcType=DECIMAL},
#{electricityAmount,jdbcType=DECIMAL},
#{serviceAmount,jdbcType=DECIMAL},
#{tradeDate,jdbcType=VARCHAR},
#{adapayMemberId,jdbcType=VARCHAR},
#{paymentId,jdbcType=VARCHAR},
#{paymentConfirmId,jdbcType=VARCHAR},
@@ -392,6 +452,9 @@
order_code = #{orderCode,jdbcType=VARCHAR},
`status` = #{status,jdbcType=VARCHAR},
settle_amount = #{settleAmount,jdbcType=DECIMAL},
electricity_amount = #{electricityAmount,jdbcType=DECIMAL},
service_amount = #{serviceAmount,jdbcType=DECIMAL},
trade_date = #{tradeDate,jdbcType=VARCHAR},
adapay_member_id = #{adapayMemberId,jdbcType=VARCHAR},
payment_id = #{paymentId,jdbcType=VARCHAR},
payment_confirm_id = #{paymentConfirmId,jdbcType=VARCHAR},
@@ -423,6 +486,15 @@
<if test="settleAmount != null">
settle_amount,
</if>
<if test="electricityAmount != null">
electricity_amount,
</if>
<if test="serviceAmount != null">
service_amount,
</if>
<if test="tradeDate != null">
trade_date,
</if>
<if test="adapayMemberId != null">
adapay_member_id,
</if>
@@ -477,6 +549,15 @@
<if test="settleAmount != null">
#{settleAmount,jdbcType=DECIMAL},
</if>
<if test="electricityAmount != null">
#{electricityAmount,jdbcType=DECIMAL},
</if>
<if test="serviceAmount != null">
#{serviceAmount,jdbcType=DECIMAL},
</if>
<if test="tradeDate != null">
#{tradeDate,jdbcType=VARCHAR},
</if>
<if test="adapayMemberId != null">
#{adapayMemberId,jdbcType=VARCHAR},
</if>
@@ -531,6 +612,15 @@
<if test="settleAmount != null">
settle_amount = #{settleAmount,jdbcType=DECIMAL},
</if>
<if test="electricityAmount != null">
electricity_amount = #{electricityAmount,jdbcType=DECIMAL},
</if>
<if test="serviceAmount != null">
service_amount = #{serviceAmount,jdbcType=DECIMAL},
</if>
<if test="tradeDate != null">
trade_date = #{tradeDate,jdbcType=VARCHAR},
</if>
<if test="adapayMemberId != null">
adapay_member_id = #{adapayMemberId,jdbcType=VARCHAR},
</if>