From ef55dd04af0102b191deeba0704d64fde90525bd Mon Sep 17 00:00:00 2001 From: Guoqs <123@jsowell.com> Date: Thu, 24 Jul 2025 14:20:57 +0800 Subject: [PATCH] =?UTF-8?q?add=E6=89=B9=E9=87=8F=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jsowell/pile/domain/MemberWalletInfo.java | 10 +- .../pile/mapper/MemberWalletInfoMapper.java | 56 +-- .../mapper/pile/MemberWalletInfoMapper.xml | 345 +++++++++++++++++- 3 files changed, 355 insertions(+), 56 deletions(-) diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/domain/MemberWalletInfo.java b/jsowell-pile/src/main/java/com/jsowell/pile/domain/MemberWalletInfo.java index 75e04d98a..1f9415f8a 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/domain/MemberWalletInfo.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/domain/MemberWalletInfo.java @@ -4,15 +4,17 @@ import java.math.BigDecimal; import java.util.Date; import lombok.AllArgsConstructor; import lombok.Builder; -import lombok.Getter; +import lombok.Data; import lombok.NoArgsConstructor; -import lombok.Setter; +import lombok.experimental.Accessors; +import lombok.experimental.SuperBuilder; /** * 会员钱包信息表 */ -@Getter -@Setter +@Data +@Accessors(chain = true) +@SuperBuilder @Builder @AllArgsConstructor @NoArgsConstructor diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/mapper/MemberWalletInfoMapper.java b/jsowell-pile/src/main/java/com/jsowell/pile/mapper/MemberWalletInfoMapper.java index db221124d..c7b481256 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/mapper/MemberWalletInfoMapper.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/mapper/MemberWalletInfoMapper.java @@ -1,22 +1,31 @@ package com.jsowell.pile.mapper; import com.jsowell.pile.domain.MemberWalletInfo; -import com.jsowell.pile.vo.base.MemberWalletVO; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; import java.util.List; -@Repository +import com.jsowell.pile.vo.base.MemberWalletVO; +import org.apache.ibatis.annotations.Param; + public interface MemberWalletInfoMapper { - /** - * delete by primary key - * - * @param id primaryKey - * @return deleteCount - */ int deleteByPrimaryKey(Integer id); + int insertSelective(MemberWalletInfo record); + + MemberWalletInfo selectByPrimaryKey(Integer id); + + int updateByPrimaryKeySelective(MemberWalletInfo record); + + int updateBatch(@Param("list") List list); + + int updateBatchSelective(@Param("list") List list); + + int batchInsert(@Param("list") List list); + + int insertOrUpdate(MemberWalletInfo record); + + int insertOrUpdateSelective(MemberWalletInfo record); + /** * insert record to table * @@ -25,30 +34,6 @@ public interface MemberWalletInfoMapper { */ int insert(MemberWalletInfo record); - /** - * insert record to table selective - * - * @param record the record - * @return insert count - */ - int insertSelective(MemberWalletInfo record); - - /** - * select by primary key - * - * @param id primary key - * @return object by primary key - */ - MemberWalletInfo selectByPrimaryKey(Integer id); - - /** - * update record selective - * - * @param record the updated record - * @return update count - */ - int updateByPrimaryKeySelective(MemberWalletInfo record); - /** * update record * @@ -57,10 +42,9 @@ public interface MemberWalletInfoMapper { */ int updateByPrimaryKey(MemberWalletInfo record); - // MemberWalletInfo selectByMemberId(String memberId); - /** * 根据会员id和目标运营商id查询用户钱包信息 + * * @param memberId * @param merchantId * @return diff --git a/jsowell-pile/src/main/resources/mapper/pile/MemberWalletInfoMapper.xml b/jsowell-pile/src/main/resources/mapper/pile/MemberWalletInfoMapper.xml index b0944611e..25e895828 100644 --- a/jsowell-pile/src/main/resources/mapper/pile/MemberWalletInfoMapper.xml +++ b/jsowell-pile/src/main/resources/mapper/pile/MemberWalletInfoMapper.xml @@ -34,17 +34,6 @@ delete from member_wallet_info where id = #{id,jdbcType=INTEGER} - - - 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 into member_wallet_info @@ -159,10 +148,214 @@ where id = #{id,jdbcType=INTEGER} - + update member_wallet_info - set member_id = #{memberId,jdbcType=VARCHAR}, + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.memberId,jdbcType=VARCHAR} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.merchantId,jdbcType=VARCHAR} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.walletCode,jdbcType=VARCHAR} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.principalBalance,jdbcType=DECIMAL} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.giftBalance,jdbcType=DECIMAL} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.version,jdbcType=INTEGER} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.createBy,jdbcType=VARCHAR} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.updateBy,jdbcType=VARCHAR} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.updateTime,jdbcType=TIMESTAMP} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.delFlag,jdbcType=CHAR} + + + + where id in + + #{item.id,jdbcType=INTEGER} + + + + + update member_wallet_info + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.memberId,jdbcType=VARCHAR} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.merchantId,jdbcType=VARCHAR} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.walletCode,jdbcType=VARCHAR} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.principalBalance,jdbcType=DECIMAL} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.giftBalance,jdbcType=DECIMAL} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.version,jdbcType=INTEGER} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.createBy,jdbcType=VARCHAR} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.updateBy,jdbcType=VARCHAR} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.updateTime,jdbcType=TIMESTAMP} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.delFlag,jdbcType=CHAR} + + + + + where id in + + #{item.id,jdbcType=INTEGER} + + + + + 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 + + (#{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} + ) + + + + + insert into member_wallet_info + + + id, + + member_id, + merchant_id, + wallet_code, + principal_balance, + gift_balance, + version, + create_by, + create_time, + update_by, + update_time, + del_flag, + + values + + + #{id,jdbcType=INTEGER}, + + #{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}, + + on duplicate key update + + + id = #{id,jdbcType=INTEGER}, + + member_id = #{memberId,jdbcType=VARCHAR}, merchant_id = #{merchantId,jdbcType=VARCHAR}, wallet_code = #{walletCode,jdbcType=VARCHAR}, principal_balance = #{principalBalance,jdbcType=DECIMAL}, @@ -172,9 +365,129 @@ 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} - + del_flag = #{delFlag,jdbcType=CHAR}, + + + + + insert into member_wallet_info + + + id, + + + member_id, + + + merchant_id, + + + wallet_code, + + + principal_balance, + + + gift_balance, + + + version, + + + create_by, + + + create_time, + + + update_by, + + + update_time, + + + del_flag, + + + values + + + #{id,jdbcType=INTEGER}, + + + #{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}, + + + on duplicate key update + + + id = #{id,jdbcType=INTEGER}, + + + 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}, + + +