更新钱包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

@@ -1,47 +1,34 @@
package com.jsowell.pile.mapper;
import com.jsowell.pile.domain.MemberWalletInfo;
import java.util.List;
import com.jsowell.pile.vo.base.MemberWalletVO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface MemberWalletInfoMapper {
int deleteByPrimaryKey(Integer id);
int insert(MemberWalletInfo record);
int insertOrUpdate(MemberWalletInfo record);
int insertOrUpdateSelective(MemberWalletInfo record);
int insertSelective(MemberWalletInfo record);
MemberWalletInfo selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(MemberWalletInfo record);
int updateByPrimaryKey(MemberWalletInfo record);
int updateBatch(@Param("list") List<MemberWalletInfo> list);
int updateBatchSelective(@Param("list") List<MemberWalletInfo> list);
int batchInsert(@Param("list") List<MemberWalletInfo> list);
int insertOrUpdate(MemberWalletInfo record);
int insertOrUpdateSelective(MemberWalletInfo record);
/**
* insert record to table
*
* @param record the record
* @return insert count
*/
int insert(MemberWalletInfo record);
/**
* update record
*
* @param record the updated record
* @return update count
*/
int updateByPrimaryKey(MemberWalletInfo record);
/**
* 根据会员id和目标运营商id查询用户钱包信息
*
@@ -56,4 +43,6 @@ public interface MemberWalletInfoMapper {
MemberWalletInfo selectByWalletCode(@Param("walletCode") String walletCode);
MemberWalletVO selectMemberWalletInfo(String walletCode);
}
List<MemberWalletInfo> queryWalletIsNull();
}

View File

@@ -25,4 +25,8 @@ public interface MemberWalletInfoService {
List<MemberWalletVO> selectByMemberWalletList(String memberId);
MemberWalletVO selectMemberWalletInfo(String walletCode);
List<MemberWalletInfo> queryWalletIsNull();
int updateBatchSelective(List<MemberWalletInfo> walletInfoList);
}

View File

@@ -120,4 +120,14 @@ public class MemberWalletInfoServiceImpl implements MemberWalletInfoService {
return memberWalletVO;
}
@Override
public List<MemberWalletInfo> queryWalletIsNull() {
return memberWalletInfoMapper.queryWalletIsNull();
}
@Override
public int updateBatchSelective(List<MemberWalletInfo> walletInfoList) {
return memberWalletInfoMapper.updateBatchSelective(walletInfoList);
}
}

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>