diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/domain/AdapayUnsplitRecord.java b/jsowell-pile/src/main/java/com/jsowell/pile/domain/AdapayUnsplitRecord.java new file mode 100644 index 000000000..316f7c607 --- /dev/null +++ b/jsowell-pile/src/main/java/com/jsowell/pile/domain/AdapayUnsplitRecord.java @@ -0,0 +1,103 @@ +package com.jsowell.pile.domain; + +import java.math.BigDecimal; +import java.util.Date; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; +import lombok.experimental.SuperBuilder; + +@Data +@Accessors(chain = true) +@SuperBuilder +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class AdapayUnsplitRecord { + /** + * 主键 + */ + private Integer id; + + /** + * 商户号 + */ + private String merchantCode; + + /** + * 支付时间 + */ + private Date payTime; + + /** + * 交易流水号 + */ + private String paymentId; + + /** + * 交易订单号 + */ + private String orderNo; + + /** + * 交易订单金额(也就是支付金额) + */ + private BigDecimal payAmount; + + /** + * 已确认分账金额(已经分账的金额) + */ + private BigDecimal confirmedSplitAmount; + + /** + * 已撤销金额(订单已经退款的金额) + */ + private BigDecimal refundAmount; + + /** + * 支付确认撤销金额(分帐后又撤销的金额) + */ + private BigDecimal paymentRevokeAmount; + + /** + * 剩余未分账金额(现在未分账的金额) + */ + private BigDecimal remainingSplitAmount; + + /** + * 订单编号 + */ + private String orderCode; + + /** + * 桩类型(ev汽车桩;ebike电单车桩) + */ + private String pileType; + + /** + * 查询订单中退款金额(应退金额,可能没有退) + */ + private BigDecimal dueRefundAmount; + + /** + * 查询订单中结算金额(结算金额,也就是应该分账的金额) + */ + private BigDecimal settleAmount; + + /** + * 退款标识 + */ + private String refundFlag; + + /** + * 分账标识 + */ + private String splitFlag; + + /** + * 更新时间 + */ + private Date updateTime; +} \ No newline at end of file diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/mapper/AdapayUnsplitRecordMapper.java b/jsowell-pile/src/main/java/com/jsowell/pile/mapper/AdapayUnsplitRecordMapper.java new file mode 100644 index 000000000..7e014ea21 --- /dev/null +++ b/jsowell-pile/src/main/java/com/jsowell/pile/mapper/AdapayUnsplitRecordMapper.java @@ -0,0 +1,29 @@ +package com.jsowell.pile.mapper; + +import com.jsowell.pile.domain.AdapayUnsplitRecord; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface AdapayUnsplitRecordMapper { + int deleteByPrimaryKey(Integer id); + + int insert(AdapayUnsplitRecord record); + + int insertOrUpdate(AdapayUnsplitRecord record); + + int insertOrUpdateSelective(AdapayUnsplitRecord record); + + int insertSelective(AdapayUnsplitRecord record); + + AdapayUnsplitRecord selectByPrimaryKey(Integer id); + + int updateByPrimaryKeySelective(AdapayUnsplitRecord record); + + int updateByPrimaryKey(AdapayUnsplitRecord record); + + int updateBatch(@Param("list") List list); + + int updateBatchSelective(@Param("list") List list); + + int batchInsert(@Param("list") List list); +} \ No newline at end of file diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/AdapayUnsplitRecordService.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/AdapayUnsplitRecordService.java new file mode 100644 index 000000000..8c9a42fcd --- /dev/null +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/AdapayUnsplitRecordService.java @@ -0,0 +1,29 @@ +package com.jsowell.pile.service; + +import com.jsowell.pile.domain.AdapayUnsplitRecord; +import java.util.List; +public interface AdapayUnsplitRecordService{ + + int deleteByPrimaryKey(Integer id); + + int insert(AdapayUnsplitRecord record); + + int insertOrUpdate(AdapayUnsplitRecord record); + + int insertOrUpdateSelective(AdapayUnsplitRecord record); + + int insertSelective(AdapayUnsplitRecord record); + + AdapayUnsplitRecord selectByPrimaryKey(Integer id); + + int updateByPrimaryKeySelective(AdapayUnsplitRecord record); + + int updateByPrimaryKey(AdapayUnsplitRecord record); + + int updateBatch(List list); + + int updateBatchSelective(List list); + + int batchInsert(List list); + +} diff --git a/jsowell-pile/src/main/java/com/jsowell/web/controller/pile/AdapayUnsplitRecordServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/web/controller/pile/AdapayUnsplitRecordServiceImpl.java new file mode 100644 index 000000000..08cabddd4 --- /dev/null +++ b/jsowell-pile/src/main/java/com/jsowell/web/controller/pile/AdapayUnsplitRecordServiceImpl.java @@ -0,0 +1,72 @@ +package com.jsowell.web.controller.pile; + +import org.springframework.stereotype.Service; + +import org.springframework.beans.factory.annotation.Autowired; + +import com.jsowell.pile.domain.AdapayUnsplitRecord; +import java.util.List; +import com.jsowell.pile.mapper.AdapayUnsplitRecordMapper; +import com.jsowell.pile.service.AdapayUnsplitRecordService; +@Service +public class AdapayUnsplitRecordServiceImpl implements AdapayUnsplitRecordService{ + + @Autowired + private AdapayUnsplitRecordMapper adapayUnsplitRecordMapper; + + @Override + public int deleteByPrimaryKey(Integer id) { + return adapayUnsplitRecordMapper.deleteByPrimaryKey(id); + } + + @Override + public int insert(AdapayUnsplitRecord record) { + return adapayUnsplitRecordMapper.insert(record); + } + + @Override + public int insertOrUpdate(AdapayUnsplitRecord record) { + return adapayUnsplitRecordMapper.insertOrUpdate(record); + } + + @Override + public int insertOrUpdateSelective(AdapayUnsplitRecord record) { + return adapayUnsplitRecordMapper.insertOrUpdateSelective(record); + } + + @Override + public int insertSelective(AdapayUnsplitRecord record) { + return adapayUnsplitRecordMapper.insertSelective(record); + } + + @Override + public AdapayUnsplitRecord selectByPrimaryKey(Integer id) { + return adapayUnsplitRecordMapper.selectByPrimaryKey(id); + } + + @Override + public int updateByPrimaryKeySelective(AdapayUnsplitRecord record) { + return adapayUnsplitRecordMapper.updateByPrimaryKeySelective(record); + } + + @Override + public int updateByPrimaryKey(AdapayUnsplitRecord record) { + return adapayUnsplitRecordMapper.updateByPrimaryKey(record); + } + + @Override + public int updateBatch(List list) { + return adapayUnsplitRecordMapper.updateBatch(list); + } + + @Override + public int updateBatchSelective(List list) { + return adapayUnsplitRecordMapper.updateBatchSelective(list); + } + + @Override + public int batchInsert(List list) { + return adapayUnsplitRecordMapper.batchInsert(list); + } + +} diff --git a/jsowell-pile/src/main/resources/mapper/pile/AdapayUnsplitRecordMapper.xml b/jsowell-pile/src/main/resources/mapper/pile/AdapayUnsplitRecordMapper.xml new file mode 100644 index 000000000..acd84bb0f --- /dev/null +++ b/jsowell-pile/src/main/resources/mapper/pile/AdapayUnsplitRecordMapper.xml @@ -0,0 +1,701 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + id, merchant_code, pay_time, payment_id, order_no, pay_amount, confirmed_split_amount, + refund_amount, payment_revoke_amount, remaining_split_amount, order_code, pile_type, + due_refund_amount, settle_amount, refund_flag, split_flag, update_time + + + + + delete from adapay_unsplit_record + where id = #{id,jdbcType=INTEGER} + + + + insert into adapay_unsplit_record (merchant_code, pay_time, payment_id, + order_no, pay_amount, confirmed_split_amount, + refund_amount, payment_revoke_amount, remaining_split_amount, + order_code, pile_type, due_refund_amount, + settle_amount, refund_flag, split_flag, + update_time) + values (#{merchantCode,jdbcType=VARCHAR}, #{payTime,jdbcType=TIMESTAMP}, #{paymentId,jdbcType=VARCHAR}, + #{orderNo,jdbcType=VARCHAR}, #{payAmount,jdbcType=DECIMAL}, #{confirmedSplitAmount,jdbcType=DECIMAL}, + #{refundAmount,jdbcType=DECIMAL}, #{paymentRevokeAmount,jdbcType=DECIMAL}, #{remainingSplitAmount,jdbcType=DECIMAL}, + #{orderCode,jdbcType=VARCHAR}, #{pileType,jdbcType=VARCHAR}, #{dueRefundAmount,jdbcType=DECIMAL}, + #{settleAmount,jdbcType=DECIMAL}, #{refundFlag,jdbcType=VARCHAR}, #{splitFlag,jdbcType=VARCHAR}, + #{updateTime,jdbcType=TIMESTAMP}) + + + + insert into adapay_unsplit_record + + + merchant_code, + + + pay_time, + + + payment_id, + + + order_no, + + + pay_amount, + + + confirmed_split_amount, + + + refund_amount, + + + payment_revoke_amount, + + + remaining_split_amount, + + + order_code, + + + pile_type, + + + due_refund_amount, + + + settle_amount, + + + refund_flag, + + + split_flag, + + + update_time, + + + + + #{merchantCode,jdbcType=VARCHAR}, + + + #{payTime,jdbcType=TIMESTAMP}, + + + #{paymentId,jdbcType=VARCHAR}, + + + #{orderNo,jdbcType=VARCHAR}, + + + #{payAmount,jdbcType=DECIMAL}, + + + #{confirmedSplitAmount,jdbcType=DECIMAL}, + + + #{refundAmount,jdbcType=DECIMAL}, + + + #{paymentRevokeAmount,jdbcType=DECIMAL}, + + + #{remainingSplitAmount,jdbcType=DECIMAL}, + + + #{orderCode,jdbcType=VARCHAR}, + + + #{pileType,jdbcType=VARCHAR}, + + + #{dueRefundAmount,jdbcType=DECIMAL}, + + + #{settleAmount,jdbcType=DECIMAL}, + + + #{refundFlag,jdbcType=VARCHAR}, + + + #{splitFlag,jdbcType=VARCHAR}, + + + #{updateTime,jdbcType=TIMESTAMP}, + + + + + + update adapay_unsplit_record + + + merchant_code = #{merchantCode,jdbcType=VARCHAR}, + + + pay_time = #{payTime,jdbcType=TIMESTAMP}, + + + payment_id = #{paymentId,jdbcType=VARCHAR}, + + + order_no = #{orderNo,jdbcType=VARCHAR}, + + + pay_amount = #{payAmount,jdbcType=DECIMAL}, + + + confirmed_split_amount = #{confirmedSplitAmount,jdbcType=DECIMAL}, + + + refund_amount = #{refundAmount,jdbcType=DECIMAL}, + + + payment_revoke_amount = #{paymentRevokeAmount,jdbcType=DECIMAL}, + + + remaining_split_amount = #{remainingSplitAmount,jdbcType=DECIMAL}, + + + order_code = #{orderCode,jdbcType=VARCHAR}, + + + pile_type = #{pileType,jdbcType=VARCHAR}, + + + due_refund_amount = #{dueRefundAmount,jdbcType=DECIMAL}, + + + settle_amount = #{settleAmount,jdbcType=DECIMAL}, + + + refund_flag = #{refundFlag,jdbcType=VARCHAR}, + + + split_flag = #{splitFlag,jdbcType=VARCHAR}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + where id = #{id,jdbcType=INTEGER} + + + + update adapay_unsplit_record + set merchant_code = #{merchantCode,jdbcType=VARCHAR}, + pay_time = #{payTime,jdbcType=TIMESTAMP}, + payment_id = #{paymentId,jdbcType=VARCHAR}, + order_no = #{orderNo,jdbcType=VARCHAR}, + pay_amount = #{payAmount,jdbcType=DECIMAL}, + confirmed_split_amount = #{confirmedSplitAmount,jdbcType=DECIMAL}, + refund_amount = #{refundAmount,jdbcType=DECIMAL}, + payment_revoke_amount = #{paymentRevokeAmount,jdbcType=DECIMAL}, + remaining_split_amount = #{remainingSplitAmount,jdbcType=DECIMAL}, + order_code = #{orderCode,jdbcType=VARCHAR}, + pile_type = #{pileType,jdbcType=VARCHAR}, + due_refund_amount = #{dueRefundAmount,jdbcType=DECIMAL}, + settle_amount = #{settleAmount,jdbcType=DECIMAL}, + refund_flag = #{refundFlag,jdbcType=VARCHAR}, + split_flag = #{splitFlag,jdbcType=VARCHAR}, + update_time = #{updateTime,jdbcType=TIMESTAMP} + where id = #{id,jdbcType=INTEGER} + + + + update adapay_unsplit_record + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.merchantCode,jdbcType=VARCHAR} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.payTime,jdbcType=TIMESTAMP} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.paymentId,jdbcType=VARCHAR} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.orderNo,jdbcType=VARCHAR} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.payAmount,jdbcType=DECIMAL} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.confirmedSplitAmount,jdbcType=DECIMAL} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.refundAmount,jdbcType=DECIMAL} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.paymentRevokeAmount,jdbcType=DECIMAL} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.remainingSplitAmount,jdbcType=DECIMAL} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.orderCode,jdbcType=VARCHAR} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.pileType,jdbcType=VARCHAR} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.dueRefundAmount,jdbcType=DECIMAL} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.settleAmount,jdbcType=DECIMAL} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.refundFlag,jdbcType=VARCHAR} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.splitFlag,jdbcType=VARCHAR} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.updateTime,jdbcType=TIMESTAMP} + + + + where id in + + #{item.id,jdbcType=INTEGER} + + + + + update adapay_unsplit_record + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.merchantCode,jdbcType=VARCHAR} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.payTime,jdbcType=TIMESTAMP} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.paymentId,jdbcType=VARCHAR} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.orderNo,jdbcType=VARCHAR} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.payAmount,jdbcType=DECIMAL} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.confirmedSplitAmount,jdbcType=DECIMAL} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.refundAmount,jdbcType=DECIMAL} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.paymentRevokeAmount,jdbcType=DECIMAL} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.remainingSplitAmount,jdbcType=DECIMAL} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.orderCode,jdbcType=VARCHAR} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.pileType,jdbcType=VARCHAR} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.dueRefundAmount,jdbcType=DECIMAL} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.settleAmount,jdbcType=DECIMAL} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.refundFlag,jdbcType=VARCHAR} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.splitFlag,jdbcType=VARCHAR} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.updateTime,jdbcType=TIMESTAMP} + + + + + where id in + + #{item.id,jdbcType=INTEGER} + + + + + insert into adapay_unsplit_record + (merchant_code, pay_time, payment_id, order_no, pay_amount, confirmed_split_amount, + refund_amount, payment_revoke_amount, remaining_split_amount, order_code, pile_type, + due_refund_amount, settle_amount, refund_flag, split_flag, update_time) + values + + (#{item.merchantCode,jdbcType=VARCHAR}, #{item.payTime,jdbcType=TIMESTAMP}, #{item.paymentId,jdbcType=VARCHAR}, + #{item.orderNo,jdbcType=VARCHAR}, #{item.payAmount,jdbcType=DECIMAL}, #{item.confirmedSplitAmount,jdbcType=DECIMAL}, + #{item.refundAmount,jdbcType=DECIMAL}, #{item.paymentRevokeAmount,jdbcType=DECIMAL}, + #{item.remainingSplitAmount,jdbcType=DECIMAL}, #{item.orderCode,jdbcType=VARCHAR}, + #{item.pileType,jdbcType=VARCHAR}, #{item.dueRefundAmount,jdbcType=DECIMAL}, #{item.settleAmount,jdbcType=DECIMAL}, + #{item.refundFlag,jdbcType=VARCHAR}, #{item.splitFlag,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP} + ) + + + + + insert into adapay_unsplit_record + + + id, + + merchant_code, + pay_time, + payment_id, + order_no, + pay_amount, + confirmed_split_amount, + refund_amount, + payment_revoke_amount, + remaining_split_amount, + order_code, + pile_type, + due_refund_amount, + settle_amount, + refund_flag, + split_flag, + update_time, + + values + + + #{id,jdbcType=INTEGER}, + + #{merchantCode,jdbcType=VARCHAR}, + #{payTime,jdbcType=TIMESTAMP}, + #{paymentId,jdbcType=VARCHAR}, + #{orderNo,jdbcType=VARCHAR}, + #{payAmount,jdbcType=DECIMAL}, + #{confirmedSplitAmount,jdbcType=DECIMAL}, + #{refundAmount,jdbcType=DECIMAL}, + #{paymentRevokeAmount,jdbcType=DECIMAL}, + #{remainingSplitAmount,jdbcType=DECIMAL}, + #{orderCode,jdbcType=VARCHAR}, + #{pileType,jdbcType=VARCHAR}, + #{dueRefundAmount,jdbcType=DECIMAL}, + #{settleAmount,jdbcType=DECIMAL}, + #{refundFlag,jdbcType=VARCHAR}, + #{splitFlag,jdbcType=VARCHAR}, + #{updateTime,jdbcType=TIMESTAMP}, + + on duplicate key update + + + id = #{id,jdbcType=INTEGER}, + + merchant_code = #{merchantCode,jdbcType=VARCHAR}, + pay_time = #{payTime,jdbcType=TIMESTAMP}, + payment_id = #{paymentId,jdbcType=VARCHAR}, + order_no = #{orderNo,jdbcType=VARCHAR}, + pay_amount = #{payAmount,jdbcType=DECIMAL}, + confirmed_split_amount = #{confirmedSplitAmount,jdbcType=DECIMAL}, + refund_amount = #{refundAmount,jdbcType=DECIMAL}, + payment_revoke_amount = #{paymentRevokeAmount,jdbcType=DECIMAL}, + remaining_split_amount = #{remainingSplitAmount,jdbcType=DECIMAL}, + order_code = #{orderCode,jdbcType=VARCHAR}, + pile_type = #{pileType,jdbcType=VARCHAR}, + due_refund_amount = #{dueRefundAmount,jdbcType=DECIMAL}, + settle_amount = #{settleAmount,jdbcType=DECIMAL}, + refund_flag = #{refundFlag,jdbcType=VARCHAR}, + split_flag = #{splitFlag,jdbcType=VARCHAR}, + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + + + insert into adapay_unsplit_record + + + id, + + + merchant_code, + + + pay_time, + + + payment_id, + + + order_no, + + + pay_amount, + + + confirmed_split_amount, + + + refund_amount, + + + payment_revoke_amount, + + + remaining_split_amount, + + + order_code, + + + pile_type, + + + due_refund_amount, + + + settle_amount, + + + refund_flag, + + + split_flag, + + + update_time, + + + values + + + #{id,jdbcType=INTEGER}, + + + #{merchantCode,jdbcType=VARCHAR}, + + + #{payTime,jdbcType=TIMESTAMP}, + + + #{paymentId,jdbcType=VARCHAR}, + + + #{orderNo,jdbcType=VARCHAR}, + + + #{payAmount,jdbcType=DECIMAL}, + + + #{confirmedSplitAmount,jdbcType=DECIMAL}, + + + #{refundAmount,jdbcType=DECIMAL}, + + + #{paymentRevokeAmount,jdbcType=DECIMAL}, + + + #{remainingSplitAmount,jdbcType=DECIMAL}, + + + #{orderCode,jdbcType=VARCHAR}, + + + #{pileType,jdbcType=VARCHAR}, + + + #{dueRefundAmount,jdbcType=DECIMAL}, + + + #{settleAmount,jdbcType=DECIMAL}, + + + #{refundFlag,jdbcType=VARCHAR}, + + + #{splitFlag,jdbcType=VARCHAR}, + + + #{updateTime,jdbcType=TIMESTAMP}, + + + on duplicate key update + + + id = #{id,jdbcType=INTEGER}, + + + merchant_code = #{merchantCode,jdbcType=VARCHAR}, + + + pay_time = #{payTime,jdbcType=TIMESTAMP}, + + + payment_id = #{paymentId,jdbcType=VARCHAR}, + + + order_no = #{orderNo,jdbcType=VARCHAR}, + + + pay_amount = #{payAmount,jdbcType=DECIMAL}, + + + confirmed_split_amount = #{confirmedSplitAmount,jdbcType=DECIMAL}, + + + refund_amount = #{refundAmount,jdbcType=DECIMAL}, + + + payment_revoke_amount = #{paymentRevokeAmount,jdbcType=DECIMAL}, + + + remaining_split_amount = #{remainingSplitAmount,jdbcType=DECIMAL}, + + + order_code = #{orderCode,jdbcType=VARCHAR}, + + + pile_type = #{pileType,jdbcType=VARCHAR}, + + + due_refund_amount = #{dueRefundAmount,jdbcType=DECIMAL}, + + + settle_amount = #{settleAmount,jdbcType=DECIMAL}, + + + refund_flag = #{refundFlag,jdbcType=VARCHAR}, + + + split_flag = #{splitFlag,jdbcType=VARCHAR}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + + \ No newline at end of file