订单分账记录表, 添加运营商id, 站点id 字段

This commit is contained in:
Guoqs
2025-01-16 15:34:23 +08:00
parent e65637e9c2
commit 363a5b62cc
4 changed files with 98 additions and 27 deletions

View File

@@ -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,9 +9,6 @@ import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import lombok.experimental.SuperBuilder;
import java.math.BigDecimal;
import java.util.Date;
/**
* 订单分账记录表
*/
@@ -30,6 +29,16 @@ public class OrderSplitRecord {
*/
private String orderCode;
/**
* 订单所属运营商id
*/
private String merchantId;
/**
* 订单所属站点id
*/
private String stationId;
/**
* 分账状态
*/

View File

@@ -1,26 +1,27 @@
package com.jsowell.pile.mapper;
import com.jsowell.pile.domain.OrderSplitRecord;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface OrderSplitRecordMapper {
// int deleteByPrimaryKey(Integer id);
int deleteByPrimaryKey(Integer id);
// int insertSelective(OrderSplitRecord record);
int insertSelective(OrderSplitRecord record);
// OrderSplitRecord selectByPrimaryKey(Integer id);
OrderSplitRecord selectByPrimaryKey(Integer id);
// int updateByPrimaryKeySelective(OrderSplitRecord record);
int updateByPrimaryKeySelective(OrderSplitRecord record);
// int updateBatchSelective(List<OrderSplitRecord> list);
int updateBatchSelective(List<OrderSplitRecord> list);
int batchInsert(@Param("list") List<OrderSplitRecord> list);
// int insertOrUpdate(OrderSplitRecord record);
int insertOrUpdate(OrderSplitRecord record);
// int insertOrUpdateSelective(OrderSplitRecord record);
int insertOrUpdateSelective(OrderSplitRecord record);
List<OrderSplitRecord> selectByOrderCode(String orderCode);
}

View File

@@ -80,6 +80,8 @@ public class OrderSplitRecordServiceImpl implements OrderSplitRecordService {
orderSplitRecord.setSettleAmount(settleAmount);
orderSplitRecord.setTradeDate(DateUtils.getDate()); // 订单结算日期 yyyy-MM-dd
if (orderInfoDetailVO != null) {
orderSplitRecord.setMerchantId(orderInfoDetailVO.getMerchantId());
orderSplitRecord.setStationId(orderInfoDetailVO.getStationId());
orderSplitRecord.setElectricityAmount(orderInfoDetailVO.getTotalElectricityAmount());
orderSplitRecord.setServiceAmount(orderInfoDetailVO.getTotalServiceAmount());
}

View File

@@ -6,6 +6,8 @@
<!--@Table order_split_record-->
<id column="id" jdbcType="INTEGER" property="id" />
<result column="order_code" jdbcType="VARCHAR" property="orderCode" />
<result column="merchant_id" jdbcType="VARCHAR" property="merchantId" />
<result column="station_id" jdbcType="VARCHAR" property="stationId" />
<result column="status" jdbcType="VARCHAR" property="status" />
<result column="settle_amount" jdbcType="DECIMAL" property="settleAmount" />
<result column="electricity_amount" jdbcType="DECIMAL" property="electricityAmount" />
@@ -27,10 +29,10 @@
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, order_code, `status`, settle_amount, electricity_amount, service_amount, trade_date,
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, merchant_id, station_id, `status`, settle_amount, electricity_amount,
service_amount, trade_date, 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
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<!--@mbg.generated-->
@@ -51,6 +53,12 @@
<if test="orderCode != null">
order_code,
</if>
<if test="merchantId != null">
merchant_id,
</if>
<if test="stationId != null">
station_id,
</if>
<if test="status != null">
`status`,
</if>
@@ -110,6 +118,12 @@
<if test="orderCode != null">
#{orderCode,jdbcType=VARCHAR},
</if>
<if test="merchantId != null">
#{merchantId,jdbcType=VARCHAR},
</if>
<if test="stationId != null">
#{stationId,jdbcType=VARCHAR},
</if>
<if test="status != null">
#{status,jdbcType=VARCHAR},
</if>
@@ -173,6 +187,12 @@
<if test="orderCode != null">
order_code = #{orderCode,jdbcType=VARCHAR},
</if>
<if test="merchantId != null">
merchant_id = #{merchantId,jdbcType=VARCHAR},
</if>
<if test="stationId != null">
station_id = #{stationId,jdbcType=VARCHAR},
</if>
<if test="status != null">
`status` = #{status,jdbcType=VARCHAR},
</if>
@@ -241,6 +261,20 @@
</if>
</foreach>
</trim>
<trim prefix="merchant_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.merchantId != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.merchantId,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="station_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.stationId != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.stationId,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="`status` = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.status != null">
@@ -376,20 +410,21 @@
<insert id="batchInsert" keyColumn="id" keyProperty="id" parameterType="map" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into order_split_record
(order_code, `status`, settle_amount, electricity_amount, service_amount, trade_date,
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)
(order_code, merchant_id, station_id, `status`, settle_amount, electricity_amount,
service_amount, trade_date, 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
<foreach collection="list" item="item" separator=",">
(#{item.orderCode,jdbcType=VARCHAR}, #{item.status,jdbcType=VARCHAR}, #{item.settleAmount,jdbcType=DECIMAL},
#{item.electricityAmount,jdbcType=DECIMAL}, #{item.serviceAmount,jdbcType=DECIMAL},
#{item.tradeDate,jdbcType=VARCHAR}, #{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})
(#{item.orderCode,jdbcType=VARCHAR}, #{item.merchantId,jdbcType=VARCHAR}, #{item.stationId,jdbcType=VARCHAR},
#{item.status,jdbcType=VARCHAR}, #{item.settleAmount,jdbcType=DECIMAL}, #{item.electricityAmount,jdbcType=DECIMAL},
#{item.serviceAmount,jdbcType=DECIMAL}, #{item.tradeDate,jdbcType=VARCHAR}, #{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}
)
</foreach>
</insert>
<insert id="insertOrUpdate" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.OrderSplitRecord" useGeneratedKeys="true">
@@ -400,6 +435,8 @@
id,
</if>
order_code,
merchant_id,
station_id,
`status`,
settle_amount,
electricity_amount,
@@ -425,6 +462,8 @@
#{id,jdbcType=INTEGER},
</if>
#{orderCode,jdbcType=VARCHAR},
#{merchantId,jdbcType=VARCHAR},
#{stationId,jdbcType=VARCHAR},
#{status,jdbcType=VARCHAR},
#{settleAmount,jdbcType=DECIMAL},
#{electricityAmount,jdbcType=DECIMAL},
@@ -450,6 +489,8 @@
id = #{id,jdbcType=INTEGER},
</if>
order_code = #{orderCode,jdbcType=VARCHAR},
merchant_id = #{merchantId,jdbcType=VARCHAR},
station_id = #{stationId,jdbcType=VARCHAR},
`status` = #{status,jdbcType=VARCHAR},
settle_amount = #{settleAmount,jdbcType=DECIMAL},
electricity_amount = #{electricityAmount,jdbcType=DECIMAL},
@@ -480,6 +521,12 @@
<if test="orderCode != null">
order_code,
</if>
<if test="merchantId != null">
merchant_id,
</if>
<if test="stationId != null">
station_id,
</if>
<if test="status != null">
`status`,
</if>
@@ -543,6 +590,12 @@
<if test="orderCode != null">
#{orderCode,jdbcType=VARCHAR},
</if>
<if test="merchantId != null">
#{merchantId,jdbcType=VARCHAR},
</if>
<if test="stationId != null">
#{stationId,jdbcType=VARCHAR},
</if>
<if test="status != null">
#{status,jdbcType=VARCHAR},
</if>
@@ -606,6 +659,12 @@
<if test="orderCode != null">
order_code = #{orderCode,jdbcType=VARCHAR},
</if>
<if test="merchantId != null">
merchant_id = #{merchantId,jdbcType=VARCHAR},
</if>
<if test="stationId != null">
station_id = #{stationId,jdbcType=VARCHAR},
</if>
<if test="status != null">
`status` = #{status,jdbcType=VARCHAR},
</if>