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,15 +1,13 @@
package com.jsowell.pile.domain;
import lombok.*;
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
@@ -17,42 +15,62 @@ import lombok.Setter;
@NoArgsConstructor
public class ClearingBillDetail {
/**
* 主键
*/
* 主键
*/
private Integer id;
/**
* 清分账单编号
*/
* 清分账单编号
*/
private String clearingBillCode;
/**
* 订单编号
*/
* 订单编号
*/
private String orderCode;
/**
* 创建人
*/
* 支付id
*/
private String paymentId;
/**
* 支付确认id
*/
private String confirmId;
/**
* 确认金额
*/
private BigDecimal confirmAmt;
/**
* 支付确认手续费金额
*/
private BigDecimal feeAmt;
/**
* 创建人
*/
private String createBy;
/**
* 创建时间
*/
* 创建时间
*/
private Date createTime;
/**
* 更新人
*/
* 更新人
*/
private String updateBy;
/**
* 更新时间
*/
* 更新时间
*/
private Date updateTime;
/**
* 删除标识0-正常1-删除)
*/
* 删除标识0-正常1-删除)
*/
private String delFlag;
}

View File

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

View File

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

View File

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