加剩余金额字段

This commit is contained in:
2023-08-10 15:13:19 +08:00
parent aa11800f59
commit df776b0466
5 changed files with 154 additions and 69 deletions

View File

@@ -12,6 +12,7 @@
<result column="pay_amt" jdbcType="DECIMAL" property="payAmt" />
<result column="refund_amt" jdbcType="DECIMAL" property="refundAmt" />
<result column="spend_amt" jdbcType="DECIMAL" property="spendAmt" />
<result column="balance_amt" jdbcType="DECIMAL" property="balanceAmt" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
@@ -21,7 +22,7 @@
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, member_id, scenario_type, payment_id, payment_order_no, pay_amt, refund_amt,
spend_amt, create_by, create_time, update_by, update_time, del_flag
spend_amt, balance_amt, create_by, create_time, update_by, update_time, del_flag
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<!--@mbg.generated-->
@@ -30,13 +31,10 @@
from member_adapay_record
where id = #{id,jdbcType=INTEGER}
</select>
<insert id="insertSelective" parameterType="com.jsowell.pile.domain.MemberAdapayRecord">
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.MemberAdapayRecord" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into member_adapay_record
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="memberId != null">
member_id,
</if>
@@ -58,6 +56,9 @@
<if test="spendAmt != null">
spend_amt,
</if>
<if test="balanceAmt != null">
balance_amt,
</if>
<if test="createBy != null">
create_by,
</if>
@@ -75,9 +76,6 @@
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="memberId != null">
#{memberId,jdbcType=VARCHAR},
</if>
@@ -99,6 +97,9 @@
<if test="spendAmt != null">
#{spendAmt,jdbcType=DECIMAL},
</if>
<if test="balanceAmt != null">
#{balanceAmt,jdbcType=DECIMAL},
</if>
<if test="createBy != null">
#{createBy,jdbcType=VARCHAR},
</if>
@@ -141,6 +142,9 @@
<if test="spendAmt != null">
spend_amt = #{spendAmt,jdbcType=DECIMAL},
</if>
<if test="balanceAmt != null">
balance_amt = #{balanceAmt,jdbcType=DECIMAL},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=VARCHAR},
</if>
@@ -198,6 +202,11 @@
when id = #{item.id,jdbcType=INTEGER} then #{item.spendAmt,jdbcType=DECIMAL}
</foreach>
</trim>
<trim prefix="balance_amt = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.balanceAmt,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}
@@ -229,47 +238,81 @@
#{item.id,jdbcType=INTEGER}
</foreach>
</update>
<insert id="batchInsert" parameterType="map">
<insert id="batchInsert" keyColumn="id" keyProperty="id" parameterType="map" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into member_adapay_record
(id, member_id, scenario_type, payment_id, payment_order_no, pay_amt, refund_amt,
spend_amt, create_by, create_time, update_by, update_time, del_flag)
(member_id, scenario_type, payment_id, payment_order_no, pay_amt, refund_amt, spend_amt,
balance_amt, create_by, create_time, update_by, update_time, del_flag)
values
<foreach collection="list" item="item" separator=",">
(#{item.id,jdbcType=INTEGER}, #{item.memberId,jdbcType=VARCHAR}, #{item.scenarioType,jdbcType=VARCHAR},
#{item.paymentId,jdbcType=VARCHAR}, #{item.paymentOrderNo,jdbcType=VARCHAR}, #{item.payAmt,jdbcType=DECIMAL},
#{item.refundAmt,jdbcType=DECIMAL}, #{item.spendAmt,jdbcType=DECIMAL}, #{item.createBy,jdbcType=VARCHAR},
(#{item.memberId,jdbcType=VARCHAR}, #{item.scenarioType,jdbcType=VARCHAR}, #{item.paymentId,jdbcType=VARCHAR},
#{item.paymentOrderNo,jdbcType=VARCHAR}, #{item.payAmt,jdbcType=DECIMAL}, #{item.refundAmt,jdbcType=DECIMAL},
#{item.spendAmt,jdbcType=DECIMAL}, #{item.balanceAmt,jdbcType=DECIMAL}, #{item.createBy,jdbcType=VARCHAR},
#{item.createTime,jdbcType=TIMESTAMP}, #{item.updateBy,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
#{item.delFlag,jdbcType=VARCHAR})
</foreach>
</insert>
<insert id="insertOrUpdate" parameterType="com.jsowell.pile.domain.MemberAdapayRecord">
<insert id="insertOrUpdate" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.MemberAdapayRecord" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into member_adapay_record
(id, member_id, scenario_type, payment_id, payment_order_no, pay_amt, refund_amt,
spend_amt, create_by, create_time, update_by, update_time, del_flag)
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
member_id,
scenario_type,
payment_id,
payment_order_no,
pay_amt,
refund_amt,
spend_amt,
balance_amt,
create_by,
create_time,
update_by,
update_time,
del_flag,
</trim>
values
(#{id,jdbcType=INTEGER}, #{memberId,jdbcType=VARCHAR}, #{scenarioType,jdbcType=VARCHAR},
#{paymentId,jdbcType=VARCHAR}, #{paymentOrderNo,jdbcType=VARCHAR}, #{payAmt,jdbcType=DECIMAL},
#{refundAmt,jdbcType=DECIMAL}, #{spendAmt,jdbcType=DECIMAL}, #{createBy,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
#{delFlag,jdbcType=VARCHAR})
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
#{memberId,jdbcType=VARCHAR},
#{scenarioType,jdbcType=VARCHAR},
#{paymentId,jdbcType=VARCHAR},
#{paymentOrderNo,jdbcType=VARCHAR},
#{payAmt,jdbcType=DECIMAL},
#{refundAmt,jdbcType=DECIMAL},
#{spendAmt,jdbcType=DECIMAL},
#{balanceAmt,jdbcType=DECIMAL},
#{createBy,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP},
#{updateBy,jdbcType=VARCHAR},
#{updateTime,jdbcType=TIMESTAMP},
#{delFlag,jdbcType=VARCHAR},
</trim>
on duplicate key update
id = #{id,jdbcType=INTEGER},
member_id = #{memberId,jdbcType=VARCHAR},
scenario_type = #{scenarioType,jdbcType=VARCHAR},
payment_id = #{paymentId,jdbcType=VARCHAR},
payment_order_no = #{paymentOrderNo,jdbcType=VARCHAR},
pay_amt = #{payAmt,jdbcType=DECIMAL},
refund_amt = #{refundAmt,jdbcType=DECIMAL},
spend_amt = #{spendAmt,jdbcType=DECIMAL},
create_by = #{createBy,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_by = #{updateBy,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=TIMESTAMP},
del_flag = #{delFlag,jdbcType=VARCHAR}
<trim suffixOverrides=",">
<if test="id != null">
id = #{id,jdbcType=INTEGER},
</if>
member_id = #{memberId,jdbcType=VARCHAR},
scenario_type = #{scenarioType,jdbcType=VARCHAR},
payment_id = #{paymentId,jdbcType=VARCHAR},
payment_order_no = #{paymentOrderNo,jdbcType=VARCHAR},
pay_amt = #{payAmt,jdbcType=DECIMAL},
refund_amt = #{refundAmt,jdbcType=DECIMAL},
spend_amt = #{spendAmt,jdbcType=DECIMAL},
balance_amt = #{balanceAmt,jdbcType=DECIMAL},
create_by = #{createBy,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_by = #{updateBy,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=TIMESTAMP},
del_flag = #{delFlag,jdbcType=VARCHAR},
</trim>
</insert>
<insert id="insertOrUpdateSelective" parameterType="com.jsowell.pile.domain.MemberAdapayRecord">
<insert id="insertOrUpdateSelective" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.MemberAdapayRecord" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into member_adapay_record
<trim prefix="(" suffix=")" suffixOverrides=",">
@@ -297,6 +340,9 @@
<if test="spendAmt != null">
spend_amt,
</if>
<if test="balanceAmt != null">
balance_amt,
</if>
<if test="createBy != null">
create_by,
</if>
@@ -339,6 +385,9 @@
<if test="spendAmt != null">
#{spendAmt,jdbcType=DECIMAL},
</if>
<if test="balanceAmt != null">
#{balanceAmt,jdbcType=DECIMAL},
</if>
<if test="createBy != null">
#{createBy,jdbcType=VARCHAR},
</if>
@@ -381,6 +430,9 @@
<if test="spendAmt != null">
spend_amt = #{spendAmt,jdbcType=DECIMAL},
</if>
<if test="balanceAmt != null">
balance_amt = #{balanceAmt,jdbcType=DECIMAL},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=VARCHAR},
</if>