update 修改余额增加备注

This commit is contained in:
2023-11-28 10:47:42 +08:00
parent b2be89c0f7
commit 45d71a5506
4 changed files with 55 additions and 13 deletions

View File

@@ -14,13 +14,14 @@
<result column="related_order_code" jdbcType="VARCHAR" property="relatedOrderCode" />
<result column="before_amount" jdbcType="DECIMAL" property="beforeAmount" />
<result column="after_amount" jdbcType="DECIMAL" property="afterAmount" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, member_id, wallet_code, `type`, sub_type, amount, category, related_order_code,
before_amount, after_amount, create_by, create_time
before_amount, after_amount, remark, create_by, create_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<!--@mbg.generated-->
@@ -39,11 +40,13 @@
insert into member_wallet_log (member_id, wallet_code, `type`,
sub_type, amount, category,
related_order_code, before_amount, after_amount,
create_by, create_time)
remark, create_by, create_time
)
values (#{memberId,jdbcType=VARCHAR}, #{walletCode,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR},
#{subType,jdbcType=VARCHAR}, #{amount,jdbcType=DECIMAL}, #{category,jdbcType=CHAR},
#{relatedOrderCode,jdbcType=VARCHAR}, #{beforeAmount,jdbcType=DECIMAL}, #{afterAmount,jdbcType=DECIMAL},
#{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP})
#{remark,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}
)
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.MemberWalletLog" useGeneratedKeys="true">
<!--@mbg.generated-->
@@ -76,6 +79,9 @@
<if test="afterAmount != null">
after_amount,
</if>
<if test="remark != null">
remark,
</if>
<if test="createBy != null">
create_by,
</if>
@@ -111,6 +117,9 @@
<if test="afterAmount != null">
#{afterAmount,jdbcType=DECIMAL},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
<if test="createBy != null">
#{createBy,jdbcType=VARCHAR},
</if>
@@ -150,6 +159,9 @@
<if test="afterAmount != null">
after_amount = #{afterAmount,jdbcType=DECIMAL},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=VARCHAR},
</if>
@@ -171,6 +183,7 @@
related_order_code = #{relatedOrderCode,jdbcType=VARCHAR},
before_amount = #{beforeAmount,jdbcType=DECIMAL},
after_amount = #{afterAmount,jdbcType=DECIMAL},
remark = #{remark,jdbcType=VARCHAR},
create_by = #{createBy,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
@@ -224,6 +237,11 @@
when id = #{item.id,jdbcType=INTEGER} then #{item.afterAmount,jdbcType=DECIMAL}
</foreach>
</trim>
<trim prefix="remark = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.remark,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="create_by = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.createBy,jdbcType=VARCHAR}
@@ -244,14 +262,14 @@
<!--@mbg.generated-->
insert into member_wallet_log
(member_id, wallet_code, `type`, sub_type, amount, category, related_order_code,
before_amount, after_amount, create_by, create_time)
before_amount, after_amount, remark, create_by, create_time)
values
<foreach collection="list" item="item" separator=",">
(#{item.memberId,jdbcType=VARCHAR}, #{item.walletCode,jdbcType=VARCHAR}, #{item.type,jdbcType=VARCHAR},
#{item.subType,jdbcType=VARCHAR}, #{item.amount,jdbcType=DECIMAL}, #{item.category,jdbcType=CHAR},
#{item.relatedOrderCode,jdbcType=VARCHAR}, #{item.beforeAmount,jdbcType=DECIMAL},
#{item.afterAmount,jdbcType=DECIMAL}, #{item.createBy,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP}
)
#{item.afterAmount,jdbcType=DECIMAL}, #{item.remark,jdbcType=VARCHAR}, #{item.createBy,jdbcType=VARCHAR},
#{item.createTime,jdbcType=TIMESTAMP})
</foreach>
</insert>
<insert id="insertOrUpdate" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.MemberWalletLog" useGeneratedKeys="true">
@@ -270,6 +288,7 @@
related_order_code,
before_amount,
after_amount,
remark,
create_by,
create_time,
</trim>
@@ -287,6 +306,7 @@
#{relatedOrderCode,jdbcType=VARCHAR},
#{beforeAmount,jdbcType=DECIMAL},
#{afterAmount,jdbcType=DECIMAL},
#{remark,jdbcType=VARCHAR},
#{createBy,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP},
</trim>
@@ -304,6 +324,7 @@
related_order_code = #{relatedOrderCode,jdbcType=VARCHAR},
before_amount = #{beforeAmount,jdbcType=DECIMAL},
after_amount = #{afterAmount,jdbcType=DECIMAL},
remark = #{remark,jdbcType=VARCHAR},
create_by = #{createBy,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
</trim>
@@ -342,6 +363,9 @@
<if test="afterAmount != null">
after_amount,
</if>
<if test="remark != null">
remark,
</if>
<if test="createBy != null">
create_by,
</if>
@@ -381,6 +405,9 @@
<if test="afterAmount != null">
#{afterAmount,jdbcType=DECIMAL},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
<if test="createBy != null">
#{createBy,jdbcType=VARCHAR},
</if>
@@ -420,6 +447,9 @@
<if test="afterAmount != null">
after_amount = #{afterAmount,jdbcType=DECIMAL},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=VARCHAR},
</if>