修改计费信息表结构

This commit is contained in:
wuweihua
2026-09-14 14:53:05 +08:00
parent 479b72b59f
commit 4bd95cb472
21 changed files with 378 additions and 137 deletions
@@ -0,0 +1,26 @@
package com.ruoyi.price.domain;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
/** receivable fee detail prc_income_bill_fee */
@Data
public class PrcIncomeBillFee implements Serializable
{
private static final long serialVersionUID = 1L;
private String feeId;
private String billId;
private String feeType;
private String feeName;
private Long scId;
private BigDecimal amount;
private String currency;
private String roundMode;
private String remark;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
}
@@ -8,10 +8,10 @@ import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/** receivable bill header prc_bill */
/** order info header prc_order_bill */
@Data
@EqualsAndHashCode(callSuper = true)
public class PrcBill extends BaseEntity
public class PrcOrderBill extends BaseEntity
{
private static final long serialVersionUID = 1L;
@@ -66,9 +66,13 @@ public class PrcBill extends BaseEntity
private BigDecimal registrationFee;
private BigDecimal freightAmount;
private BigDecimal surchargeAmount;
private BigDecimal payableTotal;
/** receivable total */
private BigDecimal incomeTotal;
/** payable total */
private BigDecimal payTotal;
private String currency;
private String roundMode;
private List<PrcBillFee> fees;
private List<PrcIncomeBillFee> incomeFees;
private List<PrcPayBillFee> payFees;
}
@@ -6,9 +6,9 @@ import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
/** receivable bill fee detail prc_bill_fee */
/** payable fee detail prc_pay_bill_fee */
@Data
public class PrcBillFee implements Serializable
public class PrcPayBillFee implements Serializable
{
private static final long serialVersionUID = 1L;
@@ -47,6 +47,11 @@ public class TmsPriceQuoteResult implements Serializable
private BigDecimal freightAmount;
/** 附加费合计(按产品关联命中后汇总) */
private BigDecimal surchargeAmount;
/** receivable total (order bill) */
private BigDecimal incomeTotal;
/** payable total (order bill); also quote payable */
private BigDecimal payTotal;
/** quote / legacy field; same as incomeTotal for bill sync */
private BigDecimal payableTotal;
private String currency = "CNY";
/** UP / DOWN / HALF_UP */
@@ -1,17 +0,0 @@
package com.ruoyi.price.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.ruoyi.price.domain.PrcBillFee;
/** receivable bill fee detail mapper */
public interface PrcBillFeeMapper
{
public List<PrcBillFee> selectByBillId(String billId);
public int insertPrcBillFee(PrcBillFee fee);
public int insertBatch(@Param("list") List<PrcBillFee> fees);
public int deleteByBillId(String billId);
}
@@ -1,24 +0,0 @@
package com.ruoyi.price.mapper;
import java.math.BigDecimal;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.ruoyi.price.domain.PrcBill;
/** receivable bill header mapper */
public interface PrcBillMapper
{
public PrcBill selectPrcBillByOrderNo(String orderNo);
public PrcBill selectPrcBillById(String billId);
public List<PrcBill> selectPrcBillList(PrcBill bill);
public int insertPrcBill(PrcBill bill);
public int updatePrcBill(PrcBill bill);
public int updateBillAmounts(@Param("billId") String billId,
@Param("surchargeAmount") BigDecimal surchargeAmount,
@Param("payableTotal") BigDecimal payableTotal);
}
@@ -0,0 +1,17 @@
package com.ruoyi.price.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.ruoyi.price.domain.PrcIncomeBillFee;
/** receivable bill fee mapper */
public interface PrcIncomeBillFeeMapper
{
public List<PrcIncomeBillFee> selectByBillId(String billId);
public int insertPrcIncomeBillFee(PrcIncomeBillFee fee);
public int insertBatch(@Param("list") List<PrcIncomeBillFee> fees);
public int deleteByBillId(String billId);
}
@@ -0,0 +1,25 @@
package com.ruoyi.price.mapper;
import java.math.BigDecimal;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.ruoyi.price.domain.PrcOrderBill;
/** order bill header mapper */
public interface PrcOrderBillMapper
{
public PrcOrderBill selectPrcOrderBillByOrderNo(String orderNo);
public PrcOrderBill selectPrcOrderBillById(String billId);
public List<PrcOrderBill> selectPrcOrderBillList(PrcOrderBill bill);
public int insertPrcOrderBill(PrcOrderBill bill);
public int updatePrcOrderBill(PrcOrderBill bill);
public int updateOrderBillAmounts(@Param("billId") String billId,
@Param("surchargeAmount") BigDecimal surchargeAmount,
@Param("incomeTotal") BigDecimal incomeTotal,
@Param("payTotal") BigDecimal payTotal);
}
@@ -0,0 +1,17 @@
package com.ruoyi.price.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.ruoyi.price.domain.PrcPayBillFee;
/** payable bill fee mapper */
public interface PrcPayBillFeeMapper
{
public List<PrcPayBillFee> selectByBillId(String billId);
public int insertPrcPayBillFee(PrcPayBillFee fee);
public int insertBatch(@Param("list") List<PrcPayBillFee> fees);
public int deleteByBillId(String billId);
}
@@ -1,16 +1,16 @@
package com.ruoyi.price.service;
import java.util.List;
import com.ruoyi.price.domain.PrcBill;
import com.ruoyi.price.domain.PrcOrderBill;
import com.ruoyi.price.domain.vo.TmsPriceBillRequest;
import com.ruoyi.price.domain.vo.TmsPriceQuoteResult;
/** Receivable billing from synced orders. Same price match as quote, persist prc_bill. */
public interface IPrcBillService
/** Order billing: persist prc_order_bill + prc_income_bill_fee. Same price match as quote. */
public interface IPrcOrderBillService
{
TmsPriceQuoteResult bill(TmsPriceBillRequest request);
List<PrcBill> selectBillList(PrcBill query);
List<PrcOrderBill> selectBillList(PrcOrderBill query);
TmsPriceQuoteResult getBill(String billId);
@@ -16,30 +16,30 @@ import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.MessageUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.sign.Md5Utils;
import com.ruoyi.price.domain.PrcBill;
import com.ruoyi.price.domain.PrcBillFee;
import com.ruoyi.price.domain.PrcIncomeBillFee;
import com.ruoyi.price.domain.PrcOrderBill;
import com.ruoyi.price.domain.vo.TmsPriceBillRequest;
import com.ruoyi.price.domain.vo.TmsPriceQuoteFeeLine;
import com.ruoyi.price.domain.vo.TmsPriceQuoteResult;
import com.ruoyi.price.mapper.PrcBillFeeMapper;
import com.ruoyi.price.mapper.PrcBillMapper;
import com.ruoyi.price.mapper.PrcIncomeBillFeeMapper;
import com.ruoyi.price.mapper.PrcOrderBillMapper;
import com.ruoyi.price.search.EsBizLogSupport;
import com.ruoyi.price.search.EsLogType;
import com.ruoyi.price.search.IBillSearchStore;
import com.ruoyi.price.service.IPrcBillService;
import com.ruoyi.price.service.IPrcOrderBillService;
import com.ruoyi.price.service.ITmsPriceQuoteService;
@Service
public class PrcBillServiceImpl implements IPrcBillService
public class PrcOrderBillServiceImpl implements IPrcOrderBillService
{
@Autowired
private ITmsPriceQuoteService tmsPriceQuoteService;
@Autowired
private PrcBillMapper billMapper;
private PrcOrderBillMapper orderBillMapper;
@Autowired
private PrcBillFeeMapper billFeeMapper;
private PrcIncomeBillFeeMapper incomeBillFeeMapper;
@Autowired
private IBillSearchStore billSearchStore;
@@ -73,9 +73,9 @@ public class PrcBillServiceImpl implements IPrcBillService
}
@Override
public List<PrcBill> selectBillList(PrcBill query)
public List<PrcOrderBill> selectBillList(PrcOrderBill query)
{
return billMapper.selectPrcBillList(query);
return orderBillMapper.selectPrcOrderBillList(query);
}
@Override
@@ -85,12 +85,12 @@ public class PrcBillServiceImpl implements IPrcBillService
{
throw new ServiceException(MessageUtils.message("price.bill.billIdRequired"));
}
PrcBill bill = billMapper.selectPrcBillById(billId);
PrcOrderBill bill = orderBillMapper.selectPrcOrderBillById(billId);
if (bill == null)
{
throw new ServiceException(MessageUtils.message("price.bill.notFound"));
}
return toResult(bill, billFeeMapper.selectByBillId(billId));
return toResult(bill, incomeBillFeeMapper.selectByBillId(billId));
}
@Override
@@ -100,12 +100,12 @@ public class PrcBillServiceImpl implements IPrcBillService
{
throw new ServiceException(MessageUtils.message("price.bill.orderNoRequired"));
}
PrcBill bill = billMapper.selectPrcBillByOrderNo(orderNo.trim());
PrcOrderBill bill = orderBillMapper.selectPrcOrderBillByOrderNo(orderNo.trim());
if (bill == null)
{
throw new ServiceException(MessageUtils.message("price.bill.notFound"));
}
return toResult(bill, billFeeMapper.selectByBillId(bill.getBillId()));
return toResult(bill, incomeBillFeeMapper.selectByBillId(bill.getBillId()));
}
private void persistBill(TmsPriceBillRequest request, BigDecimal weight, Date bizDate,
@@ -113,8 +113,8 @@ public class PrcBillServiceImpl implements IPrcBillService
{
String orderNo = request.getOrderNo();
String billKey = Md5Utils.hash(orderNo);
PrcBill existed = billMapper.selectPrcBillByOrderNo(orderNo);
PrcBill bill = existed == null ? new PrcBill() : existed;
PrcOrderBill existed = orderBillMapper.selectPrcOrderBillByOrderNo(orderNo);
PrcOrderBill bill = existed == null ? new PrcOrderBill() : existed;
if (existed == null)
{
bill.setBillId(UUID.randomUUID().toString());
@@ -165,41 +165,45 @@ public class PrcBillServiceImpl implements IPrcBillService
bill.setRegistrationFee(result.getRegistrationFee());
bill.setFreightAmount(result.getFreightAmount());
bill.setSurchargeAmount(result.getSurchargeAmount());
bill.setPayableTotal(result.getPayableTotal());
bill.setIncomeTotal(result.getPayableTotal());
bill.setPayTotal(result.getPayTotal() == null ? BigDecimal.ZERO : result.getPayTotal());
bill.setCurrency(result.getCurrency());
bill.setRoundMode(result.getRoundMode());
result.setBillId(bill.getBillId());
result.setOrderNo(orderNo);
result.setCustomerCode(request.getCustomerCode());
result.setIncomeTotal(bill.getIncomeTotal());
result.setPayTotal(bill.getPayTotal());
result.setPayableTotal(bill.getIncomeTotal());
fillResultOrder(result, bill);
result.setFromCache(Boolean.valueOf(existed != null));
if (existed == null)
{
billMapper.insertPrcBill(bill);
orderBillMapper.insertPrcOrderBill(bill);
}
else
{
billMapper.updatePrcBill(bill);
billFeeMapper.deleteByBillId(bill.getBillId());
orderBillMapper.updatePrcOrderBill(bill);
incomeBillFeeMapper.deleteByBillId(bill.getBillId());
}
List<PrcBillFee> fees = toFeeRows(bill.getBillId(), result);
List<PrcIncomeBillFee> fees = toFeeRows(bill.getBillId(), result);
if (!fees.isEmpty())
{
billFeeMapper.insertBatch(fees);
incomeBillFeeMapper.insertBatch(fees);
}
billSearchStore.save(EsLogType.BILL, orderNo, toRequestJson(request), toResponseJson(result));
}
private List<PrcBillFee> toFeeRows(String billId, TmsPriceQuoteResult result)
private List<PrcIncomeBillFee> toFeeRows(String billId, TmsPriceQuoteResult result)
{
List<PrcBillFee> fees = new ArrayList<PrcBillFee>();
List<PrcIncomeBillFee> fees = new ArrayList<PrcIncomeBillFee>();
if (result.getFeeDetails() == null)
{
return fees;
}
for (TmsPriceQuoteFeeLine line : result.getFeeDetails())
{
PrcBillFee fee = new PrcBillFee();
PrcIncomeBillFee fee = new PrcIncomeBillFee();
fee.setFeeId(UUID.randomUUID().toString());
fee.setBillId(billId);
fee.setFeeType(line.getFeeType());
@@ -214,7 +218,7 @@ public class PrcBillServiceImpl implements IPrcBillService
return fees;
}
private TmsPriceQuoteResult toResult(PrcBill bill, List<PrcBillFee> fees)
private TmsPriceQuoteResult toResult(PrcOrderBill bill, List<PrcIncomeBillFee> fees)
{
TmsPriceQuoteResult r = new TmsPriceQuoteResult();
r.setBillId(bill.getBillId());
@@ -248,14 +252,16 @@ public class PrcBillServiceImpl implements IPrcBillService
r.setRegistrationFee(bill.getRegistrationFee());
r.setFreightAmount(bill.getFreightAmount());
r.setSurchargeAmount(bill.getSurchargeAmount());
r.setPayableTotal(bill.getPayableTotal());
r.setIncomeTotal(bill.getIncomeTotal());
r.setPayTotal(bill.getPayTotal());
r.setPayableTotal(bill.getIncomeTotal());
r.setCurrency(bill.getCurrency());
r.setRoundMode(bill.getRoundMode());
r.setBizDate(bill.getBizDate());
List<TmsPriceQuoteFeeLine> lines = new ArrayList<TmsPriceQuoteFeeLine>();
if (fees != null)
{
for (PrcBillFee fee : fees)
for (PrcIncomeBillFee fee : fees)
{
TmsPriceQuoteFeeLine line = new TmsPriceQuoteFeeLine();
line.setFeeType(fee.getFeeType());
@@ -272,7 +278,7 @@ public class PrcBillServiceImpl implements IPrcBillService
return r;
}
private void fillResultOrder(TmsPriceQuoteResult r, PrcBill bill)
private void fillResultOrder(TmsPriceQuoteResult r, PrcOrderBill bill)
{
r.setTrackingNo(bill.getTrackingNo());
r.setCustomerName(bill.getCustomerName());
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.price.mapper.PrcIncomeBillFeeMapper">
<resultMap type="PrcIncomeBillFee" id="PrcIncomeBillFeeResult">
<id property="feeId" column="fee_id" />
<result property="billId" column="bill_id" />
<result property="feeType" column="fee_type" />
<result property="feeName" column="fee_name" />
<result property="scId" column="sc_id" />
<result property="amount" column="amount" />
<result property="currency" column="currency" />
<result property="roundMode" column="round_mode" />
<result property="remark" column="remark" />
<result property="createTime" column="create_time" />
</resultMap>
<select id="selectByBillId" parameterType="String" resultMap="PrcIncomeBillFeeResult">
select fee_id, bill_id, fee_type, fee_name, sc_id, amount, currency, round_mode, remark, create_time
from prc_income_bill_fee
where bill_id = #{billId}
order by field(fee_type, 'BASIC_FREIGHT', 'REGISTRATION_FEE', 'SURCHARGE'), fee_id
</select>
<insert id="insertPrcIncomeBillFee" parameterType="PrcIncomeBillFee">
insert into prc_income_bill_fee (
fee_id, bill_id, fee_type, fee_name, sc_id, amount, currency, round_mode, remark, create_time
) values (
#{feeId}, #{billId}, #{feeType}, #{feeName}, #{scId}, #{amount}, #{currency}, #{roundMode}, #{remark}, sysdate()
)
</insert>
<insert id="insertBatch" parameterType="java.util.List">
insert into prc_income_bill_fee (
fee_id, bill_id, fee_type, fee_name, sc_id, amount, currency, round_mode, remark, create_time
) values
<foreach collection="list" item="item" separator=",">
(#{item.feeId}, #{item.billId}, #{item.feeType}, #{item.feeName}, #{item.scId}, #{item.amount},
#{item.currency}, #{item.roundMode}, #{item.remark}, sysdate())
</foreach>
</insert>
<delete id="deleteByBillId" parameterType="String">
delete from prc_income_bill_fee where bill_id = #{billId}
</delete>
</mapper>
@@ -2,9 +2,9 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.price.mapper.PrcBillMapper">
<mapper namespace="com.ruoyi.price.mapper.PrcOrderBillMapper">
<resultMap type="PrcBill" id="PrcBillResult">
<resultMap type="PrcOrderBill" id="PrcOrderBillResult">
<id property="billId" column="bill_id" />
<result property="billKey" column="bill_key" />
<result property="orderNo" column="order_no" />
@@ -52,7 +52,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="registrationFee" column="registration_fee" />
<result property="freightAmount" column="freight_amount" />
<result property="surchargeAmount" column="surcharge_amount" />
<result property="payableTotal" column="payable_total" />
<result property="incomeTotal" column="income_total" />
<result property="payTotal" column="pay_total" />
<result property="currency" column="currency" />
<result property="roundMode" column="round_mode" />
<result property="createBy" column="created_by" />
@@ -61,7 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectPrcBillVo">
<sql id="selectPrcOrderBillVo">
select bill_id, bill_key, order_no, tracking_no, customer_id, customer_code, customer_name,
pieces, actual_weight, volume, volume_weight, pkg_length, pkg_width, pkg_height,
shipper_name, consignee_name, dest_postcode, warehouse_code, order_time, order_remark,
@@ -70,23 +71,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
set_type, bind_priority, customer_priceset_id, product_country_id,
weight_min, weight_max, weight_label, effective_date, charge_weight,
freight_rate, base_freight_rate, discount_percent, registration_fee,
freight_amount, surcharge_amount, payable_total, currency, round_mode,
freight_amount, surcharge_amount, income_total, pay_total, currency, round_mode,
created_by, create_time, updated_by, update_time
from prc_bill
from prc_order_bill
</sql>
<select id="selectPrcBillByOrderNo" parameterType="String" resultMap="PrcBillResult">
<include refid="selectPrcBillVo"/>
<select id="selectPrcOrderBillByOrderNo" parameterType="String" resultMap="PrcOrderBillResult">
<include refid="selectPrcOrderBillVo"/>
where order_no = #{orderNo}
</select>
<select id="selectPrcBillById" parameterType="String" resultMap="PrcBillResult">
<include refid="selectPrcBillVo"/>
<select id="selectPrcOrderBillById" parameterType="String" resultMap="PrcOrderBillResult">
<include refid="selectPrcOrderBillVo"/>
where bill_id = #{billId}
</select>
<select id="selectPrcBillList" parameterType="PrcBill" resultMap="PrcBillResult">
<include refid="selectPrcBillVo"/>
<select id="selectPrcOrderBillList" parameterType="PrcOrderBill" resultMap="PrcOrderBillResult">
<include refid="selectPrcOrderBillVo"/>
<where>
<if test="orderNo != null and orderNo != ''">
AND order_no like concat('%', #{orderNo}, '%')
@@ -122,8 +123,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
order by create_time desc, bill_id desc
</select>
<insert id="insertPrcBill" parameterType="PrcBill">
insert into prc_bill (
<insert id="insertPrcOrderBill" parameterType="PrcOrderBill">
insert into prc_order_bill (
bill_id, bill_key, order_no, tracking_no, customer_id, customer_code, customer_name,
pieces, actual_weight, volume, volume_weight, pkg_length, pkg_width, pkg_height,
shipper_name, consignee_name, dest_postcode, warehouse_code, order_time, order_remark,
@@ -132,7 +133,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
set_type, bind_priority, customer_priceset_id, product_country_id,
weight_min, weight_max, weight_label, effective_date, charge_weight,
freight_rate, base_freight_rate, discount_percent, registration_fee,
freight_amount, surcharge_amount, payable_total, currency, round_mode,
freight_amount, surcharge_amount, income_total, pay_total, currency, round_mode,
create_time
) values (
#{billId}, #{billKey}, #{orderNo}, #{trackingNo}, #{customerId}, #{customerCode}, #{customerName},
@@ -143,13 +144,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{setType}, #{bindPriority}, #{customerPricesetId}, #{productCountryId},
#{weightMin}, #{weightMax}, #{weightLabel}, #{effectiveDate}, #{chargeWeight},
#{freightRate}, #{baseFreightRate}, #{discountPercent}, #{registrationFee},
#{freightAmount}, #{surchargeAmount}, #{payableTotal}, #{currency}, #{roundMode},
#{freightAmount}, #{surchargeAmount}, #{incomeTotal}, #{payTotal}, #{currency}, #{roundMode},
sysdate()
)
</insert>
<update id="updatePrcBill" parameterType="PrcBill">
update prc_bill
<update id="updatePrcOrderBill" parameterType="PrcOrderBill">
update prc_order_bill
set bill_key = #{billKey},
tracking_no = #{trackingNo},
customer_id = #{customerId},
@@ -195,17 +196,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
registration_fee = #{registrationFee},
freight_amount = #{freightAmount},
surcharge_amount = #{surchargeAmount},
payable_total = #{payableTotal},
income_total = #{incomeTotal},
pay_total = #{payTotal},
currency = #{currency},
round_mode = #{roundMode},
update_time = sysdate()
where bill_id = #{billId}
</update>
<update id="updateBillAmounts">
update prc_bill
<update id="updateOrderBillAmounts">
update prc_order_bill
set surcharge_amount = #{surchargeAmount},
payable_total = #{payableTotal},
income_total = #{incomeTotal},
pay_total = #{payTotal},
update_time = sysdate()
where bill_id = #{billId}
</update>
@@ -2,9 +2,9 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.price.mapper.PrcBillFeeMapper">
<mapper namespace="com.ruoyi.price.mapper.PrcPayBillFeeMapper">
<resultMap type="PrcBillFee" id="PrcBillFeeResult">
<resultMap type="PrcPayBillFee" id="PrcPayBillFeeResult">
<id property="feeId" column="fee_id" />
<result property="billId" column="bill_id" />
<result property="feeType" column="fee_type" />
@@ -17,15 +17,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="createTime" column="create_time" />
</resultMap>
<select id="selectByBillId" parameterType="String" resultMap="PrcBillFeeResult">
<select id="selectByBillId" parameterType="String" resultMap="PrcPayBillFeeResult">
select fee_id, bill_id, fee_type, fee_name, sc_id, amount, currency, round_mode, remark, create_time
from prc_bill_fee
from prc_pay_bill_fee
where bill_id = #{billId}
order by field(fee_type, 'BASIC_FREIGHT', 'REGISTRATION_FEE', 'SURCHARGE'), fee_id
</select>
<insert id="insertPrcBillFee" parameterType="PrcBillFee">
insert into prc_bill_fee (
<insert id="insertPrcPayBillFee" parameterType="PrcPayBillFee">
insert into prc_pay_bill_fee (
fee_id, bill_id, fee_type, fee_name, sc_id, amount, currency, round_mode, remark, create_time
) values (
#{feeId}, #{billId}, #{feeType}, #{feeName}, #{scId}, #{amount}, #{currency}, #{roundMode}, #{remark}, sysdate()
@@ -33,7 +33,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</insert>
<insert id="insertBatch" parameterType="java.util.List">
insert into prc_bill_fee (
insert into prc_pay_bill_fee (
fee_id, bill_id, fee_type, fee_name, sc_id, amount, currency, round_mode, remark, create_time
) values
<foreach collection="list" item="item" separator=",">
@@ -43,6 +43,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</insert>
<delete id="deleteByBillId" parameterType="String">
delete from prc_bill_fee where bill_id = #{billId}
delete from prc_pay_bill_fee where bill_id = #{billId}
</delete>
</mapper>