修改计费信息表结构

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,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>