新增钱包编号字段

This commit is contained in:
2023-11-08 15:58:24 +08:00
parent 714f3e41d7
commit 968e48ba18
3 changed files with 423 additions and 483 deletions

View File

@@ -27,6 +27,11 @@ public class MemberWalletLog {
*/ */
private String memberId; private String memberId;
/**
* 钱包编号
*/
private String walletCode;
/** /**
* 类型1-进账2-出账) * 类型1-进账2-出账)
*/ */

View File

@@ -63,10 +63,10 @@ public interface MemberWalletLogMapper {
int updateBatch(List<MemberWalletLog> list); int updateBatch(List<MemberWalletLog> list);
int updateBatchSelective(List<MemberWalletLog> list);
int batchInsert(@Param("list") List<MemberWalletLog> list); int batchInsert(@Param("list") List<MemberWalletLog> list);
int updateBatchSelective(List<MemberWalletLog> list);
/** /**
* 查询用户账户余额变动信息 * 查询用户账户余额变动信息
* *

View File

@@ -6,6 +6,7 @@
<!--@Table member_wallet_log--> <!--@Table member_wallet_log-->
<id column="id" jdbcType="INTEGER" property="id" /> <id column="id" jdbcType="INTEGER" property="id" />
<result column="member_id" jdbcType="VARCHAR" property="memberId" /> <result column="member_id" jdbcType="VARCHAR" property="memberId" />
<result column="wallet_code" jdbcType="VARCHAR" property="walletCode" />
<result column="type" jdbcType="VARCHAR" property="type" /> <result column="type" jdbcType="VARCHAR" property="type" />
<result column="sub_type" jdbcType="VARCHAR" property="subType" /> <result column="sub_type" jdbcType="VARCHAR" property="subType" />
<result column="amount" jdbcType="DECIMAL" property="amount" /> <result column="amount" jdbcType="DECIMAL" property="amount" />
@@ -18,17 +19,8 @@
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
<!--@mbg.generated--> <!--@mbg.generated-->
id, id, member_id, wallet_code, `type`, sub_type, amount, category, related_order_code,
member_id, before_amount, after_amount, create_by, create_time
`type`,
sub_type,
amount,
category,
related_order_code,
before_amount,
after_amount,
create_by,
create_time
</sql> </sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap"> <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<!--@mbg.generated--> <!--@mbg.generated-->
@@ -39,30 +31,30 @@
</select> </select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer"> <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
<!--@mbg.generated--> <!--@mbg.generated-->
delete delete from member_wallet_log
from member_wallet_log
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</delete> </delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.MemberWalletLog" <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.MemberWalletLog" useGeneratedKeys="true">
useGeneratedKeys="true">
<!--@mbg.generated--> <!--@mbg.generated-->
insert into member_wallet_log (member_id, `type`, sub_type, insert into member_wallet_log (member_id, wallet_code, `type`,
amount, category, related_order_code, sub_type, amount, category,
before_amount, after_amount, create_by, related_order_code, before_amount, after_amount,
create_time) create_by, create_time)
values (#{memberId,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{subType,jdbcType=VARCHAR}, values (#{memberId,jdbcType=VARCHAR}, #{walletCode,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR},
#{amount,jdbcType=DECIMAL}, #{category,jdbcType=CHAR}, #{relatedOrderCode,jdbcType=VARCHAR}, #{subType,jdbcType=VARCHAR}, #{amount,jdbcType=DECIMAL}, #{category,jdbcType=CHAR},
#{beforeAmount,jdbcType=DECIMAL}, #{afterAmount,jdbcType=DECIMAL}, #{createBy,jdbcType=VARCHAR}, #{relatedOrderCode,jdbcType=VARCHAR}, #{beforeAmount,jdbcType=DECIMAL}, #{afterAmount,jdbcType=DECIMAL},
#{createTime,jdbcType=TIMESTAMP}) #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP})
</insert> </insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.MemberWalletLog" <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.MemberWalletLog" useGeneratedKeys="true">
useGeneratedKeys="true">
<!--@mbg.generated--> <!--@mbg.generated-->
insert into member_wallet_log insert into member_wallet_log
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="memberId != null"> <if test="memberId != null">
member_id, member_id,
</if> </if>
<if test="walletCode != null">
wallet_code,
</if>
<if test="type != null"> <if test="type != null">
`type`, `type`,
</if> </if>
@@ -95,6 +87,9 @@
<if test="memberId != null"> <if test="memberId != null">
#{memberId,jdbcType=VARCHAR}, #{memberId,jdbcType=VARCHAR},
</if> </if>
<if test="walletCode != null">
#{walletCode,jdbcType=VARCHAR},
</if>
<if test="type != null"> <if test="type != null">
#{type,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR},
</if> </if>
@@ -131,6 +126,9 @@
<if test="memberId != null"> <if test="memberId != null">
member_id = #{memberId,jdbcType=VARCHAR}, member_id = #{memberId,jdbcType=VARCHAR},
</if> </if>
<if test="walletCode != null">
wallet_code = #{walletCode,jdbcType=VARCHAR},
</if>
<if test="type != null"> <if test="type != null">
`type` = #{type,jdbcType=VARCHAR}, `type` = #{type,jdbcType=VARCHAR},
</if> </if>
@@ -165,6 +163,7 @@
<!--@mbg.generated--> <!--@mbg.generated-->
update member_wallet_log update member_wallet_log
set member_id = #{memberId,jdbcType=VARCHAR}, set member_id = #{memberId,jdbcType=VARCHAR},
wallet_code = #{walletCode,jdbcType=VARCHAR},
`type` = #{type,jdbcType=VARCHAR}, `type` = #{type,jdbcType=VARCHAR},
sub_type = #{subType,jdbcType=VARCHAR}, sub_type = #{subType,jdbcType=VARCHAR},
amount = #{amount,jdbcType=DECIMAL}, amount = #{amount,jdbcType=DECIMAL},
@@ -185,6 +184,11 @@
when id = #{item.id,jdbcType=INTEGER} then #{item.memberId,jdbcType=VARCHAR} when id = #{item.id,jdbcType=INTEGER} then #{item.memberId,jdbcType=VARCHAR}
</foreach> </foreach>
</trim> </trim>
<trim prefix="wallet_code = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.walletCode,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="`type` = case" suffix="end,"> <trim prefix="`type` = case" suffix="end,">
<foreach collection="list" index="index" item="item"> <foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.type,jdbcType=VARCHAR} when id = #{item.id,jdbcType=INTEGER} then #{item.type,jdbcType=VARCHAR}
@@ -236,101 +240,21 @@
#{item.id,jdbcType=INTEGER} #{item.id,jdbcType=INTEGER}
</foreach> </foreach>
</update> </update>
<update id="updateBatchSelective" parameterType="java.util.List">
<!--@mbg.generated-->
update member_wallet_log
<trim prefix="set" suffixOverrides=",">
<trim prefix="member_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.memberId != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.memberId,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="`type` = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.type != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.type,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="sub_type = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.subType != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.subType,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="amount = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.amount != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.amount,jdbcType=DECIMAL}
</if>
</foreach>
</trim>
<trim prefix="category = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.category != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.category,jdbcType=CHAR}
</if>
</foreach>
</trim>
<trim prefix="related_order_code = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.relatedOrderCode != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.relatedOrderCode,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="before_amount = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.beforeAmount != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.beforeAmount,jdbcType=DECIMAL}
</if>
</foreach>
</trim>
<trim prefix="after_amount = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.afterAmount != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.afterAmount,jdbcType=DECIMAL}
</if>
</foreach>
</trim>
<trim prefix="create_by = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.createBy != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.createBy,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="create_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.createTime != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
</if>
</foreach>
</trim>
</trim>
where id in
<foreach close=")" collection="list" item="item" open="(" separator=", ">
#{item.id,jdbcType=INTEGER}
</foreach>
</update>
<insert id="batchInsert" keyColumn="id" keyProperty="id" parameterType="map" useGeneratedKeys="true"> <insert id="batchInsert" keyColumn="id" keyProperty="id" parameterType="map" useGeneratedKeys="true">
<!--@mbg.generated--> <!--@mbg.generated-->
insert into member_wallet_log insert into member_wallet_log
(member_id, `type`, sub_type, amount, category, related_order_code, before_amount, (member_id, wallet_code, `type`, sub_type, amount, category, related_order_code,
after_amount, create_by) before_amount, after_amount, create_by, create_time)
values values
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
(#{item.memberId,jdbcType=VARCHAR}, #{item.type,jdbcType=VARCHAR}, #{item.subType,jdbcType=VARCHAR}, (#{item.memberId,jdbcType=VARCHAR}, #{item.walletCode,jdbcType=VARCHAR}, #{item.type,jdbcType=VARCHAR},
#{item.amount,jdbcType=DECIMAL}, #{item.category,jdbcType=CHAR}, #{item.relatedOrderCode,jdbcType=VARCHAR}, #{item.subType,jdbcType=VARCHAR}, #{item.amount,jdbcType=DECIMAL}, #{item.category,jdbcType=CHAR},
#{item.beforeAmount,jdbcType=DECIMAL}, #{item.afterAmount,jdbcType=DECIMAL}, #{item.relatedOrderCode,jdbcType=VARCHAR}, #{item.beforeAmount,jdbcType=DECIMAL},
#{item.createBy,jdbcType=VARCHAR}) #{item.afterAmount,jdbcType=DECIMAL}, #{item.createBy,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP}
)
</foreach> </foreach>
</insert> </insert>
<insert id="insertOrUpdate" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.MemberWalletLog" <insert id="insertOrUpdate" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.MemberWalletLog" useGeneratedKeys="true">
useGeneratedKeys="true">
<!--@mbg.generated--> <!--@mbg.generated-->
insert into member_wallet_log insert into member_wallet_log
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -338,6 +262,7 @@
id, id,
</if> </if>
member_id, member_id,
wallet_code,
`type`, `type`,
sub_type, sub_type,
amount, amount,
@@ -354,6 +279,7 @@
#{id,jdbcType=INTEGER}, #{id,jdbcType=INTEGER},
</if> </if>
#{memberId,jdbcType=VARCHAR}, #{memberId,jdbcType=VARCHAR},
#{walletCode,jdbcType=VARCHAR},
#{type,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR},
#{subType,jdbcType=VARCHAR}, #{subType,jdbcType=VARCHAR},
#{amount,jdbcType=DECIMAL}, #{amount,jdbcType=DECIMAL},
@@ -370,6 +296,7 @@
id = #{id,jdbcType=INTEGER}, id = #{id,jdbcType=INTEGER},
</if> </if>
member_id = #{memberId,jdbcType=VARCHAR}, member_id = #{memberId,jdbcType=VARCHAR},
wallet_code = #{walletCode,jdbcType=VARCHAR},
`type` = #{type,jdbcType=VARCHAR}, `type` = #{type,jdbcType=VARCHAR},
sub_type = #{subType,jdbcType=VARCHAR}, sub_type = #{subType,jdbcType=VARCHAR},
amount = #{amount,jdbcType=DECIMAL}, amount = #{amount,jdbcType=DECIMAL},
@@ -381,8 +308,7 @@
create_time = #{createTime,jdbcType=TIMESTAMP}, create_time = #{createTime,jdbcType=TIMESTAMP},
</trim> </trim>
</insert> </insert>
<insert id="insertOrUpdateSelective" keyColumn="id" keyProperty="id" <insert id="insertOrUpdateSelective" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.MemberWalletLog" useGeneratedKeys="true">
parameterType="com.jsowell.pile.domain.MemberWalletLog" useGeneratedKeys="true">
<!--@mbg.generated--> <!--@mbg.generated-->
insert into member_wallet_log insert into member_wallet_log
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -392,6 +318,9 @@
<if test="memberId != null"> <if test="memberId != null">
member_id, member_id,
</if> </if>
<if test="walletCode != null">
wallet_code,
</if>
<if test="type != null"> <if test="type != null">
`type`, `type`,
</if> </if>
@@ -428,6 +357,9 @@
<if test="memberId != null"> <if test="memberId != null">
#{memberId,jdbcType=VARCHAR}, #{memberId,jdbcType=VARCHAR},
</if> </if>
<if test="walletCode != null">
#{walletCode,jdbcType=VARCHAR},
</if>
<if test="type != null"> <if test="type != null">
#{type,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR},
</if> </if>
@@ -464,6 +396,9 @@
<if test="memberId != null"> <if test="memberId != null">
member_id = #{memberId,jdbcType=VARCHAR}, member_id = #{memberId,jdbcType=VARCHAR},
</if> </if>
<if test="walletCode != null">
wallet_code = #{walletCode,jdbcType=VARCHAR},
</if>
<if test="type != null"> <if test="type != null">
`type` = #{type,jdbcType=VARCHAR}, `type` = #{type,jdbcType=VARCHAR},
</if> </if>