emis-service/emis-biz/src/main/resources/mapper/EmisWaybillMapper.xml
2024-06-05 15:37:13 +08:00

1149 lines
98 KiB
XML

<?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.xdadan.erp.emis.mapper.EmisWaybillMapper">
<resultMap type="EmisWaybill" id="BaseEmisWaybillResult" extends="com.xdadan.erp.emis.mapper.EmisBaseMapper.EmisBaseResult">
<result property="id" column="id" />
<result property="orderSn" column="order_sn" />
<result property="custOrderId" column="cust_order_id" />
<result property="billCode" column="bill_code" />
<result property="billCodeSub" column="bill_code_sub" />
<result property="orderStatus" column="order_status" />
<result property="waybillStatus" column="waybill_status" />
<result property="orderType" column="order_type" />
<result property="orderDate" column="order_date" />
<result property="userId" column="user_id" />
<result property="customerCode" column="customer_code" />
<result property="customerName" column="customer_name" />
<result property="openId" column="open_id" />
<result property="receiveName" column="receive_name" />
<result property="receiveCompany" column="receive_company" />
<result property="receiveMobile" column="receive_mobile" />
<result property="receiveTel" column="receive_tel" />
<result property="receiveCountry" column="receive_country" />
<result property="receiveProvince" column="receive_province" />
<result property="receiveCity" column="receive_city" />
<result property="receiveCounty" column="receive_county" />
<result property="receiveTown" column="receive_town" />
<result property="receiveAddress" column="receive_address" />
<result property="receivePostcode" column="receive_postcode" />
<result property="receivePcd" column="receive_pcd" />
<result property="sendName" column="send_name" />
<result property="sendCompany" column="send_company" />
<result property="sendMobile" column="send_mobile" />
<result property="sendTel" column="send_tel" />
<result property="sendCountry" column="send_country" />
<result property="sendProvince" column="send_province" />
<result property="sendCity" column="send_city" />
<result property="sendCounty" column="send_county" />
<result property="sendTown" column="send_town" />
<result property="sendAddress" column="send_address" />
<result property="sendPostcode" column="send_postcode" />
<result property="sendPcd" column="send_pcd" />
<result property="paymentType" column="payment_type" />
<result property="calcFeeType" column="calc_fee_type" />
<result property="custNo" column="cust_no" />
<result property="custName" column="cust_name" />
<result property="transLineType" column="trans_line_type" />
<result property="productType" column="product_type" />
<result property="timeType" column="time_type" />
<result property="meterType" column="meter_type" />
<result property="carryType" column="carry_type" />
<result property="customsClear" column="customs_clear" />
<result property="customsEclaration" column="customs_eclaration" />
<result property="estimateDate" column="estimate_date" />
<result property="packType" column="pack_type" />
<result property="dispatchMethod" column="dispatch_method" />
<result property="pickupMethod" column="pickup_method" />
<result property="pickStartDate" column="pick_start_date" />
<result property="pickFinishDate" column="pick_finish_date" />
<result property="pickFailReason" column="pick_fail_reason" />
<result property="intoWarehouseCode" column="into_warehouse_code" />
<result property="intoWarehouseName" column="into_warehouse_name" />
<result property="intoWarehouseAddress" column="into_warehouse_address" />
<result property="intoWarehouseContact" column="into_warehouse_contact" />
<result property="intoWarehousePhone" column="into_warehouse_phone" />
<result property="intoWarehouseBillCode" column="into_warehouse_bill_code" />
<result property="warehouseInNo" column="warehouse_in_no" />
<result property="customerDeliveryBeginTime" column="customer_delivery_begin_time" />
<result property="customerDeliveryEndTime" column="customer_delivery_end_time" />
<result property="goodsType" column="goods_type" />
<result property="goodsInfo" column="goods_info" />
<result property="goodsPics" column="goods_pics" />
<result property="blPrepareInFreight" column="bl_prepare_in_freight" />
<result property="prepareInEstFee" column="prepare_in_est_fee" />
<result property="prepareInRealFee" column="prepare_in_real_fee" />
<result property="prepareInExpress" column="prepare_in_express" />
<result property="prepareInBillCode" column="prepare_in_bill_code" />
<result property="prepareInRemark" column="prepare_in_remark" />
<result property="prepareInSupplier" column="prepare_in_supplier" />
<result property="totalWeight" column="total_weight" />
<result property="totalVolume" column="total_volume" />
<result property="parcelQty" column="parcel_qty" />
<result property="billWeight" column="bill_weight" />
<result property="volumeWeight" column="volume_weight" />
<result property="currency" column="currency" />
<result property="settlementWeight" column="settlement_weight" />
<result property="scanWeight" column="scan_weight" />
<result property="feeWeight" column="fee_weight" />
<result property="freight" column="freight" />
<result property="realPaymentType" column="real_payment_type" />
<result property="realFee" column="real_fee" />
<result property="blSpecialQuote" column="bl_special_quote" />
<result property="blOverLong" column="bl_over_long" />
<result property="blBill" column="bl_bill" />
<result property="blBillText" column="bl_bill_text" />
<result property="blOverWeight" column="bl_over_weight" />
<result property="overWeightNumber" column="over_weight_number" />
<result property="feeRemaker" column="fee_remaker" />
<result property="thirdCode" column="third_code" />
<result property="realValue" column="real_value" />
<result property="blInsure" column="bl_insure" />
<result property="insureValue" column="insure_value" />
<result property="insureValueCurrency" column="insure_value_currency" />
<result property="insureFeeCurrency" column="insure_fee_currency" />
<result property="insureFee" column="insure_fee" />
<result property="insureRemark" column="insure_remark" />
<result property="insureSiteCode" column="insure_site_code" />
<result property="insureDate" column="insure_date" />
<result property="blPrint" column="bl_print" />
<result property="printManCode" column="print_man_code" />
<result property="printSite" column="print_site" />
<result property="printDate" column="print_date" />
<result property="printCount" column="print_count" />
<result property="blDispFd" column="bl_disp_fd" />
<result property="transferCode" column="transfer_code" />
<result property="transferBillcode" column="transfer_billcode" />
<result property="dispFdDate" column="disp_fd_date" />
<result property="dispFdReason" column="disp_fd_reason" />
<result property="currentSiteCode" column="current_site_code" />
<result property="nextSiteCode" column="next_site_code" />
<result property="lastSiteCode" column="last_site_code" />
<result property="registerSiteCode" column="register_site_code" />
<result property="registerDate" column="register_date" />
<result property="registerManCode" column="register_man_code" />
<result property="takePieceEmployeeCode" column="take_piece_employee_code" />
<result property="sendSiteCode" column="send_site_code" />
<result property="sendCenterCode" column="send_center_code" />
<result property="sendDate" column="send_date" />
<result property="dispatchManCode" column="dispatch_man_code" />
<result property="dispatchDate" column="dispatch_date" />
<result property="dispatchSiteCode" column="dispatch_site_code" />
<result property="produceBillDate" column="produce_bill_date" />
<result property="produceBillSiteCode" column="produce_bill_site_code" />
<result property="produceBillManCode" column="produce_bill_man_code" />
<result property="destinationCode" column="destination_code" />
<result property="destinationProvince" column="destination_province" />
<result property="destinationCity" column="destination_city" />
<result property="destinationCounty" column="destination_county" />
<result property="dispatchUnderlingSiteCode" column="dispatch_underling_site_code" />
<result property="destinationCenterCode" column="destination_center_code" />
<result property="marketManCode" column="market_man_code" />
<result property="payee" column="payee" />
<result property="salesmen" column="salesmen" />
<result property="operateEmployeeCode" column="operate_employee_code" />
<result property="blIsQuestion" column="bl_is_question" />
<result property="problemType" column="problem_type" />
<result property="problemCause" column="problem_cause" />
<result property="problemDelayDays" column="problem_delay_days" />
<result property="blMessage" column="bl_message" />
<result property="blAcceptMessage" column="bl_accept_message" />
<result property="blGenSubbill" column="bl_gen_subbill" />
<result property="blSign" column="bl_sign" />
<result property="signMan" column="sign_man" />
<result property="signManCode" column="sign_man_code" />
<result property="signSiteCode" column="sign_site_code" />
<result property="signDate" column="sign_date" />
<result property="billPicSendRmk" column="bill_pic_send_rmk" />
<result property="billPicDispatchRmk" column="bill_pic_dispatch_rmk" />
<result property="timezoneOffset" column="timezone_offset" />
<result property="paymentStatus" column="payment_status" />
<result property="paymentDate" column="payment_date" />
<result property="paymentRemark" column="payment_remark" />
<result property="orderRemark" column="order_remark" />
<result property="dataFrom" column="data_from" />
<result property="blSpecialGoods" column="bl_special_goods" />
<association property="receiveCountryName" column="receive_country" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectCountryNameByCode"/>
<association property="receiveProvinceName" column="receive_province" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectRegionNameByCode"/>
<association property="receiveCityName" column="receive_city" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectRegionNameByCode"/>
<association property="receiveCountyName" column="receive_county" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectRegionNameByCode"/>
<association property="sendCountryName" column="send_country" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectCountryNameByCode"/>
<association property="sendProvinceName" column="send_province" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectRegionNameByCode"/>
<association property="sendCityName" column="send_city" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectRegionNameByCode"/>
<association property="sendCountyName" column="send_county" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectRegionNameByCode"/>
<association property="productTypeName" column="product_type" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectProdNameByCode"/>
<association property="transLineTypeName" column="trans_line_type" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectLineNameByCode"/>
<association property="sendSiteName" column="send_site_code" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectSiteNameByCode"/>
<association property="dispatchUnderlingSiteName" column="dispatch_underling_site_code" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectSiteNameByCode"/>
<association property="destinationName" column="destination_code" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectDestNameByCode"/>
<association property="dispatchSiteName" column="dispatch_site_code" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectSiteNameByCode"/>
<association property="dispatchManName" column="dispatch_man_code" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectEmpNameByCode"/>
<association property="printSiteName" column="print_site" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectSiteNameByCode"/>
<association property="printManName" column="print_man_code" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectEmpNameByCode"/>
<association property="takePieceEmployeeName" column="take_piece_employee_code" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectEmpNameByCode"/>
<association property="operateEmployeeName" column="operate_employee_code" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectEmpNameByCode"/>
<association property="registerSiteName" column="register_site_code" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectSiteNameByCode"/>
<association property="registerManName" column="register_man_code" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectEmpNameByCode"/>
<association property="currentSiteName" column="current_site_code" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectSiteNameByCode"/>
<association property="nextSiteName" column="next_site_code" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectSiteNameByCode"/>
<association property="lastSiteName" column="last_site_code" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectSiteNameByCode"/>
<association property="problemTypeName" column="problem_type" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectProblemTypeNameById"/>
</resultMap>
<resultMap id="EmisWaybillResult" extends="BaseEmisWaybillResult" type="EmisWaybill">
<!-- 获取订单最后一条扫描记录 -->
<association property="lastScanRecord" column="bill_code" select="com.xdadan.erp.emis.mapper.EmisTmsScanRecordMapper.selectLastRecordByBillCode"/>
</resultMap>
<!-- 获取运单统计条数-->
<select id="selectWaybillStatByEmpCode" parameterType="String" resultType="map">
select waybill_status as waybillStatus,count(1) as cnt from emis_waybill
<where>
del_flag='0'
<if test="empCode != null and empCode != ''">
and take_piece_employee_code=#{empCode}
</if>
<if test="waybillStatus != null and waybillStatus != ''">
and waybill_status=#{waybillStatus}
</if>
</where>
group by waybill_status
</select>
<select id="selectCommissionStatDataByEmp" parameterType="String" resultType="map">
select waybill_status as waybillStatus,count(1) as cnt from emis_waybill
where take_piece_employee_code is not null
group by waybill_status
</select>
<!-- 其他基本信息 -->
<sql id="selectEmisWaybillVo">
select id, order_sn, cust_order_id, bill_code, bill_code_sub, order_status, waybill_status, order_type, order_date, user_id, customer_code, customer_name, open_id, receive_name, receive_company, receive_mobile, receive_tel, receive_country, receive_province, receive_city, receive_county, receive_town, receive_address, receive_postcode, receive_pcd, send_name, send_company, send_mobile, send_tel, send_country, send_province, send_city, send_county, send_town, send_address, send_postcode, send_pcd, payment_type, calc_fee_type, cust_no, cust_name, trans_line_type, product_type, time_type, meter_type, carry_type, customs_clear, customs_eclaration, estimate_date, pack_type, dispatch_method, pickup_method, pick_start_date, pick_finish_date, pick_fail_reason, into_warehouse_code, into_warehouse_name, into_warehouse_address, into_warehouse_contact, into_warehouse_phone, into_warehouse_bill_code, warehouse_in_no, customer_delivery_begin_time, customer_delivery_end_time, goods_type, goods_info, goods_pics, bl_prepare_in_freight, prepare_in_est_fee, prepare_in_real_fee, prepare_in_express, prepare_in_bill_code, prepare_in_remark, prepare_in_supplier, total_weight, total_volume, parcel_qty, bill_weight, volume_weight, currency, settlement_weight, scan_weight, fee_weight, freight, real_payment_type, real_fee, bl_special_quote, bl_over_long, bl_bill, bl_bill_text, bl_over_weight, over_weight_number, fee_remaker, third_code, real_value, bl_insure, insure_value, insure_value_currency, insure_fee_currency, insure_fee, insure_remark, insure_site_code, insure_date, bl_print, print_man_code, print_site, print_date, print_count, bl_disp_fd, transfer_code, transfer_billcode, disp_fd_date, disp_fd_reason, current_site_code, next_site_code, last_site_code, register_site_code, register_date, register_man_code, take_piece_employee_code, send_site_code, send_center_code, send_date, dispatch_man_code, dispatch_date, dispatch_site_code, produce_bill_date, produce_bill_site_code, produce_bill_man_code, destination_code, destination_province, destination_city, destination_county, dispatch_underling_site_code, destination_center_code, market_man_code, payee, salesmen, operate_employee_code, bl_is_question, problem_type, problem_cause, problem_delay_days, bl_message, bl_accept_message, bl_gen_subbill, bl_sign, sign_man, sign_man_code, sign_site_code, sign_date, bill_pic_send_rmk, bill_pic_dispatch_rmk, timezone_offset, payment_status, payment_date, payment_remark, order_remark, data_from, bl_special_goods, remark, del_flag, create_by, create_time, update_by, update_time, create_site, update_site from emis_waybill
</sql>
<!--根据运单号获取运单信息-->
<select id="selectEmisWaybillByBillCode" parameterType="String" resultMap="EmisWaybillResult">
<include refid="selectEmisWaybillVo"/>
<where>
bill_code = #{billCode} or FIND_IN_SET(#{billCode},bill_code_sub)
</where>
limit 1
</select>
<!-- 提供给扫描记录 查询使用,简化的,不包含扫描记录-->
<select id="selectWaybillBaseInfoByBillCode" parameterType="String" resultMap="BaseEmisWaybillResult">
<include refid="selectEmisWaybillVo"/>
<where>
bill_code = #{billCode}
</where>
limit 1
</select>
<!-- 根据订单号查询 -->
<select id="selectEmisWaybillByOrderSn" parameterType="String" resultMap="EmisWaybillResult">
<include refid="selectEmisWaybillVo"/>
<where>
order_sn = #{orderSn}
</where>
</select>
<!-- 多个运单查询-->
<select id="selectEmisWaybillByMutiBillCode" parameterType="String" resultMap="EmisWaybillResult">
select
id, order_sn, cust_order_id, bill_code, bill_code_sub, order_status, waybill_status, order_type, order_date, user_id, customer_code, customer_name, receive_customer_code, receive_customer_name, third_customer_code, third_customer_name, open_id, receive_name, receive_company, receive_mobile, receive_tel, receive_country, receive_province, receive_city, receive_county, receive_town, receive_address, receive_postcode, receive_pcd, send_name, send_company, send_mobile, send_tel, send_country, send_province, send_city, send_county, send_town, send_address, send_postcode, send_pcd, payment_type, calc_fee_type, cust_no, trans_line_type, product_type, time_type, meter_type, carry_type, customs_clear, customs_eclaration, estimate_date, pack_type, dispatch_method, pickup_method, pick_start_date, pick_finish_date, pick_fail_reason, into_warehouse_code, into_warehouse_name, into_warehouse_address, into_warehouse_contact, into_warehouse_phone, into_warehouse_bill_code, warehouse_in_no, customer_delivery_begin_time, customer_delivery_end_time, goods_type, goods_info, goods_pics, bl_prepare_in_freight, prepare_in_est_fee, prepare_in_real_fee, prepare_in_express, prepare_in_bill_code, prepare_in_remark, prepare_in_supplier, total_weight, total_volume, parcel_qty, bill_weight, volume_weight, currency, settlement_weight, scan_weight, fee_weight, freight, real_payment_type, real_fee, bl_special_quote, bl_over_long, bl_bill, bl_bill_text, bl_over_weight, over_weight_number, fee_remaker, third_code, real_value, bl_insure, insure_value, insure_value_currency, insure_fee_currency, insure_fee, insure_remark, insure_site_code, insure_date, bl_print, print_man_code, print_site, print_date, print_count, bl_disp_fd, transfer_code, transfer_billcode, disp_fd_date, disp_fd_reason, current_site_code, next_site_code, last_site_code, register_site_code, register_date, register_man_code, take_piece_employee_code, send_site_code, send_date, dispatch_man_code, dispatch_date, dispatch_site_code, produce_bill_date, produce_bill_site_code, produce_bill_man_code, destination_code, destination_province, destination_city, destination_county, dispatch_underling_site_code, destination_center_code, market_man_code, payee, salesmen, operate_employee_code, bl_is_question, problem_type, problem_cause, problem_delay_days, bl_message, bl_accept_message, bl_gen_subbill, sign_man, sign_man_code, sign_site_code, sign_date, bill_pic_send_rmk, bill_pic_dispatch_rmk, timezone_offset, data_from, del_flag, create_by, create_time, update_by, update_time, remark, create_site, update_site
from emis_waybill
where billCode in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{billCode}
</foreach>
</select>
<select id="selectEmisWaybillList" parameterType="EmisWaybill" resultMap="EmisWaybillResult">
<include refid="selectEmisWaybillVo"/>
<where>
del_flag='0'
<if test="id != null "> and id = #{id}</if>
<if test="orderSn != null and orderSn != ''"> and ( FIND_IN_SET(`order_sn`,#{orderSn}) or order_sn like concat('%', #{orderSn}, '%') ) </if>
<if test="billCode != null and billCode != ''"> and ( FIND_IN_SET(`bill_code`,#{billCode}) or bill_code like concat('%', #{billCode}, '%') ) </if>
<if test="custOrderId != null and custOrderId != ''"> and cust_order_id=#{custOrderId}</if>
<if test="billCodeSub != null and billCodeSub != ''"> and bill_code_sub like concat('%', #{billCodeSub}, '%')</if>
<if test="orderStatus != null and orderStatus != ''"> and order_status like concat('%', #{orderStatus}, '%')</if>
<if test="waybillStatus != null and waybillStatus != ''"> and waybill_status like concat('%', #{waybillStatus}, '%')</if>
<if test="orderType != null and orderType != ''"> and order_type like concat('%', #{orderType}, '%')</if>
<if test="orderDate != null "> and order_date = #{orderDate}</if>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="customerCode != null and customerCode != ''"> and customer_code like concat('%', #{customerCode}, '%')</if>
<if test="customerName != null and customerName != ''"> and customer_name like concat('%', #{customerName}, '%')</if>
<if test="openId != null and openId != ''"> and open_id like concat('%', #{openId}, '%')</if>
<if test="receiveName != null and receiveName != ''"> and receive_name like concat('%', #{receiveName}, '%')</if>
<if test="receiveCompany != null and receiveCompany != ''"> and receive_company like concat('%', #{receiveCompany}, '%')</if>
<if test="receiveMobile != null and receiveMobile != ''"> and receive_mobile like concat('%', #{receiveMobile}, '%')</if>
<if test="receiveTel != null and receiveTel != ''"> and receive_tel like concat('%', #{receiveTel}, '%')</if>
<if test="receiveCountry != null and receiveCountry != ''"> and receive_country like concat('%', #{receiveCountry}, '%')</if>
<if test="receiveProvince != null and receiveProvince != ''"> and receive_province like concat('%', #{receiveProvince}, '%')</if>
<if test="receiveCity != null and receiveCity != ''"> and receive_city like concat('%', #{receiveCity}, '%')</if>
<if test="receiveCounty != null and receiveCounty != ''"> and receive_county like concat('%', #{receiveCounty}, '%')</if>
<if test="receiveTown != null and receiveTown != ''"> and receive_town like concat('%', #{receiveTown}, '%')</if>
<if test="receiveAddress != null and receiveAddress != ''"> and receive_address like concat('%', #{receiveAddress}, '%')</if>
<if test="receivePostcode != null and receivePostcode != ''"> and receive_postcode like concat('%', #{receivePostcode}, '%')</if>
<if test="receivePcd != null and receivePcd != ''"> and receive_pcd like concat('%', #{receivePcd}, '%')</if>
<if test="sendName != null and sendName != ''"> and send_name like concat('%', #{sendName}, '%')</if>
<if test="sendCompany != null and sendCompany != ''"> and send_company like concat('%', #{sendCompany}, '%')</if>
<if test="sendMobile != null and sendMobile != ''"> and send_mobile like concat('%', #{sendMobile}, '%')</if>
<if test="sendTel != null and sendTel != ''"> and send_tel like concat('%', #{sendTel}, '%')</if>
<if test="sendCountry != null and sendCountry != ''"> and send_country like concat('%', #{sendCountry}, '%')</if>
<if test="sendProvince != null and sendProvince != ''"> and send_province like concat('%', #{sendProvince}, '%')</if>
<if test="sendCity != null and sendCity != ''"> and send_city like concat('%', #{sendCity}, '%')</if>
<if test="sendCounty != null and sendCounty != ''"> and send_county like concat('%', #{sendCounty}, '%')</if>
<if test="sendTown != null and sendTown != ''"> and send_town like concat('%', #{sendTown}, '%')</if>
<if test="sendAddress != null and sendAddress != ''"> and send_address like concat('%', #{sendAddress}, '%')</if>
<if test="sendPostcode != null and sendPostcode != ''"> and send_postcode like concat('%', #{sendPostcode}, '%')</if>
<if test="sendPcd != null and sendPcd != ''"> and send_pcd like concat('%', #{sendPcd}, '%')</if>
<if test="paymentType != null and paymentType != ''"> and payment_type like concat('%', #{paymentType}, '%')</if>
<if test="calcFeeType != null and calcFeeType != ''"> and calc_fee_type like concat('%', #{calcFeeType}, '%')</if>
<if test="custNo != null and custNo != ''"> and cust_no like concat('%', #{custNo}, '%')</if>
<if test="custName != null and custName != ''"> and cust_name like concat('%', #{custName}, '%')</if>
<if test="transLineType != null and transLineType != ''"> and trans_line_type like concat('%', #{transLineType}, '%')</if>
<if test="productType != null and productType != ''"> and product_type like concat('%', #{productType}, '%')</if>
<if test="timeType != null and timeType != ''"> and time_type like concat('%', #{timeType}, '%')</if>
<if test="meterType != null and meterType != ''"> and meter_type like concat('%', #{meterType}, '%')</if>
<if test="carryType != null and carryType != ''"> and carry_type like concat('%', #{carryType}, '%')</if>
<if test="customsClear != null and customsClear != ''"> and customs_clear like concat('%', #{customsClear}, '%')</if>
<if test="customsEclaration != null and customsEclaration != ''"> and customs_eclaration like concat('%', #{customsEclaration}, '%')</if>
<if test="estimateDate != null "> and estimate_date = #{estimateDate}</if>
<if test="packType != null and packType != ''"> and pack_type like concat('%', #{packType}, '%')</if>
<if test="dispatchMethod != null and dispatchMethod != ''"> and dispatch_method like concat('%', #{dispatchMethod}, '%')</if>
<if test="pickupMethod != null and pickupMethod != ''"> and pickup_method like concat('%', #{pickupMethod}, '%')</if>
<if test="pickStartDate != null "> and pick_start_date = #{pickStartDate}</if>
<if test="pickFinishDate != null "> and pick_finish_date = #{pickFinishDate}</if>
<if test="pickFailReason != null and pickFailReason != ''"> and pick_fail_reason like concat('%', #{pickFailReason}, '%')</if>
<if test="intoWarehouseCode != null and intoWarehouseCode != ''"> and into_warehouse_code like concat('%', #{intoWarehouseCode}, '%')</if>
<if test="intoWarehouseName != null and intoWarehouseName != ''"> and into_warehouse_name like concat('%', #{intoWarehouseName}, '%')</if>
<if test="intoWarehouseAddress != null and intoWarehouseAddress != ''"> and into_warehouse_address like concat('%', #{intoWarehouseAddress}, '%')</if>
<if test="intoWarehouseContact != null and intoWarehouseContact != ''"> and into_warehouse_contact like concat('%', #{intoWarehouseContact}, '%')</if>
<if test="intoWarehousePhone != null and intoWarehousePhone != ''"> and into_warehouse_phone like concat('%', #{intoWarehousePhone}, '%')</if>
<if test="intoWarehouseBillCode != null and intoWarehouseBillCode != ''"> and into_warehouse_bill_code like concat('%', #{intoWarehouseBillCode}, '%')</if>
<if test="warehouseInNo != null and warehouseInNo != ''"> and warehouse_in_no like concat('%', #{warehouseInNo}, '%')</if>
<if test="customerDeliveryBeginTime != null and customerDeliveryBeginTime != ''"> and customer_delivery_begin_time like concat('%', #{customerDeliveryBeginTime}, '%')</if>
<if test="customerDeliveryEndTime != null and customerDeliveryEndTime != ''"> and customer_delivery_end_time like concat('%', #{customerDeliveryEndTime}, '%')</if>
<if test="goodsType != null and goodsType != ''"> and goods_type like concat('%', #{goodsType}, '%')</if>
<if test="goodsInfo != null and goodsInfo != ''"> and goods_info like concat('%', #{goodsInfo}, '%')</if>
<if test="goodsPics != null and goodsPics != ''"> and goods_pics like concat('%', #{goodsPics}, '%')</if>
<if test="blPrepareInFreight != null and blPrepareInFreight != ''"> and bl_prepare_in_freight like concat('%', #{blPrepareInFreight}, '%')</if>
<if test="prepareInEstFee != null "> and prepare_in_est_fee = #{prepareInEstFee}</if>
<if test="prepareInRealFee != null "> and prepare_in_real_fee = #{prepareInRealFee}</if>
<if test="prepareInExpress != null and prepareInExpress != ''"> and prepare_in_express like concat('%', #{prepareInExpress}, '%')</if>
<if test="prepareInBillCode != null and prepareInBillCode != ''"> and prepare_in_bill_code like concat('%', #{prepareInBillCode}, '%')</if>
<if test="prepareInRemark != null and prepareInRemark != ''"> and prepare_in_remark like concat('%', #{prepareInRemark}, '%')</if>
<if test="prepareInSupplier != null and prepareInSupplier != ''"> and prepare_in_supplier like concat('%', #{prepareInSupplier}, '%')</if>
<if test="totalWeight != null "> and total_weight = #{totalWeight}</if>
<if test="totalVolume != null "> and total_volume = #{totalVolume}</if>
<if test="parcelQty != null "> and parcel_qty = #{parcelQty}</if>
<if test="billWeight != null "> and bill_weight = #{billWeight}</if>
<if test="volumeWeight != null "> and volume_weight = #{volumeWeight}</if>
<if test="currency != null and currency != ''"> and currency like concat('%', #{currency}, '%')</if>
<if test="settlementWeight != null "> and settlement_weight = #{settlementWeight}</if>
<if test="scanWeight != null "> and scan_weight = #{scanWeight}</if>
<if test="feeWeight != null "> and fee_weight = #{feeWeight}</if>
<if test="freight != null "> and freight = #{freight}</if>
<if test="realPaymentType != null and realPaymentType != ''"> and real_payment_type like concat('%', #{realPaymentType}, '%')</if>
<if test="realFee != null "> and real_fee = #{realFee}</if>
<if test="blSpecialQuote != null and blSpecialQuote != ''"> and bl_special_quote like concat('%', #{blSpecialQuote}, '%')</if>
<if test="blOverLong != null and blOverLong != ''"> and bl_over_long like concat('%', #{blOverLong}, '%')</if>
<if test="blBill != null and blBill != ''"> and bl_bill like concat('%', #{blBill}, '%')</if>
<if test="blBillText != null and blBillText != ''"> and bl_bill_text like concat('%', #{blBillText}, '%')</if>
<if test="blOverWeight != null and blOverWeight != ''"> and bl_over_weight like concat('%', #{blOverWeight}, '%')</if>
<if test="overWeightNumber != null and overWeightNumber != ''"> and over_weight_number like concat('%', #{overWeightNumber}, '%')</if>
<if test="feeRemaker != null and feeRemaker != ''"> and fee_remaker like concat('%', #{feeRemaker}, '%')</if>
<if test="thirdCode != null and thirdCode != ''"> and third_code like concat('%', #{thirdCode}, '%')</if>
<if test="realValue != null and realValue != ''"> and real_value like concat('%', #{realValue}, '%')</if>
<if test="blInsure != null and blInsure != ''"> and bl_insure like concat('%', #{blInsure}, '%')</if>
<if test="insureValue != null and insureValue != ''"> and insure_value like concat('%', #{insureValue}, '%')</if>
<if test="insureValueCurrency != null and insureValueCurrency != ''"> and insure_value_currency like concat('%', #{insureValueCurrency}, '%')</if>
<if test="insureFeeCurrency != null and insureFeeCurrency != ''"> and insure_fee_currency like concat('%', #{insureFeeCurrency}, '%')</if>
<if test="insureFee != null "> and insure_fee = #{insureFee}</if>
<if test="insureRemark != null and insureRemark != ''"> and insure_remark like concat('%', #{insureRemark}, '%')</if>
<if test="insureSiteCode != null and insureSiteCode != ''"> and insure_site_code like concat('%', #{insureSiteCode}, '%')</if>
<if test="insureDate != null and insureDate != ''"> and insure_date like concat('%', #{insureDate}, '%')</if>
<if test="blPrint != null and blPrint != ''"> and bl_print like concat('%', #{blPrint}, '%')</if>
<if test="printManCode != null and printManCode != ''"> and print_man_code like concat('%', #{printManCode}, '%')</if>
<if test="printSite != null and printSite != ''"> and print_site like concat('%', #{printSite}, '%')</if>
<if test="printDate != null and printDate != ''"> and print_date like concat('%', #{printDate}, '%')</if>
<if test="printCount != null and printCount != ''"> and print_count like concat('%', #{printCount}, '%')</if>
<if test="blDispFd != null and blDispFd != ''"> and bl_disp_fd like concat('%', #{blDispFd}, '%')</if>
<if test="transferCode != null and transferCode != ''"> and transfer_code like concat('%', #{transferCode}, '%')</if>
<if test="transferBillcode != null and transferBillcode != ''"> and transfer_billcode like concat('%', #{transferBillcode}, '%')</if>
<if test="dispFdDate != null "> and disp_fd_date = #{dispFdDate}</if>
<if test="dispFdReason != null and dispFdReason != ''"> and disp_fd_reason like concat('%', #{dispFdReason}, '%')</if>
<if test="currentSiteCode != null and currentSiteCode != ''"> and current_site_code like concat('%', #{currentSiteCode}, '%')</if>
<if test="nextSiteCode != null and nextSiteCode != ''"> and next_site_code like concat('%', #{nextSiteCode}, '%')</if>
<if test="lastSiteCode != null and lastSiteCode != ''"> and last_site_code like concat('%', #{lastSiteCode}, '%')</if>
<if test="registerSiteCode != null and registerSiteCode != ''"> and register_site_code like concat('%', #{registerSiteCode}, '%')</if>
<if test="registerDate != null "> and register_date = #{registerDate}</if>
<if test="registerManCode != null and registerManCode != ''"> and register_man_code like concat('%', #{registerManCode}, '%')</if>
<if test="takePieceEmployeeCode != null and takePieceEmployeeCode != ''"> and take_piece_employee_code like concat('%', #{takePieceEmployeeCode}, '%')</if>
<if test="sendSiteCode != null and sendSiteCode != ''"> and send_site_code like concat('%', #{sendSiteCode}, '%')</if>
<if test="sendDate != null "> and send_date = #{sendDate}</if>
<if test="dispatchManCode != null and dispatchManCode != ''"> and dispatch_man_code like concat('%', #{dispatchManCode}, '%')</if>
<if test="dispatchDate != null and dispatchDate != ''"> and dispatch_date like concat('%', #{dispatchDate}, '%')</if>
<if test="dispatchSiteCode != null and dispatchSiteCode != ''"> and dispatch_site_code like concat('%', #{dispatchSiteCode}, '%')</if>
<if test="produceBillDate != null "> and produce_bill_date = #{produceBillDate}</if>
<if test="produceBillSiteCode != null and produceBillSiteCode != ''"> and produce_bill_site_code like concat('%', #{produceBillSiteCode}, '%')</if>
<if test="produceBillManCode != null and produceBillManCode != ''"> and produce_bill_man_code like concat('%', #{produceBillManCode}, '%')</if>
<if test="destinationCode != null and destinationCode != ''"> and destination_code like concat('%', #{destinationCode}, '%')</if>
<if test="destinationProvince != null and destinationProvince != ''"> and destination_province like concat('%', #{destinationProvince}, '%')</if>
<if test="destinationCity != null and destinationCity != ''"> and destination_city like concat('%', #{destinationCity}, '%')</if>
<if test="destinationCounty != null and destinationCounty != ''"> and destination_county like concat('%', #{destinationCounty}, '%')</if>
<if test="dispatchUnderlingSiteCode != null and dispatchUnderlingSiteCode != ''"> and dispatch_underling_site_code like concat('%', #{dispatchUnderlingSiteCode}, '%')</if>
<if test="destinationCenterCode != null and destinationCenterCode != ''"> and destination_center_code like concat('%', #{destinationCenterCode}, '%')</if>
<if test="marketManCode != null and marketManCode != ''"> and market_man_code like concat('%', #{marketManCode}, '%')</if>
<if test="payee != null and payee != ''"> and payee like concat('%', #{payee}, '%')</if>
<if test="salesmen != null and salesmen != ''"> and salesmen like concat('%', #{salesmen}, '%')</if>
<if test="operateEmployeeCode != null and operateEmployeeCode != ''"> and operate_employee_code like concat('%', #{operateEmployeeCode}, '%')</if>
<if test="blIsQuestion != null and blIsQuestion != ''"> and bl_is_question like concat('%', #{blIsQuestion}, '%')</if>
<if test="problemType != null and problemType != ''"> and problem_type like concat('%', #{problemType}, '%')</if>
<if test="problemCause != null and problemCause != ''"> and problem_cause like concat('%', #{problemCause}, '%')</if>
<if test="problemDelayDays != null "> and problem_delay_days = #{problemDelayDays}</if>
<if test="blMessage != null and blMessage != ''"> and bl_message like concat('%', #{blMessage}, '%')</if>
<if test="blAcceptMessage != null and blAcceptMessage != ''"> and bl_accept_message like concat('%', #{blAcceptMessage}, '%')</if>
<if test="blGenSubbill != null and blGenSubbill != ''"> and bl_gen_subbill like concat('%', #{blGenSubbill}, '%')</if>
<if test="signMan != null and signMan != ''"> and sign_man like concat('%', #{signMan}, '%')</if>
<if test="signManCode != null and signManCode != ''"> and sign_man_code like concat('%', #{signManCode}, '%')</if>
<if test="signSiteCode != null and signSiteCode != ''"> and sign_site_code like concat('%', #{signSiteCode}, '%')</if>
<if test="signDate != null and signDate != ''"> and sign_date like concat('%', #{signDate}, '%')</if>
<if test="billPicSendRmk != null and billPicSendRmk != ''"> and bill_pic_send_rmk like concat('%', #{billPicSendRmk}, '%')</if>
<if test="billPicDispatchRmk != null and billPicDispatchRmk != ''"> and bill_pic_dispatch_rmk like concat('%', #{billPicDispatchRmk}, '%')</if>
<if test="timezoneOffset != null and timezoneOffset != ''"> and timezone_offset like concat('%', #{timezoneOffset}, '%')</if>
<if test="paymentStatus != null and paymentStatus != ''"> and payment_status like concat('%', #{paymentStatus}, '%')</if>
<if test="paymentDate != null "> and payment_date = #{paymentDate}</if>
<if test="paymentRemark != null and paymentRemark != ''"> and payment_remark like concat('%', #{paymentRemark}, '%')</if>
<if test="orderRemark != null and orderRemark != ''"> and order_remark like concat('%', #{orderRemark}, '%')</if>
<if test="dataFrom != null and dataFrom != ''"> and data_from like concat('%', #{dataFrom}, '%')</if>
<if test="remark != null and remark != ''"> and remark like concat('%', #{remark}, '%')</if>
<if test="delFlag != null and delFlag != ''"> and del_flag like concat('%', #{delFlag}, '%')</if>
<if test="createBy != null and createBy != ''"> and create_by like concat('%', #{createBy}, '%')</if>
<if test="createTime != null "> and create_time = #{createTime}</if>
<if test="updateBy != null and updateBy != ''"> and update_by like concat('%', #{updateBy}, '%')</if>
<if test="updateTime != null "> and update_time = #{updateTime}</if>
<if test="createSite != null and createSite != ''"> and create_site like concat('%', #{createSite}, '%')</if>
<if test="updateSite != null and updateSite != ''"> and update_site like concat('%', #{updateSite}, '%')</if>
<if test="params.beginSendDate != null and params.beginSendDate != ''">
and send_date <![CDATA[ >= ]]> #{params.beginSendDate}
</if>
<if test="params.endSendDate != null and params.endSendDate != ''">
and send_date <![CDATA[ <= ]]> #{params.endSendDate}
</if>
<if test="params.beginCreateTime != null and params.beginCreateTime != ''">
and create_time <![CDATA[ >= ]]> #{params.beginCreateTime}
</if>
<if test="params.endCreateTime != null and params.endCreateTime != ''">
and create_time <![CDATA[ <= ]]> #{params.endCreateTime}
</if>
<if test="params.printFlag != null and params.printFlag != ''">
and bl_print=#{params.printFlag}
</if>
<if test="params.isNeedPack != null and params.isNeedPack == 1">
and bill_code not in( select bill_code from emis_tms_pack_dtl where del_flag='0' )
</if>
<if test="params.privSiteCode != null">
and (
send_site_code in (
SELECT
site_code
FROM (
SELECT
t1.site_code,
t1.parent_site_code,
IF( FIND_IN_SET( parent_site_code, @pids ) > 0, @pids := concat( @pids, ',', site_code ), 0 ) AS child_path
FROM
( SELECT site_code, parent_site_code FROM emis_site t WHERE del_flag = '0' ORDER BY site_code, parent_site_code ) t1,
( SELECT @pids := #{params.privSiteCode} ) t2
) t3
WHERE child_path > 0
UNION
SELECT #{params.privSiteCode} FROM DUAL
)
or salesmen=#{params.privEmpCode}
or payee=#{params.privEmpName}
)
</if>
</where>
ORDER BY
<if test="params.orderSnSortList != null and params.orderSnSortList.size >0 ">
FIELD
<foreach collection="params.orderSnSortList" item="item" open="(order_sn," separator="," close=")">
#{item}
</foreach>
,
</if>
<if test="params.billCodeSortList != null and params.billCodeSortList.size >0 ">
FIELD
<foreach collection="params.billCodeSortList" item="item" open="(bill_code," separator="," close=")">
#{item}
</foreach>
,
</if>
create_time desc
</select>
<!-- 通用权限判断 参数 isPrivQuery -->
<select id="selectEmisWaybillById" parameterType="Long" resultMap="EmisWaybillResult">
select id, order_sn, cust_order_id, bill_code, bill_code_sub, order_status, waybill_status, order_type, order_date, user_id, customer_code, customer_name, open_id, receive_name, receive_company, receive_mobile, receive_tel, receive_country, receive_province, receive_city, receive_county, receive_town, receive_address, receive_postcode, receive_pcd, send_name, send_company, send_mobile, send_tel, send_country, send_province, send_city, send_county, send_town, send_address, send_postcode, send_pcd, payment_type, calc_fee_type, cust_no, cust_name, trans_line_type, product_type, time_type, meter_type, carry_type, customs_clear, customs_eclaration, estimate_date, pack_type, dispatch_method, pickup_method, pick_start_date, pick_finish_date, pick_fail_reason, into_warehouse_code, into_warehouse_name, into_warehouse_address, into_warehouse_contact, into_warehouse_phone, into_warehouse_bill_code, warehouse_in_no, customer_delivery_begin_time, customer_delivery_end_time, goods_type, goods_info, goods_pics, bl_prepare_in_freight, prepare_in_est_fee, prepare_in_real_fee, prepare_in_express, prepare_in_bill_code, prepare_in_remark, prepare_in_supplier, total_weight, total_volume, parcel_qty, bill_weight, volume_weight, currency, settlement_weight, scan_weight, fee_weight, freight, real_payment_type, real_fee, bl_special_quote, bl_over_long, bl_bill, bl_bill_text, bl_over_weight, over_weight_number, fee_remaker, third_code, real_value, bl_insure, insure_value, insure_value_currency, insure_fee_currency, insure_fee, insure_remark, insure_site_code, insure_date, bl_print, print_man_code, print_site, print_date, print_count, bl_disp_fd, transfer_code, transfer_billcode, disp_fd_date, disp_fd_reason, current_site_code, next_site_code, last_site_code, register_site_code, register_date, register_man_code, take_piece_employee_code, send_site_code, send_center_code, send_date, dispatch_man_code, dispatch_date, dispatch_site_code, produce_bill_date, produce_bill_site_code, produce_bill_man_code, destination_code, destination_province, destination_city, destination_county, dispatch_underling_site_code, destination_center_code, market_man_code, payee, salesmen, operate_employee_code, bl_is_question, problem_type, problem_cause, problem_delay_days, bl_message, bl_accept_message, bl_gen_subbill, bl_sign, sign_man, sign_man_code, sign_site_code, sign_date, bill_pic_send_rmk, bill_pic_dispatch_rmk, timezone_offset, payment_status, payment_date, payment_remark, order_remark, data_from, bl_special_goods, remark, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
from emis_waybill a
where a.id = #{id}
</select>
<insert id="insertEmisWaybill" parameterType="EmisWaybill" useGeneratedKeys="true" keyProperty="id">
insert into emis_waybill
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="orderSn != null and orderSn != ''">order_sn,</if>
<if test="custOrderId != null and custOrderId != ''">cust_order_id,</if>
<if test="billCode != null and billCode != ''">bill_code,</if>
<if test="billCodeSub != null and billCodeSub != ''">bill_code_sub,</if>
<if test="orderStatus != null and orderStatus != ''">order_status,</if>
<if test="waybillStatus != null and waybillStatus != ''">waybill_status,</if>
<if test="orderType != null and orderType != ''">order_type,</if>
<if test="orderDate != null">order_date,</if>
<if test="userId != null">user_id,</if>
<if test="customerCode != null and customerCode != ''">customer_code,</if>
<if test="customerName != null and customerName != ''">customer_name,</if>
<if test="openId != null and openId != ''">open_id,</if>
<if test="receiveName != null and receiveName != ''">receive_name,</if>
<if test="receiveCompany != null and receiveCompany != ''">receive_company,</if>
<if test="receiveMobile != null and receiveMobile != ''">receive_mobile,</if>
<if test="receiveTel != null and receiveTel != ''">receive_tel,</if>
<if test="receiveCountry != null and receiveCountry != ''">receive_country,</if>
<if test="receiveProvince != null and receiveProvince != ''">receive_province,</if>
<if test="receiveCity != null and receiveCity != ''">receive_city,</if>
<if test="receiveCounty != null and receiveCounty != ''">receive_county,</if>
<if test="receiveTown != null and receiveTown != ''">receive_town,</if>
<if test="receiveAddress != null and receiveAddress != ''">receive_address,</if>
<if test="receivePostcode != null and receivePostcode != ''">receive_postcode,</if>
<if test="receivePcd != null and receivePcd != ''">receive_pcd,</if>
<if test="sendName != null and sendName != ''">send_name,</if>
<if test="sendCompany != null and sendCompany != ''">send_company,</if>
<if test="sendMobile != null and sendMobile != ''">send_mobile,</if>
<if test="sendTel != null and sendTel != ''">send_tel,</if>
<if test="sendCountry != null and sendCountry != ''">send_country,</if>
<if test="sendProvince != null and sendProvince != ''">send_province,</if>
<if test="sendCity != null and sendCity != ''">send_city,</if>
<if test="sendCounty != null and sendCounty != ''">send_county,</if>
<if test="sendTown != null and sendTown != ''">send_town,</if>
<if test="sendAddress != null and sendAddress != ''">send_address,</if>
<if test="sendPostcode != null and sendPostcode != ''">send_postcode,</if>
<if test="sendPcd != null and sendPcd != ''">send_pcd,</if>
<if test="paymentType != null and paymentType != ''">payment_type,</if>
<if test="calcFeeType != null and calcFeeType != ''">calc_fee_type,</if>
<if test="custNo != null and custNo != ''">cust_no,</if>
<if test="custName != null and custName != ''">cust_name,</if>
<if test="transLineType != null and transLineType != ''">trans_line_type,</if>
<if test="productType != null and productType != ''">product_type,</if>
<if test="timeType != null and timeType != ''">time_type,</if>
<if test="meterType != null and meterType != ''">meter_type,</if>
<if test="carryType != null and carryType != ''">carry_type,</if>
<if test="customsClear != null and customsClear != ''">customs_clear,</if>
<if test="customsEclaration != null and customsEclaration != ''">customs_eclaration,</if>
<if test="estimateDate != null">estimate_date,</if>
<if test="packType != null and packType != ''">pack_type,</if>
<if test="dispatchMethod != null and dispatchMethod != ''">dispatch_method,</if>
<if test="pickupMethod != null and pickupMethod != ''">pickup_method,</if>
<if test="pickStartDate != null">pick_start_date,</if>
<if test="pickFinishDate != null">pick_finish_date,</if>
<if test="pickFailReason != null and pickFailReason != ''">pick_fail_reason,</if>
<if test="intoWarehouseCode != null and intoWarehouseCode != ''">into_warehouse_code,</if>
<if test="intoWarehouseName != null and intoWarehouseName != ''">into_warehouse_name,</if>
<if test="intoWarehouseAddress != null and intoWarehouseAddress != ''">into_warehouse_address,</if>
<if test="intoWarehouseContact != null and intoWarehouseContact != ''">into_warehouse_contact,</if>
<if test="intoWarehousePhone != null and intoWarehousePhone != ''">into_warehouse_phone,</if>
<if test="intoWarehouseBillCode != null and intoWarehouseBillCode != ''">into_warehouse_bill_code,</if>
<if test="warehouseInNo != null and warehouseInNo != ''">warehouse_in_no,</if>
<if test="customerDeliveryBeginTime != null and customerDeliveryBeginTime != ''">customer_delivery_begin_time,</if>
<if test="customerDeliveryEndTime != null and customerDeliveryEndTime != ''">customer_delivery_end_time,</if>
<if test="goodsType != null and goodsType != ''">goods_type,</if>
<if test="goodsInfo != null and goodsInfo != ''">goods_info,</if>
<if test="goodsPics != null and goodsPics != ''">goods_pics,</if>
<if test="blPrepareInFreight != null and blPrepareInFreight != ''">bl_prepare_in_freight,</if>
<if test="prepareInEstFee != null">prepare_in_est_fee,</if>
<if test="prepareInRealFee != null">prepare_in_real_fee,</if>
<if test="prepareInExpress != null and prepareInExpress != ''">prepare_in_express,</if>
<if test="prepareInBillCode != null and prepareInBillCode != ''">prepare_in_bill_code,</if>
<if test="prepareInRemark != null and prepareInRemark != ''">prepare_in_remark,</if>
<if test="prepareInSupplier != null and prepareInSupplier != ''">prepare_in_supplier,</if>
<if test="totalWeight != null">total_weight,</if>
<if test="totalVolume != null">total_volume,</if>
<if test="parcelQty != null">parcel_qty,</if>
<if test="billWeight != null">bill_weight,</if>
<if test="volumeWeight != null">volume_weight,</if>
<if test="currency != null and currency != ''">currency,</if>
<if test="settlementWeight != null">settlement_weight,</if>
<if test="scanWeight != null">scan_weight,</if>
<if test="feeWeight != null">fee_weight,</if>
<if test="freight != null">freight,</if>
<if test="realPaymentType != null and realPaymentType != ''">real_payment_type,</if>
<if test="realFee != null">real_fee,</if>
<if test="blSpecialQuote != null and blSpecialQuote != ''">bl_special_quote,</if>
<if test="blOverLong != null and blOverLong != ''">bl_over_long,</if>
<if test="blBill != null and blBill != ''">bl_bill,</if>
<if test="blBillText != null and blBillText != ''">bl_bill_text,</if>
<if test="blOverWeight != null and blOverWeight != ''">bl_over_weight,</if>
<if test="overWeightNumber != null and overWeightNumber != ''">over_weight_number,</if>
<if test="feeRemaker != null and feeRemaker != ''">fee_remaker,</if>
<if test="thirdCode != null and thirdCode != ''">third_code,</if>
<if test="realValue != null and realValue != ''">real_value,</if>
<if test="blInsure != null and blInsure != ''">bl_insure,</if>
<if test="insureValue != null and insureValue != ''">insure_value,</if>
<if test="insureValueCurrency != null and insureValueCurrency != ''">insure_value_currency,</if>
<if test="insureFeeCurrency != null and insureFeeCurrency != ''">insure_fee_currency,</if>
<if test="insureFee != null">insure_fee,</if>
<if test="insureRemark != null and insureRemark != ''">insure_remark,</if>
<if test="insureSiteCode != null and insureSiteCode != ''">insure_site_code,</if>
<if test="insureDate != null and insureDate != ''">insure_date,</if>
<if test="blPrint != null and blPrint != ''">bl_print,</if>
<if test="printManCode != null and printManCode != ''">print_man_code,</if>
<if test="printSite != null and printSite != ''">print_site,</if>
<if test="printDate != null and printDate != ''">print_date,</if>
<if test="printCount != null">print_count,</if>
<if test="blDispFd != null and blDispFd != ''">bl_disp_fd,</if>
<if test="transferCode != null and transferCode != ''">transfer_code,</if>
<if test="transferBillcode != null and transferBillcode != ''">transfer_billcode,</if>
<if test="dispFdDate != null">disp_fd_date,</if>
<if test="dispFdReason != null and dispFdReason != ''">disp_fd_reason,</if>
<if test="currentSiteCode != null and currentSiteCode != ''">current_site_code,</if>
<if test="nextSiteCode != null and nextSiteCode != ''">next_site_code,</if>
<if test="lastSiteCode != null and lastSiteCode != ''">last_site_code,</if>
<if test="registerSiteCode != null and registerSiteCode != ''">register_site_code,</if>
<if test="registerDate != null">register_date,</if>
<if test="registerManCode != null and registerManCode != ''">register_man_code,</if>
<if test="takePieceEmployeeCode != null and takePieceEmployeeCode != ''">take_piece_employee_code,</if>
<if test="sendSiteCode != null and sendSiteCode != ''">send_site_code,</if>
<if test="sendCenterCode != null and sendCenterCode != ''">send_center_code,</if>
<if test="sendDate != null">send_date,</if>
<if test="dispatchManCode != null and dispatchManCode != ''">dispatch_man_code,</if>
<if test="dispatchDate != null and dispatchDate != ''">dispatch_date,</if>
<if test="dispatchSiteCode != null and dispatchSiteCode != ''">dispatch_site_code,</if>
<if test="produceBillDate != null">produce_bill_date,</if>
<if test="produceBillSiteCode != null and produceBillSiteCode != ''">produce_bill_site_code,</if>
<if test="produceBillManCode != null and produceBillManCode != ''">produce_bill_man_code,</if>
<if test="destinationCode != null and destinationCode != ''">destination_code,</if>
<if test="destinationProvince != null and destinationProvince != ''">destination_province,</if>
<if test="destinationCity != null and destinationCity != ''">destination_city,</if>
<if test="destinationCounty != null and destinationCounty != ''">destination_county,</if>
<if test="dispatchUnderlingSiteCode != null and dispatchUnderlingSiteCode != ''">dispatch_underling_site_code,</if>
<if test="destinationCenterCode != null and destinationCenterCode != ''">destination_center_code,</if>
<if test="marketManCode != null and marketManCode != ''">market_man_code,</if>
<if test="payee != null and payee != ''">payee,</if>
<if test="salesmen != null and salesmen != ''">salesmen,</if>
<if test="operateEmployeeCode != null and operateEmployeeCode != ''">operate_employee_code,</if>
<if test="blIsQuestion != null and blIsQuestion != ''">bl_is_question,</if>
<if test="problemType != null and problemType != ''">problem_type,</if>
<if test="problemCause != null and problemCause != ''">problem_cause,</if>
<if test="problemDelayDays != null">problem_delay_days,</if>
<if test="blMessage != null and blMessage != ''">bl_message,</if>
<if test="blAcceptMessage != null and blAcceptMessage != ''">bl_accept_message,</if>
<if test="blGenSubbill != null and blGenSubbill != ''">bl_gen_subbill,</if>
<if test="blSign != null and blSign != ''">bl_sign,</if>
<if test="signMan != null and signMan != ''">sign_man,</if>
<if test="signManCode != null and signManCode != ''">sign_man_code,</if>
<if test="signSiteCode != null and signSiteCode != ''">sign_site_code,</if>
<if test="signDate != null">sign_date,</if>
<if test="billPicSendRmk != null and billPicSendRmk != ''">bill_pic_send_rmk,</if>
<if test="billPicDispatchRmk != null and billPicDispatchRmk != ''">bill_pic_dispatch_rmk,</if>
<if test="timezoneOffset != null and timezoneOffset != ''">timezone_offset,</if>
<if test="paymentStatus != null and paymentStatus != ''">payment_status,</if>
<if test="paymentDate != null">payment_date,</if>
<if test="paymentRemark != null and paymentRemark != ''">payment_remark,</if>
<if test="orderRemark != null and orderRemark != ''">order_remark,</if>
<if test="dataFrom != null and dataFrom != ''">data_from,</if>
<if test="blSpecialGoods != null and blSpecialGoods != ''">bl_special_goods,</if>
<if test="remark != null and remark != ''">remark,</if>
<if test="delFlag != null and delFlag != ''">del_flag,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null and updateBy != ''">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="createSite != null and createSite != ''">create_site,</if>
<if test="updateSite != null and updateSite != ''">update_site,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="orderSn != null and orderSn != ''">#{orderSn},</if>
<if test="custOrderId != null and custOrderId != ''">#{custOrderId},</if>
<if test="billCode != null and billCode != ''">#{billCode},</if>
<if test="billCodeSub != null and billCodeSub != ''">#{billCodeSub},</if>
<if test="orderStatus != null and orderStatus != ''">#{orderStatus},</if>
<if test="waybillStatus != null and waybillStatus != ''">#{waybillStatus},</if>
<if test="orderType != null and orderType != ''">#{orderType},</if>
<if test="orderDate != null">#{orderDate},</if>
<if test="userId != null">#{userId},</if>
<if test="customerCode != null and customerCode != ''">#{customerCode},</if>
<if test="customerName != null and customerName != ''">#{customerName},</if>
<if test="openId != null and openId != ''">#{openId},</if>
<if test="receiveName != null and receiveName != ''">#{receiveName},</if>
<if test="receiveCompany != null and receiveCompany != ''">#{receiveCompany},</if>
<if test="receiveMobile != null and receiveMobile != ''">#{receiveMobile},</if>
<if test="receiveTel != null and receiveTel != ''">#{receiveTel},</if>
<if test="receiveCountry != null and receiveCountry != ''">#{receiveCountry},</if>
<if test="receiveProvince != null and receiveProvince != ''">#{receiveProvince},</if>
<if test="receiveCity != null and receiveCity != ''">#{receiveCity},</if>
<if test="receiveCounty != null and receiveCounty != ''">#{receiveCounty},</if>
<if test="receiveTown != null and receiveTown != ''">#{receiveTown},</if>
<if test="receiveAddress != null and receiveAddress != ''">#{receiveAddress},</if>
<if test="receivePostcode != null and receivePostcode != ''">#{receivePostcode},</if>
<if test="receivePcd != null and receivePcd != ''">#{receivePcd},</if>
<if test="sendName != null and sendName != ''">#{sendName},</if>
<if test="sendCompany != null and sendCompany != ''">#{sendCompany},</if>
<if test="sendMobile != null and sendMobile != ''">#{sendMobile},</if>
<if test="sendTel != null and sendTel != ''">#{sendTel},</if>
<if test="sendCountry != null and sendCountry != ''">#{sendCountry},</if>
<if test="sendProvince != null and sendProvince != ''">#{sendProvince},</if>
<if test="sendCity != null and sendCity != ''">#{sendCity},</if>
<if test="sendCounty != null and sendCounty != ''">#{sendCounty},</if>
<if test="sendTown != null and sendTown != ''">#{sendTown},</if>
<if test="sendAddress != null and sendAddress != ''">#{sendAddress},</if>
<if test="sendPostcode != null and sendPostcode != ''">#{sendPostcode},</if>
<if test="sendPcd != null and sendPcd != ''">#{sendPcd},</if>
<if test="paymentType != null and paymentType != ''">#{paymentType},</if>
<if test="calcFeeType != null and calcFeeType != ''">#{calcFeeType},</if>
<if test="custNo != null and custNo != ''">#{custNo},</if>
<if test="custName != null and custName != ''">#{custName},</if>
<if test="transLineType != null and transLineType != ''">#{transLineType},</if>
<if test="productType != null and productType != ''">#{productType},</if>
<if test="timeType != null and timeType != ''">#{timeType},</if>
<if test="meterType != null and meterType != ''">#{meterType},</if>
<if test="carryType != null and carryType != ''">#{carryType},</if>
<if test="customsClear != null and customsClear != ''">#{customsClear},</if>
<if test="customsEclaration != null and customsEclaration != ''">#{customsEclaration},</if>
<if test="estimateDate != null">#{estimateDate},</if>
<if test="packType != null and packType != ''">#{packType},</if>
<if test="dispatchMethod != null and dispatchMethod != ''">#{dispatchMethod},</if>
<if test="pickupMethod != null and pickupMethod != ''">#{pickupMethod},</if>
<if test="pickStartDate != null">#{pickStartDate},</if>
<if test="pickFinishDate != null">#{pickFinishDate},</if>
<if test="pickFailReason != null and pickFailReason != ''">#{pickFailReason},</if>
<if test="intoWarehouseCode != null and intoWarehouseCode != ''">#{intoWarehouseCode},</if>
<if test="intoWarehouseName != null and intoWarehouseName != ''">#{intoWarehouseName},</if>
<if test="intoWarehouseAddress != null and intoWarehouseAddress != ''">#{intoWarehouseAddress},</if>
<if test="intoWarehouseContact != null and intoWarehouseContact != ''">#{intoWarehouseContact},</if>
<if test="intoWarehousePhone != null and intoWarehousePhone != ''">#{intoWarehousePhone},</if>
<if test="intoWarehouseBillCode != null and intoWarehouseBillCode != ''">#{intoWarehouseBillCode},</if>
<if test="warehouseInNo != null and warehouseInNo != ''">#{warehouseInNo},</if>
<if test="customerDeliveryBeginTime != null and customerDeliveryBeginTime != ''">#{customerDeliveryBeginTime},</if>
<if test="customerDeliveryEndTime != null and customerDeliveryEndTime != ''">#{customerDeliveryEndTime},</if>
<if test="goodsType != null and goodsType != ''">#{goodsType},</if>
<if test="goodsInfo != null and goodsInfo != ''">#{goodsInfo},</if>
<if test="goodsPics != null and goodsPics != ''">#{goodsPics},</if>
<if test="blPrepareInFreight != null and blPrepareInFreight != ''">#{blPrepareInFreight},</if>
<if test="prepareInEstFee != null">#{prepareInEstFee},</if>
<if test="prepareInRealFee != null">#{prepareInRealFee},</if>
<if test="prepareInExpress != null and prepareInExpress != ''">#{prepareInExpress},</if>
<if test="prepareInBillCode != null and prepareInBillCode != ''">#{prepareInBillCode},</if>
<if test="prepareInRemark != null and prepareInRemark != ''">#{prepareInRemark},</if>
<if test="prepareInSupplier != null and prepareInSupplier != ''">#{prepareInSupplier},</if>
<if test="totalWeight != null">#{totalWeight},</if>
<if test="totalVolume != null">#{totalVolume},</if>
<if test="parcelQty != null">#{parcelQty},</if>
<if test="billWeight != null">#{billWeight},</if>
<if test="volumeWeight != null">#{volumeWeight},</if>
<if test="currency != null and currency != ''">#{currency},</if>
<if test="settlementWeight != null">#{settlementWeight},</if>
<if test="scanWeight != null">#{scanWeight},</if>
<if test="feeWeight != null">#{feeWeight},</if>
<if test="freight != null">#{freight},</if>
<if test="realPaymentType != null and realPaymentType != ''">#{realPaymentType},</if>
<if test="realFee != null">#{realFee},</if>
<if test="blSpecialQuote != null and blSpecialQuote != ''">#{blSpecialQuote},</if>
<if test="blOverLong != null and blOverLong != ''">#{blOverLong},</if>
<if test="blBill != null and blBill != ''">#{blBill},</if>
<if test="blBillText != null and blBillText != ''">#{blBillText},</if>
<if test="blOverWeight != null and blOverWeight != ''">#{blOverWeight},</if>
<if test="overWeightNumber != null and overWeightNumber != ''">#{overWeightNumber},</if>
<if test="feeRemaker != null and feeRemaker != ''">#{feeRemaker},</if>
<if test="thirdCode != null and thirdCode != ''">#{thirdCode},</if>
<if test="realValue != null and realValue != ''">#{realValue},</if>
<if test="blInsure != null and blInsure != ''">#{blInsure},</if>
<if test="insureValue != null and insureValue != ''">#{insureValue},</if>
<if test="insureValueCurrency != null and insureValueCurrency != ''">#{insureValueCurrency},</if>
<if test="insureFeeCurrency != null and insureFeeCurrency != ''">#{insureFeeCurrency},</if>
<if test="insureFee != null">#{insureFee},</if>
<if test="insureRemark != null and insureRemark != ''">#{insureRemark},</if>
<if test="insureSiteCode != null and insureSiteCode != ''">#{insureSiteCode},</if>
<if test="insureDate != null and insureDate != ''">#{insureDate},</if>
<if test="blPrint != null and blPrint != ''">#{blPrint},</if>
<if test="printManCode != null and printManCode != ''">#{printManCode},</if>
<if test="printSite != null and printSite != ''">#{printSite},</if>
<if test="printDate != null and printDate != ''">#{printDate},</if>
<if test="printCount != null">#{printCount},</if>
<if test="blDispFd != null and blDispFd != ''">#{blDispFd},</if>
<if test="transferCode != null and transferCode != ''">#{transferCode},</if>
<if test="transferBillcode != null and transferBillcode != ''">#{transferBillcode},</if>
<if test="dispFdDate != null">#{dispFdDate},</if>
<if test="dispFdReason != null and dispFdReason != ''">#{dispFdReason},</if>
<if test="currentSiteCode != null and currentSiteCode != ''">#{currentSiteCode},</if>
<if test="nextSiteCode != null and nextSiteCode != ''">#{nextSiteCode},</if>
<if test="lastSiteCode != null and lastSiteCode != ''">#{lastSiteCode},</if>
<if test="registerSiteCode != null and registerSiteCode != ''">#{registerSiteCode},</if>
<if test="registerDate != null">#{registerDate},</if>
<if test="registerManCode != null and registerManCode != ''">#{registerManCode},</if>
<if test="takePieceEmployeeCode != null and takePieceEmployeeCode != ''">#{takePieceEmployeeCode},</if>
<if test="sendSiteCode != null and sendSiteCode != ''">#{sendSiteCode},</if>
<if test="sendCenterCode != null and sendCenterCode != ''">#{sendCenterCode},</if>
<if test="sendDate != null">#{sendDate},</if>
<if test="dispatchManCode != null and dispatchManCode != ''">#{dispatchManCode},</if>
<if test="dispatchDate != null and dispatchDate != ''">#{dispatchDate},</if>
<if test="dispatchSiteCode != null and dispatchSiteCode != ''">#{dispatchSiteCode},</if>
<if test="produceBillDate != null">#{produceBillDate},</if>
<if test="produceBillSiteCode != null and produceBillSiteCode != ''">#{produceBillSiteCode},</if>
<if test="produceBillManCode != null and produceBillManCode != ''">#{produceBillManCode},</if>
<if test="destinationCode != null and destinationCode != ''">#{destinationCode},</if>
<if test="destinationProvince != null and destinationProvince != ''">#{destinationProvince},</if>
<if test="destinationCity != null and destinationCity != ''">#{destinationCity},</if>
<if test="destinationCounty != null and destinationCounty != ''">#{destinationCounty},</if>
<if test="dispatchUnderlingSiteCode != null and dispatchUnderlingSiteCode != ''">#{dispatchUnderlingSiteCode},</if>
<if test="destinationCenterCode != null and destinationCenterCode != ''">#{destinationCenterCode},</if>
<if test="marketManCode != null and marketManCode != ''">#{marketManCode},</if>
<if test="payee != null and payee != ''">#{payee},</if>
<if test="salesmen != null and salesmen != ''">#{salesmen},</if>
<if test="operateEmployeeCode != null and operateEmployeeCode != ''">#{operateEmployeeCode},</if>
<if test="blIsQuestion != null and blIsQuestion != ''">#{blIsQuestion},</if>
<if test="problemType != null and problemType != ''">#{problemType},</if>
<if test="problemCause != null and problemCause != ''">#{problemCause},</if>
<if test="problemDelayDays != null">#{problemDelayDays},</if>
<if test="blMessage != null and blMessage != ''">#{blMessage},</if>
<if test="blAcceptMessage != null and blAcceptMessage != ''">#{blAcceptMessage},</if>
<if test="blGenSubbill != null and blGenSubbill != ''">#{blGenSubbill},</if>
<if test="blSign != null and blSign != ''">#{blSign},</if>
<if test="signMan != null and signMan != ''">#{signMan},</if>
<if test="signManCode != null and signManCode != ''">#{signManCode},</if>
<if test="signSiteCode != null and signSiteCode != ''">#{signSiteCode},</if>
<if test="signDate != null">#{signDate},</if>
<if test="billPicSendRmk != null and billPicSendRmk != ''">#{billPicSendRmk},</if>
<if test="billPicDispatchRmk != null and billPicDispatchRmk != ''">#{billPicDispatchRmk},</if>
<if test="timezoneOffset != null and timezoneOffset != ''">#{timezoneOffset},</if>
<if test="paymentStatus != null and paymentStatus != ''">#{paymentStatus},</if>
<if test="paymentDate != null">#{paymentDate},</if>
<if test="paymentRemark != null and paymentRemark != ''">#{paymentRemark},</if>
<if test="orderRemark != null and orderRemark != ''">#{orderRemark},</if>
<if test="dataFrom != null and dataFrom != ''">#{dataFrom},</if>
<if test="blSpecialGoods != null and blSpecialGoods != ''">#{blSpecialGoods},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="delFlag != null and delFlag != ''">#{delFlag},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="createSite != null and createSite != ''">#{createSite},</if>
<if test="updateSite != null and updateSite != ''">#{updateSite},</if>
</trim>
</insert>
<update id="updateEmisWaybill" parameterType="EmisWaybill">
update emis_waybill
<trim prefix="SET" suffixOverrides=",">
<if test="custOrderId != null and custOrderId != ''">cust_order_id = #{custOrderId},</if>
<if test="billCodeSub != null and billCodeSub != ''">bill_code_sub = #{billCodeSub},</if>
<if test="orderStatus != null and orderStatus != ''">order_status = #{orderStatus},</if>
<if test="waybillStatus != null and waybillStatus != ''">waybill_status = #{waybillStatus},</if>
<if test="orderType != null and orderType != ''">order_type = #{orderType},</if>
<if test="orderDate != null">order_date = #{orderDate},</if>
<if test="userId != null">user_id = #{userId},</if>
<if test="customerCode != null and customerCode != ''">customer_code = #{customerCode},</if>
<if test="customerName != null and customerName != ''">customer_name = #{customerName},</if>
<if test="openId != null and openId != ''">open_id = #{openId},</if>
<if test="receiveName != null and receiveName != ''">receive_name = #{receiveName},</if>
<if test="receiveCompany != null and receiveCompany != ''">receive_company = #{receiveCompany},</if>
<if test="receiveMobile != null and receiveMobile != ''">receive_mobile = #{receiveMobile},</if>
<if test="receiveTel != null and receiveTel != ''">receive_tel = #{receiveTel},</if>
<if test="receiveCountry != null and receiveCountry != ''">receive_country = #{receiveCountry},</if>
<if test="receiveProvince != null and receiveProvince != ''">receive_province = #{receiveProvince},</if>
<if test="receiveCity != null and receiveCity != ''">receive_city = #{receiveCity},</if>
<if test="receiveCounty != null and receiveCounty != ''">receive_county = #{receiveCounty},</if>
<if test="receiveTown != null and receiveTown != ''">receive_town = #{receiveTown},</if>
<if test="receiveAddress != null and receiveAddress != ''">receive_address = #{receiveAddress},</if>
<if test="receivePostcode != null and receivePostcode != ''">receive_postcode = #{receivePostcode},</if>
<if test="receivePcd != null and receivePcd != ''">receive_pcd = #{receivePcd},</if>
<if test="sendName != null and sendName != ''">send_name = #{sendName},</if>
<if test="sendCompany != null and sendCompany != ''">send_company = #{sendCompany},</if>
<if test="sendMobile != null and sendMobile != ''">send_mobile = #{sendMobile},</if>
<if test="sendTel != null and sendTel != ''">send_tel = #{sendTel},</if>
<if test="sendCountry != null and sendCountry != ''">send_country = #{sendCountry},</if>
<if test="sendProvince != null and sendProvince != ''">send_province = #{sendProvince},</if>
<if test="sendCity != null and sendCity != ''">send_city = #{sendCity},</if>
<if test="sendCounty != null and sendCounty != ''">send_county = #{sendCounty},</if>
<if test="sendTown != null and sendTown != ''">send_town = #{sendTown},</if>
<if test="sendAddress != null and sendAddress != ''">send_address = #{sendAddress},</if>
<if test="sendPostcode != null and sendPostcode != ''">send_postcode = #{sendPostcode},</if>
<if test="sendPcd != null and sendPcd != ''">send_pcd = #{sendPcd},</if>
<if test="paymentType != null and paymentType != ''">payment_type = #{paymentType},</if>
<if test="calcFeeType != null and calcFeeType != ''">calc_fee_type = #{calcFeeType},</if>
<if test="custNo != null and custNo != ''">cust_no = #{custNo},</if>
<if test="custName != null and custName != ''">cust_name = #{custName},</if>
<if test="transLineType != null and transLineType != ''">trans_line_type = #{transLineType},</if>
<if test="productType != null and productType != ''">product_type = #{productType},</if>
<if test="timeType != null and timeType != ''">time_type = #{timeType},</if>
<if test="meterType != null and meterType != ''">meter_type = #{meterType},</if>
<if test="carryType != null and carryType != ''">carry_type = #{carryType},</if>
<if test="customsClear != null and customsClear != ''">customs_clear = #{customsClear},</if>
<if test="customsEclaration != null and customsEclaration != ''">customs_eclaration = #{customsEclaration},</if>
<if test="estimateDate != null">estimate_date = #{estimateDate},</if>
<if test="packType != null and packType != ''">pack_type = #{packType},</if>
<if test="dispatchMethod != null and dispatchMethod != ''">dispatch_method = #{dispatchMethod},</if>
<if test="pickupMethod != null and pickupMethod != ''">pickup_method = #{pickupMethod},</if>
<if test="pickStartDate != null">pick_start_date = #{pickStartDate},</if>
<if test="pickFinishDate != null">pick_finish_date = #{pickFinishDate},</if>
<if test="pickFailReason != null and pickFailReason != ''">pick_fail_reason = #{pickFailReason},</if>
<if test="intoWarehouseCode != null and intoWarehouseCode != ''">into_warehouse_code = #{intoWarehouseCode},</if>
<if test="intoWarehouseName != null and intoWarehouseName != ''">into_warehouse_name = #{intoWarehouseName},</if>
<if test="intoWarehouseAddress != null and intoWarehouseAddress != ''">into_warehouse_address = #{intoWarehouseAddress},</if>
<if test="intoWarehouseContact != null and intoWarehouseContact != ''">into_warehouse_contact = #{intoWarehouseContact},</if>
<if test="intoWarehousePhone != null and intoWarehousePhone != ''">into_warehouse_phone = #{intoWarehousePhone},</if>
<if test="intoWarehouseBillCode != null and intoWarehouseBillCode != ''">into_warehouse_bill_code = #{intoWarehouseBillCode},</if>
<if test="warehouseInNo != null and warehouseInNo != ''">warehouse_in_no = #{warehouseInNo},</if>
<if test="customerDeliveryBeginTime != null and customerDeliveryBeginTime != ''">customer_delivery_begin_time = #{customerDeliveryBeginTime},</if>
<if test="customerDeliveryEndTime != null and customerDeliveryEndTime != ''">customer_delivery_end_time = #{customerDeliveryEndTime},</if>
<if test="goodsType != null and goodsType != ''">goods_type = #{goodsType},</if>
<if test="goodsInfo != null and goodsInfo != ''">goods_info = #{goodsInfo},</if>
<if test="goodsPics != null and goodsPics != ''">goods_pics = #{goodsPics},</if>
<if test="blPrepareInFreight != null and blPrepareInFreight != ''">bl_prepare_in_freight = #{blPrepareInFreight},</if>
<if test="prepareInEstFee != null">prepare_in_est_fee = #{prepareInEstFee},</if>
<if test="prepareInRealFee != null">prepare_in_real_fee = #{prepareInRealFee},</if>
<if test="prepareInExpress != null and prepareInExpress != ''">prepare_in_express = #{prepareInExpress},</if>
<if test="prepareInBillCode != null and prepareInBillCode != ''">prepare_in_bill_code = #{prepareInBillCode},</if>
<if test="prepareInRemark != null and prepareInRemark != ''">prepare_in_remark = #{prepareInRemark},</if>
<if test="prepareInSupplier != null and prepareInSupplier != ''">prepare_in_supplier = #{prepareInSupplier},</if>
<if test="totalWeight != null">total_weight = #{totalWeight},</if>
<if test="totalVolume != null">total_volume = #{totalVolume},</if>
<if test="parcelQty != null">parcel_qty = #{parcelQty},</if>
<if test="billWeight != null">bill_weight = #{billWeight},</if>
<if test="volumeWeight != null">volume_weight = #{volumeWeight},</if>
<if test="currency != null and currency != ''">currency = #{currency},</if>
<if test="settlementWeight != null">settlement_weight = #{settlementWeight},</if>
<if test="scanWeight != null">scan_weight = #{scanWeight},</if>
<if test="feeWeight != null">fee_weight = #{feeWeight},</if>
<if test="freight != null">freight = #{freight},</if>
<if test="realPaymentType != null and realPaymentType != ''">real_payment_type = #{realPaymentType},</if>
<if test="realFee != null">real_fee = #{realFee},</if>
<if test="blSpecialQuote != null and blSpecialQuote != ''">bl_special_quote = #{blSpecialQuote},</if>
<if test="blOverLong != null and blOverLong != ''">bl_over_long = #{blOverLong},</if>
<if test="blBill != null and blBill != ''">bl_bill = #{blBill},</if>
<if test="blBillText != null and blBillText != ''">bl_bill_text = #{blBillText},</if>
<if test="blOverWeight != null and blOverWeight != ''">bl_over_weight = #{blOverWeight},</if>
<if test="overWeightNumber != null and overWeightNumber != ''">over_weight_number = #{overWeightNumber},</if>
<if test="feeRemaker != null and feeRemaker != ''">fee_remaker = #{feeRemaker},</if>
<if test="thirdCode != null and thirdCode != ''">third_code = #{thirdCode},</if>
<if test="realValue != null and realValue != ''">real_value = #{realValue},</if>
<if test="blInsure != null and blInsure != ''">bl_insure = #{blInsure},</if>
<if test="insureValue != null and insureValue != ''">insure_value = #{insureValue},</if>
<if test="insureValueCurrency != null and insureValueCurrency != ''">insure_value_currency = #{insureValueCurrency},</if>
<if test="insureFeeCurrency != null and insureFeeCurrency != ''">insure_fee_currency = #{insureFeeCurrency},</if>
<if test="insureFee != null">insure_fee = #{insureFee},</if>
<if test="insureRemark != null and insureRemark != ''">insure_remark = #{insureRemark},</if>
<if test="insureSiteCode != null and insureSiteCode != ''">insure_site_code = #{insureSiteCode},</if>
<if test="insureDate != null and insureDate != ''">insure_date = #{insureDate},</if>
<if test="blPrint != null and blPrint != ''">bl_print = #{blPrint},</if>
<if test="printManCode != null and printManCode != ''">print_man_code = #{printManCode},</if>
<if test="printSite != null and printSite != ''">print_site = #{printSite},</if>
<if test="printDate != null and printDate != ''">print_date = #{printDate},</if>
<if test="printCount != null">print_count = #{printCount},</if>
<if test="blDispFd != null and blDispFd != ''">bl_disp_fd = #{blDispFd},</if>
<if test="transferCode != null and transferCode != ''">transfer_code = #{transferCode},</if>
<if test="transferBillcode != null and transferBillcode != ''">transfer_billcode = #{transferBillcode},</if>
<if test="dispFdDate != null">disp_fd_date = #{dispFdDate},</if>
<if test="dispFdReason != null and dispFdReason != ''">disp_fd_reason = #{dispFdReason},</if>
<if test="currentSiteCode != null and currentSiteCode != ''">current_site_code = #{currentSiteCode},</if>
<if test="nextSiteCode != null and nextSiteCode != ''">next_site_code = #{nextSiteCode},</if>
<if test="lastSiteCode != null and lastSiteCode != ''">last_site_code = #{lastSiteCode},</if>
<if test="registerSiteCode != null and registerSiteCode != ''">register_site_code = #{registerSiteCode},</if>
<if test="registerDate != null">register_date = #{registerDate},</if>
<if test="registerManCode != null and registerManCode != ''">register_man_code = #{registerManCode},</if>
<if test="takePieceEmployeeCode != null and takePieceEmployeeCode != ''">take_piece_employee_code = #{takePieceEmployeeCode},</if>
<if test="sendSiteCode != null and sendSiteCode != ''">send_site_code = #{sendSiteCode},</if>
<if test="sendCenterCode != null and sendCenterCode != ''">send_center_code = #{sendCenterCode},</if>
<if test="sendDate != null">send_date = #{sendDate},</if>
<if test="dispatchManCode != null and dispatchManCode != ''">dispatch_man_code = #{dispatchManCode},</if>
<if test="dispatchDate != null and dispatchDate != ''">dispatch_date = #{dispatchDate},</if>
<if test="dispatchSiteCode != null and dispatchSiteCode != ''">dispatch_site_code = #{dispatchSiteCode},</if>
<if test="produceBillDate != null">produce_bill_date = #{produceBillDate},</if>
<if test="produceBillSiteCode != null and produceBillSiteCode != ''">produce_bill_site_code = #{produceBillSiteCode},</if>
<if test="produceBillManCode != null and produceBillManCode != ''">produce_bill_man_code = #{produceBillManCode},</if>
<if test="destinationCode != null and destinationCode != ''">destination_code = #{destinationCode},</if>
<if test="destinationProvince != null and destinationProvince != ''">destination_province = #{destinationProvince},</if>
<if test="destinationCity != null and destinationCity != ''">destination_city = #{destinationCity},</if>
<if test="destinationCounty != null and destinationCounty != ''">destination_county = #{destinationCounty},</if>
<if test="dispatchUnderlingSiteCode != null and dispatchUnderlingSiteCode != ''">dispatch_underling_site_code = #{dispatchUnderlingSiteCode},</if>
<if test="destinationCenterCode != null and destinationCenterCode != ''">destination_center_code = #{destinationCenterCode},</if>
<if test="marketManCode != null and marketManCode != ''">market_man_code = #{marketManCode},</if>
<if test="payee != null and payee != ''">payee = #{payee},</if>
<if test="salesmen != null and salesmen != ''">salesmen = #{salesmen},</if>
<if test="operateEmployeeCode != null and operateEmployeeCode != ''">operate_employee_code = #{operateEmployeeCode},</if>
<if test="blIsQuestion != null and blIsQuestion != ''">bl_is_question = #{blIsQuestion},</if>
<if test="problemType != null and problemType != ''">problem_type = #{problemType},</if>
<if test="problemCause != null and problemCause != ''">problem_cause = #{problemCause},</if>
<if test="problemDelayDays != null">problem_delay_days = #{problemDelayDays},</if>
<if test="blMessage != null and blMessage != ''">bl_message = #{blMessage},</if>
<if test="blAcceptMessage != null and blAcceptMessage != ''">bl_accept_message = #{blAcceptMessage},</if>
<if test="blGenSubbill != null and blGenSubbill != ''">bl_gen_subbill = #{blGenSubbill},</if>
<if test="blSign != null and blSign != ''">bl_sign = #{blSign},</if>
<if test="signMan != null and signMan != ''">sign_man = #{signMan},</if>
<if test="signManCode != null and signManCode != ''">sign_man_code = #{signManCode},</if>
<if test="signSiteCode != null and signSiteCode != ''">sign_site_code = #{signSiteCode},</if>
<if test="signDate != null">sign_date = #{signDate},</if>
<if test="billPicSendRmk != null and billPicSendRmk != ''">bill_pic_send_rmk = #{billPicSendRmk},</if>
<if test="billPicDispatchRmk != null and billPicDispatchRmk != ''">bill_pic_dispatch_rmk = #{billPicDispatchRmk},</if>
<if test="timezoneOffset != null and timezoneOffset != ''">timezone_offset = #{timezoneOffset},</if>
<if test="paymentStatus != null and paymentStatus != ''">payment_status = #{paymentStatus},</if>
<if test="paymentDate != null">payment_date = #{paymentDate},</if>
<if test="paymentRemark != null and paymentRemark != ''">payment_remark = #{paymentRemark},</if>
<if test="orderRemark != null and orderRemark != ''">order_remark = #{orderRemark},</if>
<if test="dataFrom != null and dataFrom != ''">data_from = #{dataFrom},</if>
<if test="blSpecialGoods != null and blSpecialGoods != ''">bl_special_goods = #{blSpecialGoods},</if>
<if test="remark != null and remark != ''">remark = #{remark},</if>
<if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="createSite != null and createSite != ''">create_site = #{createSite},</if>
<if test="updateSite != null and updateSite != ''">update_site = #{updateSite},</if>
</trim>
where id = #{id}
</update>
<update id="updatePrintStatus" parameterType="EmisWaybill">
update emis_waybill set
bl_print='1',
print_man_code=#{printManCode},
print_site=#{printSite},
print_date=now(),
print_count=print_count+1
<if test="updateBy != null and updateBy != ''">,update_by = #{updateBy}</if>
<if test="updateSite != null and updateSite != ''">,update_site = #{updateSite}</if>
where bill_code=#{billCode}
</update>
<update id="updateSignStatus" parameterType="EmisWaybill">
update emis_waybill
set sign_man=#{signMan},
sign_man_code=#{signManCode},
sign_site_code = #{signSiteCode},
sign_date = #{signDate},
bill_pic_dispatch_rmk = #{billPicDispatchRmk}
<if test="updateBy != null and updateBy != ''">,update_by = #{updateBy}</if>
<if test="updateSite != null and updateSite != ''">,update_site = #{updateSite}</if>
where bill_code=#{billCode}
</update>
<update id="updateProblemStatus" parameterType="EmisWaybill">
update emis_waybill
<trim prefix="SET" suffixOverrides=",">
bl_is_question = '1',
problem_type = #{problemType},
problem_cause = #{problemCause},
problem_delay_days = #{problemDelayDays}
<if test="updateBy != null and updateBy != ''">,update_by = #{updateBy}</if>
<if test="updateSite != null and updateSite != ''">,update_site = #{updateSite}</if>
</trim>
where bill_code=#{billCode}
</update>
<update id="updateTransferInfo" parameterType="EmisWaybill">
update emis_waybill
<trim prefix="SET" suffixOverrides=",">
bl_disp_fd ='1',
transfer_code = #{transferCode},
transfer_billcode = #{transferBillcode},
disp_fd_date = #{dispFdDate},
disp_fd_reason = #{dispFdReason}
<if test="updateBy != null and updateBy != ''">,update_by = #{updateBy}</if>
<if test="updateSite != null and updateSite != ''">,update_site = #{updateSite}</if>
</trim>
where bill_code=#{billCode}
</update>
<update id="updatePreOrNextSiteByBillCode" parameterType="EmisWaybill">
update emis_waybill
<trim prefix="SET" suffixOverrides=",">
<if test="currentSiteCode != null and currentSiteCode != ''">current_site_code = #{currentSiteCode},</if>
<if test="nextSiteCode != null and nextSiteCode != ''">next_site_code = #{nextSiteCode},</if>
<if test="lastSiteCode != null and lastSiteCode != ''">last_site_code = #{lastSiteCode},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="updateSite != null and updateSite != ''">update_site = #{updateSite},</if>
</trim>
where bill_code=#{billCode}
</update>
<update id="changeWaybillStatusByBillCode" parameterType="EmisWaybill">
update emis_waybill
<trim prefix="SET" suffixOverrides=",">
waybill_status=#{waybillStatus}
<if test="updateBy != null and updateBy != ''">,update_by = #{updateBy}</if>
<if test="updateSite != null and updateSite != ''">,update_site = #{updateSite}</if>
</trim>
where bill_code=#{billCode}
</update>
<update id="changeOrderStatusByBillCode" parameterType="EmisWaybill">
update emis_waybill set order_status=#{orderStatus}
<if test="updateBy != null and updateBy != ''">,update_by = #{updateBy}</if>
<if test="updateSite != null and updateSite != ''">,update_site = #{updateSite}</if>
where bill_code=#{billCode}
</update>
<update id="changeOrderStatusByOrderSn" parameterType="EmisWaybill">
update emis_waybill set order_status=#{orderStatus}
<if test="updateBy != null and updateBy != ''">,update_by = #{updateBy}</if>
<if test="updateSite != null and updateSite != ''">,update_site = #{updateSite}</if>
where order_sn=#{orderSn}
</update>
<delete id="deleteEmisWaybillById" parameterType="Long">
update emis_waybill set del_flag='1'
<if test="updateBy != null and updateBy != ''">,update_by = #{updateBy}</if>
<if test="updateSite != null and updateSite != ''">,update_site = #{updateSite}</if>
where id = #{id}
</delete>
<delete id="deleteEmisWaybillByIds" parameterType="String">
update emis_waybill set del_flag='1
<if test="updateBy != null and updateBy != ''">,update_by = #{updateBy}</if>
<if test="updateSite != null and updateSite != ''">,update_site = #{updateSite}</if>
where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>