增加订单主表

This commit is contained in:
wuweihua
2026-10-16 17:27:11 +08:00
parent e227c6a80f
commit db396458c5
25 changed files with 1326 additions and 302 deletions
@@ -108,6 +108,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
limit #{limit}
</select>
<delete id="deleteByTransferNo" parameterType="String">
delete from prc_billing_task where transfer_no = #{transferNo}
</delete>
<insert id="insertPrcBillingTask" parameterType="PrcBillingTask" useGeneratedKeys="true" keyProperty="taskId">
insert into prc_billing_task (
transfer_no, tracking_no, order_no, customer_code, bill_type, success_status,
@@ -8,6 +8,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="PrcOrderBill" id="PrcOrderBillResult">
<id property="billId" column="bill_id" />
<result property="orderId" column="order_id" />
<result property="billKey" column="bill_key" />
<result property="orderNo" column="order_no" />
<result property="trackingNo" column="tracking_no" />
@@ -84,7 +85,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectPrcOrderBillVo">
select bill_id, bill_key, order_no, tracking_no, transfer_no,
select bill_id, order_id, bill_key, order_no, tracking_no, transfer_no,
belong_saler, belong_saler_code, settlement_man, settlement_man_code, service_man, service_man_code,
customer_id, customer_code, customer_name,
pieces, actual_weight, receive_weight, volume, volume_weight, pkg_length, pkg_width, pkg_height,
@@ -102,11 +103,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<!-- 应收生成专用来源快照:income_total 只汇总当前仍未出账的费用。 -->
<sql id="selectArBillSourceVo">
select p.bill_id, p.bill_key, p.order_no, p.tracking_no, p.transfer_no,
select p.bill_id, p.order_id, p.bill_key, p.order_no, p.tracking_no, p.transfer_no,
p.belong_saler, p.belong_saler_code, p.settlement_man, p.settlement_man_code, p.service_man, p.service_man_code,
p.customer_id, p.customer_code, p.customer_name,
p.pieces, p.actual_weight, p.receive_weight, p.volume, p.volume_weight, p.pkg_length, p.pkg_width, p.pkg_height,
p.shipper_name, p.consignee_name, p.dest_postcode, p.warehouse_code, p.order_time, e.pickup_date, p.order_remark,
p.shipper_name, p.consignee_name, p.dest_postcode, p.warehouse_code, p.order_time, o.pickup_date, p.order_remark,
p.product_code, p.product_name, p.country_code, p.country_name, p.weight, p.biz_date, p.tms_id,
p.match_source, p.match_message, p.price_set_id, p.price_set_code, p.price_set_name,
p.set_type, p.bind_priority, p.customer_priceset_id, p.psv_id, p.psd_id, p.product_country_id,
@@ -121,7 +122,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
p.customer_active_status, p.credit_arrears_status, p.refund_status, p.billing_fail_status, p.round_mode,
p.created_by, p.create_time, p.updated_by, p.update_time
from prc_order_bill p
left join prc_order_bill_ext e on e.bill_id = p.bill_id
left join prc_order o on o.order_id = p.order_id
</sql>
<select id="selectPrcOrderBillByOrderNo" parameterType="String" resultMap="PrcOrderBillResult">
@@ -540,7 +541,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<insert id="insertPrcOrderBill" parameterType="PrcOrderBill">
insert into prc_order_bill (
bill_id, bill_key, order_no, tracking_no, transfer_no,
bill_id, order_id, bill_key, order_no, tracking_no, transfer_no,
belong_saler, belong_saler_code, settlement_man, settlement_man_code, service_man, service_man_code,
customer_id, customer_code, customer_name,
pieces, actual_weight, receive_weight, volume, volume_weight, pkg_length, pkg_width, pkg_height,
@@ -554,7 +555,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
customer_active_status, credit_arrears_status, refund_status, billing_fail_status, round_mode,
create_time
) values (
#{billId}, #{billKey}, #{orderNo}, #{trackingNo}, #{transferNo},
#{billId}, #{orderId}, #{billKey}, #{orderNo}, #{trackingNo}, #{transferNo},
#{belongSaler}, #{belongSalerCode}, #{settlementMan}, #{settlementManCode}, #{serviceMan}, #{serviceManCode},
#{customerId}, #{customerCode}, #{customerName},
#{pieces}, #{actualWeight}, #{receiveWeight}, #{volume}, #{volumeWeight}, #{pkgLength}, #{pkgWidth}, #{pkgHeight},
@@ -573,6 +574,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<update id="updatePrcOrderBill" parameterType="PrcOrderBill">
update prc_order_bill
set bill_key = #{billKey},
order_id = #{orderId},
tracking_no = #{trackingNo},
transfer_no = #{transferNo},
belong_saler = #{belongSaler},
@@ -2,10 +2,10 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bms.price.mapper.PrcOrderBillExtMapper">
<mapper namespace="com.bms.price.mapper.PrcOrderExtMapper">
<resultMap type="PrcOrderBillExt" id="PrcOrderBillExtResult">
<id property="billId" column="bill_id" />
<resultMap type="PrcOrderExt" id="PrcOrderExtResult">
<id property="orderId" column="order_id" />
<result property="orderNo" column="order_no" />
<result property="upstreamId" column="upstream_id" />
<result property="lineNo" column="line_no" />
@@ -63,7 +63,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="importState" column="import_state" />
<result property="importCountry" column="import_country" />
<result property="buyerid" column="buyerid" />
<result property="orderStatus" column="order_status" />
<result property="createAt" column="create_at" />
<result property="payType" column="pay_type" />
<result property="lineCode" column="line_code" />
@@ -71,7 +70,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="productType" column="product_type" />
<result property="lineType" column="line_type" />
<result property="cargoName" column="cargo_name" />
<result property="productFloorCode" column="product_floor_code" />
<result property="orderInsurance" column="order_insurance" />
<result property="productSumPrice" column="product_sum_price" />
<result property="productSum" column="product_sum" />
@@ -81,7 +79,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="productFloor" column="product_floor" />
<result property="latestTrajectory" column="latest_trajectory" />
<result property="wayBill" column="way_bill" />
<result property="pickupDate" column="pickup_date" />
<result property="blBaging" column="bl_baging" />
<result property="blPickup" column="bl_pickup" />
<result property="bagDate" column="bag_date" />
@@ -149,7 +146,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="trackQueryTime" column="track_query_time" />
<result property="airConfirmTime" column="air_confirm_time" />
<result property="packageType" column="package_type" />
<result property="dimensionalWeightFactor" column="dimensional_weight_factor" />
<result property="updateBy" column="update_by" />
<result property="customerPickupSite" column="customer_pickup_site" />
<result property="barcodeNumber" column="barcode_number" />
@@ -181,26 +177,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectPrcOrderBillExtVo">
select bill_id, order_no, upstream_id, line_no, package_num, actual_volume, cp_type, consignee_mobile, order_returnsign, trade_type, duty_type, battery_type, consignee_companyname, consignee_address, consignee_telephone, consignee_state, consignee_city, consignee_suburb, consignee_passportno, consignee_email, consignee_taxno, consignee_taxnotype, consignee_taxnocountry, consignee_streetno, consignee_doorno, shipper_taxnotype, shipper_taxno, shipper_taxnocountry, customer_id, product_imagepath, order_transactionurl, order_cargoamount, cargo_type, shipper_companyname, shipper_address1, shipper_address2, shipper_address3, shipper_city, shipper_state, shipper_postcode, shipper_country, shipper_telephone, shipper_suburb, shipper_email, shipper_passportno, import_code, import_name, import_companyname, import_address, import_address2, import_address3, import_telephone, import_email, import_postcode, import_city, import_state, import_country, buyerid, order_status, create_at, pay_type, line_code, line_name, product_type, line_type, cargo_name, product_floor_code, order_insurance, product_sum_price, product_sum, shipper_doorno, tariff_payment_account, topayment, product_floor, latest_trajectory, way_bill, pickup_date, bl_baging, bl_pickup, bag_date, org_order_status, status_description, zz_date, shipping_date, order_type, receiving_photo, freight, is_receivable, is_meet, bill_no_receivable, bill_no_meet, country_eingth_name, is_receivable_fee, settlement_fee, product_id, service_freight, is_pay_fee, has_added_surcharge, yf_fee, yf_totail_fee, trajectory_status, cargo_type_name, service_code, three_code, volume_height_old, volume_length_old, volume_width_old, register_man_old, bag_no_old, air_no_old, box_sizi_old, baging_man_old, retrieval_man_old, invoice_amount_old, invoice_title_old, invoice_weight_old, sku_old, hs_code_old, register_date_old, invoice_currency_old, trajectory_sub_state, sign_in_time, warehouse_time, declaration_time, release_time, station_time, takeoff_time, landing_time, clearance_and_delivery_time, supplier_name, credit_code, other_id, platform_code, sync_shipment_status, update_weight, other_bag_no, bag_flag, online_time, outbound_time, air_confirm_date, shipment_type, track_query_time, air_confirm_time, package_type, dimensional_weight_factor, update_by, customer_pickup_site, barcode_number, tracking_reflect_status, remote_postcode, clearance_time, arrive_stock_time, departure_time, first_deliver_time, hs_code_tax_count, hs_code_tax_amount, hs_code_tax_currency, invoice_url, clearance_no, push_weight, internal_check_time, air_delay_time, first_landing_time, second_takeoff_time, des_port_check_time, stay_remark, miss_box_remark, product_channel_id, customer_track_id, register_site, package_type_financial, mrn, create_time, update_time
from prc_order_bill_ext
<sql id="selectPrcOrderExtVo">
select order_id, order_no, upstream_id, line_no, package_num, actual_volume, cp_type, consignee_mobile, order_returnsign, trade_type, duty_type, battery_type, consignee_companyname, consignee_address, consignee_telephone, consignee_state, consignee_city, consignee_suburb, consignee_passportno, consignee_email, consignee_taxno, consignee_taxnotype, consignee_taxnocountry, consignee_streetno, consignee_doorno, shipper_taxnotype, shipper_taxno, shipper_taxnocountry, customer_id, product_imagepath, order_transactionurl, order_cargoamount, cargo_type, shipper_companyname, shipper_address1, shipper_address2, shipper_address3, shipper_city, shipper_state, shipper_postcode, shipper_country, shipper_telephone, shipper_suburb, shipper_email, shipper_passportno, import_code, import_name, import_companyname, import_address, import_address2, import_address3, import_telephone, import_email, import_postcode, import_city, import_state, import_country, buyerid, create_at, pay_type, line_code, line_name, product_type, line_type, cargo_name, order_insurance, product_sum_price, product_sum, shipper_doorno, tariff_payment_account, topayment, product_floor, latest_trajectory, way_bill, bl_baging, bl_pickup, bag_date, org_order_status, status_description, zz_date, shipping_date, order_type, receiving_photo, freight, is_receivable, is_meet, bill_no_receivable, bill_no_meet, country_eingth_name, is_receivable_fee, settlement_fee, product_id, service_freight, is_pay_fee, has_added_surcharge, yf_fee, yf_totail_fee, trajectory_status, cargo_type_name, service_code, three_code, volume_height_old, volume_length_old, volume_width_old, register_man_old, bag_no_old, air_no_old, box_sizi_old, baging_man_old, retrieval_man_old, invoice_amount_old, invoice_title_old, invoice_weight_old, sku_old, hs_code_old, register_date_old, invoice_currency_old, trajectory_sub_state, sign_in_time, warehouse_time, declaration_time, release_time, station_time, takeoff_time, landing_time, clearance_and_delivery_time, supplier_name, credit_code, other_id, platform_code, sync_shipment_status, update_weight, other_bag_no, bag_flag, online_time, outbound_time, air_confirm_date, shipment_type, track_query_time, air_confirm_time, package_type, update_by, customer_pickup_site, barcode_number, tracking_reflect_status, remote_postcode, clearance_time, arrive_stock_time, departure_time, first_deliver_time, hs_code_tax_count, hs_code_tax_amount, hs_code_tax_currency, invoice_url, clearance_no, push_weight, internal_check_time, air_delay_time, first_landing_time, second_takeoff_time, des_port_check_time, stay_remark, miss_box_remark, product_channel_id, customer_track_id, register_site, package_type_financial, mrn, create_time, update_time
from prc_order_ext
</sql>
<select id="selectByBillId" parameterType="String" resultMap="PrcOrderBillExtResult">
<include refid="selectPrcOrderBillExtVo"/>
where bill_id = #{billId}
<select id="selectByOrderId" parameterType="String" resultMap="PrcOrderExtResult">
<include refid="selectPrcOrderExtVo"/>
where order_id = #{orderId}
</select>
<select id="selectByOrderNo" parameterType="String" resultMap="PrcOrderBillExtResult">
<include refid="selectPrcOrderBillExtVo"/>
<select id="selectByOrderNo" parameterType="String" resultMap="PrcOrderExtResult">
<include refid="selectPrcOrderExtVo"/>
where order_no = #{orderNo}
</select>
<insert id="insertPrcOrderBillExt" parameterType="PrcOrderBillExt">
insert into prc_order_bill_ext (
bill_id, order_no, upstream_id, line_no, package_num, actual_volume, cp_type, consignee_mobile, order_returnsign, trade_type, duty_type, battery_type, consignee_companyname, consignee_address, consignee_telephone, consignee_state, consignee_city, consignee_suburb, consignee_passportno, consignee_email, consignee_taxno, consignee_taxnotype, consignee_taxnocountry, consignee_streetno, consignee_doorno, shipper_taxnotype, shipper_taxno, shipper_taxnocountry, customer_id, product_imagepath, order_transactionurl, order_cargoamount, cargo_type, shipper_companyname, shipper_address1, shipper_address2, shipper_address3, shipper_city, shipper_state, shipper_postcode, shipper_country, shipper_telephone, shipper_suburb, shipper_email, shipper_passportno, import_code, import_name, import_companyname, import_address, import_address2, import_address3, import_telephone, import_email, import_postcode, import_city, import_state, import_country, buyerid, order_status, create_at, pay_type, line_code, line_name, product_type, line_type, cargo_name, product_floor_code, order_insurance, product_sum_price, product_sum, shipper_doorno, tariff_payment_account, topayment, product_floor, latest_trajectory, way_bill, pickup_date, bl_baging, bl_pickup, bag_date, org_order_status, status_description, zz_date, shipping_date, order_type, receiving_photo, freight, is_receivable, is_meet, bill_no_receivable, bill_no_meet, country_eingth_name, is_receivable_fee, settlement_fee, product_id, service_freight, is_pay_fee, has_added_surcharge, yf_fee, yf_totail_fee, trajectory_status, cargo_type_name, service_code, three_code, volume_height_old, volume_length_old, volume_width_old, register_man_old, bag_no_old, air_no_old, box_sizi_old, baging_man_old, retrieval_man_old, invoice_amount_old, invoice_title_old, invoice_weight_old, sku_old, hs_code_old, register_date_old, invoice_currency_old, trajectory_sub_state, sign_in_time, warehouse_time, declaration_time, release_time, station_time, takeoff_time, landing_time, clearance_and_delivery_time, supplier_name, credit_code, other_id, platform_code, sync_shipment_status, update_weight, other_bag_no, bag_flag, online_time, outbound_time, air_confirm_date, shipment_type, track_query_time, air_confirm_time, package_type, dimensional_weight_factor, update_by, customer_pickup_site, barcode_number, tracking_reflect_status, remote_postcode, clearance_time, arrive_stock_time, departure_time, first_deliver_time, hs_code_tax_count, hs_code_tax_amount, hs_code_tax_currency, invoice_url, clearance_no, push_weight, internal_check_time, air_delay_time, first_landing_time, second_takeoff_time, des_port_check_time, stay_remark, miss_box_remark, product_channel_id, customer_track_id, register_site, package_type_financial, mrn, create_time
<insert id="insertPrcOrderExt" parameterType="PrcOrderExt">
insert into prc_order_ext (
order_id, order_no, upstream_id, line_no, package_num, actual_volume, cp_type, consignee_mobile, order_returnsign, trade_type, duty_type, battery_type, consignee_companyname, consignee_address, consignee_telephone, consignee_state, consignee_city, consignee_suburb, consignee_passportno, consignee_email, consignee_taxno, consignee_taxnotype, consignee_taxnocountry, consignee_streetno, consignee_doorno, shipper_taxnotype, shipper_taxno, shipper_taxnocountry, customer_id, product_imagepath, order_transactionurl, order_cargoamount, cargo_type, shipper_companyname, shipper_address1, shipper_address2, shipper_address3, shipper_city, shipper_state, shipper_postcode, shipper_country, shipper_telephone, shipper_suburb, shipper_email, shipper_passportno, import_code, import_name, import_companyname, import_address, import_address2, import_address3, import_telephone, import_email, import_postcode, import_city, import_state, import_country, buyerid, create_at, pay_type, line_code, line_name, product_type, line_type, cargo_name, order_insurance, product_sum_price, product_sum, shipper_doorno, tariff_payment_account, topayment, product_floor, latest_trajectory, way_bill, bl_baging, bl_pickup, bag_date, org_order_status, status_description, zz_date, shipping_date, order_type, receiving_photo, freight, is_receivable, is_meet, bill_no_receivable, bill_no_meet, country_eingth_name, is_receivable_fee, settlement_fee, product_id, service_freight, is_pay_fee, has_added_surcharge, yf_fee, yf_totail_fee, trajectory_status, cargo_type_name, service_code, three_code, volume_height_old, volume_length_old, volume_width_old, register_man_old, bag_no_old, air_no_old, box_sizi_old, baging_man_old, retrieval_man_old, invoice_amount_old, invoice_title_old, invoice_weight_old, sku_old, hs_code_old, register_date_old, invoice_currency_old, trajectory_sub_state, sign_in_time, warehouse_time, declaration_time, release_time, station_time, takeoff_time, landing_time, clearance_and_delivery_time, supplier_name, credit_code, other_id, platform_code, sync_shipment_status, update_weight, other_bag_no, bag_flag, online_time, outbound_time, air_confirm_date, shipment_type, track_query_time, air_confirm_time, package_type, update_by, customer_pickup_site, barcode_number, tracking_reflect_status, remote_postcode, clearance_time, arrive_stock_time, departure_time, first_deliver_time, hs_code_tax_count, hs_code_tax_amount, hs_code_tax_currency, invoice_url, clearance_no, push_weight, internal_check_time, air_delay_time, first_landing_time, second_takeoff_time, des_port_check_time, stay_remark, miss_box_remark, product_channel_id, customer_track_id, register_site, package_type_financial, mrn, create_time
) values (
#{billId},
#{orderId},
#{orderNo},
#{upstreamId},
#{lineNo},
@@ -258,7 +254,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{importState},
#{importCountry},
#{buyerid},
#{orderStatus},
#{createAt},
#{payType},
#{lineCode},
@@ -266,7 +261,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{productType},
#{lineType},
#{cargoName},
#{productFloorCode},
#{orderInsurance},
#{productSumPrice},
#{productSum},
@@ -276,7 +270,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{productFloor},
#{latestTrajectory},
#{wayBill},
#{pickupDate},
#{blBaging},
#{blPickup},
#{bagDate},
@@ -344,7 +337,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{trackQueryTime},
#{airConfirmTime},
#{packageType},
#{dimensionalWeightFactor},
#{updateBy},
#{customerPickupSite},
#{barcodeNumber},
@@ -376,11 +368,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
)
</insert>
<insert id="upsertPrcOrderBillExt" parameterType="PrcOrderBillExt">
insert into prc_order_bill_ext (
bill_id, order_no, upstream_id, line_no, package_num, actual_volume, cp_type, consignee_mobile, order_returnsign, trade_type, duty_type, battery_type, consignee_companyname, consignee_address, consignee_telephone, consignee_state, consignee_city, consignee_suburb, consignee_passportno, consignee_email, consignee_taxno, consignee_taxnotype, consignee_taxnocountry, consignee_streetno, consignee_doorno, shipper_taxnotype, shipper_taxno, shipper_taxnocountry, customer_id, product_imagepath, order_transactionurl, order_cargoamount, cargo_type, shipper_companyname, shipper_address1, shipper_address2, shipper_address3, shipper_city, shipper_state, shipper_postcode, shipper_country, shipper_telephone, shipper_suburb, shipper_email, shipper_passportno, import_code, import_name, import_companyname, import_address, import_address2, import_address3, import_telephone, import_email, import_postcode, import_city, import_state, import_country, buyerid, order_status, create_at, pay_type, line_code, line_name, product_type, line_type, cargo_name, product_floor_code, order_insurance, product_sum_price, product_sum, shipper_doorno, tariff_payment_account, topayment, product_floor, latest_trajectory, way_bill, pickup_date, bl_baging, bl_pickup, bag_date, org_order_status, status_description, zz_date, shipping_date, order_type, receiving_photo, freight, is_receivable, is_meet, bill_no_receivable, bill_no_meet, country_eingth_name, is_receivable_fee, settlement_fee, product_id, service_freight, is_pay_fee, has_added_surcharge, yf_fee, yf_totail_fee, trajectory_status, cargo_type_name, service_code, three_code, volume_height_old, volume_length_old, volume_width_old, register_man_old, bag_no_old, air_no_old, box_sizi_old, baging_man_old, retrieval_man_old, invoice_amount_old, invoice_title_old, invoice_weight_old, sku_old, hs_code_old, register_date_old, invoice_currency_old, trajectory_sub_state, sign_in_time, warehouse_time, declaration_time, release_time, station_time, takeoff_time, landing_time, clearance_and_delivery_time, supplier_name, credit_code, other_id, platform_code, sync_shipment_status, update_weight, other_bag_no, bag_flag, online_time, outbound_time, air_confirm_date, shipment_type, track_query_time, air_confirm_time, package_type, dimensional_weight_factor, update_by, customer_pickup_site, barcode_number, tracking_reflect_status, remote_postcode, clearance_time, arrive_stock_time, departure_time, first_deliver_time, hs_code_tax_count, hs_code_tax_amount, hs_code_tax_currency, invoice_url, clearance_no, push_weight, internal_check_time, air_delay_time, first_landing_time, second_takeoff_time, des_port_check_time, stay_remark, miss_box_remark, product_channel_id, customer_track_id, register_site, package_type_financial, mrn, create_time
<insert id="upsertPrcOrderExt" parameterType="PrcOrderExt">
insert into prc_order_ext (
order_id, order_no, upstream_id, line_no, package_num, actual_volume, cp_type, consignee_mobile, order_returnsign, trade_type, duty_type, battery_type, consignee_companyname, consignee_address, consignee_telephone, consignee_state, consignee_city, consignee_suburb, consignee_passportno, consignee_email, consignee_taxno, consignee_taxnotype, consignee_taxnocountry, consignee_streetno, consignee_doorno, shipper_taxnotype, shipper_taxno, shipper_taxnocountry, customer_id, product_imagepath, order_transactionurl, order_cargoamount, cargo_type, shipper_companyname, shipper_address1, shipper_address2, shipper_address3, shipper_city, shipper_state, shipper_postcode, shipper_country, shipper_telephone, shipper_suburb, shipper_email, shipper_passportno, import_code, import_name, import_companyname, import_address, import_address2, import_address3, import_telephone, import_email, import_postcode, import_city, import_state, import_country, buyerid, create_at, pay_type, line_code, line_name, product_type, line_type, cargo_name, order_insurance, product_sum_price, product_sum, shipper_doorno, tariff_payment_account, topayment, product_floor, latest_trajectory, way_bill, bl_baging, bl_pickup, bag_date, org_order_status, status_description, zz_date, shipping_date, order_type, receiving_photo, freight, is_receivable, is_meet, bill_no_receivable, bill_no_meet, country_eingth_name, is_receivable_fee, settlement_fee, product_id, service_freight, is_pay_fee, has_added_surcharge, yf_fee, yf_totail_fee, trajectory_status, cargo_type_name, service_code, three_code, volume_height_old, volume_length_old, volume_width_old, register_man_old, bag_no_old, air_no_old, box_sizi_old, baging_man_old, retrieval_man_old, invoice_amount_old, invoice_title_old, invoice_weight_old, sku_old, hs_code_old, register_date_old, invoice_currency_old, trajectory_sub_state, sign_in_time, warehouse_time, declaration_time, release_time, station_time, takeoff_time, landing_time, clearance_and_delivery_time, supplier_name, credit_code, other_id, platform_code, sync_shipment_status, update_weight, other_bag_no, bag_flag, online_time, outbound_time, air_confirm_date, shipment_type, track_query_time, air_confirm_time, package_type, update_by, customer_pickup_site, barcode_number, tracking_reflect_status, remote_postcode, clearance_time, arrive_stock_time, departure_time, first_deliver_time, hs_code_tax_count, hs_code_tax_amount, hs_code_tax_currency, invoice_url, clearance_no, push_weight, internal_check_time, air_delay_time, first_landing_time, second_takeoff_time, des_port_check_time, stay_remark, miss_box_remark, product_channel_id, customer_track_id, register_site, package_type_financial, mrn, create_time
) values (
#{billId},
#{orderId},
#{orderNo},
#{upstreamId},
#{lineNo},
@@ -438,7 +430,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{importState},
#{importCountry},
#{buyerid},
#{orderStatus},
#{createAt},
#{payType},
#{lineCode},
@@ -446,7 +437,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{productType},
#{lineType},
#{cargoName},
#{productFloorCode},
#{orderInsurance},
#{productSumPrice},
#{productSum},
@@ -456,7 +446,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{productFloor},
#{latestTrajectory},
#{wayBill},
#{pickupDate},
#{blBaging},
#{blPickup},
#{bagDate},
@@ -524,7 +513,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{trackQueryTime},
#{airConfirmTime},
#{packageType},
#{dimensionalWeightFactor},
#{updateBy},
#{customerPickupSite},
#{barcodeNumber},
@@ -612,7 +600,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
import_state = values(import_state),
import_country = values(import_country),
buyerid = values(buyerid),
order_status = values(order_status),
create_at = values(create_at),
pay_type = values(pay_type),
line_code = values(line_code),
@@ -620,7 +607,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
product_type = values(product_type),
line_type = values(line_type),
cargo_name = values(cargo_name),
product_floor_code = values(product_floor_code),
order_insurance = values(order_insurance),
product_sum_price = values(product_sum_price),
product_sum = values(product_sum),
@@ -630,7 +616,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
product_floor = values(product_floor),
latest_trajectory = values(latest_trajectory),
way_bill = values(way_bill),
pickup_date = values(pickup_date),
bl_baging = values(bl_baging),
bl_pickup = values(bl_pickup),
bag_date = values(bag_date),
@@ -698,7 +683,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
track_query_time = values(track_query_time),
air_confirm_time = values(air_confirm_time),
package_type = values(package_type),
dimensional_weight_factor = values(dimensional_weight_factor),
update_by = values(update_by),
customer_pickup_site = values(customer_pickup_site),
barcode_number = values(barcode_number),
@@ -0,0 +1,256 @@
<?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.bms.price.mapper.PrcOrderMapper">
<resultMap type="PrcOrder" id="PrcOrderResult">
<id property="orderId" column="order_id" />
<result property="orderNo" column="order_no" />
<result property="trackingNo" column="tracking_no" />
<result property="transferNo" column="transfer_no" />
<result property="trackId" column="track_id" />
<result property="belongSaler" column="belong_saler" />
<result property="belongSalerCode" column="belong_saler_code" />
<result property="settlementMan" column="settlement_man" />
<result property="settlementManCode" column="settlement_man_code" />
<result property="serviceMan" column="service_man" />
<result property="serviceManCode" column="service_man_code" />
<result property="customerCode" column="customer_code" />
<result property="customerName" column="customer_name" />
<result property="pieces" column="pieces" />
<result property="actualWeight" column="actual_weight" />
<result property="weight" column="weight" />
<result property="dimensionalWeightFactor" column="dimensional_weight_factor" />
<result property="volume" column="volume" />
<result property="volumeWeight" column="volume_weight" />
<result property="pkgLength" column="pkg_length" />
<result property="pkgWidth" column="pkg_width" />
<result property="pkgHeight" column="pkg_height" />
<result property="shipperName" column="shipper_name" />
<result property="consigneeName" column="consignee_name" />
<result property="consigneePostcode" column="consignee_postcode" />
<result property="warehouseCode" column="warehouse_code" />
<result property="orderTime" column="order_time" />
<result property="orderRemark" column="order_remark" />
<result property="productCode" column="product_code" />
<result property="productName" column="product_name" />
<result property="productFloorCode" column="product_floor_code" />
<result property="countryCode" column="country_code" />
<result property="countryName" column="country_name" />
<result property="orderStatus" column="order_status" />
<result property="pickupDate" column="pickup_date" />
<result property="bizDate" column="biz_date" />
<result property="successStatus" column="success_status" />
<result property="failCode" column="fail_code" />
<result property="createBy" column="created_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="updated_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectPrcOrderVo">
select order_id, order_no, tracking_no, transfer_no, track_id,
belong_saler, belong_saler_code, settlement_man, settlement_man_code, service_man, service_man_code,
customer_code, customer_name, pieces, actual_weight, weight, dimensional_weight_factor,
volume, volume_weight, pkg_length, pkg_width, pkg_height,
shipper_name, consignee_name, consignee_postcode, warehouse_code,
order_time, order_remark, product_code, product_name, product_floor_code,
country_code, country_name, order_status, pickup_date, biz_date,
success_status, fail_code, created_by, create_time, updated_by, update_time
from prc_order
</sql>
<select id="selectPrcOrderById" parameterType="String" resultMap="PrcOrderResult">
<include refid="selectPrcOrderVo"/>
where order_id = #{orderId}
</select>
<select id="selectPrcOrderByTransferNo" parameterType="String" resultMap="PrcOrderResult">
<include refid="selectPrcOrderVo"/>
where transfer_no = #{transferNo}
</select>
<select id="selectPrcOrderByOrderNo" parameterType="String" resultMap="PrcOrderResult">
<include refid="selectPrcOrderVo"/>
where order_no = #{orderNo}
</select>
<select id="selectPrcOrderList" parameterType="PrcOrder" resultMap="PrcOrderResult">
<include refid="selectPrcOrderVo"/>
<where>
<if test="transferNo != null and transferNo != ''">
AND transfer_no like concat('%', #{transferNo}, '%')
</if>
<if test="transferNos != null and transferNos.size() &gt; 0">
AND transfer_no in
<foreach collection="transferNos" item="n" open="(" separator="," close=")">#{n}</foreach>
</if>
<if test="trackingNo != null and trackingNo != ''">
AND tracking_no like concat('%', #{trackingNo}, '%')
</if>
<if test="orderNo != null and orderNo != ''">
AND order_no like concat('%', #{orderNo}, '%')
</if>
<if test="customerCode != null and customerCode != ''">
AND customer_code like concat('%', #{customerCode}, '%')
</if>
<if test="successStatus != null and successStatus != ''">
AND success_status = #{successStatus}
</if>
<if test="failCode != null and failCode != ''">
AND fail_code = #{failCode}
</if>
<if test="failCodes != null and failCodes.size() &gt; 0">
AND fail_code in
<foreach collection="failCodes" item="c" open="(" separator="," close=")">#{c}</foreach>
</if>
<if test="params.beginTime != null and params.beginTime != ''">
AND date_format(biz_date,'%Y%m%d') &gt;= date_format(#{params.beginTime},'%Y%m%d')
</if>
<if test="params.endTime != null and params.endTime != ''">
AND date_format(biz_date,'%Y%m%d') &lt;= date_format(#{params.endTime},'%Y%m%d')
</if>
</where>
order by create_time desc, order_id desc
</select>
<insert id="insertPrcOrder" parameterType="PrcOrder">
insert into prc_order (
order_id, order_no, tracking_no, transfer_no, track_id,
belong_saler, belong_saler_code, settlement_man, settlement_man_code, service_man, service_man_code,
customer_code, customer_name, pieces, actual_weight, weight, dimensional_weight_factor,
volume, volume_weight, pkg_length, pkg_width, pkg_height,
shipper_name, consignee_name, consignee_postcode, warehouse_code,
order_time, order_remark, product_code, product_name, product_floor_code,
country_code, country_name, order_status, pickup_date, biz_date,
success_status, fail_code, created_by, create_time, updated_by, update_time
) values (
#{orderId}, #{orderNo}, #{trackingNo}, #{transferNo}, #{trackId},
#{belongSaler}, #{belongSalerCode}, #{settlementMan}, #{settlementManCode}, #{serviceMan}, #{serviceManCode},
#{customerCode}, #{customerName}, #{pieces}, #{actualWeight}, #{weight}, #{dimensionalWeightFactor},
#{volume}, #{volumeWeight}, #{pkgLength}, #{pkgWidth}, #{pkgHeight},
#{shipperName}, #{consigneeName}, #{consigneePostcode}, #{warehouseCode},
#{orderTime}, #{orderRemark}, #{productCode}, #{productName}, #{productFloorCode},
#{countryCode}, #{countryName}, #{orderStatus}, #{pickupDate}, #{bizDate},
#{successStatus}, #{failCode}, #{createBy}, #{createTime}, #{updateBy}, #{updateTime}
)
</insert>
<update id="updatePrcOrder" parameterType="PrcOrder">
update prc_order
<set>
order_no = #{orderNo},
tracking_no = #{trackingNo},
track_id = #{trackId},
belong_saler = #{belongSaler},
belong_saler_code = #{belongSalerCode},
settlement_man = #{settlementMan},
settlement_man_code = #{settlementManCode},
service_man = #{serviceMan},
service_man_code = #{serviceManCode},
customer_code = #{customerCode},
customer_name = #{customerName},
pieces = #{pieces},
actual_weight = #{actualWeight},
weight = #{weight},
dimensional_weight_factor = #{dimensionalWeightFactor},
volume = #{volume},
volume_weight = #{volumeWeight},
pkg_length = #{pkgLength},
pkg_width = #{pkgWidth},
pkg_height = #{pkgHeight},
shipper_name = #{shipperName},
consignee_name = #{consigneeName},
consignee_postcode = #{consigneePostcode},
warehouse_code = #{warehouseCode},
order_time = #{orderTime},
order_remark = #{orderRemark},
product_code = #{productCode},
product_name = #{productName},
product_floor_code = #{productFloorCode},
country_code = #{countryCode},
country_name = #{countryName},
order_status = #{orderStatus},
pickup_date = #{pickupDate},
biz_date = #{bizDate},
success_status = #{successStatus},
fail_code = #{failCode},
updated_by = #{updateBy},
update_time = #{updateTime}
</set>
where order_id = #{orderId}
</update>
<!-- Upsert by unique transfer_no: insert new UUID or overwrite all upstream fields -->
<insert id="upsertPrcOrderByTransferNo" parameterType="PrcOrder">
insert into prc_order (
order_id, order_no, tracking_no, transfer_no, track_id,
belong_saler, belong_saler_code, settlement_man, settlement_man_code, service_man, service_man_code,
customer_code, customer_name, pieces, actual_weight, weight, dimensional_weight_factor,
volume, volume_weight, pkg_length, pkg_width, pkg_height,
shipper_name, consignee_name, consignee_postcode, warehouse_code,
order_time, order_remark, product_code, product_name, product_floor_code,
country_code, country_name, order_status, pickup_date, biz_date,
success_status, fail_code, created_by, create_time, updated_by, update_time
) values (
#{orderId}, #{orderNo}, #{trackingNo}, #{transferNo}, #{trackId},
#{belongSaler}, #{belongSalerCode}, #{settlementMan}, #{settlementManCode}, #{serviceMan}, #{serviceManCode},
#{customerCode}, #{customerName}, #{pieces}, #{actualWeight}, #{weight}, #{dimensionalWeightFactor},
#{volume}, #{volumeWeight}, #{pkgLength}, #{pkgWidth}, #{pkgHeight},
#{shipperName}, #{consigneeName}, #{consigneePostcode}, #{warehouseCode},
#{orderTime}, #{orderRemark}, #{productCode}, #{productName}, #{productFloorCode},
#{countryCode}, #{countryName}, #{orderStatus}, #{pickupDate}, #{bizDate},
#{successStatus}, #{failCode}, #{createBy}, #{createTime}, #{updateBy}, #{updateTime}
)
on duplicate key update
order_id = values(order_id),
order_no = values(order_no),
tracking_no = values(tracking_no),
track_id = values(track_id),
belong_saler = values(belong_saler),
belong_saler_code = values(belong_saler_code),
settlement_man = values(settlement_man),
settlement_man_code = values(settlement_man_code),
service_man = values(service_man),
service_man_code = values(service_man_code),
customer_code = values(customer_code),
customer_name = values(customer_name),
pieces = values(pieces),
actual_weight = values(actual_weight),
weight = values(weight),
dimensional_weight_factor = values(dimensional_weight_factor),
volume = values(volume),
volume_weight = values(volume_weight),
pkg_length = values(pkg_length),
pkg_width = values(pkg_width),
pkg_height = values(pkg_height),
shipper_name = values(shipper_name),
consignee_name = values(consignee_name),
consignee_postcode = values(consignee_postcode),
warehouse_code = values(warehouse_code),
order_time = values(order_time),
order_remark = values(order_remark),
product_code = values(product_code),
product_name = values(product_name),
product_floor_code = values(product_floor_code),
country_code = values(country_code),
country_name = values(country_name),
order_status = values(order_status),
pickup_date = values(pickup_date),
biz_date = values(biz_date),
success_status = values(success_status),
fail_code = values(fail_code),
updated_by = values(updated_by),
update_time = values(update_time)
</insert>
<update id="updateBillingStatus">
update prc_order
set success_status = #{successStatus},
fail_code = #{failCode},
updated_by = #{updateBy},
update_time = now()
where order_id = #{orderId}
</update>
</mapper>