|
@@ -1762,7 +1762,7 @@
|
|
|
tv.f_name vslName,
|
|
|
ty.f_no voyNo,
|
|
|
tw.f_corpid,
|
|
|
- tp.f_name corpName,
|
|
|
+ tp.f_name projectName,
|
|
|
tw.create_by createBy,
|
|
|
tw.create_time createTime,
|
|
|
tw.f_loadportid,
|
|
@@ -2352,7 +2352,7 @@
|
|
|
tw.f_cntval,
|
|
|
tw.f_date_changed,
|
|
|
tw.f_market_number,
|
|
|
- tw.f_money,
|
|
|
+ tw.f_money as fMoney,
|
|
|
tw.f_take_orders,
|
|
|
tw.f_reason
|
|
|
FROM t_warehousebills tw
|
|
@@ -3491,4 +3491,262 @@
|
|
|
f_billtype
|
|
|
) fail ON temp.billType = fail.billType
|
|
|
</select>
|
|
|
+ <select id="getTWarehouseBillOutboundExcel"
|
|
|
+ resultType="com.ruoyi.warehouseBusiness.domain.TWarehouseBillOutboundExcel">
|
|
|
+ SELECT
|
|
|
+ DISTINCT
|
|
|
+ tw.f_id,
|
|
|
+ tw.f_billno as fBillno,
|
|
|
+ tw.f_customsdeclartion,
|
|
|
+ tw.f_originalbillno,
|
|
|
+ tw.f_deptid,
|
|
|
+ tw.f_bsdeptid,
|
|
|
+ tw.f_contacts,
|
|
|
+ tw.f_tel,
|
|
|
+ tw.f_corpid,
|
|
|
+ tc.f_name AS corpName,
|
|
|
+ tw.f_tocorpid,
|
|
|
+ tw.f_stltypeid,
|
|
|
+ tw.f_bscorpno,
|
|
|
+ tw.f_warehouseid as fWarehouseid,
|
|
|
+ tw.f_storekeeper,
|
|
|
+ tw.f_chargedate,
|
|
|
+ tw.f_bsdate as fBsdate,
|
|
|
+ tw.f_planqty,
|
|
|
+ tw.f_plangrossweight,
|
|
|
+ tw.f_plannetweight,
|
|
|
+ tw.f_planvolumn,
|
|
|
+ tw.f_qty,
|
|
|
+ tw.f_grossweight,
|
|
|
+ tw.f_netweight,
|
|
|
+ tw.f_volumn,
|
|
|
+ tw.f_billingway,
|
|
|
+ tw.f_trademodeid,
|
|
|
+ tw.f_sbu,
|
|
|
+ tw.f_feetunit,
|
|
|
+ tw.f_mblno,
|
|
|
+ tw.f_marks,
|
|
|
+ tw.f_vslvoy,
|
|
|
+ tw.f_eta,
|
|
|
+ tw.f_customno,
|
|
|
+ tw.f_ifweigh,
|
|
|
+ tw.f_ifpledge,
|
|
|
+ tw.f_ifdamage,
|
|
|
+ tw.f_bankcorpid,
|
|
|
+ tw.f_billtype,
|
|
|
+ tw.f_billstatus,
|
|
|
+ CASE
|
|
|
+
|
|
|
+ WHEN tw.f_billstatus = '1' THEN
|
|
|
+ '保存'
|
|
|
+ WHEN tw.f_billstatus = '2' THEN
|
|
|
+ '暂存'
|
|
|
+ WHEN tw.f_billstatus = '3' THEN
|
|
|
+ '审批驳回'
|
|
|
+ WHEN tw.f_billstatus = '4' THEN
|
|
|
+ '提交审核'
|
|
|
+ WHEN tw.f_billstatus = '5' THEN
|
|
|
+ '审核中'
|
|
|
+ WHEN tw.f_billstatus = '6' THEN
|
|
|
+ '审核完成'
|
|
|
+ END AS fBillstatusName,
|
|
|
+ tw.f_items_status,
|
|
|
+ tw.del_flag,
|
|
|
+ tw.create_by as createBy,
|
|
|
+ tw.create_time,
|
|
|
+ tw.update_by,
|
|
|
+ tw.update_time,
|
|
|
+ tw.remark,
|
|
|
+ tw.f_billing_deadline,
|
|
|
+ tw.f_product_name,
|
|
|
+ tw.f_review_date,
|
|
|
+ tw.f_truckno,
|
|
|
+ tw.f_driver_name,
|
|
|
+ tw.f_driver_tel,
|
|
|
+ tw.f_driver_id_car,
|
|
|
+ tw.f_business_type,
|
|
|
+ tw.f_labour,
|
|
|
+ tw.f_fleet,
|
|
|
+ tw.f_inwarehouseid,
|
|
|
+ tw.f_bstime,
|
|
|
+ tw.f_cartype,
|
|
|
+ tw.f_goodsid,
|
|
|
+ tp.f_name AS projectName,
|
|
|
+ tw.f_new_trademodeid,
|
|
|
+ tw.f_loadportid,
|
|
|
+ tw.f_destportid,
|
|
|
+ tw.f_serviceitems,
|
|
|
+ tw.f_invoceobj,
|
|
|
+ tw.f_sign,
|
|
|
+ tw.f_detentioncargo,
|
|
|
+ tw.f_booksmarks,
|
|
|
+ tw.f_shippername,
|
|
|
+ tw.f_shipperattn,
|
|
|
+ tw.f_shippertel,
|
|
|
+ tw.f_consigneername,
|
|
|
+ tw.f_consigneeattn,
|
|
|
+ tw.f_consigneetel,
|
|
|
+ tw.f_insurance,
|
|
|
+ tw.f_insuranceamt,
|
|
|
+ tw.f_closedate,
|
|
|
+ tw.f_docmentdate,
|
|
|
+ tw.f_vslid,
|
|
|
+ tw.f_voyid,
|
|
|
+ tw.f_typeid,
|
|
|
+ tw.f_paymode,
|
|
|
+ tw.f_laneid,
|
|
|
+ tw.f_cntval,
|
|
|
+ tw.f_date_changed,
|
|
|
+ tw.f_market_number,
|
|
|
+ tw.f_money as fMoney,
|
|
|
+ tw.f_teachers_weight,
|
|
|
+ tw.f_students_weight,
|
|
|
+ th.f_name AS fWarehouseName,
|
|
|
+ tw.f_market_typid,
|
|
|
+ tw.f_purchase,
|
|
|
+ tr.f_name AS fsbuName,
|
|
|
+ tw.f_create_log,
|
|
|
+ tw.f_print_log,
|
|
|
+ tw.f_print,
|
|
|
+ tw.f_take_orders,
|
|
|
+ tw.f_reason,
|
|
|
+ CASE
|
|
|
+
|
|
|
+ WHEN f_take_orders = '0' THEN
|
|
|
+ '待接单'
|
|
|
+ WHEN f_take_orders = '1' THEN
|
|
|
+ '已接单'
|
|
|
+ WHEN f_take_orders = '2' THEN
|
|
|
+ '拒绝'
|
|
|
+ END AS fTakeOrdersName
|
|
|
+ FROM
|
|
|
+ t_warehousebills tw
|
|
|
+ LEFT JOIN t_project tp
|
|
|
+ ON tw.f_goodsid = tp.f_id
|
|
|
+ LEFT JOIN t_corps tc
|
|
|
+ ON tw.f_corpid = tc.f_id
|
|
|
+ LEFT JOIN t_corps tr
|
|
|
+ ON tr.f_id = tw.f_sbu
|
|
|
+ LEFT JOIN t_warehouse th ON tw.f_warehouseid = th.f_id
|
|
|
+ LEFT JOIN t_warehousebillsfees tb ON tb.f_pid = tw.f_id
|
|
|
+ <where>
|
|
|
+ tw.del_flag = '0'
|
|
|
+ and tb.del_flag = '0'
|
|
|
+ <if test="fFeeid != null ">and tb.f_feeid = #{fFeeid}</if>
|
|
|
+ <if test="fBillno != null and fBillno != ''">and tw.f_billno = #{fBillno}</if>
|
|
|
+ <if test="fCustomsdeclartion != null and fCustomsdeclartion != ''">and tw.f_customsdeclartion =
|
|
|
+ #{fCustomsdeclartion}
|
|
|
+ </if>
|
|
|
+ <if test="fOriginalbillno != null and fOriginalbillno != ''">and tw.f_originalbillno = #{fOriginalbillno}
|
|
|
+ </if>
|
|
|
+ <if test="fDeptid != null ">and tw.f_deptid = #{fDeptid}</if>
|
|
|
+ <if test="fBsdeptid != null ">and tw.f_bsdeptid = #{fBsdeptid}</if>
|
|
|
+ <if test="fContacts != null and fContacts != ''">and tw.f_contacts = #{fContacts}</if>
|
|
|
+ <if test="fTel != null and fTel != ''">and tw.f_tel = #{fTel}</if>
|
|
|
+ <if test="fCorpid != null ">and tw.f_corpid = #{fCorpid}</if>
|
|
|
+ <if test="fTocorpid != null ">and tw.f_tocorpid = #{fTocorpid}</if>
|
|
|
+ <if test="fStltypeid != null ">and tw.f_stltypeid = #{fStltypeid}</if>
|
|
|
+ <if test="fBscorpno != null and fBscorpno != ''">and tw.f_bscorpno = #{fBscorpno}</if>
|
|
|
+ <if test="fWarehouseid != null ">and tw.f_warehouseid = #{fWarehouseid}</if>
|
|
|
+ <if test="fStorekeeper != null and fStorekeeper != ''">and tw.f_storekeeper = #{fStorekeeper}</if>
|
|
|
+ <if test="fChargedate != null ">and tw.f_chargedate = #{fChargedate}</if>
|
|
|
+ <if test="fBsdate != null ">and tw.f_bsdate = #{fBsdate}</if>
|
|
|
+ <if test="fPlanqty != null ">and tw.f_planqty = #{fPlanqty}</if>
|
|
|
+ <if test="fPlangrossweight != null ">and tw.f_plangrossweight = #{fPlangrossweight}</if>
|
|
|
+ <if test="fPlannetweight != null ">and tw.f_plannetweight = #{fPlannetweight}</if>
|
|
|
+ <if test="fPlanvolumn != null ">and tw.f_planvolumn = #{fPlanvolumn}</if>
|
|
|
+ <if test="fQty != null ">and tw.f_qty = #{fQty}</if>
|
|
|
+ <if test="fGrossweight != null ">and tw.f_grossweight = #{fGrossweight}</if>
|
|
|
+ <if test="fNetweight != null ">and tw.f_netweight = #{fNetweight}</if>
|
|
|
+ <if test="fVolumn != null ">and tw.f_volumn = #{fVolumn}</if>
|
|
|
+ <if test="fBillingway != null ">and tw.f_billingway = #{fBillingway}</if>
|
|
|
+ <if test="fTrademodeid != null ">and tw.f_trademodeid = #{fTrademodeid}</if>
|
|
|
+ <if test="fSbu != null ">and tw.f_sbu = #{fSbu}</if>
|
|
|
+ <if test="fFeetunit != null and fFeetunit != ''">and tw.f_feetunit = #{fFeetunit}</if>
|
|
|
+ <if test="fMblno != null and fMblno != ''">and tw.f_mblno = #{fMblno}</if>
|
|
|
+ <if test="fMarks != null and fMarks != ''">and tw.f_marks = #{fMarks}</if>
|
|
|
+ <if test="fVslvoy != null and fVslvoy != ''">and tw.f_vslvoy = #{fVslvoy}</if>
|
|
|
+ <if test="fEta != null ">and tw.f_eta = #{fEta}</if>
|
|
|
+ <if test="fCustomno != null and fCustomno != ''">and tw.f_customno = #{fCustomno}</if>
|
|
|
+ <if test="fIfweigh != null and fIfweigh != ''">and tw.f_ifweigh = #{fIfweigh}</if>
|
|
|
+ <if test="fIfpledge != null and fIfpledge != ''">and tw.f_ifpledge = #{fIfpledge}</if>
|
|
|
+ <if test="fIfdamage != null and fIfdamage != ''">and tw.f_ifdamage = #{fIfdamage}</if>
|
|
|
+ <if test="fBankcorpid != null and fBankcorpid != ''">and tw.f_bankcorpid = #{fBankcorpid}</if>
|
|
|
+ <if test="fBilltype != null and fBilltype != ''">and tw.f_billtype = #{fBilltype}</if>
|
|
|
+ <if test="fBillstatus != null ">and tw.f_billstatus = #{fBillstatus}</if>
|
|
|
+ <if test="fBillstatus != null and fBillstatus == 7">and tw.f_billstatus != '6'</if>
|
|
|
+ <if test="fItemsStatus != null ">and tw.f_items_status = #{fItemsStatus}</if>
|
|
|
+ <if test="fBillingDeadline != null ">and tw.f_billing_deadline = #{fBillingDeadline}</if>
|
|
|
+ <if test="fProductName != null and fProductName != ''">and tw.f_product_name like concat('%',
|
|
|
+ #{fProductName},
|
|
|
+ '%')
|
|
|
+ </if>
|
|
|
+ <if test="fReviewDate != null ">and tw.f_review_date = #{fReviewDate}</if>
|
|
|
+ <if test="fTruckno != null and fTruckno != ''">and tw.f_truckno = #{fTruckno}</if>
|
|
|
+ <if test="fDriverName != null and fDriverName != ''">and tw.f_driver_name like concat('%', #{fDriverName},
|
|
|
+ '%')
|
|
|
+ </if>
|
|
|
+ <if test="fDriverTel != null and fDriverTel != ''">and tw.f_driver_tel = #{fDriverTel}</if>
|
|
|
+ <if test="fDriverIdCar != null and fDriverIdCar != ''">and tw.f_driver_id_car = #{fDriverIdCar}</if>
|
|
|
+ <if test="fBusinessType != null and fBusinessType != ''">and tw.f_business_type = #{fBusinessType}</if>
|
|
|
+ <if test="fLabour != null ">and tw.f_labour = #{fLabour}</if>
|
|
|
+ <if test="fFleet != null ">and tw.f_fleet = #{fFleet}</if>
|
|
|
+ <if test="fInwarehouseid != null ">and tw.f_inwarehouseid = #{fInwarehouseid}</if>
|
|
|
+ <if test="fBstime != null ">and tw.f_bstime = #{fBstime}</if>
|
|
|
+ <if test="fCartype != null ">and tw.f_cartype = #{fCartype}</if>
|
|
|
+ <if test="fGoodsid != null ">and tw.f_goodsid = #{fGoodsid}</if>
|
|
|
+ <if test="fNewTrademodeid != null ">and tw.f_new_trademodeid = #{fNewTrademodeid}</if>
|
|
|
+ <if test="fLoadportid != null ">and tw.f_loadportid = #{fLoadportid}</if>
|
|
|
+ <if test="fDestportid != null ">and tw.f_destportid = #{fDestportid}</if>
|
|
|
+ <if test="fServiceitems != null and fServiceitems != ''">and tw.f_serviceitems = #{fServiceitems}</if>
|
|
|
+ <if test="fInvoceobj != null and fInvoceobj != ''">and tw.f_invoceobj = #{fInvoceobj}</if>
|
|
|
+ <if test="fSign != null ">and tw.f_sign = #{fSign}</if>
|
|
|
+ <if test="fDetentioncargo != null ">and tw.f_detentioncargo = #{fDetentioncargo}</if>
|
|
|
+ <if test="fBooksmarks != null and fBooksmarks != ''">and tw.f_booksmarks = #{fBooksmarks}</if>
|
|
|
+ <if test="fShippername != null and fShippername != ''">and tw.f_shippername like concat('%',
|
|
|
+ #{fShippername},
|
|
|
+ '%')
|
|
|
+ </if>
|
|
|
+ <if test="fShipperattn != null and fShipperattn != ''">and tw.f_shipperattn = #{fShipperattn}</if>
|
|
|
+ <if test="fShippertel != null and fShippertel != ''">and tw.f_shippertel = #{fShippertel}</if>
|
|
|
+ <if test="fConsigneername != null and fConsigneername != ''">and tw.f_consigneername like concat('%',
|
|
|
+ #{fConsigneername}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="fConsigneeattn != null and fConsigneeattn != ''">and tw.f_consigneeattn = #{fConsigneeattn}</if>
|
|
|
+ <if test="fConsigneetel != null and fConsigneetel != ''">and tw.f_consigneetel = #{fConsigneetel}</if>
|
|
|
+ <if test="fInsurance != null and fInsurance != ''">and tw.f_insurance = #{fInsurance}</if>
|
|
|
+ <if test="fInsuranceamt != null ">and tw.f_insuranceamt = #{fInsuranceamt}</if>
|
|
|
+ <if test="fClosedate != null ">and tw.f_closedate = #{fClosedate}</if>
|
|
|
+ <if test="fDocmentdate != null ">and tw.f_docmentdate = #{fDocmentdate}</if>
|
|
|
+ <if test="fVslid != null ">and tw.f_vslid = #{fVslid}</if>
|
|
|
+ <if test="fVoyid != null ">and tw.f_voyid = #{fVoyid}</if>
|
|
|
+ <if test="fTypeid != null ">and tw.f_typeid = #{fTypeid}</if>
|
|
|
+ <if test="fPaymode != null ">and tw.f_paymode = #{fPaymode}</if>
|
|
|
+ <if test="fLaneid != null ">and tw.f_laneid = #{fLaneid}</if>
|
|
|
+ <if test="fCntval != null and fCntval != ''">and tw.f_cntval = #{fCntval}</if>
|
|
|
+ <if test="createBy != null and createBy != ''">and tw.create_by = #{createBy}</if>
|
|
|
+ <if test="remark != null and remark != ''">and tw.remark = #{remark}</if>
|
|
|
+ <if test='cLoadDate != null and cLoadDate[0] != null and cLoadDate[0]!= ""'>
|
|
|
+ and tw.create_time >= #{cLoadDate[0]}
|
|
|
+ </if>
|
|
|
+ <if test='cLoadDate != null and cLoadDate[1] != null and cLoadDate[1]!= ""'>
|
|
|
+ and tw.create_time <= #{cLoadDate[1]}
|
|
|
+ </if>
|
|
|
+ <if test='moneys != null and moneys[0] != null and moneys[0]!= ""'>
|
|
|
+ and tw.f_money >= #{moneys[0]}
|
|
|
+ </if>
|
|
|
+ <if test='moneys != null and moneys[1] != null and moneys[1]!= ""'>
|
|
|
+ and tw.f_money <= #{moneys[1]}
|
|
|
+ </if>
|
|
|
+ <if test='timeInterval != null and timeInterval[0] != null and timeInterval[0]!= ""'>
|
|
|
+ and tw.f_bsdate >= #{timeInterval[0]}
|
|
|
+ </if>
|
|
|
+ <if test='timeInterval != null and timeInterval[1] != null and timeInterval[1]!= ""'>
|
|
|
+ and tw.f_bsdate <= #{timeInterval[1]}
|
|
|
+ </if>
|
|
|
+ <if test="fTakeOrders != null "> and tw.f_take_orders = #{fTakeOrders}</if>
|
|
|
+ <if test="fReason != null and fReason != ''"> and tw.f_reason = #{fReason}</if>
|
|
|
+ </where>
|
|
|
+ ORDER BY tw.f_bsdate DESC,tw.f_id DESC
|
|
|
+ </select>
|
|
|
</mapper>
|