updateupdate

This commit is contained in:
2023-09-21 15:45:33 +08:00
parent 43d9d57848
commit 9a492bb783
4 changed files with 211 additions and 54 deletions

View File

@@ -1,11 +1,9 @@
package com.jsowell.pile.domain; package com.jsowell.pile.domain;
import lombok.*;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
/** /**
* 清分账单详情表 * 清分账单详情表
@@ -31,6 +29,26 @@ public class ClearingBillDetail {
*/ */
private String orderCode; private String orderCode;
/**
* 支付id
*/
private String paymentId;
/**
* 支付确认id
*/
private String confirmId;
/**
* 确认金额
*/
private BigDecimal confirmAmt;
/**
* 支付确认手续费金额
*/
private BigDecimal feeAmt;
/** /**
* 创建人 * 创建人
*/ */

View File

@@ -8,6 +8,7 @@ import java.util.List;
public interface ClearingBillDetailMapper { public interface ClearingBillDetailMapper {
/** /**
* delete by primary key * delete by primary key
*
* @param id primaryKey * @param id primaryKey
* @return deleteCount * @return deleteCount
*/ */
@@ -15,6 +16,7 @@ public interface ClearingBillDetailMapper {
/** /**
* insert record to table * insert record to table
*
* @param record the record * @param record the record
* @return insert count * @return insert count
*/ */
@@ -26,6 +28,7 @@ public interface ClearingBillDetailMapper {
/** /**
* insert record to table selective * insert record to table selective
*
* @param record the record * @param record the record
* @return insert count * @return insert count
*/ */
@@ -33,6 +36,7 @@ public interface ClearingBillDetailMapper {
/** /**
* select by primary key * select by primary key
*
* @param id primary key * @param id primary key
* @return object by primary key * @return object by primary key
*/ */
@@ -40,6 +44,7 @@ public interface ClearingBillDetailMapper {
/** /**
* update record selective * update record selective
*
* @param record the updated record * @param record the updated record
* @return update count * @return update count
*/ */
@@ -47,6 +52,7 @@ public interface ClearingBillDetailMapper {
/** /**
* update record * update record
*
* @param record the updated record * @param record the updated record
* @return update count * @return update count
*/ */

View File

@@ -1296,6 +1296,7 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
ClearingBillDetail clearingBillDetail = ClearingBillDetail.builder() ClearingBillDetail clearingBillDetail = ClearingBillDetail.builder()
.clearingBillCode(clearingBillCode) .clearingBillCode(clearingBillCode)
.orderCode(orderBasicInfo.getOrderCode()) .orderCode(orderBasicInfo.getOrderCode())
.createTime(DateUtils.getNowDate()) .createTime(DateUtils.getNowDate())
.delFlag(DelFlagEnum.NORMAL.getValue()) .delFlag(DelFlagEnum.NORMAL.getValue())
.build(); .build();

View File

@@ -7,6 +7,10 @@
<id column="id" jdbcType="INTEGER" property="id" /> <id column="id" jdbcType="INTEGER" property="id" />
<result column="clearing_bill_code" jdbcType="VARCHAR" property="clearingBillCode" /> <result column="clearing_bill_code" jdbcType="VARCHAR" property="clearingBillCode" />
<result column="order_code" jdbcType="VARCHAR" property="orderCode" /> <result column="order_code" jdbcType="VARCHAR" property="orderCode" />
<result column="payment_id" jdbcType="VARCHAR" property="paymentId" />
<result column="confirm_id" jdbcType="VARCHAR" property="confirmId" />
<result column="confirm_amt" jdbcType="DECIMAL" property="confirmAmt" />
<result column="fee_amt" jdbcType="DECIMAL" property="feeAmt" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" /> <result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_by" jdbcType="VARCHAR" property="updateBy" /> <result column="update_by" jdbcType="VARCHAR" property="updateBy" />
@@ -15,8 +19,8 @@
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
<!--@mbg.generated--> <!--@mbg.generated-->
id, clearing_bill_code, order_code, create_by, create_time, update_by, update_time, id, clearing_bill_code, order_code, payment_id, confirm_id, confirm_amt, fee_amt,
del_flag create_by, create_time, update_by, update_time, del_flag
</sql> </sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap"> <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<!--@mbg.generated--> <!--@mbg.generated-->
@@ -30,28 +34,39 @@
delete from clearing_bill_detail delete from clearing_bill_detail
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</delete> </delete>
<insert id="insert" parameterType="com.jsowell.pile.domain.ClearingBillDetail"> <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.ClearingBillDetail" useGeneratedKeys="true">
<!--@mbg.generated--> <!--@mbg.generated-->
insert into clearing_bill_detail (id, clearing_bill_code, order_code, insert into clearing_bill_detail (clearing_bill_code, order_code, payment_id,
confirm_id, confirm_amt, fee_amt,
create_by, create_time, update_by, create_by, create_time, update_by,
update_time, del_flag) update_time, del_flag)
values (#{id,jdbcType=INTEGER}, #{clearingBillCode,jdbcType=VARCHAR}, #{orderCode,jdbcType=VARCHAR}, values (#{clearingBillCode,jdbcType=VARCHAR}, #{orderCode,jdbcType=VARCHAR}, #{paymentId,jdbcType=VARCHAR},
#{confirmId,jdbcType=VARCHAR}, #{confirmAmt,jdbcType=DECIMAL}, #{feeAmt,jdbcType=DECIMAL},
#{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR},
#{updateTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=VARCHAR}) #{updateTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=VARCHAR})
</insert> </insert>
<insert id="insertSelective" parameterType="com.jsowell.pile.domain.ClearingBillDetail"> <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.ClearingBillDetail" useGeneratedKeys="true">
<!--@mbg.generated--> <!--@mbg.generated-->
insert into clearing_bill_detail insert into clearing_bill_detail
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="clearingBillCode != null"> <if test="clearingBillCode != null">
clearing_bill_code, clearing_bill_code,
</if> </if>
<if test="orderCode != null"> <if test="orderCode != null">
order_code, order_code,
</if> </if>
<if test="paymentId != null">
payment_id,
</if>
<if test="confirmId != null">
confirm_id,
</if>
<if test="confirmAmt != null">
confirm_amt,
</if>
<if test="feeAmt != null">
fee_amt,
</if>
<if test="createBy != null"> <if test="createBy != null">
create_by, create_by,
</if> </if>
@@ -69,15 +84,24 @@
</if> </if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="clearingBillCode != null"> <if test="clearingBillCode != null">
#{clearingBillCode,jdbcType=VARCHAR}, #{clearingBillCode,jdbcType=VARCHAR},
</if> </if>
<if test="orderCode != null"> <if test="orderCode != null">
#{orderCode,jdbcType=VARCHAR}, #{orderCode,jdbcType=VARCHAR},
</if> </if>
<if test="paymentId != null">
#{paymentId,jdbcType=VARCHAR},
</if>
<if test="confirmId != null">
#{confirmId,jdbcType=VARCHAR},
</if>
<if test="confirmAmt != null">
#{confirmAmt,jdbcType=DECIMAL},
</if>
<if test="feeAmt != null">
#{feeAmt,jdbcType=DECIMAL},
</if>
<if test="createBy != null"> <if test="createBy != null">
#{createBy,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR},
</if> </if>
@@ -105,6 +129,18 @@
<if test="orderCode != null"> <if test="orderCode != null">
order_code = #{orderCode,jdbcType=VARCHAR}, order_code = #{orderCode,jdbcType=VARCHAR},
</if> </if>
<if test="paymentId != null">
payment_id = #{paymentId,jdbcType=VARCHAR},
</if>
<if test="confirmId != null">
confirm_id = #{confirmId,jdbcType=VARCHAR},
</if>
<if test="confirmAmt != null">
confirm_amt = #{confirmAmt,jdbcType=DECIMAL},
</if>
<if test="feeAmt != null">
fee_amt = #{feeAmt,jdbcType=DECIMAL},
</if>
<if test="createBy != null"> <if test="createBy != null">
create_by = #{createBy,jdbcType=VARCHAR}, create_by = #{createBy,jdbcType=VARCHAR},
</if> </if>
@@ -128,6 +164,10 @@
update clearing_bill_detail update clearing_bill_detail
set clearing_bill_code = #{clearingBillCode,jdbcType=VARCHAR}, set clearing_bill_code = #{clearingBillCode,jdbcType=VARCHAR},
order_code = #{orderCode,jdbcType=VARCHAR}, order_code = #{orderCode,jdbcType=VARCHAR},
payment_id = #{paymentId,jdbcType=VARCHAR},
confirm_id = #{confirmId,jdbcType=VARCHAR},
confirm_amt = #{confirmAmt,jdbcType=DECIMAL},
fee_amt = #{feeAmt,jdbcType=DECIMAL},
create_by = #{createBy,jdbcType=VARCHAR}, create_by = #{createBy,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP}, create_time = #{createTime,jdbcType=TIMESTAMP},
update_by = #{updateBy,jdbcType=VARCHAR}, update_by = #{updateBy,jdbcType=VARCHAR},
@@ -149,6 +189,26 @@
when id = #{item.id,jdbcType=INTEGER} then #{item.orderCode,jdbcType=VARCHAR} when id = #{item.id,jdbcType=INTEGER} then #{item.orderCode,jdbcType=VARCHAR}
</foreach> </foreach>
</trim> </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="confirm_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.confirmId,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="confirm_amt = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.confirmAmt,jdbcType=DECIMAL}
</foreach>
</trim>
<trim prefix="fee_amt = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.feeAmt,jdbcType=DECIMAL}
</foreach>
</trim>
<trim prefix="create_by = case" suffix="end,"> <trim prefix="create_by = 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.createBy,jdbcType=VARCHAR} when id = #{item.id,jdbcType=INTEGER} then #{item.createBy,jdbcType=VARCHAR}
@@ -180,38 +240,74 @@
#{item.id,jdbcType=INTEGER} #{item.id,jdbcType=INTEGER}
</foreach> </foreach>
</update> </update>
<insert id="batchInsert" parameterType="map"> <insert id="batchInsert" keyColumn="id" keyProperty="id" parameterType="map" useGeneratedKeys="true">
<!--@mbg.generated--> <!--@mbg.generated-->
insert into clearing_bill_detail insert into clearing_bill_detail
(id, clearing_bill_code, order_code, create_by, create_time, update_by, update_time, (clearing_bill_code, order_code, payment_id, confirm_id, confirm_amt, fee_amt, create_by,
del_flag) create_time, update_by, update_time, del_flag)
values values
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
(#{item.id,jdbcType=INTEGER}, #{item.clearingBillCode,jdbcType=VARCHAR}, #{item.orderCode,jdbcType=VARCHAR}, (#{item.clearingBillCode,jdbcType=VARCHAR}, #{item.orderCode,jdbcType=VARCHAR}, #{item.paymentId,jdbcType=VARCHAR},
#{item.confirmId,jdbcType=VARCHAR}, #{item.confirmAmt,jdbcType=DECIMAL}, #{item.feeAmt,jdbcType=DECIMAL},
#{item.createBy,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP}, #{item.updateBy,jdbcType=VARCHAR}, #{item.createBy,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP}, #{item.updateBy,jdbcType=VARCHAR},
#{item.updateTime,jdbcType=TIMESTAMP}, #{item.delFlag,jdbcType=VARCHAR}) #{item.updateTime,jdbcType=TIMESTAMP}, #{item.delFlag,jdbcType=VARCHAR})
</foreach> </foreach>
</insert> </insert>
<insert id="insertOrUpdate" parameterType="com.jsowell.pile.domain.ClearingBillDetail"> <insert id="insertOrUpdate" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.ClearingBillDetail" useGeneratedKeys="true">
<!--@mbg.generated--> <!--@mbg.generated-->
insert into clearing_bill_detail insert into clearing_bill_detail
(id, clearing_bill_code, order_code, create_by, create_time, update_by, update_time, <trim prefix="(" suffix=")" suffixOverrides=",">
del_flag) <if test="id != null">
id,
</if>
clearing_bill_code,
order_code,
payment_id,
confirm_id,
confirm_amt,
fee_amt,
create_by,
create_time,
update_by,
update_time,
del_flag,
</trim>
values values
(#{id,jdbcType=INTEGER}, #{clearingBillCode,jdbcType=VARCHAR}, #{orderCode,jdbcType=VARCHAR}, <trim prefix="(" suffix=")" suffixOverrides=",">
#{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR}, <if test="id != null">
#{updateTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=VARCHAR}) #{id,jdbcType=INTEGER},
</if>
#{clearingBillCode,jdbcType=VARCHAR},
#{orderCode,jdbcType=VARCHAR},
#{paymentId,jdbcType=VARCHAR},
#{confirmId,jdbcType=VARCHAR},
#{confirmAmt,jdbcType=DECIMAL},
#{feeAmt,jdbcType=DECIMAL},
#{createBy,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP},
#{updateBy,jdbcType=VARCHAR},
#{updateTime,jdbcType=TIMESTAMP},
#{delFlag,jdbcType=VARCHAR},
</trim>
on duplicate key update on duplicate key update
<trim suffixOverrides=",">
<if test="id != null">
id = #{id,jdbcType=INTEGER}, id = #{id,jdbcType=INTEGER},
</if>
clearing_bill_code = #{clearingBillCode,jdbcType=VARCHAR}, clearing_bill_code = #{clearingBillCode,jdbcType=VARCHAR},
order_code = #{orderCode,jdbcType=VARCHAR}, order_code = #{orderCode,jdbcType=VARCHAR},
payment_id = #{paymentId,jdbcType=VARCHAR},
confirm_id = #{confirmId,jdbcType=VARCHAR},
confirm_amt = #{confirmAmt,jdbcType=DECIMAL},
fee_amt = #{feeAmt,jdbcType=DECIMAL},
create_by = #{createBy,jdbcType=VARCHAR}, create_by = #{createBy,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP}, create_time = #{createTime,jdbcType=TIMESTAMP},
update_by = #{updateBy,jdbcType=VARCHAR}, update_by = #{updateBy,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=TIMESTAMP}, update_time = #{updateTime,jdbcType=TIMESTAMP},
del_flag = #{delFlag,jdbcType=VARCHAR} del_flag = #{delFlag,jdbcType=VARCHAR},
</trim>
</insert> </insert>
<insert id="insertOrUpdateSelective" parameterType="com.jsowell.pile.domain.ClearingBillDetail"> <insert id="insertOrUpdateSelective" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.ClearingBillDetail" useGeneratedKeys="true">
<!--@mbg.generated--> <!--@mbg.generated-->
insert into clearing_bill_detail insert into clearing_bill_detail
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -224,6 +320,18 @@
<if test="orderCode != null"> <if test="orderCode != null">
order_code, order_code,
</if> </if>
<if test="paymentId != null">
payment_id,
</if>
<if test="confirmId != null">
confirm_id,
</if>
<if test="confirmAmt != null">
confirm_amt,
</if>
<if test="feeAmt != null">
fee_amt,
</if>
<if test="createBy != null"> <if test="createBy != null">
create_by, create_by,
</if> </if>
@@ -251,6 +359,18 @@
<if test="orderCode != null"> <if test="orderCode != null">
#{orderCode,jdbcType=VARCHAR}, #{orderCode,jdbcType=VARCHAR},
</if> </if>
<if test="paymentId != null">
#{paymentId,jdbcType=VARCHAR},
</if>
<if test="confirmId != null">
#{confirmId,jdbcType=VARCHAR},
</if>
<if test="confirmAmt != null">
#{confirmAmt,jdbcType=DECIMAL},
</if>
<if test="feeAmt != null">
#{feeAmt,jdbcType=DECIMAL},
</if>
<if test="createBy != null"> <if test="createBy != null">
#{createBy,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR},
</if> </if>
@@ -278,6 +398,18 @@
<if test="orderCode != null"> <if test="orderCode != null">
order_code = #{orderCode,jdbcType=VARCHAR}, order_code = #{orderCode,jdbcType=VARCHAR},
</if> </if>
<if test="paymentId != null">
payment_id = #{paymentId,jdbcType=VARCHAR},
</if>
<if test="confirmId != null">
confirm_id = #{confirmId,jdbcType=VARCHAR},
</if>
<if test="confirmAmt != null">
confirm_amt = #{confirmAmt,jdbcType=DECIMAL},
</if>
<if test="feeAmt != null">
fee_amt = #{feeAmt,jdbcType=DECIMAL},
</if>
<if test="createBy != null"> <if test="createBy != null">
create_by = #{createBy,jdbcType=VARCHAR}, create_by = #{createBy,jdbcType=VARCHAR},
</if> </if>