643 lines
44 KiB
XML
643 lines
44 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.oms.mapper.EmisWaybillMapper">
|
|
|
|
<resultMap type="EmisWaybill" id="BaseEmisWaybillResult">
|
|
<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="feeRemark" column="fee_remark" />
|
|
<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="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" />
|
|
<result property="extInfo" column="ext_info" />
|
|
|
|
|
|
<!-- 扩展属性 -->
|
|
<result property="receiveCountryName" column="receive_country_name" />
|
|
<result property="receiveProvinceName" column="receive_province_name" />
|
|
<result property="receiveCityName" column="receive_city_name" />
|
|
<result property="receiveCountyName" column="receive_county_name" />
|
|
|
|
|
|
<result property="sendCountryName" column="send_country_name" />
|
|
<result property="sendProvinceName" column="send_province_name" />
|
|
<result property="sendCityName" column="send_city_name" />
|
|
<result property="sendCountyName" column="send_county_name" />
|
|
|
|
<result property="productTypeName" column="product_type_name" />
|
|
<result property="transLineTypeName" column="trans_line_type_name" />
|
|
<result property="sendSiteName" column="send_site_name" />
|
|
<result property="dispatchUnderlingSiteName" column="dispatch_underling_site_name" />
|
|
|
|
<result property="destinationName" column="destination_name" />
|
|
|
|
<result property="dispatchSiteName" column="dispatch_site_name" />
|
|
<result property="dispatchManName" column="dispatch_man_name" />
|
|
|
|
<result property="printSiteName" column="print_site_name" />
|
|
<result property="printManName" column="print_man_name" />
|
|
|
|
<result property="takePieceEmployeeName" column="take_piece_employee_name" />
|
|
<result property="operateEmployeeName" column="operate_employee_name" />
|
|
<result property="registerSiteName" column="register_site_name" />
|
|
<result property="registerManName" column="register_man_name" />
|
|
|
|
<result property="currentSiteName" column="current_site_name" />
|
|
<result property="nextSiteName" column="next_site_name" />
|
|
<result property="lastSiteName" column="last_site_name" />
|
|
|
|
<result property="problemTypeName" column="problem_type_name" />
|
|
|
|
|
|
<result property="billPicSendRmk" column="bill_pic_send_rmk" />
|
|
<result property="billPicDispatchRmk" column="bill_pic_dispatch_rmk" />
|
|
<result property="billPicGoodsRmk" column="goods_pics" />
|
|
|
|
|
|
</resultMap>
|
|
|
|
<resultMap id="EmisWaybillResult" extends="BaseEmisWaybillResult" type="EmisWaybill">
|
|
<!-- 获取订单最后一条扫描记录 -->
|
|
<!-- <association property="lastScanRecord" column="bill_code" select="com.xdadan.erp.emis.mapper.EmisTmsScanRecordMapper.selectLastRecordBaseInfoByBillCode"/>-->
|
|
</resultMap>
|
|
|
|
|
|
<!-- 其他基本信息 a.bill_code_sub, 列表中不要显示子单 -->
|
|
<sql id="selectEmisWaybillVo">
|
|
select
|
|
a.id,a.order_sn, a.cust_order_id, a.bill_code, a.order_status, a.waybill_status,
|
|
a.order_type, a.order_date, a.user_id, a.customer_code, a.customer_name, a.open_id, a.receive_name,
|
|
a.receive_company, a.receive_mobile, a.receive_tel, a.receive_country, a.receive_province, a.receive_city,
|
|
a.receive_county, a.receive_town, a.receive_address, a.receive_postcode, a.receive_pcd, a.send_name, a.send_company,
|
|
a.send_mobile, a.send_tel, a.send_country, a.send_province, a.send_city, a.send_county, a.send_town, a.send_address,
|
|
a.send_postcode, a.send_pcd, a.payment_type, a.calc_fee_type, a.cust_no, a.cust_name, a.trans_line_type, a.product_type,
|
|
a.time_type, a.meter_type, a.carry_type, a.customs_clear, a.customs_eclaration, a.estimate_date, a.pack_type, a.dispatch_method,
|
|
a.pickup_method, a.pick_start_date, a.pick_finish_date, a.pick_fail_reason, a.into_warehouse_code,
|
|
a.into_warehouse_name, a.into_warehouse_address, a.into_warehouse_contact, a.into_warehouse_phone,
|
|
a.into_warehouse_bill_code, a.warehouse_in_no, a.customer_delivery_begin_time, a.customer_delivery_end_time,
|
|
a.goods_type, a.goods_info, a.goods_pics, a.bl_prepare_in_freight, a.prepare_in_est_fee,
|
|
a.prepare_in_real_fee, a.prepare_in_express, a.prepare_in_bill_code, a.prepare_in_remark,
|
|
a.prepare_in_supplier, a.total_weight, a.total_volume, a.parcel_qty, a.bill_weight, a.volume_weight, a.currency,
|
|
a.settlement_weight, a.scan_weight, a.fee_weight, a.freight, a.real_payment_type, a.real_fee, a.bl_special_quote,
|
|
a.bl_over_long, a.bl_bill, a.bl_bill_text, a.bl_over_weight, a.over_weight_number, a.fee_remark, a.third_code,
|
|
a.real_value, a.bl_insure, a.insure_value, a.insure_value_currency, a.insure_fee_currency, a.insure_fee, a.insure_remark,
|
|
a.insure_site_code, a.insure_date, a.bl_print, a.print_man_code, a.print_site, a.print_date, a.print_count, a.bl_disp_fd,
|
|
a.transfer_code, a.transfer_billcode, a.disp_fd_date, a.disp_fd_reason, a.current_site_code, a.next_site_code, a.last_site_code,
|
|
a.register_site_code, a.register_date, a.register_man_code, a.take_piece_employee_code, a.send_site_code, a.send_center_code,
|
|
a.send_date, a.dispatch_man_code, a.dispatch_date, a.dispatch_site_code, a.produce_bill_date, a.produce_bill_site_code,
|
|
a.produce_bill_man_code, a.destination_code, a.destination_province, a.destination_city, a.destination_county,
|
|
a.dispatch_underling_site_code, a.destination_center_code, a.market_man_code, a.payee, a.salesmen, a.operate_employee_code,
|
|
a.bl_is_question, a.problem_type, a.problem_cause, a.problem_delay_days, a.bl_message, a.bl_accept_message, a.bl_gen_subbill,
|
|
a.bl_sign, a.sign_man, a.sign_man_code, a.sign_site_code, a.sign_date, a.bill_pic_send_rmk, a.bill_pic_dispatch_rmk, a.timezone_offset,
|
|
a.payment_status, a.payment_date, a.payment_remark, a.order_remark, a.data_from, a.bl_special_goods,a.ext_info,
|
|
a.remark, a.del_flag, a.create_by,
|
|
a.create_time, a.update_by, a.update_time, a.create_site, a.update_site,
|
|
|
|
b.name as receive_country_name,c.name as send_country_name,
|
|
d.region_name as receive_province_name,e.region_name as receive_city_name,f.region_name as receive_county_name,
|
|
g.region_name as send_province_name,h.region_name as send_city_name,i.region_name as send_county_name,
|
|
j.prod_name as product_type_name,k.line_name as trans_line_type_name,
|
|
l.site_name as send_site_name,m.site_name as dispatch_underling_site_name,
|
|
n.dest_name as destination_name,o.site_name as dispatch_site_name,
|
|
p.emp_name as dispatch_man_name,q.site_name as print_site_name,
|
|
r.emp_name as print_man_name,
|
|
s.emp_name as take_piece_employee_name,
|
|
t.emp_name as operate_employee_name,
|
|
u.site_name as register_site_name,
|
|
v.emp_name as register_man_name,
|
|
w.site_name as current_site_name,
|
|
x.site_name as next_site_name,
|
|
y.site_name as last_site_name,
|
|
z.type_name as problem_type_name
|
|
|
|
from emis_waybill a
|
|
left join emis_country b on a.receive_country=b.code
|
|
left join emis_country c on a.send_country=c.code
|
|
left join emis_region d on a.receive_province=d.region_code
|
|
left join emis_region e on a.receive_city=e.region_code
|
|
left join emis_region f on a.receive_county=f.region_code
|
|
|
|
left join emis_region g on a.send_province=g.region_code
|
|
left join emis_region h on a.send_city=h.region_code
|
|
left join emis_region i on a.send_county=i.region_code
|
|
|
|
left join emis_trans_product j on a.product_type=j.prod_code
|
|
left join emis_trans_line k on a.trans_line_type=k.line_code
|
|
left join emis_site l on a.send_site_code=l.site_code
|
|
left join emis_site m on a.dispatch_underling_site_code=m.site_code
|
|
|
|
left join emis_destination n on a.destination_code=n.dest_code
|
|
left join emis_site o on a.dispatch_site_code=o.site_code
|
|
|
|
left join sys_user p on a.dispatch_man_code=p.emp_code
|
|
left join emis_site q on a.print_site=q.site_code
|
|
left join sys_user r on a.print_man_code=r.emp_code
|
|
left join sys_user s on a.take_piece_employee_code=s.emp_code
|
|
left join sys_user t on a.operate_employee_code=t.emp_code
|
|
left join emis_site u on a.register_site_code=u.site_code
|
|
left join sys_user v on a.register_man_code=v.emp_code
|
|
left join emis_site w on a.current_site_code=w.site_code
|
|
left join emis_site x on a.next_site_code=x.site_code
|
|
left join emis_site y on a.last_site_code=y.site_code
|
|
left join emis_problem_type z on a.problem_type=z.id
|
|
|
|
</sql>
|
|
|
|
<select id="selectWaybillBaseInfoByBillCode" parameterType="String" resultMap="BaseEmisWaybillResult">
|
|
<include refid="selectEmisWaybillVo"/>
|
|
<where>
|
|
a.bill_code = #{billCode}
|
|
</where>
|
|
limit 1
|
|
</select>
|
|
|
|
<select id="selectUserOrderList" parameterType="EmisWaybill" resultMap="EmisWaybillResult">
|
|
<include refid="selectEmisWaybillVo"/>
|
|
<where>
|
|
a.del_flag='0'
|
|
<if test="id != null "> and a.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=#{orderStatus}</if>
|
|
<if test="waybillStatus != null and waybillStatus != ''"> and waybill_status=#{waybillStatus}</if>
|
|
<if test="orderType != null and orderType != ''"> and order_type=#{orderType}</if>
|
|
<if test="orderDate != null "> and order_date = #{orderDate}</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=#{receiveCountry}</if>
|
|
<if test="receiveProvince != null and receiveProvince != ''"> and receive_province=#{receiveProvince}</if>
|
|
<if test="receiveCity != null and receiveCity != ''"> and receive_city=#{receiveCity}</if>
|
|
<if test="receiveCounty != null and receiveCounty != ''"> and receive_county=#{receiveCounty}</if>
|
|
<if test="receiveTown != null and receiveTown != ''"> and receive_town=#{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=#{sendCountry}</if>
|
|
<if test="sendProvince != null and sendProvince != ''"> and send_province=#{sendProvince}</if>
|
|
<if test="sendCity != null and sendCity != ''"> and send_city=#{sendCity}</if>
|
|
<if test="sendCounty != null and sendCounty != ''"> and send_county=#{sendCounty}</if>
|
|
<if test="sendTown != null and sendTown != ''"> and send_town=#{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="paymentType != null and paymentType != ''"> and payment_type=#{paymentType}</if>
|
|
<if test="calcFeeType != null and calcFeeType != ''"> and calc_fee_type=#{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=#{transLineType}</if>
|
|
<if test="productType != null and productType != ''"> and product_type=#{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=#{customsClear}</if>
|
|
<if test="customsEclaration != null and customsEclaration != ''"> and customs_eclaration=#{customsEclaration}</if>
|
|
<if test="estimateDate != null "> and estimate_date = #{estimateDate}</if>
|
|
<if test="packType != null and packType != ''"> and FIND_IN_SET(#{packType},pack_type)</if>
|
|
<if test="dispatchMethod != null and dispatchMethod != ''"> and dispatch_method=#{dispatchMethod}</if>
|
|
<if test="pickupMethod != null and pickupMethod != ''"> and pickup_method= #{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="goodsInfo != null and goodsInfo != ''"> and goods_info like concat('%', #{goodsInfo}, '%')</if>
|
|
<if test="blPrepareInFreight != null and blPrepareInFreight != ''"> and bl_prepare_in_freight=#{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= #{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=#{realPaymentType}</if>
|
|
<if test="realFee != null "> and real_fee = #{realFee}</if>
|
|
<if test="blSpecialQuote != null and blSpecialQuote != ''"> and bl_special_quote=#{blSpecialQuote}</if>
|
|
<if test="blOverLong != null and blOverLong != ''"> and bl_over_long=#{blOverLong}</if>
|
|
<if test="blBill != null and blBill != ''"> and bl_bill=#{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="feeRemark != null and feeRemark != ''"> and fee_remark like concat('%', #{feeRemark}, '%')</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= #{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=#{insureSiteCode}</if>
|
|
<if test="blPrint != null and blPrint != ''"> and bl_print=#{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=#{printSite},</if>
|
|
<if test="printDate != null and printDate != ''"> and print_date like concat('%', #{printDate}, '%')</if>
|
|
<if test="blDispFd != null and blDispFd != ''"> and bl_disp_fd=#{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=#{currentSiteCode}</if>
|
|
<if test="nextSiteCode != null and nextSiteCode != ''"> and next_site_code= #{nextSiteCode}</if>
|
|
<if test="lastSiteCode != null and lastSiteCode != ''"> and last_site_code=#{lastSiteCode}</if>
|
|
<if test="registerSiteCode != null and registerSiteCode != ''"> and register_site_code=#{registerSiteCode}</if>
|
|
<if test="registerDate != null "> and register_date = #{registerDate}</if>
|
|
<if test="registerManCode != null and registerManCode != ''"> and register_man_code= #{registerManCode}</if>
|
|
<if test="takePieceEmployeeCode != null and takePieceEmployeeCode != ''"> and take_piece_employee_code=#{takePieceEmployeeCode}</if>
|
|
<if test="sendSiteCode != null and sendSiteCode != ''"> and send_site_code=#{sendSiteCode}</if>
|
|
<if test="sendDate != null "> and send_date = #{sendDate}</if>
|
|
<if test="dispatchManCode != null and dispatchManCode != ''"> and dispatch_man_code=#{dispatchManCode}</if>
|
|
<if test="dispatchSiteCode != null and dispatchSiteCode != ''"> and dispatch_site_code=#{dispatchSiteCode}</if>
|
|
<if test="produceBillDate != null "> and produce_bill_date = #{produceBillDate}</if>
|
|
<if test="produceBillSiteCode != null and produceBillSiteCode != ''"> and produce_bill_site_code=#{produceBillSiteCode}</if>
|
|
<if test="produceBillManCode != null and produceBillManCode != ''"> and produce_bill_man_code=#{produceBillManCode}</if>
|
|
<if test="destinationCode != null and destinationCode != ''"> and destination_code =#{destinationCode}</if>
|
|
<if test="destinationProvince != null and destinationProvince != ''"> and destination_province=#{destinationProvince}</if>
|
|
<if test="destinationCity != null and destinationCity != ''"> and destination_city=#{destinationCity}</if>
|
|
<if test="destinationCounty != null and destinationCounty != ''"> and destination_county=#{destinationCounty}</if>
|
|
<if test="dispatchUnderlingSiteCode != null and dispatchUnderlingSiteCode != ''"> and dispatch_underling_site_code=#{dispatchUnderlingSiteCode}</if>
|
|
<if test="destinationCenterCode != null and destinationCenterCode != ''"> and destination_center_code=#{destinationCenterCode}</if>
|
|
<if test="marketManCode != null and marketManCode != ''"> and market_man_code = #{marketManCode}</if>
|
|
<if test="payee != null and payee != ''"> and payee=#{payee}</if>
|
|
<if test="salesmen != null and salesmen != ''"> and salesmen like concat('%', #{salesmen}, '%')</if>
|
|
<if test="operateEmployeeCode != null and operateEmployeeCode != ''"> and operate_employee_code=#{operateEmployeeCode}</if>
|
|
<if test="blIsQuestion != null and blIsQuestion != ''"> and bl_is_question=#{blIsQuestion}</if>
|
|
<if test="problemType != null and problemType != ''"> and problem_type=#{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=#{blMessage}</if>
|
|
<if test="blAcceptMessage != null and blAcceptMessage != ''"> and bl_accept_message=#{blAcceptMessage}</if>
|
|
<if test="blGenSubbill != null and blGenSubbill != ''"> and bl_gen_subbill=#{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=#{signManCode}</if>
|
|
<if test="signSiteCode != null and signSiteCode != ''"> and sign_site_code=#{signSiteCode}</if>
|
|
<if test="paymentStatus != null and paymentStatus != ''"> and payment_status =#{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="sendSiteCode != null and sendSiteCode != ''"> and a.send_site_code= #{sendSiteCode}</if>
|
|
|
|
<if test="remark != null and remark != ''"> and a.remark like concat('%', #{remark}, '%')</if>
|
|
<if test="createBy != null and createBy != ''"> and a.create_by= #{createBy}</if>
|
|
<if test="updateBy != null and updateBy != ''"> and a.update_by=#{updateBy}</if>
|
|
<if test="createSite != null and createSite != ''"> and a.create_site=#{createSite}</if>
|
|
<if test="updateSite != null and updateSite != ''"> and a.update_site=#{updateSite}</if>
|
|
|
|
<if test="userId != null "> and a.user_id = #{userId}</if>
|
|
|
|
<!-- 寄件 -->
|
|
<if test="params.omsOrderTab == null or (params.omsOrderTab != null and params.omsOrderTab != 2) ">
|
|
and a.customer_code=#{customerCode}
|
|
</if>
|
|
|
|
<!-- 收件 -->
|
|
<if test="params.omsOrderTab != null and params.omsOrderTab == 2 ">
|
|
and exists (select 1 from emis_customer_user ecu where a.del_flag='0' and a.receive_mobile=ecu.phone and ecu.customer_code=#{customerCode} )
|
|
</if>
|
|
|
|
<!-- 待付款 -->
|
|
<if test="params.omsOrderTab != null and params.omsOrderTab == 3 ">
|
|
and a.payment_status='0'
|
|
</if>
|
|
|
|
and not exists(
|
|
select 1 from emis_waybill_problem_info ewpi where a.bill_code=ewpi.bill_code and ewpi.del_flag='0' and ewpi.`problem_type` !=null and ewpi.`problem_type` in(173,170,151)
|
|
)
|
|
|
|
<if test="params.beginDate != null and params.beginDate != ''">
|
|
and a.send_date <![CDATA[ >= ]]> #{params.beginDate}
|
|
</if>
|
|
<if test="params.endDate != null and params.endDate != ''">
|
|
and a.send_date <![CDATA[ <= ]]> #{params.endDate}
|
|
</if>
|
|
|
|
<if test="params.beginSendDate != null and params.beginSendDate != ''">
|
|
and a.send_date <![CDATA[ >= ]]> #{params.beginSendDate}
|
|
</if>
|
|
<if test="params.endSendDate != null and params.endSendDate != ''">
|
|
and a.send_date <![CDATA[ <= ]]> #{params.endSendDate}
|
|
</if>
|
|
|
|
<if test="params.beginCreateTime != null and params.beginCreateTime != ''">
|
|
and a.create_time <![CDATA[ >= ]]> #{params.beginCreateTime}
|
|
</if>
|
|
<if test="params.endCreateTime != null and params.endCreateTime != ''">
|
|
and a.create_time <![CDATA[ <= ]]> #{params.endCreateTime}
|
|
</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>
|
|
a.create_time desc
|
|
</select>
|
|
|
|
|
|
|
|
<select id="selectUserSendOrderCount" parameterType="String" resultType="long">
|
|
select count(1) as cnt from emis_waybill a
|
|
<where>
|
|
a.del_flag='0'
|
|
|
|
<!-- 寄件 -->
|
|
and a.customer_code=#{customerCode}
|
|
and not exists(
|
|
select 1 from emis_waybill_problem_info ewpi where a.bill_code=ewpi.bill_code and ewpi.del_flag='0' and ewpi.`problem_type` !=null and ewpi.`problem_type` in(173,170,151)
|
|
)
|
|
|
|
</where>
|
|
|
|
</select>
|
|
|
|
<select id="selectUserRecieveOrderCount" parameterType="String" resultType="long">
|
|
select count(1) as cnt from emis_waybill a
|
|
<where>
|
|
a.del_flag='0'
|
|
|
|
|
|
<!-- 收件 -->
|
|
and exists (select 1 from emis_customer_user ecu where a.del_flag='0' and a.receive_mobile=ecu.phone and ecu.customer_code=#{customerCode} )
|
|
|
|
and not exists(
|
|
select 1 from emis_waybill_problem_info ewpi where a.bill_code=ewpi.bill_code and ewpi.del_flag='0' and ewpi.`problem_type` !=null and ewpi.`problem_type` in(173,170,151)
|
|
)
|
|
|
|
|
|
|
|
</where>
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
|
<select id="selectUserBindSalesmenList" resultType="map">
|
|
SELECT
|
|
b.emp_code AS empCode,
|
|
b.emp_name AS empName,
|
|
b.extra_data AS rate,
|
|
b.avatar,
|
|
b.phonenumber AS phone,
|
|
b.owner_site_code AS ownerSiteCode,
|
|
c.site_name AS ownerSiteName,
|
|
a.default_flag as defaultFlag
|
|
FROM
|
|
sys_oms_user_bind_emp a,
|
|
sys_user b,
|
|
emis_site c
|
|
WHERE
|
|
a.emp_code = b.emp_code and b.owner_site_code=c.site_code and b.del_flag='0' and c.del_flag='0' and b.bl_open='1'
|
|
AND a.customer_code = #{customerCode}
|
|
<if test="searchValue != null and searchValue != ''">
|
|
and b.emp_name like concat('%', #{searchValue}, '%')
|
|
</if>
|
|
<if test="blDefaultFlag != null and blDefaultFlag != ''">
|
|
and b.default_flag=#{blDefaultFlag}
|
|
</if>
|
|
</select>
|
|
|
|
<select id="queryNewSalesmen" resultType="map">
|
|
SELECT
|
|
a.emp_code AS empCode,
|
|
a.emp_name AS empName,
|
|
a.extra_data AS rate,
|
|
a.avatar,
|
|
a.phonenumber AS phone,
|
|
a.owner_site_code AS ownerSiteCode,
|
|
b.site_name AS ownerSiteName
|
|
FROM
|
|
sys_user a,emis_site b,sys_user_post c
|
|
WHERE a.del_flag='0' and b.del_flag='0' and a.bl_open='1'
|
|
and a.owner_site_code=b.site_code and a.user_id=c.user_id and c.post_id=5
|
|
<if test="searchValue != null and searchValue != ''">
|
|
and (a.emp_code=#{searchValue} or a.phonenumber=#{searchValue})
|
|
</if>
|
|
|
|
|
|
</select>
|
|
|
|
|
|
<select id="checkEmpIsExist" resultType="int">
|
|
select count(1) from sys_user where del_flag='0' and emp_code=#{empCode}
|
|
</select>
|
|
|
|
<select id="checkIsBindSalesmen" resultType="int">
|
|
select count(1) from sys_oms_user_bind_emp where customer_code=#{customerCode} and emp_code=#{empCode}
|
|
</select>
|
|
|
|
<delete id="cancelBindSalesmenDefault" parameterType="String">
|
|
update sys_oms_user_bind_emp set default_flag='0' where customer_code=#{customerCode}
|
|
</delete>
|
|
|
|
<delete id="setBindSalesmenDefault" parameterType="String">
|
|
update sys_oms_user_bind_emp set default_flag=#{defaultFlag} where customer_code=#{customerCode} and emp_code=#{empCode}
|
|
</delete>
|
|
|
|
<delete id="deleteBindSalesmen" parameterType="String">
|
|
delete from sys_oms_user_bind_emp where customer_code=#{customerCode} and emp_code=#{empCode}
|
|
</delete>
|
|
|
|
<insert id="insertBindSalesmen" parameterType="String" >
|
|
insert into sys_oms_user_bind_emp(customer_code,emp_code) values(#{customerCode}, #{empCode})
|
|
</insert>
|
|
|
|
|
|
</mapper> |