diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/domain/OrderSplitRecord.java b/jsowell-pile/src/main/java/com/jsowell/pile/domain/OrderSplitRecord.java index 3f65df5f5..d3424afcd 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/domain/OrderSplitRecord.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/domain/OrderSplitRecord.java @@ -1,5 +1,7 @@ package com.jsowell.pile.domain; +import java.math.BigDecimal; +import java.util.Date; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -7,12 +9,9 @@ import lombok.NoArgsConstructor; import lombok.experimental.Accessors; import lombok.experimental.SuperBuilder; -import java.math.BigDecimal; -import java.util.Date; - /** - * 订单分账记录表 - */ + * 订单分账记录表 + */ @Data @Accessors(chain = true) @SuperBuilder @@ -21,30 +20,30 @@ import java.util.Date; @NoArgsConstructor public class OrderSplitRecord { /** - * 主键 - */ + * 主键 + */ private Integer id; /** - * 订单编号 - */ + * 订单编号 + */ private String orderCode; /** - * 订单结算金额(总金额) - */ + * 分账状态 + */ + private String status; + + /** + * 订单结算金额(总金额) + */ private BigDecimal settleAmount; /** - * 汇付用户id - */ + * 汇付用户id + */ private String adapayMemberId; - /** - * 分账状态 - */ - private String status; - /** * 支付对象id */ @@ -56,52 +55,52 @@ public class OrderSplitRecord { private String paymentConfirmId; /** - * 电费分成比例 - */ + * 电费分成比例 + */ private BigDecimal electricitySplitRatio; /** - * 电费分成金额 - */ + * 电费分成金额 + */ private BigDecimal electricitySplitAmount; /** - * 服务费分成比例 - */ + * 服务费分成比例 + */ private BigDecimal serviceSplitRatio; /** - * 服务费分成金额 - */ + * 服务费分成金额 + */ private BigDecimal serviceSplitAmount; /** - * 备注 - */ + * 备注 + */ private String remark; /** - * 创建人 - */ + * 创建人 + */ private String createBy; /** - * 创建时间 - */ + * 创建时间 + */ private Date createTime; /** - * 更新人 - */ + * 更新人 + */ private String updateBy; /** - * 更新时间 - */ + * 更新时间 + */ private Date updateTime; /** - * 删除标识(0-正常; 1-删除) - */ + * 删除标识(0-正常; 1-删除) + */ private String delFlag; } \ No newline at end of file diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/mapper/OrderSplitRecordMapper.java b/jsowell-pile/src/main/java/com/jsowell/pile/mapper/OrderSplitRecordMapper.java index a7debf2b8..d0b812712 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/mapper/OrderSplitRecordMapper.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/mapper/OrderSplitRecordMapper.java @@ -6,9 +6,19 @@ import org.apache.ibatis.annotations.Param; import java.util.List; public interface OrderSplitRecordMapper { + int deleteByPrimaryKey(Integer id); - /** - * 批量保存订单拆分记录 - */ - int batchInsert(@Param("list") List orderSplitRecords); + int insertSelective(OrderSplitRecord record); + + OrderSplitRecord selectByPrimaryKey(Integer id); + + int updateByPrimaryKeySelective(OrderSplitRecord record); + + int updateBatchSelective(List list); + + int batchInsert(@Param("list") List list); + + int insertOrUpdate(OrderSplitRecord record); + + int insertOrUpdateSelective(OrderSplitRecord record); } \ No newline at end of file diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/OrderSplitRecordService.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/OrderSplitRecordService.java index 79fac5a13..bc3ce28f1 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/OrderSplitRecordService.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/OrderSplitRecordService.java @@ -1,5 +1,25 @@ package com.jsowell.pile.service; -public interface OrderSplitRecordService{ +import com.jsowell.pile.domain.OrderSplitRecord; +import java.util.List; + +public interface OrderSplitRecordService { + + int deleteByPrimaryKey(Integer id); + + int insertOrUpdate(OrderSplitRecord record); + + int insertOrUpdateSelective(OrderSplitRecord record); + + int insertSelective(OrderSplitRecord record); + + OrderSplitRecord selectByPrimaryKey(Integer id); + + int updateByPrimaryKeySelective(OrderSplitRecord record); + + int updateBatchSelective(List list); + + int batchInsert(List list); } + diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/OrderSplitRecordServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/OrderSplitRecordServiceImpl.java index 91bfa2d96..0fe9ff755 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/OrderSplitRecordServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/OrderSplitRecordServiceImpl.java @@ -7,10 +7,51 @@ import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.List; + @Service -public class OrderSplitRecordServiceImpl implements OrderSplitRecordService{ +public class OrderSplitRecordServiceImpl implements OrderSplitRecordService { @Resource private OrderSplitRecordMapper orderSplitRecordMapper; + @Override + public int deleteByPrimaryKey(Integer id) { + return orderSplitRecordMapper.deleteByPrimaryKey(id); + } + + @Override + public int insertOrUpdate(OrderSplitRecord record) { + return orderSplitRecordMapper.insertOrUpdate(record); + } + + @Override + public int insertOrUpdateSelective(OrderSplitRecord record) { + return orderSplitRecordMapper.insertOrUpdateSelective(record); + } + + @Override + public int insertSelective(OrderSplitRecord record) { + return orderSplitRecordMapper.insertSelective(record); + } + + @Override + public OrderSplitRecord selectByPrimaryKey(Integer id) { + return orderSplitRecordMapper.selectByPrimaryKey(id); + } + + @Override + public int updateByPrimaryKeySelective(OrderSplitRecord record) { + return orderSplitRecordMapper.updateByPrimaryKeySelective(record); + } + + @Override + public int updateBatchSelective(List list) { + return orderSplitRecordMapper.updateBatchSelective(list); + } + + @Override + public int batchInsert(List list) { + return orderSplitRecordMapper.batchInsert(list); + } } + diff --git a/jsowell-pile/src/main/resources/mapper/pile/OrderSplitRecordMapper.xml b/jsowell-pile/src/main/resources/mapper/pile/OrderSplitRecordMapper.xml index a3f9a56cd..f06ea4a8e 100644 --- a/jsowell-pile/src/main/resources/mapper/pile/OrderSplitRecordMapper.xml +++ b/jsowell-pile/src/main/resources/mapper/pile/OrderSplitRecordMapper.xml @@ -24,24 +24,553 @@ - id, `status`, order_code, settle_amount, adapay_member_id, payment_id, payment_confirm_id, electricity_split_ratio, - electricity_split_amount, service_split_ratio, service_split_amount, remark, create_by, - create_time, update_by, update_time, del_flag + id, order_code, `status`, settle_amount, adapay_member_id, payment_id, payment_confirm_id, + electricity_split_ratio, electricity_split_amount, service_split_ratio, service_split_amount, + remark, create_by, create_time, update_by, update_time, del_flag - + + + + delete from order_split_record + where id = #{id,jdbcType=INTEGER} + + + + insert into order_split_record + + + order_code, + + + `status`, + + + settle_amount, + + + adapay_member_id, + + + payment_id, + + + payment_confirm_id, + + + electricity_split_ratio, + + + electricity_split_amount, + + + service_split_ratio, + + + service_split_amount, + + + remark, + + + create_by, + + + create_time, + + + update_by, + + + update_time, + + + del_flag, + + + + + #{orderCode,jdbcType=VARCHAR}, + + + #{status,jdbcType=VARCHAR}, + + + #{settleAmount,jdbcType=DECIMAL}, + + + #{adapayMemberId,jdbcType=VARCHAR}, + + + #{paymentId,jdbcType=VARCHAR}, + + + #{paymentConfirmId,jdbcType=VARCHAR}, + + + #{electricitySplitRatio,jdbcType=DECIMAL}, + + + #{electricitySplitAmount,jdbcType=DECIMAL}, + + + #{serviceSplitRatio,jdbcType=DECIMAL}, + + + #{serviceSplitAmount,jdbcType=DECIMAL}, + + + #{remark,jdbcType=VARCHAR}, + + + #{createBy,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=TIMESTAMP}, + + + #{updateBy,jdbcType=VARCHAR}, + + + #{updateTime,jdbcType=TIMESTAMP}, + + + #{delFlag,jdbcType=VARCHAR}, + + + + + + update order_split_record + + + order_code = #{orderCode,jdbcType=VARCHAR}, + + + `status` = #{status,jdbcType=VARCHAR}, + + + settle_amount = #{settleAmount,jdbcType=DECIMAL}, + + + adapay_member_id = #{adapayMemberId,jdbcType=VARCHAR}, + + + payment_id = #{paymentId,jdbcType=VARCHAR}, + + + payment_confirm_id = #{paymentConfirmId,jdbcType=VARCHAR}, + + + electricity_split_ratio = #{electricitySplitRatio,jdbcType=DECIMAL}, + + + electricity_split_amount = #{electricitySplitAmount,jdbcType=DECIMAL}, + + + service_split_ratio = #{serviceSplitRatio,jdbcType=DECIMAL}, + + + service_split_amount = #{serviceSplitAmount,jdbcType=DECIMAL}, + + + remark = #{remark,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}, + + + where id = #{id,jdbcType=INTEGER} + + + + update order_split_record + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.orderCode,jdbcType=VARCHAR} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.status,jdbcType=VARCHAR} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.settleAmount,jdbcType=DECIMAL} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.adapayMemberId,jdbcType=VARCHAR} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.paymentId,jdbcType=VARCHAR} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.paymentConfirmId,jdbcType=VARCHAR} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.electricitySplitRatio,jdbcType=DECIMAL} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.electricitySplitAmount,jdbcType=DECIMAL} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.serviceSplitRatio,jdbcType=DECIMAL} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.serviceSplitAmount,jdbcType=DECIMAL} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.remark,jdbcType=VARCHAR} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.createBy,jdbcType=VARCHAR} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.updateBy,jdbcType=VARCHAR} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.updateTime,jdbcType=TIMESTAMP} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.delFlag,jdbcType=VARCHAR} + + + + + where id in + + #{item.id,jdbcType=INTEGER} + + insert into order_split_record - (`status`, order_code, settle_amount, adapay_member_id, payment_id, payment_confirm_id, electricity_split_ratio, - electricity_split_amount, service_split_ratio, service_split_amount, remark, create_by) + (order_code, `status`, settle_amount, adapay_member_id, payment_id, payment_confirm_id, + electricity_split_ratio, electricity_split_amount, service_split_ratio, service_split_amount, + remark, create_by, create_time, update_by, update_time, del_flag) values - (#{item.status,jdbcType=VARCHAR}, #{item.orderCode,jdbcType=VARCHAR}, #{item.settleAmount,jdbcType=DECIMAL}, - #{item.adapayMemberId,jdbcType=VARCHAR}, #{item.paymentId,jdbcType=VARCHAR}, #{item.paymentConfirmId,jdbcType=VARCHAR}, - #{item.electricitySplitRatio,jdbcType=DECIMAL}, #{item.electricitySplitAmount,jdbcType=DECIMAL}, - #{item.serviceSplitRatio,jdbcType=DECIMAL}, #{item.serviceSplitAmount,jdbcType=DECIMAL}, #{item.remark,jdbcType=VARCHAR}, - #{item.createBy,jdbcType=VARCHAR}) + (#{item.orderCode,jdbcType=VARCHAR}, #{item.status,jdbcType=VARCHAR}, #{item.settleAmount,jdbcType=DECIMAL}, + #{item.adapayMemberId,jdbcType=VARCHAR}, #{item.paymentId,jdbcType=VARCHAR}, #{item.paymentConfirmId,jdbcType=VARCHAR}, + #{item.electricitySplitRatio,jdbcType=DECIMAL}, #{item.electricitySplitAmount,jdbcType=DECIMAL}, + #{item.serviceSplitRatio,jdbcType=DECIMAL}, #{item.serviceSplitAmount,jdbcType=DECIMAL}, + #{item.remark,jdbcType=VARCHAR}, #{item.createBy,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP}, + #{item.updateBy,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP}, #{item.delFlag,jdbcType=VARCHAR} + ) + + + insert into order_split_record + + + id, + + order_code, + `status`, + settle_amount, + adapay_member_id, + payment_id, + payment_confirm_id, + electricity_split_ratio, + electricity_split_amount, + service_split_ratio, + service_split_amount, + remark, + create_by, + create_time, + update_by, + update_time, + del_flag, + + values + + + #{id,jdbcType=INTEGER}, + + #{orderCode,jdbcType=VARCHAR}, + #{status,jdbcType=VARCHAR}, + #{settleAmount,jdbcType=DECIMAL}, + #{adapayMemberId,jdbcType=VARCHAR}, + #{paymentId,jdbcType=VARCHAR}, + #{paymentConfirmId,jdbcType=VARCHAR}, + #{electricitySplitRatio,jdbcType=DECIMAL}, + #{electricitySplitAmount,jdbcType=DECIMAL}, + #{serviceSplitRatio,jdbcType=DECIMAL}, + #{serviceSplitAmount,jdbcType=DECIMAL}, + #{remark,jdbcType=VARCHAR}, + #{createBy,jdbcType=VARCHAR}, + #{createTime,jdbcType=TIMESTAMP}, + #{updateBy,jdbcType=VARCHAR}, + #{updateTime,jdbcType=TIMESTAMP}, + #{delFlag,jdbcType=VARCHAR}, + + on duplicate key update + + + id = #{id,jdbcType=INTEGER}, + + order_code = #{orderCode,jdbcType=VARCHAR}, + `status` = #{status,jdbcType=VARCHAR}, + settle_amount = #{settleAmount,jdbcType=DECIMAL}, + adapay_member_id = #{adapayMemberId,jdbcType=VARCHAR}, + payment_id = #{paymentId,jdbcType=VARCHAR}, + payment_confirm_id = #{paymentConfirmId,jdbcType=VARCHAR}, + electricity_split_ratio = #{electricitySplitRatio,jdbcType=DECIMAL}, + electricity_split_amount = #{electricitySplitAmount,jdbcType=DECIMAL}, + service_split_ratio = #{serviceSplitRatio,jdbcType=DECIMAL}, + service_split_amount = #{serviceSplitAmount,jdbcType=DECIMAL}, + remark = #{remark,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}, + + + + + insert into order_split_record + + + id, + + + order_code, + + + `status`, + + + settle_amount, + + + adapay_member_id, + + + payment_id, + + + payment_confirm_id, + + + electricity_split_ratio, + + + electricity_split_amount, + + + service_split_ratio, + + + service_split_amount, + + + remark, + + + create_by, + + + create_time, + + + update_by, + + + update_time, + + + del_flag, + + + values + + + #{id,jdbcType=INTEGER}, + + + #{orderCode,jdbcType=VARCHAR}, + + + #{status,jdbcType=VARCHAR}, + + + #{settleAmount,jdbcType=DECIMAL}, + + + #{adapayMemberId,jdbcType=VARCHAR}, + + + #{paymentId,jdbcType=VARCHAR}, + + + #{paymentConfirmId,jdbcType=VARCHAR}, + + + #{electricitySplitRatio,jdbcType=DECIMAL}, + + + #{electricitySplitAmount,jdbcType=DECIMAL}, + + + #{serviceSplitRatio,jdbcType=DECIMAL}, + + + #{serviceSplitAmount,jdbcType=DECIMAL}, + + + #{remark,jdbcType=VARCHAR}, + + + #{createBy,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=TIMESTAMP}, + + + #{updateBy,jdbcType=VARCHAR}, + + + #{updateTime,jdbcType=TIMESTAMP}, + + + #{delFlag,jdbcType=VARCHAR}, + + + on duplicate key update + + + id = #{id,jdbcType=INTEGER}, + + + order_code = #{orderCode,jdbcType=VARCHAR}, + + + `status` = #{status,jdbcType=VARCHAR}, + + + settle_amount = #{settleAmount,jdbcType=DECIMAL}, + + + adapay_member_id = #{adapayMemberId,jdbcType=VARCHAR}, + + + payment_id = #{paymentId,jdbcType=VARCHAR}, + + + payment_confirm_id = #{paymentConfirmId,jdbcType=VARCHAR}, + + + electricity_split_ratio = #{electricitySplitRatio,jdbcType=DECIMAL}, + + + electricity_split_amount = #{electricitySplitAmount,jdbcType=DECIMAL}, + + + service_split_ratio = #{serviceSplitRatio,jdbcType=DECIMAL}, + + + service_split_amount = #{serviceSplitAmount,jdbcType=DECIMAL}, + + + remark = #{remark,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}, + + + \ No newline at end of file