2023-03-04 16:29:55 +08:00
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
|
|
<mapper namespace="com.jsowell.pile.mapper.MemberWalletLogMapper">
|
2023-11-08 11:28:57 +08:00
|
|
|
<resultMap id="BaseResultMap" type="com.jsowell.pile.domain.MemberWalletLog">
|
|
|
|
|
<!--@mbg.generated-->
|
|
|
|
|
<!--@Table member_wallet_log-->
|
|
|
|
|
<id column="id" jdbcType="INTEGER" property="id"/>
|
|
|
|
|
<result column="member_id" jdbcType="VARCHAR" property="memberId"/>
|
|
|
|
|
<result column="type" jdbcType="VARCHAR" property="type"/>
|
|
|
|
|
<result column="sub_type" jdbcType="VARCHAR" property="subType"/>
|
|
|
|
|
<result column="amount" jdbcType="DECIMAL" property="amount"/>
|
|
|
|
|
<result column="category" jdbcType="CHAR" property="category"/>
|
|
|
|
|
<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="create_by" jdbcType="VARCHAR" property="createBy"/>
|
|
|
|
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
|
|
|
|
</resultMap>
|
|
|
|
|
<sql id="Base_Column_List">
|
|
|
|
|
<!--@mbg.generated-->
|
|
|
|
|
id,
|
2023-08-10 15:19:45 +08:00
|
|
|
member_id,
|
|
|
|
|
`type`,
|
|
|
|
|
sub_type,
|
|
|
|
|
amount,
|
|
|
|
|
category,
|
2023-09-15 14:00:45 +08:00
|
|
|
related_order_code,
|
2023-11-08 11:28:57 +08:00
|
|
|
before_amount,
|
|
|
|
|
after_amount,
|
2023-08-10 15:19:45 +08:00
|
|
|
create_by,
|
2023-11-08 11:28:57 +08:00
|
|
|
create_time
|
|
|
|
|
</sql>
|
|
|
|
|
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
|
|
|
|
<!--@mbg.generated-->
|
|
|
|
|
select
|
|
|
|
|
<include refid="Base_Column_List"/>
|
|
|
|
|
from member_wallet_log
|
|
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
|
|
</select>
|
|
|
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
|
|
|
|
<!--@mbg.generated-->
|
|
|
|
|
delete
|
|
|
|
|
from member_wallet_log
|
|
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
|
|
</delete>
|
|
|
|
|
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.MemberWalletLog"
|
|
|
|
|
useGeneratedKeys="true">
|
|
|
|
|
<!--@mbg.generated-->
|
|
|
|
|
insert into member_wallet_log (member_id, `type`, sub_type,
|
|
|
|
|
amount, category, related_order_code,
|
|
|
|
|
before_amount, after_amount, create_by,
|
|
|
|
|
create_time)
|
|
|
|
|
values (#{memberId,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})
|
|
|
|
|
</insert>
|
|
|
|
|
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.MemberWalletLog"
|
|
|
|
|
useGeneratedKeys="true">
|
|
|
|
|
<!--@mbg.generated-->
|
|
|
|
|
insert into member_wallet_log
|
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="memberId != null">
|
|
|
|
|
member_id,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="type != null">
|
|
|
|
|
`type`,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="subType != null">
|
|
|
|
|
sub_type,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="amount != null">
|
|
|
|
|
amount,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="category != null">
|
|
|
|
|
category,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="relatedOrderCode != null">
|
|
|
|
|
related_order_code,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="beforeAmount != null">
|
|
|
|
|
before_amount,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="afterAmount != null">
|
|
|
|
|
after_amount,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="createBy != null">
|
|
|
|
|
create_by,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="createTime != null">
|
|
|
|
|
create_time,
|
|
|
|
|
</if>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="memberId != null">
|
|
|
|
|
#{memberId,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="type != null">
|
|
|
|
|
#{type,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="subType != null">
|
|
|
|
|
#{subType,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="amount != null">
|
|
|
|
|
#{amount,jdbcType=DECIMAL},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="category != null">
|
|
|
|
|
#{category,jdbcType=CHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="relatedOrderCode != null">
|
|
|
|
|
#{relatedOrderCode,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="beforeAmount != null">
|
|
|
|
|
#{beforeAmount,jdbcType=DECIMAL},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="afterAmount != null">
|
|
|
|
|
#{afterAmount,jdbcType=DECIMAL},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="createBy != null">
|
|
|
|
|
#{createBy,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="createTime != null">
|
|
|
|
|
#{createTime,jdbcType=TIMESTAMP},
|
|
|
|
|
</if>
|
|
|
|
|
</trim>
|
|
|
|
|
</insert>
|
|
|
|
|
<update id="updateByPrimaryKeySelective" parameterType="com.jsowell.pile.domain.MemberWalletLog">
|
|
|
|
|
<!--@mbg.generated-->
|
|
|
|
|
update member_wallet_log
|
|
|
|
|
<set>
|
|
|
|
|
<if test="memberId != null">
|
|
|
|
|
member_id = #{memberId,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="type != null">
|
|
|
|
|
`type` = #{type,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="subType != null">
|
|
|
|
|
sub_type = #{subType,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="amount != null">
|
|
|
|
|
amount = #{amount,jdbcType=DECIMAL},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="category != null">
|
|
|
|
|
category = #{category,jdbcType=CHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="relatedOrderCode != null">
|
|
|
|
|
related_order_code = #{relatedOrderCode,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="beforeAmount != null">
|
|
|
|
|
before_amount = #{beforeAmount,jdbcType=DECIMAL},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="afterAmount != null">
|
|
|
|
|
after_amount = #{afterAmount,jdbcType=DECIMAL},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="createBy != null">
|
|
|
|
|
create_by = #{createBy,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="createTime != null">
|
|
|
|
|
create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
|
|
|
</if>
|
|
|
|
|
</set>
|
|
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
|
|
</update>
|
|
|
|
|
<update id="updateByPrimaryKey" parameterType="com.jsowell.pile.domain.MemberWalletLog">
|
|
|
|
|
<!--@mbg.generated-->
|
|
|
|
|
update member_wallet_log
|
|
|
|
|
set member_id = #{memberId,jdbcType=VARCHAR},
|
|
|
|
|
`type` = #{type,jdbcType=VARCHAR},
|
|
|
|
|
sub_type = #{subType,jdbcType=VARCHAR},
|
|
|
|
|
amount = #{amount,jdbcType=DECIMAL},
|
|
|
|
|
category = #{category,jdbcType=CHAR},
|
|
|
|
|
related_order_code = #{relatedOrderCode,jdbcType=VARCHAR},
|
|
|
|
|
before_amount = #{beforeAmount,jdbcType=DECIMAL},
|
|
|
|
|
after_amount = #{afterAmount,jdbcType=DECIMAL},
|
|
|
|
|
create_by = #{createBy,jdbcType=VARCHAR},
|
|
|
|
|
create_time = #{createTime,jdbcType=TIMESTAMP}
|
|
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
|
|
</update>
|
|
|
|
|
<update id="updateBatch" 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">
|
|
|
|
|
when id = #{item.id,jdbcType=INTEGER} then #{item.memberId,jdbcType=VARCHAR}
|
|
|
|
|
</foreach>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="`type` = case" suffix="end,">
|
|
|
|
|
<foreach collection="list" index="index" item="item">
|
|
|
|
|
when id = #{item.id,jdbcType=INTEGER} then #{item.type,jdbcType=VARCHAR}
|
|
|
|
|
</foreach>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="sub_type = case" suffix="end,">
|
|
|
|
|
<foreach collection="list" index="index" item="item">
|
|
|
|
|
when id = #{item.id,jdbcType=INTEGER} then #{item.subType,jdbcType=VARCHAR}
|
|
|
|
|
</foreach>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="amount = case" suffix="end,">
|
|
|
|
|
<foreach collection="list" index="index" item="item">
|
|
|
|
|
when id = #{item.id,jdbcType=INTEGER} then #{item.amount,jdbcType=DECIMAL}
|
|
|
|
|
</foreach>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="category = case" suffix="end,">
|
|
|
|
|
<foreach collection="list" index="index" item="item">
|
|
|
|
|
when id = #{item.id,jdbcType=INTEGER} then #{item.category,jdbcType=CHAR}
|
|
|
|
|
</foreach>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="related_order_code = case" suffix="end,">
|
|
|
|
|
<foreach collection="list" index="index" item="item">
|
|
|
|
|
when id = #{item.id,jdbcType=INTEGER} then #{item.relatedOrderCode,jdbcType=VARCHAR}
|
|
|
|
|
</foreach>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="before_amount = case" suffix="end,">
|
|
|
|
|
<foreach collection="list" index="index" item="item">
|
|
|
|
|
when id = #{item.id,jdbcType=INTEGER} then #{item.beforeAmount,jdbcType=DECIMAL}
|
|
|
|
|
</foreach>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="after_amount = case" suffix="end,">
|
|
|
|
|
<foreach collection="list" index="index" item="item">
|
|
|
|
|
when id = #{item.id,jdbcType=INTEGER} then #{item.afterAmount,jdbcType=DECIMAL}
|
|
|
|
|
</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}
|
|
|
|
|
</foreach>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="create_time = case" suffix="end,">
|
|
|
|
|
<foreach collection="list" index="index" item="item">
|
|
|
|
|
when id = #{item.id,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
|
|
|
|
|
</foreach>
|
|
|
|
|
</trim>
|
|
|
|
|
</trim>
|
|
|
|
|
where id in
|
|
|
|
|
<foreach close=")" collection="list" item="item" open="(" separator=", ">
|
|
|
|
|
#{item.id,jdbcType=INTEGER}
|
|
|
|
|
</foreach>
|
|
|
|
|
</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">
|
|
|
|
|
<!--@mbg.generated-->
|
|
|
|
|
insert into member_wallet_log
|
|
|
|
|
(member_id, `type`, sub_type, amount, category, related_order_code, before_amount,
|
2023-11-08 11:38:41 +08:00
|
|
|
after_amount, create_by)
|
2023-08-10 15:19:45 +08:00
|
|
|
values
|
|
|
|
|
<foreach collection="list" item="item" separator=",">
|
|
|
|
|
(#{item.memberId,jdbcType=VARCHAR}, #{item.type,jdbcType=VARCHAR}, #{item.subType,jdbcType=VARCHAR},
|
|
|
|
|
#{item.amount,jdbcType=DECIMAL}, #{item.category,jdbcType=CHAR}, #{item.relatedOrderCode,jdbcType=VARCHAR},
|
2023-11-08 11:28:57 +08:00
|
|
|
#{item.beforeAmount,jdbcType=DECIMAL}, #{item.afterAmount,jdbcType=DECIMAL},
|
2023-11-08 11:38:41 +08:00
|
|
|
#{item.createBy,jdbcType=VARCHAR})
|
2023-08-10 15:19:45 +08:00
|
|
|
</foreach>
|
|
|
|
|
</insert>
|
2023-11-08 11:28:57 +08:00
|
|
|
<insert id="insertOrUpdate" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.MemberWalletLog"
|
|
|
|
|
useGeneratedKeys="true">
|
|
|
|
|
<!--@mbg.generated-->
|
|
|
|
|
insert into member_wallet_log
|
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="id != null">
|
|
|
|
|
id,
|
|
|
|
|
</if>
|
|
|
|
|
member_id,
|
|
|
|
|
`type`,
|
|
|
|
|
sub_type,
|
|
|
|
|
amount,
|
|
|
|
|
category,
|
|
|
|
|
related_order_code,
|
|
|
|
|
before_amount,
|
|
|
|
|
after_amount,
|
|
|
|
|
create_by,
|
|
|
|
|
create_time,
|
|
|
|
|
</trim>
|
|
|
|
|
values
|
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="id != null">
|
|
|
|
|
#{id,jdbcType=INTEGER},
|
|
|
|
|
</if>
|
|
|
|
|
#{memberId,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},
|
|
|
|
|
</trim>
|
|
|
|
|
on duplicate key update
|
|
|
|
|
<trim suffixOverrides=",">
|
|
|
|
|
<if test="id != null">
|
|
|
|
|
id = #{id,jdbcType=INTEGER},
|
|
|
|
|
</if>
|
|
|
|
|
member_id = #{memberId,jdbcType=VARCHAR},
|
|
|
|
|
`type` = #{type,jdbcType=VARCHAR},
|
|
|
|
|
sub_type = #{subType,jdbcType=VARCHAR},
|
|
|
|
|
amount = #{amount,jdbcType=DECIMAL},
|
|
|
|
|
category = #{category,jdbcType=CHAR},
|
|
|
|
|
related_order_code = #{relatedOrderCode,jdbcType=VARCHAR},
|
|
|
|
|
before_amount = #{beforeAmount,jdbcType=DECIMAL},
|
|
|
|
|
after_amount = #{afterAmount,jdbcType=DECIMAL},
|
|
|
|
|
create_by = #{createBy,jdbcType=VARCHAR},
|
|
|
|
|
create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
|
|
|
</trim>
|
|
|
|
|
</insert>
|
|
|
|
|
<insert id="insertOrUpdateSelective" keyColumn="id" keyProperty="id"
|
|
|
|
|
parameterType="com.jsowell.pile.domain.MemberWalletLog" useGeneratedKeys="true">
|
|
|
|
|
<!--@mbg.generated-->
|
|
|
|
|
insert into member_wallet_log
|
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="id != null">
|
|
|
|
|
id,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="memberId != null">
|
|
|
|
|
member_id,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="type != null">
|
|
|
|
|
`type`,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="subType != null">
|
|
|
|
|
sub_type,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="amount != null">
|
|
|
|
|
amount,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="category != null">
|
|
|
|
|
category,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="relatedOrderCode != null">
|
|
|
|
|
related_order_code,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="beforeAmount != null">
|
|
|
|
|
before_amount,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="afterAmount != null">
|
|
|
|
|
after_amount,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="createBy != null">
|
|
|
|
|
create_by,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="createTime != null">
|
|
|
|
|
create_time,
|
|
|
|
|
</if>
|
|
|
|
|
</trim>
|
|
|
|
|
values
|
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="id != null">
|
|
|
|
|
#{id,jdbcType=INTEGER},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="memberId != null">
|
|
|
|
|
#{memberId,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="type != null">
|
|
|
|
|
#{type,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="subType != null">
|
|
|
|
|
#{subType,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="amount != null">
|
|
|
|
|
#{amount,jdbcType=DECIMAL},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="category != null">
|
|
|
|
|
#{category,jdbcType=CHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="relatedOrderCode != null">
|
|
|
|
|
#{relatedOrderCode,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="beforeAmount != null">
|
|
|
|
|
#{beforeAmount,jdbcType=DECIMAL},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="afterAmount != null">
|
|
|
|
|
#{afterAmount,jdbcType=DECIMAL},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="createBy != null">
|
|
|
|
|
#{createBy,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="createTime != null">
|
|
|
|
|
#{createTime,jdbcType=TIMESTAMP},
|
|
|
|
|
</if>
|
|
|
|
|
</trim>
|
|
|
|
|
on duplicate key update
|
|
|
|
|
<trim suffixOverrides=",">
|
|
|
|
|
<if test="id != null">
|
|
|
|
|
id = #{id,jdbcType=INTEGER},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="memberId != null">
|
|
|
|
|
member_id = #{memberId,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="type != null">
|
|
|
|
|
`type` = #{type,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="subType != null">
|
|
|
|
|
sub_type = #{subType,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="amount != null">
|
|
|
|
|
amount = #{amount,jdbcType=DECIMAL},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="category != null">
|
|
|
|
|
category = #{category,jdbcType=CHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="relatedOrderCode != null">
|
|
|
|
|
related_order_code = #{relatedOrderCode,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="beforeAmount != null">
|
|
|
|
|
before_amount = #{beforeAmount,jdbcType=DECIMAL},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="afterAmount != null">
|
|
|
|
|
after_amount = #{afterAmount,jdbcType=DECIMAL},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="createBy != null">
|
|
|
|
|
create_by = #{createBy,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="createTime != null">
|
|
|
|
|
create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
|
|
|
</if>
|
|
|
|
|
</trim>
|
|
|
|
|
</insert>
|
2023-03-04 16:29:55 +08:00
|
|
|
|
2023-08-10 15:19:45 +08:00
|
|
|
<select id="getMemberBalanceChanges" resultType="com.jsowell.pile.vo.uniapp.MemberWalletLogVO">
|
|
|
|
|
SELECT t1.member_id as memberId,
|
|
|
|
|
t1.type,
|
|
|
|
|
t1.sub_type as subType,
|
|
|
|
|
t1.amount,
|
|
|
|
|
t1.category,
|
2023-11-08 14:59:19 +08:00
|
|
|
t1.create_time as transactionTime,
|
|
|
|
|
t1.before_amount as beforeAmount,
|
|
|
|
|
t1.after_amount as afterAmount
|
2023-08-10 15:19:45 +08:00
|
|
|
from member_wallet_log t1
|
|
|
|
|
where t1.member_id = #{memberId,jdbcType=VARCHAR}
|
|
|
|
|
<if test="type != null and type != ''">
|
|
|
|
|
and t1.type = #{type,jdbcType=VARCHAR}
|
|
|
|
|
</if>
|
|
|
|
|
order by t1.create_time DESC
|
|
|
|
|
</select>
|
2023-07-22 15:23:31 +08:00
|
|
|
|
2023-08-10 15:19:45 +08:00
|
|
|
<select id="getMemberWalletDetail" resultType="com.jsowell.pile.vo.uniapp.MemberWalletLogVO">
|
|
|
|
|
SELECT t1.member_id as memberId,
|
|
|
|
|
t1.type,
|
|
|
|
|
t1.sub_type as subType,
|
|
|
|
|
t1.amount,
|
|
|
|
|
t1.category,
|
|
|
|
|
t1.related_order_code as relatedOrderCode,
|
|
|
|
|
t2.pay_amount as payAmount,
|
|
|
|
|
t2.order_amount as orderAmount,
|
|
|
|
|
t2.refund_amount as refundAmount,
|
|
|
|
|
t1.create_time as transactionTime
|
|
|
|
|
from member_wallet_log t1
|
|
|
|
|
left join order_basic_info t2
|
|
|
|
|
on t1.related_order_code = t2.order_code
|
|
|
|
|
where t1.member_id = #{dto.memberId,jdbcType=VARCHAR}
|
|
|
|
|
and t1.create_time <![CDATA[ >= ]]> #{dto.tradeDate,jdbcType=VARCHAR}
|
|
|
|
|
and t1.create_time <![CDATA[ < ]]> #{dto.endDate,jdbcType=VARCHAR}
|
|
|
|
|
and t1.sub_type != '12'
|
|
|
|
|
order by t1.create_time desc
|
|
|
|
|
</select>
|
|
|
|
|
|
2023-08-21 14:38:30 +08:00
|
|
|
<select id="getMemberRefundAmount" resultType="com.jsowell.pile.vo.uniapp.MemberBalanceVO">
|
2023-11-08 11:28:57 +08:00
|
|
|
select member_id as memberId,
|
|
|
|
|
principal_balance as principalAmount
|
|
|
|
|
from member_wallet_info
|
2023-08-10 15:19:45 +08:00
|
|
|
where
|
2023-11-08 11:28:57 +08:00
|
|
|
<if test="list != null and list.size() != 0">
|
|
|
|
|
member_id in
|
|
|
|
|
<foreach close=")" collection="list" item="memberId" open="(" separator=",">
|
|
|
|
|
#{memberId,jdbcType=VARCHAR}
|
|
|
|
|
</foreach>
|
|
|
|
|
</if>
|
2023-08-10 15:19:45 +08:00
|
|
|
</select>
|
2023-09-15 14:25:51 +08:00
|
|
|
|
2023-11-08 11:28:57 +08:00
|
|
|
<select id="getOrderRecord" resultMap="BaseResultMap">
|
|
|
|
|
select
|
|
|
|
|
<include refid="Base_Column_List"/>
|
|
|
|
|
from member_wallet_log
|
|
|
|
|
where related_order_code = #{orderCode,jdbcType=VARCHAR}
|
|
|
|
|
and type = #{type,jdbcType=VARCHAR}
|
2023-09-15 14:25:51 +08:00
|
|
|
</select>
|
2023-03-04 16:29:55 +08:00
|
|
|
</mapper>
|