会员汇付支付记录表

This commit is contained in:
2023-08-09 16:55:22 +08:00
parent ecc95ceee5
commit d42097429a
5 changed files with 590 additions and 0 deletions

View File

@@ -0,0 +1,81 @@
package com.jsowell.pile.domain;
import java.math.BigDecimal;
import java.util.Date;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
/**
* 会员汇付支付记录表
*/
@Getter
@Setter
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class MemberAdapayRecord {
private Integer id;
/**
* 会员id
*/
private String memberId;
/**
* 场景类型order, balance
*/
private String scenarioType;
/**
* 汇付支付id
*/
private String paymentId;
/**
* 汇付支付单号
*/
private String paymentOrderNo;
/**
* 支付金额
*/
private BigDecimal payAmt;
/**
* 退款金额
*/
private BigDecimal refundAmt;
/**
* 消费金额
*/
private BigDecimal spendAmt;
/**
* 创建人
*/
private String createBy;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新人
*/
private String updateBy;
/**
* 更新时间
*/
private Date updateTime;
/**
* 删除标识
*/
private String delFlag;
}

View File

@@ -0,0 +1,36 @@
package com.jsowell.pile.mapper;
import com.jsowell.pile.domain.MemberAdapayRecord;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface MemberAdapayRecordMapper {
/**
* insert record to table selective
* @param record the record
* @return insert count
*/
int insertSelective(MemberAdapayRecord record);
/**
* select by primary key
* @param id primary key
* @return object by primary key
*/
MemberAdapayRecord selectByPrimaryKey(Integer id);
/**
* update record selective
* @param record the updated record
* @return update count
*/
int updateByPrimaryKeySelective(MemberAdapayRecord record);
int updateBatch(List<MemberAdapayRecord> list);
int batchInsert(@Param("list") List<MemberAdapayRecord> list);
int insertOrUpdate(MemberAdapayRecord record);
int insertOrUpdateSelective(MemberAdapayRecord record);
}

View File

@@ -0,0 +1,22 @@
package com.jsowell.pile.service;
import java.util.List;
import com.jsowell.pile.domain.MemberAdapayRecord;
public interface MemberAdapayRecordService{
int insertSelective(MemberAdapayRecord record);
MemberAdapayRecord selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(MemberAdapayRecord record);
int updateBatch(List<MemberAdapayRecord> list);
int batchInsert(List<MemberAdapayRecord> list);
int insertOrUpdate(MemberAdapayRecord record);
int insertOrUpdateSelective(MemberAdapayRecord record);
}

View File

@@ -0,0 +1,50 @@
package com.jsowell.pile.service.impl;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import com.jsowell.pile.domain.MemberAdapayRecord;
import com.jsowell.pile.mapper.MemberAdapayRecordMapper;
import com.jsowell.pile.service.MemberAdapayRecordService;
@Service
public class MemberAdapayRecordServiceImpl implements MemberAdapayRecordService{
@Resource
private MemberAdapayRecordMapper memberAdapayRecordMapper;
@Override
public int insertSelective(MemberAdapayRecord record) {
return memberAdapayRecordMapper.insertSelective(record);
}
@Override
public MemberAdapayRecord selectByPrimaryKey(Integer id) {
return memberAdapayRecordMapper.selectByPrimaryKey(id);
}
@Override
public int updateByPrimaryKeySelective(MemberAdapayRecord record) {
return memberAdapayRecordMapper.updateByPrimaryKeySelective(record);
}
@Override
public int updateBatch(List<MemberAdapayRecord> list) {
return memberAdapayRecordMapper.updateBatch(list);
}
@Override
public int batchInsert(List<MemberAdapayRecord> list) {
return memberAdapayRecordMapper.batchInsert(list);
}
@Override
public int insertOrUpdate(MemberAdapayRecord record) {
return memberAdapayRecordMapper.insertOrUpdate(record);
}
@Override
public int insertOrUpdateSelective(MemberAdapayRecord record) {
return memberAdapayRecordMapper.insertOrUpdateSelective(record);
}
}

View File

@@ -0,0 +1,401 @@
<?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.MemberAdapayRecordMapper">
<resultMap id="BaseResultMap" type="com.jsowell.pile.domain.MemberAdapayRecord">
<!--@mbg.generated-->
<!--@Table member_adapay_record-->
<id column="id" jdbcType="INTEGER" property="id" />
<result column="member_id" jdbcType="VARCHAR" property="memberId" />
<result column="scenario_type" jdbcType="VARCHAR" property="scenarioType" />
<result column="payment_id" jdbcType="VARCHAR" property="paymentId" />
<result column="payment_order_no" jdbcType="VARCHAR" property="paymentOrderNo" />
<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="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="del_flag" jdbcType="VARCHAR" property="delFlag" />
</resultMap>
<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
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<!--@mbg.generated-->
select
<include refid="Base_Column_List" />
from member_adapay_record
where id = #{id,jdbcType=INTEGER}
</select>
<insert id="insertSelective" parameterType="com.jsowell.pile.domain.MemberAdapayRecord">
<!--@mbg.generated-->
insert into member_adapay_record
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="memberId != null">
member_id,
</if>
<if test="scenarioType != null">
scenario_type,
</if>
<if test="paymentId != null">
payment_id,
</if>
<if test="paymentOrderNo != null">
payment_order_no,
</if>
<if test="payAmt != null">
pay_amt,
</if>
<if test="refundAmt != null">
refund_amt,
</if>
<if test="spendAmt != null">
spend_amt,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateBy != null">
update_by,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="delFlag != null">
del_flag,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="memberId != null">
#{memberId,jdbcType=VARCHAR},
</if>
<if test="scenarioType != null">
#{scenarioType,jdbcType=VARCHAR},
</if>
<if test="paymentId != null">
#{paymentId,jdbcType=VARCHAR},
</if>
<if test="paymentOrderNo != null">
#{paymentOrderNo,jdbcType=VARCHAR},
</if>
<if test="payAmt != null">
#{payAmt,jdbcType=DECIMAL},
</if>
<if test="refundAmt != null">
#{refundAmt,jdbcType=DECIMAL},
</if>
<if test="spendAmt != null">
#{spendAmt,jdbcType=DECIMAL},
</if>
<if test="createBy != null">
#{createBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null">
#{updateBy,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="delFlag != null">
#{delFlag,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.jsowell.pile.domain.MemberAdapayRecord">
<!--@mbg.generated-->
update member_adapay_record
<set>
<if test="memberId != null">
member_id = #{memberId,jdbcType=VARCHAR},
</if>
<if test="scenarioType != null">
scenario_type = #{scenarioType,jdbcType=VARCHAR},
</if>
<if test="paymentId != null">
payment_id = #{paymentId,jdbcType=VARCHAR},
</if>
<if test="paymentOrderNo != null">
payment_order_no = #{paymentOrderNo,jdbcType=VARCHAR},
</if>
<if test="payAmt != null">
pay_amt = #{payAmt,jdbcType=DECIMAL},
</if>
<if test="refundAmt != null">
refund_amt = #{refundAmt,jdbcType=DECIMAL},
</if>
<if test="spendAmt != null">
spend_amt = #{spendAmt,jdbcType=DECIMAL},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null">
update_by = #{updateBy,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="delFlag != null">
del_flag = #{delFlag,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateBatch" parameterType="java.util.List">
<!--@mbg.generated-->
update member_adapay_record
<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="scenario_type = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.scenarioType,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="payment_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.paymentId,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="payment_order_no = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.paymentOrderNo,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="pay_amt = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.payAmt,jdbcType=DECIMAL}
</foreach>
</trim>
<trim prefix="refund_amt = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.refundAmt,jdbcType=DECIMAL}
</foreach>
</trim>
<trim prefix="spend_amt = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.spendAmt,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 prefix="update_by = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.updateBy,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="update_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.updateTime,jdbcType=TIMESTAMP}
</foreach>
</trim>
<trim prefix="del_flag = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.delFlag,jdbcType=VARCHAR}
</foreach>
</trim>
</trim>
where id in
<foreach close=")" collection="list" item="item" open="(" separator=", ">
#{item.id,jdbcType=INTEGER}
</foreach>
</update>
<insert id="batchInsert" parameterType="map">
<!--@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)
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.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">
<!--@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)
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})
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}
</insert>
<insert id="insertOrUpdateSelective" parameterType="com.jsowell.pile.domain.MemberAdapayRecord">
<!--@mbg.generated-->
insert into member_adapay_record
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="memberId != null">
member_id,
</if>
<if test="scenarioType != null">
scenario_type,
</if>
<if test="paymentId != null">
payment_id,
</if>
<if test="paymentOrderNo != null">
payment_order_no,
</if>
<if test="payAmt != null">
pay_amt,
</if>
<if test="refundAmt != null">
refund_amt,
</if>
<if test="spendAmt != null">
spend_amt,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateBy != null">
update_by,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="delFlag != null">
del_flag,
</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="scenarioType != null">
#{scenarioType,jdbcType=VARCHAR},
</if>
<if test="paymentId != null">
#{paymentId,jdbcType=VARCHAR},
</if>
<if test="paymentOrderNo != null">
#{paymentOrderNo,jdbcType=VARCHAR},
</if>
<if test="payAmt != null">
#{payAmt,jdbcType=DECIMAL},
</if>
<if test="refundAmt != null">
#{refundAmt,jdbcType=DECIMAL},
</if>
<if test="spendAmt != null">
#{spendAmt,jdbcType=DECIMAL},
</if>
<if test="createBy != null">
#{createBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null">
#{updateBy,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="delFlag != null">
#{delFlag,jdbcType=VARCHAR},
</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="scenarioType != null">
scenario_type = #{scenarioType,jdbcType=VARCHAR},
</if>
<if test="paymentId != null">
payment_id = #{paymentId,jdbcType=VARCHAR},
</if>
<if test="paymentOrderNo != null">
payment_order_no = #{paymentOrderNo,jdbcType=VARCHAR},
</if>
<if test="payAmt != null">
pay_amt = #{payAmt,jdbcType=DECIMAL},
</if>
<if test="refundAmt != null">
refund_amt = #{refundAmt,jdbcType=DECIMAL},
</if>
<if test="spendAmt != null">
spend_amt = #{spendAmt,jdbcType=DECIMAL},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null">
update_by = #{updateBy,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="delFlag != null">
del_flag = #{delFlag,jdbcType=VARCHAR},
</if>
</trim>
</insert>
</mapper>