<iftest="custOrderId != null and custOrderId != ''"> and cust_order_id=#{custOrderId}</if>
<iftest="billCodeSub != null and billCodeSub != ''"> and bill_code_sub like concat('%', #{billCodeSub}, '%')</if>
<iftest="orderStatus != null and orderStatus != ''"> and order_status=#{orderStatus}</if>
<iftest="waybillStatus != null and waybillStatus != ''"> and waybill_status=#{waybillStatus}</if>
<iftest="orderType != null and orderType != ''"> and order_type=#{orderType}</if>
<iftest="orderDate != null "> and order_date = #{orderDate}</if>
<iftest="userId != null "> and user_id = #{userId}</if>
<iftest="customerCode != null and customerCode != ''"> and customer_code=#{customerCode}</if>
<iftest="customerName != null and customerName != ''"> and customer_name like concat('%', #{customerName}, '%')</if>
<iftest="openId != null and openId != ''"> and open_id like concat('%', #{openId}, '%')</if>
<iftest="receiveName != null and receiveName != ''"> and receive_name like concat('%', #{receiveName}, '%')</if>
<iftest="receiveCompany != null and receiveCompany != ''"> and receive_company like concat('%', #{receiveCompany}, '%')</if>
<iftest="receiveMobile != null and receiveMobile != ''"> and receive_mobile like concat('%', #{receiveMobile}, '%')</if>
<iftest="receiveTel != null and receiveTel != ''"> and receive_tel like concat('%', #{receiveTel}, '%')</if>
<iftest="receiveCountry != null and receiveCountry != ''"> and receive_country=#{receiveCountry}</if>
<iftest="receiveProvince != null and receiveProvince != ''"> and receive_province=#{receiveProvince}</if>
<iftest="receiveCity != null and receiveCity != ''"> and receive_city=#{receiveCity}</if>
<iftest="receiveCounty != null and receiveCounty != ''"> and receive_county=#{receiveCounty}</if>
<iftest="receiveTown != null and receiveTown != ''"> and receive_town=#{receiveTown}</if>
<iftest="receiveAddress != null and receiveAddress != ''"> and receive_address like concat('%', #{receiveAddress}, '%')</if>
<iftest="receivePostcode != null and receivePostcode != ''"> and receive_postcode like concat('%', #{receivePostcode}, '%')</if>
<iftest="receivePcd != null and receivePcd != ''"> and receive_pcd like concat('%', #{receivePcd}, '%')</if>
<iftest="sendName != null and sendName != ''"> and send_name like concat('%', #{sendName}, '%')</if>
<iftest="sendCompany != null and sendCompany != ''"> and send_company like concat('%', #{sendCompany}, '%')</if>
<iftest="sendMobile != null and sendMobile != ''"> and send_mobile like concat('%', #{sendMobile}, '%')</if>
<iftest="sendTel != null and sendTel != ''"> and send_tel like concat('%', #{sendTel}, '%')</if>
<iftest="sendCountry != null and sendCountry != ''"> and send_country=#{sendCountry}</if>
<iftest="sendProvince != null and sendProvince != ''"> and send_province=#{sendProvince}</if>
<iftest="sendCity != null and sendCity != ''"> and send_city=#{sendCity}</if>
<iftest="sendCounty != null and sendCounty != ''"> and send_county=#{sendCounty}</if>
<iftest="sendTown != null and sendTown != ''"> and send_town=#{sendTown}</if>
<iftest="blVirtual ==1"> and bl_virtual=#{blVirtual}</if>
<iftest="sendAddress != null and sendAddress != ''"> and send_address like concat('%', #{sendAddress}, '%')</if>
<iftest="sendPostcode != null and sendPostcode != ''"> and send_postcode like concat('%', #{sendPostcode}, '%')</if>
<iftest="enterpriseName != null and enterpriseName != ''"> and a.enterprise_name like concat('%', #{enterpriseName}, '%')</if>
<iftest="enterpriseTaxId != null and enterpriseTaxId != ''"> and a.enterprise_tax_id like concat('%', #{enterpriseTaxId}, '%')</if>
<iftest="paymentType != null and paymentType != ''"> and FIND_IN_SET(payment_type,#{paymentType})</if>
<iftest="calcFeeType != null and calcFeeType != ''"> and calc_fee_type=#{calcFeeType}</if>
<iftest="custNo != null and custNo != ''"> and cust_no like concat('%', #{custNo}, '%')</if>
<iftest="custName != null and custName != ''"> and cust_name like concat('%', #{custName}, '%')</if>
<includerefid="salesSupportFilter"/>
<iftest="transLineType != null and transLineType != ''"> and trans_line_type=#{transLineType}</if>
<iftest="productType != null and productType != ''"> and FIND_IN_SET(product_type,#{productType})</if>
<iftest="timeType != null and timeType != ''"> and time_type like concat('%', #{timeType}, '%')</if>
<iftest="meterType != null and meterType != ''"> and meter_type=#{meterType}</if>
<iftest="carryType != null and carryType != ''">and FIND_IN_SET(a.carry_type,#{carryType})</if>
<iftest="customsClear != null and customsClear != ''"> and customs_clear=#{customsClear}</if>
<iftest="customsEclaration != null and customsEclaration != ''"> and customs_eclaration=#{customsEclaration}</if>
<iftest="estimateDate != null "> and estimate_date = #{estimateDate}</if>
<iftest="packType != null and packType != ''"> and FIND_IN_SET(#{packType},pack_type)</if>
<iftest="dispatchMethod != null and dispatchMethod != ''"> and dispatch_method=#{dispatchMethod}</if>
<iftest="pickupMethod != null and pickupMethod != ''"> and pickup_method= #{pickupMethod}</if>
<iftest="pickStartDate != null "> and pick_start_date = #{pickStartDate}</if>
<iftest="pickFinishDate != null "> and pick_finish_date = #{pickFinishDate}</if>
<iftest="pickFailReason != null and pickFailReason != ''"> and pick_fail_reason like concat('%', #{pickFailReason}, '%')</if>
<iftest="intoWarehouseCode != null and intoWarehouseCode != ''"> and into_warehouse_code like concat('%', #{intoWarehouseCode}, '%')</if>
<iftest="intoWarehouseName != null and intoWarehouseName != ''"> and into_warehouse_name like concat('%', #{intoWarehouseName}, '%')</if>
<iftest="intoWarehouseAddress != null and intoWarehouseAddress != ''"> and into_warehouse_address like concat('%', #{intoWarehouseAddress}, '%')</if>
<iftest="intoWarehouseContact != null and intoWarehouseContact != ''"> and into_warehouse_contact like concat('%', #{intoWarehouseContact}, '%')</if>
<iftest="intoWarehousePhone != null and intoWarehousePhone != ''"> and into_warehouse_phone like concat('%', #{intoWarehousePhone}, '%')</if>
<iftest="intoWarehouseBillCode != null and intoWarehouseBillCode != ''"> and into_warehouse_bill_code like concat('%', #{intoWarehouseBillCode}, '%')</if>
<iftest="warehouseInNo != null and warehouseInNo != ''"> and warehouse_in_no like concat('%', #{warehouseInNo}, '%')</if>
<iftest="customerDeliveryBeginTime != null and customerDeliveryBeginTime != ''"> and customer_delivery_begin_time like concat('%', #{customerDeliveryBeginTime}, '%')</if>
<iftest="customerDeliveryEndTime != null and customerDeliveryEndTime != ''"> and customer_delivery_end_time like concat('%', #{customerDeliveryEndTime}, '%')</if>
<iftest="goodsInfo != null and goodsInfo != ''"> and goods_info like concat('%', #{goodsInfo}, '%')</if>
<iftest="blPrepareInFreight != null and blPrepareInFreight != ''"> and bl_prepare_in_freight=#{blPrepareInFreight}</if>
<iftest="prepareInEstFee != null "> and prepare_in_est_fee = #{prepareInEstFee}</if>
<iftest="prepareInRealFee != null "> and prepare_in_real_fee = #{prepareInRealFee}</if>
<iftest="prepareInExpress != null and prepareInExpress != ''"> and prepare_in_express like concat('%', #{prepareInExpress}, '%')</if>
<iftest="prepareInBillCode != null and prepareInBillCode != ''"> and prepare_in_bill_code like concat('%', #{prepareInBillCode}, '%')</if>
<iftest="prepareInRemark != null and prepareInRemark != ''"> and prepare_in_remark like concat('%', #{prepareInRemark}, '%')</if>
<iftest="prepareInSupplier != null and prepareInSupplier != ''"> and prepare_in_supplier like concat('%', #{prepareInSupplier}, '%')</if>
<iftest="totalWeight != null "> and total_weight = #{totalWeight}</if>
<iftest="totalVolume != null "> and total_volume = #{totalVolume}</if>
<iftest="parcelQty != null "> and parcel_qty = #{parcelQty}</if>
<iftest="billWeight != null "> and bill_weight = #{billWeight}</if>
<iftest="volumeWeight != null "> and volume_weight = #{volumeWeight}</if>
<iftest="currency != null and currency != ''"> and currency= #{currency}</if>
<iftest="settlementWeight != null "> and settlement_weight = #{settlementWeight}</if>
<iftest="scanWeight != null "> and scan_weight = #{scanWeight}</if>
<iftest="feeWeight != null "> and fee_weight = #{feeWeight}</if>
<iftest="freight != null "> and freight = #{freight}</if>
<iftest="realPaymentType != null and realPaymentType != ''"> and real_payment_type=#{realPaymentType}</if>
<iftest="realFee != null "> and real_fee = #{realFee}</if>
<iftest="blSpecialQuote != null and blSpecialQuote != ''"> and bl_special_quote=#{blSpecialQuote}</if>
<iftest="blOverLong != null and blOverLong != ''"> and bl_over_long=#{blOverLong}</if>
<iftest="blBill != null and blBill != ''"> and bl_bill=#{blBill}</if>
<iftest="blBillText != null and blBillText != ''"> and bl_bill_text like concat('%', #{blBillText}, '%')</if>
<iftest="blOverWeight != null and blOverWeight != ''"> and bl_over_weight like concat('%', #{blOverWeight}, '%')</if>
<iftest="overWeightNumber != null and overWeightNumber != ''"> and over_weight_number like concat('%', #{overWeightNumber}, '%')</if>
<iftest="feeRemark != null and feeRemark != ''"> and fee_remark like concat('%', #{feeRemark}, '%')</if>
<iftest="thirdCode != null and thirdCode != ''"> and third_code like concat('%', #{thirdCode}, '%')</if>
<iftest="realValue != null and realValue != ''"> and real_value like concat('%', #{realValue}, '%')</if>
<iftest="blInsure != null and blInsure != ''"> and bl_insure= #{blInsure}</if>
<iftest="insureValue != null and insureValue != ''"> and insure_value like concat('%', #{insureValue}, '%')</if>
<iftest="insureValueCurrency != null and insureValueCurrency != ''"> and insure_value_currency like concat('%', #{insureValueCurrency}, '%')</if>
<iftest="insureFeeCurrency != null and insureFeeCurrency != ''"> and insure_fee_currency like concat('%', #{insureFeeCurrency}, '%')</if>
<iftest="insureFee != null "> and insure_fee = #{insureFee}</if>
<iftest="insureRemark != null and insureRemark != ''"> and insure_remark like concat('%', #{insureRemark}, '%')</if>
<iftest="insureSiteCode != null and insureSiteCode != ''"> and insure_site_code=#{insureSiteCode}</if>
<iftest="blPrint != null and blPrint != ''"> and bl_print=#{blPrint}</if>
<iftest="printManCode != null and printManCode != ''"> and print_man_code like concat('%', #{printManCode}, '%')</if>
<iftest="printSite != null and printSite != ''"> and print_site=#{printSite},</if>
<iftest="printDate != null and printDate != ''"> and print_date like concat('%', #{printDate}, '%')</if>
<iftest="blDispFd != null and blDispFd != ''"> and bl_disp_fd=#{blDispFd}</if>
<iftest="transferCode != null and transferCode != ''"> and transfer_code like concat('%', #{transferCode}, '%')</if>
<iftest="transferBillcode != null and transferBillcode != ''"> and transfer_billcode like concat('%', #{transferBillcode}, '%')</if>
<iftest="dispFdDate != null "> and disp_fd_date = #{dispFdDate}</if>
<iftest="dispFdReason != null and dispFdReason != ''"> and disp_fd_reason like concat('%', #{dispFdReason}, '%')</if>
<iftest="currentSiteCode != null and currentSiteCode != ''"> and current_site_code=#{currentSiteCode}</if>
<iftest="nextSiteCode != null and nextSiteCode != ''"> and next_site_code= #{nextSiteCode}</if>
<iftest="lastSiteCode != null and lastSiteCode != ''"> and last_site_code=#{lastSiteCode}</if>
<iftest="registerSiteCode != null and registerSiteCode != ''"> and register_site_code=#{registerSiteCode}</if>
<iftest="registerDate != null "> and register_date = #{registerDate}</if>
<iftest="registerManCode != null and registerManCode != ''"> and register_man_code= #{registerManCode}</if>
<iftest="takePieceEmployeeCode != null and takePieceEmployeeCode != ''"> and exists (select 1 from sys_user su1, sys_user su2 where su1.emp_code = #{takePieceEmployeeCode} and su2.emp_code = a.take_piece_employee_code and su1.emp_name = su2.emp_name and su1.del_flag='0' and su2.del_flag='0')</if>
<iftest="sendDate != null "> and send_date = #{sendDate}</if>
<iftest="dispatchManCode != null and dispatchManCode != ''"> and dispatch_man_code=#{dispatchManCode}</if>
<iftest="dispatchSiteCode != null and dispatchSiteCode != ''"> and dispatch_site_code=#{dispatchSiteCode}</if>
<iftest="produceBillDate != null "> and produce_bill_date = #{produceBillDate}</if>
<iftest="produceBillSiteCode != null and produceBillSiteCode != ''"> and produce_bill_site_code=#{produceBillSiteCode}</if>
<iftest="produceBillManCode != null and produceBillManCode != ''"> and produce_bill_man_code=#{produceBillManCode}</if>
<iftest="destinationCode != null and destinationCode != ''"> and destination_code =#{destinationCode}</if>
<iftest="destinationProvince != null and destinationProvince != ''"> and destination_province=#{destinationProvince}</if>
<iftest="destinationCity != null and destinationCity != ''"> and destination_city=#{destinationCity}</if>
<iftest="destinationCounty != null and destinationCounty != ''"> and destination_county=#{destinationCounty}</if>
<iftest="dispatchUnderlingSiteCode != null and dispatchUnderlingSiteCode != ''"> and dispatch_underling_site_code=#{dispatchUnderlingSiteCode}</if>
<iftest="destinationCenterCode != null and destinationCenterCode != ''"> and destination_center_code=#{destinationCenterCode}</if>
<iftest="marketManCode != null and marketManCode != ''"> and market_man_code = #{marketManCode}</if>
<iftest="payee != null and payee != ''"> and a.payee=#{payee}</if>
<iftest="salesmen != null and salesmen != ''"> and a.salesmen like concat('%', #{salesmen}, '%')</if>
<iftest="operateEmployeeCode != null and operateEmployeeCode != ''"> and operate_employee_code=#{operateEmployeeCode}</if>
<iftest="blIsQuestion != null and blIsQuestion != ''"> and bl_is_question=#{blIsQuestion}</if>
<iftest="problemType != null and problemType != ''"> and problem_type=#{problemType}</if>
<iftest="problemCause != null and problemCause != ''"> and problem_cause like concat('%', #{problemCause}, '%')</if>
<iftest="problemDelayDays != null "> and problem_delay_days = #{problemDelayDays}</if>
<iftest="blMessage != null and blMessage != ''"> and bl_message=#{blMessage}</if>
<iftest="blAcceptMessage != null and blAcceptMessage != ''"> and bl_accept_message=#{blAcceptMessage}</if>
<iftest="blGenSubbill != null and blGenSubbill != ''"> and bl_gen_subbill=#{blGenSubbill}</if>
<iftest="signMan != null and signMan != ''"> and sign_man like concat('%', #{signMan}, '%')</if>
<iftest="signManCode != null and signManCode != ''"> and sign_man_code=#{signManCode}</if>
<iftest="signSiteCode != null and signSiteCode != ''"> and sign_site_code=#{signSiteCode}</if>
<iftest="paymentStatus != null and paymentStatus != ''"> and FIND_IN_SET(payment_status,#{paymentStatus})</if>
<iftest="paymentDate != null "> and payment_date = #{paymentDate}</if>
<iftest="paymentRemark != null and paymentRemark != ''"> and payment_remark like concat('%', #{paymentRemark}, '%')</if>
<iftest="orderRemark != null and orderRemark != ''"> and order_remark like concat('%', #{orderRemark}, '%')</if>
<iftest="sendSiteCode != null and sendSiteCode != ''">and FIND_IN_SET(`send_site_code`,#{sendSiteCode})
</if>
<iftest="startSiteCode != null and startSiteCode != ''">
and a.start_site_code=#{startSiteCode}
</if>
<iftest="remark != null and remark != ''"> and a.remark like concat('%', #{remark}, '%')</if>
<iftest="createBy != null and createBy != ''"> and a.create_by= #{createBy}</if>
<iftest="updateBy != null and updateBy != ''"> and a.update_by=#{updateBy}</if>
<iftest="createSite != null and createSite != ''"> and a.create_site=#{createSite}</if>
<iftest="updateSite != null and updateSite != ''"> and a.update_site=#{updateSite}</if>
<iftest="params.problemQueryType != null and params.problemQueryType == 1 and params.problemQueryIds != null and params.problemQueryIds !=''">
and exists (
select 1 from emis_waybill_problem_info ewpi where a.bill_code=ewpi.bill_code and ewpi.del_flag='0' and FIND_IN_SET( ewpi.`problem_type`, #{params.problemQueryIds} )
)
</if>
<iftest="params.problemQueryType != null and params.problemQueryType == 2 and params.problemQueryIds != null and params.problemQueryIds !=''">
and not exists (
select 1 from emis_waybill_problem_info ewpi where a.bill_code=ewpi.bill_code and ewpi.del_flag='0' and FIND_IN_SET( ewpi.`problem_type`, #{params.problemQueryIds} )
)
</if>
<iftest="params.waybillStatType != null and params.waybillStatType == 1">
and a.order_type='0'
and a.waybill_status='0'
and a.order_status in('0','3')
and (
a.take_piece_employee_code=#{params.privEmpCode}
or (a.pickup_method in('1','3') and a.operate_employee_code is null )
or (a.operate_employee_code=#{params.privEmpCode} )
)
</if>
<iftest="params.waybillStatType != null and params.waybillStatType == 2">
and a.waybill_status!='0' and a.order_status!='2'
and (
a.operate_employee_code=#{params.privEmpCode}
or a.take_piece_employee_code=#{params.privEmpCode}
or a.register_man_code=#{params.privEmpCode}
)
</if>
<iftest="params.waybillStatType != null and params.waybillStatType == 3">
and a.order_status='2'
and (
a.operate_employee_code=#{params.privEmpCode}
or a.take_piece_employee_code=#{params.privEmpCode}
)
</if>
<!-- 转单 -->
<iftest="params.waybillStatType != null and params.waybillStatType == 4">
and a.order_status in('0','3') and exists (
select 1 from emis_waybill_change_to ewcto where a.bill_code=ewcto.bill_code and ewcto.change_from=#{params.privEmpCode}
)
</if>
<iftest="params.beginOrderDate != null and params.beginOrderDate != ''">
and a.order_date <![CDATA[ >= ]]> #{params.beginOrderDate}
</if>
<iftest="params.endOrderDate != null and params.endOrderDate != ''">
and a.order_date <![CDATA[ <= ]]> #{params.endOrderDate}
</if>
<iftest="payee != null and payee != ''">
and a.payee=#{payee}
</if>
<iftest="salesmen != null and salesmen != '' ">
and a.salesmen=#{salesmen}
</if>
<iftest="blSign != null and blSign != ''">
and a.bl_sign=#{blSign}
</if>
<iftest="params.beginDate != null and params.beginDate != ''">
and a.send_date <![CDATA[ >= ]]> #{params.beginDate}
</if>
<iftest="params.endDate != null and params.endDate != ''">
and a.send_date <![CDATA[ <= ]]> #{params.endDate}
</if>
<iftest="params.blUploadGoodsPic != null and params.blUploadGoodsPic != '' and params.blUploadGoodsPic == 1">
and a.goods_pics is not null
</if>
<iftest="params.blUploadGoodsPic != null and params.blUploadGoodsPic != '' and params.blUploadGoodsPic == 0">
and a.goods_pics is null
</if>
<iftest="params.beginSendDate != null and params.beginSendDate != ''">
and a.send_date <![CDATA[ >= ]]> #{params.beginSendDate}
</if>
<iftest="params.endSendDate != null and params.endSendDate != ''">
and a.send_date <![CDATA[ <= ]]> #{params.endSendDate}
</if>
<iftest="params.beginCreateTime != null and params.beginCreateTime != ''">
and a.create_time <![CDATA[ >= ]]> #{params.beginCreateTime}
</if>
<iftest="params.endCreateTime != null and params.endCreateTime != ''">
and a.create_time <![CDATA[ <= ]]> #{params.endCreateTime}
</if>
<iftest="params.expireNotSign != null and params.expireNotSign == 1">
and a.estimate_date <![CDATA[ < ]]> now() and bl_sign!='1'
</if>
<iftest="params.printFlag != null ">
and a.bl_print=#{params.printFlag}
</if>
<iftest="params.isNeedPack != null and params.isNeedPack == 1">
and not EXISTS ( select 1 from emis_tms_pack_dtl etp where etp.del_flag='0' and etp.main_bill_code=a.bill_code )
and a.trans_line_type in(
select line_code from emis_trans_line etl where etl.trans_type=1
)
and bl_sign!='1' and waybill_status!='40'
and (a.send_site_code=#{params.privSiteCode} or a.start_site_code=#{params.privSiteCode})
and a.current_site_code=#{params.privSiteCode}
</if>
<iftest="params.isNeedBatch != null and params.isNeedBatch == 1">
and a.bill_code = #{billCode}
<!--
and a.bill_code not in(
select etsbd.bill_code from emis_tms_site_batch_dtl etsbd,emis_tms_site_batch etsb
where etsbd.batch_no=etsb.batch_no and etsbd.del_flag='0' and etsb.del_flag='0' and etsb.batch_type=#{params.batchType}
)
-->
</if>
<!-- 查询现金客户额度属性; 1:查询超期额度,2:查询账期内额度 -->
<iftest="params.queryQuotaType != null and params.queryQuotaType == 1">
and a.send_date is not null
and DATEDIFF(NOW(), a.send_date) > 10
</if>
<iftest="params.queryQuotaType != null and params.queryQuotaType == 2">
and a.send_date is not null
and DATEDIFF(NOW(), a.send_date) <![CDATA[ <= ]]> 10
</if>
<iftest="(params.isNeedBatch == null or (params.isNeedBatch != null and params.isNeedBatch != 1) ) ">
<iftest="(salesmen == null or salesmen=='') and params.privSiteCode != null and params.privSiteCode != '88888'">
and (
a.send_site_code=#{params.privSiteCode}
or a.dispatch_site_code=#{params.privSiteCode}
or a.start_site_code=#{params.privSiteCode}
<iftest="params.isQueryPrintOrder != null and params.isQueryPrintOrder == 1">
or EXISTS (select 1 from emis_tms_scan_record etsr where a.bill_code=etsr.main_bill_code and etsr.scan_site_code=#{params.privSiteCode})
</if>
<iftest="custNo != null and custNo != ''">
or EXISTS (
select 1 from emis_customer_user ecu where a.cust_no=ecu.monthly_pay_code and ecu.owner_site=#{params.privSiteCode}
)
</if>
or a.salesmen=#{params.privEmpName}
or a.payee=#{params.privEmpName}
or a.salesmen in(
select salesmen from emis_salesmen_rel esr where esr.del_flag='0' and esr.bl_open='1' and now() <![CDATA[ >= ]]> esr.start_date and now() <![CDATA[ <= ]]> esr.end_date and esr.sales_ass=#{params.privEmpName}
)
or a.operate_employee_code=#{params.privEmpCode}
or a.take_piece_employee_code=#{params.privEmpCode}
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.