更新钱包code为空的数据

This commit is contained in:
Guoqs
2025-07-24 14:55:56 +08:00
parent ef55dd04af
commit e418ce562a
6 changed files with 112 additions and 33 deletions

View File

@@ -19,12 +19,12 @@
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, member_id, merchant_id, wallet_code, principal_balance, gift_balance, version,
id, member_id, merchant_id, wallet_code, principal_balance, gift_balance, version,
create_by, create_time, update_by, update_time, del_flag
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<!--@mbg.generated-->
select
select
<include refid="Base_Column_List" />
from member_wallet_info
where id = #{id,jdbcType=INTEGER}
@@ -34,6 +34,17 @@
delete from member_wallet_info
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.MemberWalletInfo" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into member_wallet_info (member_id, merchant_id, wallet_code,
principal_balance, gift_balance, version,
create_by, create_time, update_by,
update_time, del_flag)
values (#{memberId,jdbcType=VARCHAR}, #{merchantId,jdbcType=VARCHAR}, #{walletCode,jdbcType=VARCHAR},
#{principalBalance,jdbcType=DECIMAL}, #{giftBalance,jdbcType=DECIMAL}, #{version,jdbcType=INTEGER},
#{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR},
#{updateTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=CHAR})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.MemberWalletInfo" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into member_wallet_info
@@ -148,6 +159,22 @@
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.jsowell.pile.domain.MemberWalletInfo">
<!--@mbg.generated-->
update member_wallet_info
set member_id = #{memberId,jdbcType=VARCHAR},
merchant_id = #{merchantId,jdbcType=VARCHAR},
wallet_code = #{walletCode,jdbcType=VARCHAR},
principal_balance = #{principalBalance,jdbcType=DECIMAL},
gift_balance = #{giftBalance,jdbcType=DECIMAL},
version = #{version,jdbcType=INTEGER},
create_by = #{createBy,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_by = #{updateBy,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=TIMESTAMP},
del_flag = #{delFlag,jdbcType=CHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateBatch" parameterType="java.util.List">
<!--@mbg.generated-->
update member_wallet_info
@@ -303,13 +330,13 @@
<insert id="batchInsert" keyColumn="id" keyProperty="id" parameterType="map" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into member_wallet_info
(member_id, merchant_id, wallet_code, principal_balance, gift_balance, version, create_by,
(member_id, merchant_id, wallet_code, principal_balance, gift_balance, version, create_by,
create_time, update_by, update_time, del_flag)
values
<foreach collection="list" item="item" separator=",">
(#{item.memberId,jdbcType=VARCHAR}, #{item.merchantId,jdbcType=VARCHAR}, #{item.walletCode,jdbcType=VARCHAR},
#{item.principalBalance,jdbcType=DECIMAL}, #{item.giftBalance,jdbcType=DECIMAL},
#{item.version,jdbcType=INTEGER}, #{item.createBy,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP},
(#{item.memberId,jdbcType=VARCHAR}, #{item.merchantId,jdbcType=VARCHAR}, #{item.walletCode,jdbcType=VARCHAR},
#{item.principalBalance,jdbcType=DECIMAL}, #{item.giftBalance,jdbcType=DECIMAL},
#{item.version,jdbcType=INTEGER}, #{item.createBy,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP},
#{item.updateBy,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP}, #{item.delFlag,jdbcType=CHAR}
)
</foreach>
@@ -350,7 +377,7 @@
#{updateTime,jdbcType=TIMESTAMP},
#{delFlag,jdbcType=CHAR},
</trim>
on duplicate key update
on duplicate key update
<trim suffixOverrides=",">
<if test="id != null">
id = #{id,jdbcType=INTEGER},
@@ -448,7 +475,7 @@
#{delFlag,jdbcType=CHAR},
</if>
</trim>
on duplicate key update
on duplicate key update
<trim suffixOverrides=",">
<if test="id != null">
id = #{id,jdbcType=INTEGER},
@@ -539,4 +566,12 @@
and sub_type = '11') t3 on t3.wallet_code = t1.wallet_code
where t1.wallet_code = #{walletCode,jdbcType=VARCHAR}
</select>
</mapper>
<select id="queryWalletIsNull" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from member_wallet_info
where del_flag = '0'
and merchant_id is null
</select>
</mapper>