TWarehousebillsMapper.xml 175 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.ruoyi.warehouseBusiness.mapper.TWarehouseBillsMapper">
  6. <resultMap type="TWarehousebills" id="TWarehousebillsResult">
  7. <result property="fId" column="f_id" />
  8. <result property="fBillno" column="f_billno" />
  9. <result property="fCustomsdeclartion" column="f_customsdeclartion" />
  10. <result property="fOriginalbillno" column="f_originalbillno" />
  11. <result property="fDeptid" column="f_deptid" />
  12. <result property="fBsdeptid" column="f_bsdeptid" />
  13. <result property="fContacts" column="f_contacts" />
  14. <result property="fTel" column="f_tel" />
  15. <result property="fCorpid" column="f_corpid" />
  16. <result property="fShipper" column="f_shipper" />
  17. <result property="fTocorpid" column="f_tocorpid" />
  18. <result property="fStltypeid" column="f_stltypeid" />
  19. <result property="fBscorpno" column="f_bscorpno" />
  20. <result property="fWarehouseid" column="f_warehouseid" />
  21. <result property="fStorekeeper" column="f_storekeeper" />
  22. <result property="fChargedate" column="f_chargedate" />
  23. <result property="fBsdate" column="f_bsdate" />
  24. <result property="fPlanqty" column="f_planqty" />
  25. <result property="fPlangrossweight" column="f_plangrossweight" />
  26. <result property="fPlannetweight" column="f_plannetweight" />
  27. <result property="fPlanvolumn" column="f_planvolumn" />
  28. <result property="fQty" column="f_qty" />
  29. <result property="fGrossweight" column="f_grossweight" />
  30. <result property="fNetweight" column="f_netweight" />
  31. <result property="fVolumn" column="f_volumn" />
  32. <result property="fTrademodeid" column="f_trademodeid" />
  33. <result property="fBillingway" column="f_billingway" />
  34. <result property="fSbu" column="f_sbu" />
  35. <result property="fFeetunit" column="f_feetunit" />
  36. <result property="fMblno" column="f_mblno" />
  37. <result property="fEmblno" column="f_emblno" />
  38. <result property="fCompany" column="f_company" />
  39. <result property="fVslvoy" column="f_vslvoy" />
  40. <result property="fEta" column="f_eta" />
  41. <result property="fMarks" column="f_marks" />
  42. <result property="fCustomno" column="f_customno" />
  43. <result property="fIfweigh" column="f_ifweigh" />
  44. <result property="fIfpledge" column="f_ifpledge" />
  45. <result property="fIfdamage" column="f_ifdamage" />
  46. <result property="fBankcorpid" column="f_bankcorpid" />
  47. <result property="fBilltype" column="f_billtype" />
  48. <result property="fBillstatus" column="f_billstatus" />
  49. <result property="delFlag" column="del_flag" />
  50. <result property="createBy" column="create_by" />
  51. <result property="createTime" column="create_time" />
  52. <result property="fItemsStatus" column="f_items_status" />
  53. <result property="updateBy" column="update_by" />
  54. <result property="updateTime" column="update_time" />
  55. <result property="remark" column="remark" />
  56. <result property="fBillingDeadline" column="f_billing_deadline" />
  57. <result property="fProductName" column="f_product_name" />
  58. <result property="fReviewDate" column="f_review_date" />
  59. <result property="fTruckno" column="f_truckno" />
  60. <result property="fDriverName" column="f_driver_name" />
  61. <result property="fDriverTel" column="f_driver_tel" />
  62. <result property="fDriverIdCar" column="f_driver_id_car" />
  63. <result property="fBusinessType" column="f_business_type" />
  64. <result property="fLabour" column="f_labour" />
  65. <result property="fFleet" column="f_fleet" />
  66. <result property="fInwarehouseid" column="f_inwarehouseid" />
  67. <result property="fBstime" column="f_bstime" />
  68. <result property="fCartype" column="f_cartype" />
  69. <result property="fGoodsid" column="f_goodsid" />
  70. <result property="fNewTrademodeid" column="f_new_trademodeid" />
  71. <result property="fLoadportid" column="f_loadportid" />
  72. <result property="fDestportid" column="f_destportid" />
  73. <result property="fServiceitems" column="f_serviceitems" />
  74. <result property="fInvoceobj" column="f_invoceobj" />
  75. <result property="fSign" column="f_sign" />
  76. <result property="fDetentioncargo" column="f_detentioncargo" />
  77. <result property="fBooksmarks" column="f_booksmarks" />
  78. <result property="fShippername" column="f_shippername" />
  79. <result property="fShipperattn" column="f_shipperattn" />
  80. <result property="fShippertel" column="f_shippertel" />
  81. <result property="fConsigneername" column="f_consigneername" />
  82. <result property="fConsigneeattn" column="f_consigneeattn" />
  83. <result property="fConsigneetel" column="f_consigneetel" />
  84. <result property="fInsurance" column="f_insurance" />
  85. <result property="fInsuranceamt" column="f_insuranceamt" />
  86. <result property="fClosedate" column="f_closedate" />
  87. <result property="fDocmentdate" column="f_docmentdate" />
  88. <result property="fVslid" column="f_vslid" />
  89. <result property="fVoyid" column="f_voyid" />
  90. <result property="fTypeid" column="f_typeid" />
  91. <result property="fPaymode" column="f_paymode" />
  92. <result property="fLaneid" column="f_laneid" />
  93. <result property="fCntval" column="f_cntval" />
  94. <result property="freeContainerDate" column="free_container_date" />
  95. <result property="fBusinessAttribution" column="f_business_attribution" />
  96. <result property="fSupervisionUnit" column="f_supervision_unit" />
  97. <result property="fDeclarationElements" column="f_declaration_elements" />
  98. <result property="fPartNumber" column="f_part_number" />
  99. <result property="fIfinspection" column="f_ifinspection" />
  100. <result property="fValue" column="f_value" />
  101. <result property="fWeighingDate" column="f_weighing_date" />
  102. <result property="fIfsampling" column="f_ifsampling" />
  103. <result property="sendSampleDate" column="send_sample_date" />
  104. <result property="fIfweightRecovery" column="f_ifweight_recovery" />
  105. <result property="weightRecoveryDate" column="weight_recovery_date" />
  106. <result property="warehouseStatus" column="warehouse_status" />
  107. <result property="fTimes" column="f_times" />
  108. <result property="fDateChanged" column="f_date_changed"/>
  109. <result property="fChargetype" column="f_chargetype"/>
  110. <result property="fWeighWeight" column="f_weigh_weight" />
  111. <result property="fPredictBranch" column="f_predict_branch" />
  112. <result property="fGrade" column="f_grade" />
  113. <result property="fDeliveryDetails" column="f_delivery_details" />
  114. <result property="fSalesmanId" column="f_salesman_id" />
  115. <result property="fItemstatus" column="f_itemstatus" />
  116. <result property="fUpdeteStatus" column="f_updete_status"/>
  117. <result property="fSubmitUpdate" column="f_submit_update"/>
  118. <result property="fDeleteStatus" column="f_delete_status"/>
  119. <result property="fRemarksFees" column="f_remarks_fees" />
  120. <result property="fCargoPlanning" column="f_cargo_planning" />
  121. <result property="fArrivalStatus" column="f_arrival_status" />
  122. <result property="fDismountStatus" column="f_dismount_status" />
  123. <result property="fFeeStatus" column="f_fee_status" />
  124. <result property="fServiceitemsNew" column="f_serviceitems_new" />
  125. <result property="fReceivable" column="f_receivable" />
  126. <result property="fRecycle" column="f_recycle" />
  127. <result property="fDue" column="f_due" />
  128. <result property="fPay" column="f_pay" />
  129. <result property="fCaregoStatus" column="f_carego_status" />
  130. </resultMap>
  131. <resultMap type="WarehouseBillsVO" id="WarehousebillsVOResult">
  132. <result property="fId" column="f_id" />
  133. <result property="fBillno" column="f_billno" />
  134. <result property="fMblno" column="f_mblno" />
  135. <result property="fBsdate" column="f_bsdate" />
  136. <result property="fQty" column="f_qty" />
  137. <result property="fGrossweight" column="f_grossweight" />
  138. <result property="fNetweight" column="f_netweight" />
  139. <result property="fBilltype" column="f_billtype" />
  140. </resultMap>
  141. <sql id="selectTWarehousebillsVo">
  142. select f_id, f_billno, f_customsdeclartion, f_originalbillno, f_deptid, f_bsdeptid, f_contacts, f_tel, f_corpid, f_shipper, f_tocorpid, f_stltypeid, f_bscorpno,
  143. f_warehouseid, f_storekeeper, f_chargedate, f_bsdate, f_planqty, f_plangrossweight, f_plannetweight, f_planvolumn, f_qty, f_grossweight, f_netweight,
  144. f_volumn, f_billingway, f_trademodeid, f_sbu, f_feetunit, f_mblno, f_emblno, f_company, f_marks, f_vslvoy, f_eta, f_customno, f_ifweigh, f_ifpledge, f_ifdamage, f_bankcorpid,
  145. f_billtype, f_billstatus, f_items_status, del_flag, create_by, create_time, update_by, update_time, remark, f_billing_deadline, f_product_name, f_review_date,
  146. f_truckno, f_driver_name, f_driver_tel, f_driver_id_car, f_business_type, f_labour, f_fleet, f_inwarehouseid, f_bstime, f_cartype, f_goodsid, f_new_trademodeid,
  147. f_loadportid, f_destportid, f_serviceitems, f_invoceobj, f_sign, f_detentioncargo, f_booksmarks, f_shippername, f_shipperattn, f_shippertel, f_consigneername,
  148. f_consigneeattn, f_consigneetel, f_insurance, f_insuranceamt, f_closedate, f_docmentdate, f_vslid, f_voyid, f_typeid, f_paymode, f_laneid, f_cntval,
  149. free_container_date, f_business_attribution, f_fee_status, f_supervision_unit, f_declaration_elements, f_part_number, f_ifinspection, f_value, f_weighing_date,
  150. f_ifsampling, send_sample_date, f_ifweight_recovery, weight_recovery_date, warehouse_status, f_times ,f_date_changed, f_chargetype,f_weigh_weight,
  151. f_predict_branch,f_grade,f_delivery_details,f_salesman_id,f_itemstatus,f_updete_status, f_submit_update, f_delete_status,f_remarks_fees,f_cargo_planning,
  152. f_arrival_status,f_dismount_status,f_serviceitems_new,f_receivable,f_recycle,f_due,f_pay,f_carego_status from t_warehousebills
  153. </sql>
  154. <select id="selectTWarehousebillsList" parameterType="TWarehousebills" resultMap="TWarehousebillsResult">
  155. select
  156. ware.*
  157. from
  158. t_warehousebills ware
  159. left join sys_user u on ware.create_by = u.user_name
  160. left join sys_dept d on ware.f_bsdeptid = d.dept_id
  161. <where>
  162. ware.f_typeid IS NULL
  163. <if test="fBillno != null and fBillno != ''">and f_billno = #{fBillno}</if>
  164. <if test="fCustomsdeclartion != null and fCustomsdeclartion != ''">and f_customsdeclartion =
  165. #{fCustomsdeclartion}
  166. </if>
  167. <if test="fOriginalbillno != null and fOriginalbillno != ''">and f_originalbillno = #{fOriginalbillno}</if>
  168. <if test="fDeptid != null ">and f_deptid = #{fDeptid}</if>
  169. <if test="fBsdeptid != null ">and f_bsdeptid = #{fBsdeptid}</if>
  170. <if test="fInwarehouseid != null ">and f_inwarehouseid = #{fInwarehouseid}</if>
  171. <if test="fContacts != null and fContacts != ''">and f_contacts = #{fContacts}</if>
  172. <if test="fTel != null and fTel != ''">and f_tel = #{fTel}</if>
  173. <if test="fCorpid != null ">and f_corpid = #{fCorpid}</if>
  174. <if test="fShipper != null and fShipper != ''">and f_shipper like concat('%', #{fShipper}, '%')</if>
  175. <if test="fTocorpid != null ">and f_tocorpid = #{fTocorpid}</if>
  176. <if test="fChargedate != null ">and f_chargedate = #{fChargedate}</if>
  177. <if test='timeInterval != null and timeInterval[0] != null and timeInterval[0]!= ""'>
  178. and f_bsdate &gt;= #{timeInterval[0]}
  179. </if>
  180. <if test='timeInterval != null and timeInterval[1] != null and timeInterval[1]!= ""'>
  181. and f_bsdate &lt;= #{timeInterval[1]}
  182. </if>
  183. <if test="fStltypeid != null ">and f_stltypeid = #{fStltypeid}</if>
  184. <if test="fBscorpno != null and fBscorpno != ''">and f_bscorpno = #{fBscorpno}</if>
  185. <if test="fWarehouseid != null ">and f_warehouseid = #{fWarehouseid}</if>
  186. <if test="fStorekeeper != null and fStorekeeper != ''">and f_storekeeper = #{fStorekeeper}</if>
  187. <if test="fBsdate != null ">and f_bsdate = #{fBsdate}</if>
  188. <if test="fPlanqty != null ">and f_planqty = #{fPlanqty}</if>
  189. <if test="fProductName != null and fProductName != ''">and f_product_name like concat('%', #{fProductName},
  190. '%')
  191. </if>
  192. <if test="fPlangrossweight != null ">and f_plangrossweight = #{fPlangrossweight}</if>
  193. <if test="fPlannetweight != null ">and f_plannetweight = #{fPlannetweight}</if>
  194. <if test="fPlanvolumn != null ">and f_planvolumn = #{fPlanvolumn}</if>
  195. <if test="fQty != null ">and f_qty = #{fQty}</if>
  196. <if test="fMarks != null and fMarks != ''">and f_marks = #{fMarks}</if>
  197. <if test="fGrossweight != null ">and f_grossweight = #{fGrossweight}</if>
  198. <if test="fNetweight != null ">and f_netweight = #{fNetweight}</if>
  199. <if test="fVolumn != null ">and f_volumn = #{fVolumn}</if>
  200. <if test="fTrademodeid != null ">and f_trademodeid = #{fTrademodeid}</if>
  201. <if test="fBillingway != null ">and f_billingway = #{fBillingway}</if>
  202. <if test="fSbu != null ">and f_sbu = #{fSbu}</if>
  203. <if test="fFeetunit != null and fFeetunit != ''">and f_feetunit = #{fFeetunit}</if>
  204. <if test="fMblno != null and fMblno != ''">and f_mblno = #{fMblno}</if>
  205. <if test="fEmblno != null and fEmblno != ''">and f_emblno = #{fEmblno}</if>
  206. <if test="fVslvoy != null and fVslvoy != ''">and f_vslvoy = #{fVslvoy}</if>
  207. <if test="fEta != null ">and f_eta = #{fEta}</if>
  208. <if test="fCustomno != null and fCustomno != ''">and f_customno = #{fCustomno}</if>
  209. <if test="fIfweigh != null and fIfweigh != ''">and f_ifweigh = #{fIfweigh}</if>
  210. <if test="fIfpledge != null and fIfpledge != ''">and f_ifpledge = #{fIfpledge}</if>
  211. <if test="fIfdamage != null and fIfdamage != ''">and f_ifdamage = #{fIfdamage}</if>
  212. <if test="fBankcorpid != null ">and f_bankcorpid = #{fBankcorpid}</if>
  213. <if test="fBillingDeadline != null ">and f_billing_deadline = #{fBillingDeadline}</if>
  214. <if test="fBilltype != null and fBilltype != ''">and f_billtype = #{fBilltype}</if>
  215. <if test="fBillstatus != null and fBillstatus != ''">and f_billstatus = #{fBillstatus}</if>
  216. <if test="fNewTrademodeid != null ">and f_new_trademodeid = #{fNewTrademodeid}</if>
  217. </where>
  218. ${params.dataScope}
  219. </select>
  220. <select id="selectWarehouseBusinessList" parameterType="TWarehousebills" resultType="Map">
  221. SELECT
  222. DISTINCT
  223. bill.f_id AS fId,
  224. corp.f_name AS fCorpid,
  225. corpTo.f_name AS fTocorpid,
  226. bill.f_shipper AS fShipper,
  227. bill.f_mblno AS fMblno,
  228. bill.f_emblno AS fEmblno,
  229. bill.f_company AS fCompany,
  230. corpSub.f_name AS fSbu,
  231. bill.f_marks AS fMarks,
  232. bill.remark AS remark,
  233. bill.f_planqty AS fPlanqty,
  234. bill.f_plangrossweight AS fPlangrossweight,
  235. bill.f_plannetweight AS fPlannetweight,
  236. bill.f_planvolumn AS fPlanvolumn,
  237. bill.f_bsdate AS fBsdate,
  238. bill.f_trademodeid AS fTrademodeid,
  239. bill.f_truckno AS fTruckno,
  240. bill.f_driver_name AS fDriverName,
  241. bill.f_driver_tel AS fDriverTel,
  242. bill.f_driver_id_car AS fDriverIdCar,
  243. dictIn.dict_label AS fBusinessType,
  244. ware.f_name AS fWarehouseid,
  245. bill.f_qty AS fQty,
  246. bill.f_cntval AS fCntval,
  247. bill.f_netweight AS fNetweight,
  248. bill.create_time AS createTime,
  249. ware1.f_name AS fInwarehouseid,
  250. bill.f_chargetype AS fChargetype,
  251. bill.create_by AS createBy,
  252. bill.f_grossweight AS fGrossweight,
  253. bill.f_product_name AS fProductName,
  254. bill.f_billing_deadline AS fBillingDeadline,
  255. bill.free_container_date AS freeContainerDate,
  256. bill.warehouse_status AS warehouseStatus,
  257. CASE
  258. WHEN bill.f_fee_status = '0'THEN ''
  259. WHEN bill.f_fee_status = '1'THEN '暂存'
  260. WHEN bill.f_fee_status = '2'THEN '部分入账'
  261. WHEN bill.f_fee_status = '3'THEN '全部入账'
  262. END AS fFeeStatus,
  263. CASE WHEN bill.f_billstatus = '1' THEN '录入'
  264. WHEN bill.f_billstatus = '2' THEN '暂存'
  265. WHEN bill.f_billstatus = '3' THEN '驳回'
  266. WHEN bill.f_billstatus = '4' THEN '请核'
  267. WHEN bill.f_billstatus = '5' THEN '审核中'
  268. WHEN bill.f_billstatus = '6' THEN '全部入账'
  269. END
  270. AS fBillstatus,
  271. CASE
  272. WHEN bill.f_billtype = 'SJRK'
  273. AND bill.f_items_status = '1' THEN
  274. '计划'
  275. WHEN bill.f_billtype = 'SJRK'
  276. AND bill.f_items_status = '2' THEN
  277. '待入库'
  278. WHEN bill.f_billtype = 'SJRK'
  279. AND bill.f_items_status = '3' THEN
  280. '入库中'
  281. WHEN bill.f_billtype = 'SJRK'
  282. AND bill.f_items_status = '4' THEN
  283. '已入库'
  284. WHEN bill.f_billtype = 'SJCK'
  285. AND bill.f_items_status = '1' THEN
  286. '计划'
  287. WHEN bill.f_billtype = 'SJCK'
  288. AND bill.f_items_status = '2' THEN
  289. '待出库'
  290. WHEN bill.f_billtype = 'SJCK'
  291. AND bill.f_items_status = '3' THEN
  292. '出库中'
  293. WHEN bill.f_billtype = 'SJCK'
  294. AND bill.f_items_status = '4' THEN
  295. '已出库'
  296. WHEN bill.f_billtype = 'CKDB'
  297. AND bill.f_items_status = '1' THEN
  298. '计划'
  299. WHEN bill.f_billtype = 'CKDB'
  300. AND bill.f_items_status = '2' THEN
  301. '待调拨'
  302. WHEN bill.f_billtype = 'CKDB'
  303. AND bill.f_items_status = '3' THEN
  304. '调拨中'
  305. WHEN bill.f_billtype = 'CKDB'
  306. AND bill.f_items_status = '4' THEN
  307. '已调拨'
  308. WHEN bill.f_billtype = 'HWTG'
  309. AND bill.f_items_status = '1' THEN
  310. '计划'
  311. WHEN bill.f_billtype = 'HWTG'
  312. AND bill.f_items_status = '2' THEN
  313. '待调拨'
  314. WHEN bill.f_billtype = 'HWTG'
  315. AND bill.f_items_status = '3' THEN
  316. '调拨中'
  317. WHEN bill.f_billtype = 'HWTG'
  318. AND bill.f_items_status = '4' THEN
  319. '已调拨'
  320. END AS fItemsStatus,
  321. bill.f_billno AS fBillno,
  322. g.f_name AS fGoodsid,
  323. bill.f_vslid AS fVslid,
  324. bill.f_voyid AS fVoyid,
  325. bill.f_storekeeper AS fStorekeeper,
  326. bill.f_remarks_fees AS fRemarksFees
  327. FROM
  328. t_warehousebills bill
  329. LEFT JOIN t_goods g ON g.f_id = bill.f_goodsid
  330. left join sys_user u on bill.create_by = u.user_name
  331. left join sys_user u1 on bill.f_storekeeper = u1.user_name
  332. left join sys_dept d on bill.f_bsdeptid = d.dept_id
  333. LEFT JOIN t_corps corp ON corp.f_id = bill.f_corpid
  334. LEFT JOIN t_corps corpTo ON corpTo.f_id = bill.f_tocorpid
  335. LEFT JOIN t_corps corpSub ON corpSub.f_id = bill.f_sbu
  336. LEFT JOIN t_warehouse ware ON ware.f_id = bill.f_warehouseid
  337. LEFT JOIN t_warehouse ware1 ON ware1.f_id = bill.f_inwarehouseid
  338. LEFT JOIN t_warehousebillsitems item ON item.f_pid = bill.f_id
  339. LEFT JOIN t_goods goods ON goods.f_id = item.f_goodsid
  340. LEFT JOIN sys_dict_data dictIn ON dictIn.dict_value = bill.f_business_type
  341. <where>
  342. <if test="fTypeid == null or fTypeid == ''">and bill.f_typeid IS NULL</if>
  343. <if test="fTypeid != null and fTypeid != ''">and bill.f_typeid = #{fTypeid}</if>
  344. <if test="fFeeStatus != null and fFeeStatus != ''">and bill.f_fee_status = #{fFeeStatus}</if>
  345. <if test="fBillno != null and fBillno != ''">and bill.f_billno like concat('%', #{fBillno}, '%')</if>
  346. <if test="fTruckno != null and fTruckno != ''">and item.f_truckno like concat('%', #{fTruckno}, '%')</if>
  347. <if test="fCustomsdeclartion != null and fCustomsdeclartion != ''">and bill.f_customsdeclartion =
  348. #{fCustomsdeclartion}
  349. </if>
  350. <if test="fOriginalbillno != null and fOriginalbillno != ''">and bill.f_originalbillno =
  351. #{fOriginalbillno}
  352. </if>
  353. <if test="fDeptid != null ">and bill.f_deptid = #{fDeptid}</if>
  354. <if test="fInwarehouseid != null ">and bill.f_inwarehouseid = #{fInwarehouseid}</if>
  355. <if test="fBsdeptid != null ">and bill.f_bsdeptid = #{fBsdeptid}</if>
  356. <if test="fChargedate != null ">and bill.f_chargedate = #{fChargedate}</if>
  357. <if test='timeInterval != null and timeInterval[0] != null and timeInterval[0]!= ""'>
  358. and bill.f_bsdate &gt;= #{timeInterval[0]}
  359. </if>
  360. <if test='timeInterval != null and timeInterval[1] != null and timeInterval[1]!= ""'>
  361. and bill.f_bsdate &lt;= #{timeInterval[1]}
  362. </if>
  363. <if test='freeContainerList != null and freeContainerList[0] != null and freeContainerList[0]!= ""'>
  364. and bill.free_container_date &gt;= #{freeContainerList[0]}
  365. </if>
  366. <if test='freeContainerList != null and freeContainerList[1] != null and freeContainerList[1]!= ""'>
  367. and bill.free_container_date &lt;= #{freeContainerList[1]}
  368. </if>
  369. <if test="fGoodsid != null and fGoodsid != ''">and item.f_goodsid = #{fGoodsid}</if>
  370. <if test="fContacts != null and fContacts != ''">and bill.f_contacts = #{fContacts}</if>
  371. <if test="fTel != null and fTel != ''">and bill.f_tel = #{fTel}</if>
  372. <if test="fCorpid != null ">and bill.f_corpid = #{fCorpid}</if>
  373. <if test="fShipper != null and fShipper != ''">and bill.f_shipper like concat('%', #{fShipper}, '%')</if>
  374. <if test="fBillingDeadline != null ">and bill.f_billing_deadline = #{fBillingDeadline}</if>
  375. <if test="fTocorpid != null ">and bill.f_tocorpid = #{fTocorpid}</if>
  376. <if test="fMarks != null and fMarks != ''">and bill.f_marks like concat('%', #{fMarks}, '%')</if>
  377. <if test="fStltypeid != null ">and bill.f_stltypeid = #{fStltypeid}</if>
  378. <if test="fReviewDate != null ">and f_review_date = #{fReviewDate}</if>
  379. <if test="fBscorpno != null and fBscorpno != ''">and bill.f_bscorpno = #{fBscorpno}</if>
  380. <if test="fWarehouseid != null ">and bill.f_warehouseid = #{fWarehouseid}</if>
  381. <if test="fStorekeeper != null and fStorekeeper != ''">and bill.f_storekeeper = #{fStorekeeper}</if>
  382. <if test="fBsdate != null ">and bill.f_bsdate = #{fBsdate}</if>
  383. <if test="fPlanqty != null ">and bill.f_planqty = #{fPlanqty}</if>
  384. <if test="fPlangrossweight != null ">and bill.f_plangrossweight = #{fPlangrossweight}</if>
  385. <if test="fPlannetweight != null ">and bill.f_plannetweight = #{fPlannetweight}</if>
  386. <if test="fPlanvolumn != null ">and bill.f_planvolumn = #{fPlanvolumn}</if>
  387. <if test="fQty != null ">and bill.f_qty = #{fQty}</if>
  388. <if test="fGrossweight != null ">and bill.f_grossweight = #{fGrossweight}</if>
  389. <if test="fNetweight != null ">and bill.f_netweight = #{fNetweight}</if>
  390. <if test="fVolumn != null ">and bill.f_volumn = #{fVolumn}</if>
  391. <if test="fTrademodeid != null ">and bill.f_trademodeid = #{fTrademodeid}</if>
  392. <if test="fBillingway != null ">and bill.f_billingway = #{fBillingway}</if>
  393. <if test="fSbu != null ">and bill.f_sbu = #{fSbu}</if>
  394. <if test="fFeetunit != null and fFeetunit != ''">and bill.f_feetunit = #{fFeetunit}</if>
  395. <if test="fMblno != null and fMblno != ''">and (bill.f_mblno like concat('%', #{fMblno}, '%') or item.f_mblno like concat('%', #{fMblno}, '%'))</if>
  396. <if test="fEmblno != null and fEmblno != ''">and bill.f_emblno like concat('%', #{fEmblno}, '%')</if>
  397. <if test="fVslvoy != null and fVslvoy != ''">and bill.f_vslvoy = #{fVslvoy}</if>
  398. <if test="fEta != null ">and bill.f_eta = #{fEta}</if>
  399. <if test="fCustomno != null and fCustomno != ''">and bill.f_customno = #{fCustomno}</if>
  400. <if test="fIfweigh != null and fIfweigh != ''">and bill.f_ifweigh = #{fIfweigh}</if>
  401. <if test="fIfpledge != null and fIfpledge != ''">and bill.f_ifpledge = #{fIfpledge}</if>
  402. <if test="fIfdamage != null and fIfdamage != ''">and bill.f_ifdamage = #{fIfdamage}</if>
  403. <if test="fBankcorpid != null ">and bill.f_bankcorpid = #{fBankcorpid}</if>
  404. <if test="fBilltype != null">and bill.f_billtype = #{fBilltype}</if>
  405. <if test='timeInterval != null and timeInterval[0] != null and timeInterval[0]!= ""'>
  406. and bill.f_bsdate &gt;= #{timeInterval[0]}
  407. </if>
  408. <if test='timeInterval != null and timeInterval[1] != null and timeInterval[1]!= ""'>
  409. and bill.f_bsdate &lt;= #{timeInterval[1]}
  410. </if>
  411. <if test="fBilltype != null and fBilltype == 'SJRK'">
  412. AND dictIn.dict_type = 'st_in_type'
  413. AND dictIn.status = '0'
  414. </if>
  415. <if test="fBilltype != null and fBilltype == 'SJCK'">
  416. AND dictIn.dict_type = 'st_out_type'
  417. AND dictIn.status = '0'
  418. </if>
  419. <if test="fBilltype != null and fBilltype == 'CKDB'">
  420. AND dictIn.dict_type = 'st_trans_type'
  421. AND dictIn.status = '0'
  422. </if>
  423. <if test="fBilltype != null and fBilltype == 'HWTG'">
  424. AND dictIn.dict_type = 'st_trans_type'
  425. AND dictIn.status = '0'
  426. </if>
  427. <if test="fBilltype != null and fBilltype == 'CDZZ'"><!-- 场地直装 仿出库 -->
  428. AND dictIn.dict_type = 'st_out_type'
  429. AND dictIn.status = '0'
  430. </if>
  431. <if test="fBillstatus != null and fBillstatus != ''">and bill.f_billstatus = #{fBillstatus}</if>
  432. <if test="fItemsStatus != null and fItemsStatus != ''">and bill.f_items_status = #{fItemsStatus}</if>
  433. <if test="createBy != null and createBy != ''">and bill.create_by = #{createBy}</if>
  434. <if test="fNewTrademodeid != null ">and bill.f_new_trademodeid = #{fNewTrademodeid}</if>
  435. <if test="warehouseStatus != null and warehouseStatus != ''">and bill.warehouse_status = #{warehouseStatus}</if>
  436. </where>
  437. ${params.dataScope}
  438. ORDER BY bill.f_bsdate DESC, bill.f_bstime DESC,bill.f_id DESC,bill.f_billstatus
  439. </select>
  440. <select id="selectWarehouseBusinessList1" parameterType="TWarehousebills" resultType="Map">
  441. SELECT
  442. DISTINCT
  443. bill.f_id AS fId,
  444. corp.f_name AS fCorpid,
  445. corpTo.f_name AS fTocorpid,
  446. bill.f_shipper AS fShipper,
  447. bill.f_mblno AS fMblno,
  448. bill.f_emblno AS fEmblno,
  449. bill.f_company AS fCompany,
  450. corpSub.f_name AS fSbu,
  451. bill.f_marks AS fMarks,
  452. bill.remark AS remark,
  453. bill.f_planqty AS fPlanqty,
  454. bill.f_plangrossweight AS fPlangrossweight,
  455. bill.f_plannetweight AS fPlannetweight,
  456. bill.f_planvolumn AS fPlanvolumn,
  457. bill.f_bsdate AS fBsdate,
  458. dict.dict_label AS fTrademodeid,
  459. bill.f_truckno AS fTruckno,
  460. bill.f_driver_name AS fDriverName,
  461. bill.f_driver_tel AS fDriverTel,
  462. bill.f_driver_id_car AS fDriverIdCar,
  463. ware.f_name AS fWarehouseid,
  464. bill.f_qty AS fQty,
  465. bill.f_cntval AS fCntval,
  466. bill.f_chargetype AS fChargetype,
  467. bill.f_netweight AS fNetweight,
  468. bill.create_time AS createTime,
  469. ware1.f_name AS fInwarehouseid,
  470. bill.create_by AS createBy,
  471. bill.f_grossweight AS fGrossweight,
  472. bill.f_product_name AS fProductName,
  473. bill.f_billing_deadline AS fBillingDeadline,
  474. bill.free_container_date AS freeContainerDate,
  475. bill.warehouse_status AS warehouseStatus,
  476. CASE
  477. WHEN bill.f_fee_status = '0'THEN ''
  478. WHEN bill.f_fee_status = '1'THEN '暂存'
  479. WHEN bill.f_fee_status = '2'THEN '部分入账'
  480. WHEN bill.f_fee_status = '3'THEN '全部入账'
  481. END AS fFeeStatus,
  482. CASE
  483. WHEN bill.f_billtype = 'HQZY' AND bill.f_billstatus = '1' THEN '录入'
  484. WHEN bill.f_billtype = 'HQZY' AND bill.f_billstatus = '2' THEN '暂存'
  485. WHEN bill.f_billtype = 'HQZY' AND bill.f_billstatus = '3' THEN '驳回'
  486. WHEN bill.f_billtype = 'HQZY' AND bill.f_billstatus = '4' THEN '请核'
  487. WHEN bill.f_billtype = 'HQZY' AND bill.f_billstatus = '5' THEN '审核中'
  488. WHEN bill.f_billtype = 'HQZY' AND bill.f_billstatus = '6' THEN '全部入账'
  489. WHEN bill.f_billtype = 'JSCCF' AND bill.f_billstatus = '1' THEN '新建'
  490. WHEN bill.f_billtype = 'JSCCF' AND bill.f_billstatus = '2' THEN '暂存'
  491. WHEN bill.f_billtype = 'JSCCF' AND bill.f_billstatus = '3' THEN '审核驳回'
  492. WHEN bill.f_billtype = 'JSCCF' AND bill.f_billstatus = '4' THEN '提交审核'
  493. WHEN bill.f_billtype = 'JSCCF' AND bill.f_billstatus = '5' THEN '审核中'
  494. WHEN bill.f_billtype = 'JSCCF' AND bill.f_billstatus = '6' THEN '审核通过'
  495. END
  496. AS fBillstatus,
  497. CASE
  498. WHEN bill.f_billtype = 'HQZY'
  499. AND bill.f_items_status = '1' THEN
  500. '计划'
  501. WHEN bill.f_billtype = 'HQZY'
  502. AND bill.f_items_status = '2' THEN
  503. '待货转'
  504. WHEN bill.f_billtype = 'HQZY'
  505. AND bill.f_items_status = '3' THEN
  506. '货转中'
  507. WHEN bill.f_billtype = 'HQZY'
  508. AND bill.f_items_status = '4' THEN
  509. '已货转'
  510. END
  511. AS fItemsStatus,
  512. bill.f_billno AS fBillno,
  513. g.f_name AS fGoodsid,
  514. bill.f_storekeeper AS fStorekeeper,
  515. bill.f_remarks_fees AS fRemarksFees
  516. FROM
  517. t_warehousebills bill
  518. LEFT JOIN t_goods g ON g.f_id = bill.f_goodsid
  519. left join sys_user u on bill.create_by = u.user_name
  520. left join sys_user u1 on bill.f_storekeeper = u1.user_name
  521. left join sys_dept d on bill.f_bsdeptid = d.dept_id
  522. LEFT JOIN t_corps corp ON corp.f_id = bill.f_corpid
  523. LEFT JOIN t_corps corpTo ON corpTo.f_id = bill.f_tocorpid
  524. LEFT JOIN t_corps corpSub ON corpSub.f_id = bill.f_sbu
  525. LEFT JOIN t_warehouse ware ON ware.f_id = bill.f_warehouseid
  526. LEFT JOIN t_warehouse ware1 ON ware1.f_id = bill.f_inwarehouseid
  527. LEFT JOIN t_warehousebillsitems item ON item.f_pid = bill.f_id
  528. LEFT JOIN t_goods goods ON goods.f_id = item.f_goodsid
  529. LEFT JOIN sys_dict_data dict ON dict.dict_value = bill.f_trademodeid
  530. <where>
  531. dict.status = '0'
  532. AND dict.dict_type = 'data_trademodes'
  533. AND bill.f_typeid IS NULL
  534. <if test="fFeeStatus != null and fFeeStatus != ''">and bill.f_fee_status = #{fFeeStatus}</if>
  535. <if test="fBillno != null and fBillno != ''">and bill.f_billno like concat('%', #{fBillno}, '%')</if>
  536. <if test="fTruckno != null and fTruckno != ''">and item.f_truckno like concat('%', #{fTruckno}, '%')</if>
  537. <if test="fCustomsdeclartion != null and fCustomsdeclartion != ''">and bill.f_customsdeclartion =
  538. #{fCustomsdeclartion}
  539. </if>
  540. <if test="fOriginalbillno != null and fOriginalbillno != ''">and bill.f_originalbillno =
  541. #{fOriginalbillno}
  542. </if>
  543. <if test="fDeptid != null ">and bill.f_deptid = #{fDeptid}</if>
  544. <if test="fInwarehouseid != null ">and bill.f_inwarehouseid = #{fInwarehouseid}</if>
  545. <if test="fBsdeptid != null ">and bill.f_bsdeptid = #{fBsdeptid}</if>
  546. <if test="fChargedate != null ">and bill.f_chargedate = #{fChargedate}</if>
  547. <if test='timeInterval != null and timeInterval[0] != null and timeInterval[0]!= ""'>
  548. and bill.f_bsdate &gt;= #{timeInterval[0]}
  549. </if>
  550. <if test='timeInterval != null and timeInterval[1] != null and timeInterval[1]!= ""'>
  551. and bill.f_bsdate &lt;= #{timeInterval[1]}
  552. </if>
  553. <if test='freeContainerList != null and freeContainerList[0] != null and freeContainerList[0]!= ""'>
  554. and bill.free_container_date &gt;= #{freeContainerList[0]}
  555. </if>
  556. <if test='freeContainerList != null and freeContainerList[1] != null and freeContainerList[1]!= ""'>
  557. and bill.free_container_date &lt;= #{freeContainerList[1]}
  558. </if>
  559. <if test="fGoodsid != null and fGoodsid != ''">and item.f_goodsid = #{fGoodsid}</if>
  560. <if test="fContacts != null and fContacts != ''">and bill.f_contacts = #{fContacts}</if>
  561. <if test="fTel != null and fTel != ''">and bill.f_tel = #{fTel}</if>
  562. <if test="fCorpid != null ">and bill.f_corpid = #{fCorpid}</if>
  563. <if test="fShipper != null and fShipper != ''">and bill.f_shipper like concat('%', #{fShipper}, '%')</if>
  564. <if test="fBillingDeadline != null ">and bill.f_billing_deadline = #{fBillingDeadline}</if>
  565. <if test='timeInterval2 != null and timeInterval2[0] != null and timeInterval2[0]!= ""'><!-- 仓储费增加计费截止日期区间查询 -->
  566. and bill.f_billing_deadline &gt;= #{timeInterval2[0]}
  567. </if>
  568. <if test='timeInterval2 != null and timeInterval2[1] != null and timeInterval2[1]!= ""'>
  569. and bill.f_billing_deadline &lt;= #{timeInterval2[1]}
  570. </if>
  571. <if test="fTocorpid != null ">and bill.f_tocorpid = #{fTocorpid}</if>
  572. <if test="fMarks != null and fMarks != ''">and bill.f_marks like concat('%', #{fMarks}, '%')</if>
  573. <if test="fStltypeid != null ">and bill.f_stltypeid = #{fStltypeid}</if>
  574. <if test="fReviewDate != null ">and f_review_date = #{fReviewDate}</if>
  575. <if test="fBscorpno != null and fBscorpno != ''">and bill.f_bscorpno = #{fBscorpno}</if>
  576. <if test="fWarehouseid != null ">and bill.f_warehouseid = #{fWarehouseid}</if>
  577. <if test="fStorekeeper != null and fStorekeeper != ''">and bill.f_storekeeper = #{fStorekeeper}</if>
  578. <if test="fBsdate != null ">and bill.f_bsdate = #{fBsdate}</if>
  579. <if test="fPlanqty != null ">and bill.f_planqty = #{fPlanqty}</if>
  580. <if test="fPlangrossweight != null ">and bill.f_plangrossweight = #{fPlangrossweight}</if>
  581. <if test="fPlannetweight != null ">and bill.f_plannetweight = #{fPlannetweight}</if>
  582. <if test="fPlanvolumn != null ">and bill.f_planvolumn = #{fPlanvolumn}</if>
  583. <if test="fQty != null ">and bill.f_qty = #{fQty}</if>
  584. <if test="fGrossweight != null ">and bill.f_grossweight = #{fGrossweight}</if>
  585. <if test="fNetweight != null ">and bill.f_netweight = #{fNetweight}</if>
  586. <if test="fVolumn != null ">and bill.f_volumn = #{fVolumn}</if>
  587. <if test="fTrademodeid != null ">and bill.f_trademodeid = #{fTrademodeid}</if>
  588. <if test="fBillingway != null ">and bill.f_billingway = #{fBillingway}</if>
  589. <if test="fSbu != null ">and bill.f_sbu = #{fSbu}</if>
  590. <if test="fFeetunit != null and fFeetunit != ''">and bill.f_feetunit = #{fFeetunit}</if>
  591. <if test="fMblno != null and fMblno != ''">and bill.f_mblno like concat('%', #{fMblno}, '%')</if>
  592. <if test="fEmblno != null and fEmblno != ''">and bill.f_emblno like concat('%', #{fEmblno}, '%')</if>
  593. <if test="fVslvoy != null and fVslvoy != ''">and bill.f_vslvoy = #{fVslvoy}</if>
  594. <if test="fEta != null ">and bill.f_eta = #{fEta}</if>
  595. <if test="fCustomno != null and fCustomno != ''">and bill.f_customno = #{fCustomno}</if>
  596. <if test="fIfweigh != null and fIfweigh != ''">and bill.f_ifweigh = #{fIfweigh}</if>
  597. <if test="fIfpledge != null and fIfpledge != ''">and bill.f_ifpledge = #{fIfpledge}</if>
  598. <if test="fIfdamage != null and fIfdamage != ''">and bill.f_ifdamage = #{fIfdamage}</if>
  599. <if test="fBankcorpid != null ">and bill.f_bankcorpid = #{fBankcorpid}</if>
  600. <if test="fBilltype != null and fBilltype != ''">
  601. and bill.f_billtype = #{fBilltype}
  602. </if>
  603. <if test="fBillstatus != null and fBillstatus != ''">and bill.f_billstatus = #{fBillstatus}</if>
  604. <if test="fItemsStatus != null and fItemsStatus != ''">and bill.f_items_status = #{fItemsStatus}</if>
  605. <if test="createBy != null and createBy != ''">and bill.create_by = #{createBy}</if>
  606. <if test="fNewTrademodeid != null ">and bill.f_new_trademodeid = #{fNewTrademodeid}</if>
  607. <if test="warehouseStatus != null and warehouseStatus != ''">and bill.warehouse_status = #{warehouseStatus}</if>
  608. </where>
  609. ${params.dataScope}
  610. ORDER BY bill.f_bsdate DESC, bill.f_bstime DESC,bill.f_id DESC,bill.f_billstatus
  611. </select>
  612. <select id="selectTWarehousebillsById" parameterType="Long" resultMap="TWarehousebillsResult">
  613. <include refid="selectTWarehousebillsVo"/>
  614. where f_id = #{fId}
  615. ORDER BY f_bsdate desc
  616. </select>
  617. <select id="selectTWarehousebillsItemsList"
  618. resultType="com.ruoyi.warehouseBusiness.domain.TWareHouseExcelItems">
  619. SELECT
  620. ( @ii := @ii + 1 ) AS fId,
  621. CASE
  622. wi.f_billtype
  623. WHEN 'SJRK' THEN
  624. '入库'
  625. WHEN 'SJCK' THEN
  626. '出库'
  627. WHEN 'KCZZ' THEN
  628. '库存总账'
  629. END AS fBilltype,
  630. ware.f_name AS warehouseName,
  631. wi.f_mblno AS fMblno,
  632. wi.f_product_name AS fGoodsid,
  633. wi.f_marks AS fMarks,
  634. wi.f_bsdate AS fBsdate,
  635. dict.dict_label AS fFeeUnitid,
  636. wi.f_billing_qty AS fBillingQty,
  637. wi.f_chargedate AS fChargedate,
  638. wi.f_billing_deadline AS fBillingDeadline,
  639. wi.f_billing_days AS fBillingDays,
  640. wi.f_inventory_days AS fInventoryDays,
  641. wi.f_amt AS fAmt,
  642. wi.price_date_remarks AS priceDateRemarks,
  643. wi.remark AS remark
  644. FROM
  645. t_warehousebills w
  646. LEFT JOIN t_warehousebillsfees wi ON w.f_id = wi.f_pid
  647. LEFT JOIN t_warehouse ware ON ware.f_id = wi.f_warehouseid
  648. LEFT JOIN sys_dict_data dict ON dict.dict_value = wi.f_billingway,
  649. ( SELECT @ii := 0 ) AS ii
  650. WHERE w.f_id = #{fId}
  651. AND w.f_typeid IS NULL
  652. AND dict.status = '0'
  653. AND dict.dict_type = 'data_unitfees'
  654. </select>
  655. <select id="selectInStockDetail" resultType="com.ruoyi.warehouseBusiness.excel.StorageDetail">
  656. SELECT
  657. wi.f_mblno AS fMblno,
  658. tg.f_name AS fProductName,
  659. wi.f_packagespecs AS fPackagespecs,
  660. dict.dict_label AS fBusinessType,
  661. wi.f_bsdate AS inStockDate,
  662. wi.f_qty AS fQtyD,
  663. wi.f_grossweight AS fGrossweightD
  664. FROM t_warehousebillsitems wi
  665. LEFT JOIN t_warehousebills w ON wi.f_pid = w.f_id
  666. LEFT JOIN t_goods tg ON wi.f_goodsid = tg.f_id
  667. LEFT JOIN sys_dict_data dict ON w.f_business_type = dict.dict_value
  668. WHERE
  669. wi.f_billstatus = 40
  670. AND dict.status = 0
  671. <if test="billType != null and billType!= '' and billType== 'SJRK'">
  672. AND wi.f_billtype = 'SJRK'
  673. AND dict.dict_type = 'st_in_type'
  674. <if test="fId != null and fId!= ''">
  675. AND wi.f_mblno = (select distinct f_mblno from t_warehousebills where f_id = #{fId})
  676. AND wi.f_warehouselocid in (
  677. select distinct wi.f_warehouselocid
  678. from t_warehousebillsitems wi left join t_warehousebillsfees wf on wf.src_id = wi.f_id
  679. where wf.f_pid = #{fId}
  680. )
  681. </if>
  682. </if>
  683. <if test="billType != null and billType!= '' and billType== 'CKDB'">
  684. AND wi.f_billtype = 'CKDB'
  685. AND dict.dict_type = 'st_trans_type'
  686. <if test="fId != null and fId!= ''">
  687. AND wi.f_mblno = (select distinct f_mblno from t_warehousebills where f_id = #{fId})
  688. AND wi.f_transfer_warehouselocid in (
  689. select distinct wi.f_warehouselocid
  690. from t_warehousebillsitems wi left join t_warehousebillsfees wf on wf.src_id = wi.f_id
  691. where wf.f_pid = #{fId}
  692. )
  693. </if>
  694. </if>
  695. <if test="fId != null and fId!= ''">
  696. AND wi.f_bsdate &gt;= (select min(f_chargedate) from t_warehousebillsfees where f_pid = #{fId})
  697. </if>
  698. </select>
  699. <select id="selectNotInStockDetail" resultType="com.ruoyi.warehouseBusiness.excel.StorageDetail">
  700. SELECT
  701. wf.f_mblno AS fMblno,
  702. wf.f_product_name AS fProductName,
  703. wi.f_packagespecs AS fPackagespecs,
  704. dict.dict_label AS fBusinessType,
  705. wf.f_chargedate AS inStockDate,
  706. wf.f_billing_deadline AS outStockDate,
  707. wi.f_truckno AS fTruckno,
  708. wi.f_qty AS fQtyC,
  709. wi.f_grossweight AS fGrossweightC,
  710. dictF.dict_label AS fBillingway,
  711. wf.f_billing_qty AS fBillingQty,
  712. wf.f_billing_days AS fBillingDays,
  713. wf.f_amount AS fAmount
  714. FROM t_warehousebillsfees wf
  715. LEFT JOIN t_warehousebillsitems wi ON wi.f_id = wf.src_id
  716. LEFT JOIN t_warehousebills w ON w.f_id = wi.f_pid
  717. LEFT JOIN sys_dict_data dict ON w.f_business_type = dict.dict_value
  718. LEFT JOIN sys_dict_data dictF ON wf.f_billingway = dictF.dict_value
  719. WHERE w.f_typeid IS NULL
  720. AND dict.status = '0'
  721. AND dictF.status = '0'
  722. AND dictF.dict_type = 'data_unitfees'
  723. <if test="fId != null and fId!= ''">AND wf.f_pid = #{fId}</if>
  724. <if test="billType != null and billType!= '' and billType== 'SJCK'">
  725. AND wf.f_billtype = 'SJCK'
  726. AND dict.dict_type = 'st_out_type'
  727. </if>
  728. <if test="billType != null and billType!= '' and billType== 'HQZY'">
  729. AND wf.f_billtype = 'HQZY'
  730. AND dict.dict_type = 'st_goodstf_type'
  731. </if>
  732. </select>
  733. <select id="selectInventoryDetail" resultType="com.ruoyi.warehouseBusiness.excel.StorageDetail">
  734. SELECT
  735. wf.f_mblno AS fMblno,
  736. wf.f_product_name AS fProductName,
  737. wi.f_packagespecs AS fPackagespecs,
  738. '在库' AS fBusinessType,
  739. wf.f_bsdate AS inStockDate,
  740. dictF.dict_label AS fBillingway,
  741. wf.f_billing_qty AS fBillingQty,
  742. wf.f_billing_days AS fBillingDays,
  743. wf.f_amount AS fAmount
  744. FROM t_warehousebillsfees wf
  745. LEFT JOIN t_warehousebillsitems wi ON wi.f_id = wf.src_id
  746. LEFT JOIN t_warehousebills w ON w.f_id = wi.f_pid
  747. LEFT JOIN sys_dict_data dictF ON wf.f_billingway = dictF.dict_value
  748. WHERE w.f_typeid IS NULL
  749. AND dictF.status = '0'
  750. AND dictF.dict_type = 'data_unitfees'
  751. AND wf.f_billtype = 'KCZZ'
  752. <if test="fId != null and fId!= ''">AND wf.f_pid = #{fId}</if>
  753. </select>
  754. <select id="selectInventorySJRKList" parameterType="TWarehousebills" resultType="Map">
  755. SELECT
  756. co.f_name AS fName,
  757. leg.f_shipper AS fShipper,
  758. it.f_bsdate AS fBsdate,
  759. leg.f_mblno AS fMblno,
  760. it.f_business_type AS fBusinessType,
  761. dict.dict_label AS fBusinessTypes,
  762. it.f_marks AS fMarks ,
  763. goo.f_name AS fGoodsName,
  764. it.f_warehouse_information AS fWarehouseLocationids,
  765. dicttr.dict_label AS fTrademodeid,
  766. it.f_qty AS fQty,
  767. it.f_grossweight AS fGrossweight,
  768. it.f_netweight AS fNetweight,
  769. it.f_driver_name AS fDriverName,
  770. it.f_truckno AS fTruckno,
  771. it.f_driver_id_car AS fDriverIdCar,
  772. CASE
  773. it.f_billtype
  774. WHEN 'SJRK' THEN
  775. '入库'
  776. WHEN 'SJCK' THEN
  777. '出库'
  778. WHEN 'CKDB' THEN
  779. '调拨'
  780. END AS fBilltype
  781. FROM
  782. t_warehousebills leg
  783. left join sys_user u on leg.create_by = u.user_name
  784. left join sys_user u1 on leg.f_salesman_id = u1.user_name
  785. left join sys_dept d on leg.f_bsdeptid = d.dept_id
  786. LEFT JOIN t_warehousebillsitems it ON leg.f_id = it.f_pid
  787. LEFT JOIN t_goods goo ON it.f_goodsid = goo.f_id
  788. LEFT JOIN t_corps co ON leg.f_corpid = co.f_id
  789. LEFT JOIN sys_dict_data dict ON dict.dict_value = it.f_business_type
  790. LEFT JOIN t_warehouse ware ON ware.f_id = it.f_warehouselocid
  791. LEFT JOIN sys_dict_data dicttr ON dicttr.dict_value = leg.f_trademodeid
  792. <where>
  793. dict.status = '0'
  794. AND leg.f_typeid IS NULL
  795. AND dict.dict_type = 'storage_type'
  796. AND dicttr.STATUS = '0'
  797. AND dicttr.dict_type = 'data_trademodes'
  798. AND leg.f_billtype in ('SJRK','CKDB')
  799. AND it.f_billstatus = 40
  800. <if test="fGoodsid != null ">and it.f_goodsid = #{fGoodsid}</if>
  801. <if test="fTrademodeid != null ">and leg.f_trademodeid = #{fTrademodeid}</if>
  802. <if test="fNewTrademodeid != null ">and leg.f_new_trademodeid = #{fNewTrademodeid}</if>
  803. <if test="fCorpid != null ">and leg.f_corpid = #{fCorpid}</if>
  804. <if test="fShipper != null and fShipper != ''">and leg.f_shipper like concat('%', #{fShipper}, '%')</if>
  805. <if test="fMblno != null ">and it.f_mblno like concat('%',#{fMblno},'%')</if>
  806. <if test="fEmblno != null ">and it.f_emblno like concat('%',#{fEmblno},'%')</if>
  807. <if test="fLocation != null and fLocation ==1 ">
  808. and it.f_warehouselocid = #{fWarehouseid}
  809. </if>
  810. <if test="fLocation != null and fLocation ==0 ">
  811. and ware.ancestors LIKE concat('%', #{fWarehouseid}, '%')
  812. </if>
  813. <if test='timeInterval != null and timeInterval[0] != null and timeInterval[0]!= ""'>
  814. and it.f_bsdate &gt;= #{timeInterval[0]}
  815. </if>
  816. <if test='timeInterval != null and timeInterval[1] != null and timeInterval[1]!= ""'>
  817. and it.f_bsdate &lt;= #{timeInterval[1]}
  818. </if>
  819. </where>
  820. ${params.dataScope}
  821. </select>
  822. <select id="selectInventorySJCKList" parameterType="TWarehousebills" resultType="Map">
  823. SELECT
  824. co.f_name AS fName,
  825. leg.f_shipper AS fShipper,
  826. it.f_bsdate AS fBsdate,
  827. leg.f_mblno AS fMblno,
  828. it.f_business_type AS fBusinessType,
  829. dict.dict_label AS fBusinessTypes,
  830. it.f_marks AS fMarks ,
  831. goo.f_name AS fGoodsName,
  832. dicttr.dict_label AS fTrademodeid,
  833. it.f_qty AS fQty,
  834. it.f_grossweight AS fGrossweight,
  835. it.f_netweight AS fNetweight,
  836. it.f_driver_name AS fDriverName,
  837. it.f_truckno AS fTruckno,
  838. it.f_driver_id_car AS fDriverIdCar,
  839. CASE
  840. it.f_billtype
  841. WHEN 'SJRK' THEN
  842. '入库'
  843. WHEN 'SJCK' THEN
  844. '出库'
  845. WHEN 'CKDB' THEN
  846. '调拨'
  847. END AS fBilltype ,
  848. CASE
  849. it.f_billtype
  850. WHEN 'SJRK' THEN
  851. it.f_warehouse_information
  852. WHEN 'SJCK' THEN
  853. it.f_warehouse_information
  854. WHEN 'CKDB' THEN
  855. it.f_orgwarehouse_information
  856. END AS fWarehouseLocationids
  857. FROM
  858. t_warehousebills leg
  859. left join sys_user u on leg.create_by = u.user_name
  860. left join sys_user u1 on leg.f_salesman_id = u1.user_name
  861. left join sys_dept d on leg.f_bsdeptid = d.dept_id
  862. LEFT JOIN t_warehousebillsitems it ON leg.f_id = it.f_pid
  863. LEFT JOIN t_goods goo ON it.f_goodsid = goo.f_id
  864. LEFT JOIN t_corps co ON leg.f_corpid = co.f_id
  865. LEFT JOIN sys_dict_data dict ON dict.dict_value = it.f_business_type
  866. LEFT JOIN t_warehouse ware ON ware.f_id = it.f_warehouselocid
  867. LEFT JOIN sys_dict_data dicttr ON dicttr.dict_value = leg.f_trademodeid
  868. <where>
  869. dict.status = '0'
  870. AND leg.f_typeid IS NULL
  871. AND dict.dict_type = 'storage_type'
  872. AND dicttr.STATUS = '0'
  873. AND dicttr.dict_type = 'data_trademodes'
  874. AND leg.f_billtype in ('SJCK','CKDB')
  875. AND it.f_billstatus = 40
  876. <if test="fGoodsid != null ">and it.f_goodsid = #{fGoodsid}</if>
  877. <if test="fTrademodeid != null ">and leg.f_trademodeid = #{fTrademodeid}</if>
  878. <if test="fNewTrademodeid != null ">and leg.f_new_trademodeid = #{fNewTrademodeid}</if>
  879. <if test="fCorpid != null ">and leg.f_corpid = #{fCorpid}</if>
  880. <if test="fShipper != null and fShipper != ''">and leg.f_shipper like concat('%', #{fShipper}, '%')</if>
  881. <if test="fMblno != null ">and it.f_mblno like concat('%',#{fMblno},'%')</if>
  882. <if test="fEmblno != null ">and it.f_emblno like concat('%',#{fEmblno},'%')</if>
  883. <if test="fLocation != null and fLocation ==1 ">
  884. and it.f_warehouselocid = #{fWarehouseid}
  885. </if>
  886. <if test="fLocation != null and fLocation ==0 ">
  887. and ware.ancestors LIKE concat('%', #{fWarehouseid}, '%')
  888. </if>
  889. <if test='timeInterval != null and timeInterval[0] != null and timeInterval[0]!= ""'>
  890. and it.f_bsdate &gt;= #{timeInterval[0]}
  891. </if>
  892. <if test='timeInterval != null and timeInterval[1] != null and timeInterval[1]!= ""'>
  893. and it.f_bsdate &lt;= #{timeInterval[1]}
  894. </if>
  895. </where>
  896. ${params.dataScope}
  897. </select>
  898. <select id="selectTWarehousebillsItemList"
  899. resultType="com.ruoyi.reportManagement.domain.TWareHouseItemsExcel">
  900. SELECT
  901. ( @ii := @ii + 1 ) AS fId,
  902. co.f_name AS fCorpid,
  903. leg.f_shipper AS fShipper,
  904. it.f_bsdate AS fBsdate,
  905. leg.f_mblno AS fMblno,
  906. dict.dict_label AS fBusinessType,
  907. it.f_marks AS fMarks,
  908. go.f_name AS fGoodsid,
  909. it.f_warehouse_information AS fWarehouseInformation,
  910. dicttr.dict_label AS fTrademodeid,
  911. it.f_qty AS fQty,
  912. it.f_grossweight AS fGrossweight,
  913. it.f_netweight AS fNetweight,
  914. it.f_driver_name AS fDrivername,
  915. it.f_truckno AS fTruckno,
  916. it.f_driver_id_car AS fDriverIdCar
  917. FROM
  918. t_warehousebills leg
  919. LEFT JOIN t_warehousebillsitems it ON leg.f_id = it.f_pid
  920. LEFT JOIN t_goods go ON it.f_goodsid = go.f_id
  921. LEFT JOIN t_corps co ON leg.f_corpid = co.f_id
  922. LEFT JOIN sys_dict_data dict ON dict.dict_value = it.f_business_type
  923. LEFT JOIN t_warehouse_area area ON area.f_id = it.f_warehouselocid
  924. LEFT JOIN sys_dict_data dicttr ON dicttr.dict_value = leg.f_trademodeid,(
  925. SELECT
  926. @ii := 0
  927. ) AS ii
  928. WHERE
  929. dict.STATUS = '0'
  930. AND leg.f_typeid IS NULL
  931. AND dict.dict_type = 'storage_type'
  932. AND dicttr.STATUS = '0'
  933. AND dicttr.dict_type = 'data_trademodes'
  934. AND leg.f_billtype IN (
  935. 'SJRk',
  936. 'SJCK'
  937. )
  938. <if test="fBilltype != null">AND leg.f_billtype = #{fBilltype}</if>
  939. <if test="fGoodsid != null ">and it.f_goodsid = #{fGoodsid}</if>
  940. <if test="fTrademodeid != null ">and leg.f_trademodeid = #{fTrademodeid}</if>
  941. <if test="fNewTrademodeid != null ">and leg.f_new_trademodeid = #{fNewTrademodeid}</if>
  942. <if test="fCorpid != null ">and leg.f_corpid = #{fCorpid}</if>
  943. <if test="fShipper != null and fShipper != ''">and leg.f_shipper like concat('%', #{fShipper}, '%')</if>
  944. <if test="fMblno != null ">and leg.f_mblno = #{fMblno}</if>
  945. <if test="fEmblno != null ">and leg.f_emblno = #{fEmblno}</if>
  946. <if test="fLocation != null and fLocation ==1 ">
  947. and it.f_warehouselocid = #{fWarehouseid}
  948. </if>
  949. <if test="fLocation != null and fLocation ==0 ">
  950. and ware.ancestors LIKE concat('%', #{fWarehouseid}, '%')
  951. </if>
  952. <if test='timeInterval != null and timeInterval[0] != null and timeInterval[0]!= ""'>
  953. and it.f_bsdate &gt;= #{timeInterval[0]}
  954. </if>
  955. <if test='timeInterval != null and timeInterval[1] != null and timeInterval[1]!= ""'>
  956. and it.f_bsdate &lt;= #{timeInterval[1]}
  957. </if>
  958. </select>
  959. <select id="selectContainMblno" parameterType="TWarehousebills" resultType="int">
  960. SELECT
  961. count( f_id )
  962. FROM
  963. t_warehousebills
  964. where
  965. f_mblno = #{fMblno}
  966. AND f_bsdate = #{fBsdate}
  967. AND f_billtype = #{fBilltype}
  968. </select>
  969. <insert id="insertTWarehousebills" parameterType="TWarehousebills" useGeneratedKeys="true" keyProperty="fId">
  970. insert into t_warehousebills
  971. <trim prefix="(" suffix=")" suffixOverrides=",">
  972. <if test="fBillno != null">f_billno,</if>
  973. <if test="fCustomsdeclartion != null">f_customsdeclartion,</if>
  974. <if test="fOriginalbillno != null">f_originalbillno,</if>
  975. <if test="fDeptid != null">f_deptid,</if>
  976. <if test="fBsdeptid != null">f_bsdeptid,</if>
  977. <if test="fContacts != null">f_contacts,</if>
  978. <if test="fTel != null">f_tel,</if>
  979. <if test="fCorpid != null">f_corpid,</if>
  980. <if test="fShipper != null">f_shipper,</if>
  981. <if test="fTocorpid != null">f_tocorpid,</if>
  982. <if test="fStltypeid != null">f_stltypeid,</if>
  983. <if test="fBscorpno != null">f_bscorpno,</if>
  984. <if test="fWarehouseid != null">f_warehouseid,</if>
  985. <if test="fStorekeeper != null">f_storekeeper,</if>
  986. <if test="fChargedate != null">f_chargedate,</if>
  987. <if test="fBsdate != null">f_bsdate,</if>
  988. <if test="fPlanqty != null">f_planqty,</if>
  989. <if test="fPlangrossweight != null">f_plangrossweight,</if>
  990. <if test="fPlannetweight != null">f_plannetweight,</if>
  991. <if test="fPlanvolumn != null">f_planvolumn,</if>
  992. <if test="fQty != null">f_qty,</if>
  993. <if test="fGrossweight != null">f_grossweight,</if>
  994. <if test="fNetweight != null">f_netweight,</if>
  995. <if test="fVolumn != null">f_volumn,</if>
  996. <if test="fTrademodeid != null">f_trademodeid,</if>
  997. <if test="fBillingway != null">f_billingway,</if>
  998. <if test="fSbu != null">f_sbu,</if>
  999. <if test="fFeetunit != null">f_feetunit,</if>
  1000. <if test="fMblno != null">f_mblno,</if>
  1001. <if test="fEmblno != null">f_emblno,</if>
  1002. <if test="fCompany != null">f_company,</if>
  1003. <if test="fVslvoy != null">f_vslvoy,</if>
  1004. <if test="fEta != null">f_eta,</if>
  1005. <if test="fMarks != null">f_marks,</if>
  1006. <if test="fCustomno != null">f_customno,</if>
  1007. <if test="fIfweigh != null">f_ifweigh,</if>
  1008. <if test="fIfpledge != null">f_ifpledge,</if>
  1009. <if test="fIfdamage != null">f_ifdamage,</if>
  1010. <if test="fBankcorpid != null">f_bankcorpid,</if>
  1011. <if test="fBilltype != null">f_billtype,</if>
  1012. <if test="fBillstatus != null">f_billstatus,</if>
  1013. <if test="delFlag != null">del_flag,</if>
  1014. <if test="createBy != null">create_by,</if>
  1015. <if test="createTime != null">create_time,</if>
  1016. <if test="fItemsStatus != null">f_items_status,</if>
  1017. <if test="updateBy != null">update_by,</if>
  1018. <if test="updateTime != null">update_time,</if>
  1019. <if test="remark != null">remark,</if>
  1020. <if test="fBillingDeadline != null">f_billing_deadline,</if>
  1021. <if test="fProductName != null">f_product_name,</if>
  1022. <if test="fReviewDate != null">f_review_date,</if>
  1023. <if test="fTruckno != null">f_truckno,</if>
  1024. <if test="fDriverName != null">f_driver_name,</if>
  1025. <if test="fDriverTel != null">f_driver_tel,</if>
  1026. <if test="fDriverIdCar != null">f_driver_id_car,</if>
  1027. <if test="fBusinessType != null">f_business_type,</if>
  1028. <if test="fLabour != null">f_labour,</if>
  1029. <if test="fFleet != null">f_fleet,</if>
  1030. <if test="fInwarehouseid != null">f_inwarehouseid,</if>
  1031. <if test="fBstime != null">f_bstime,</if>
  1032. <if test="fCartype != null">f_cartype,</if>
  1033. <if test="fGoodsid != null">f_goodsid,</if>
  1034. <if test="fNewTrademodeid != null">f_new_trademodeid,</if>
  1035. <if test="fLoadportid != null">f_loadportid,</if>
  1036. <if test="fDestportid != null">f_destportid,</if>
  1037. <if test="fServiceitems != null">f_serviceitems,</if>
  1038. <if test="fInvoceobj != null">f_invoceobj,</if>
  1039. <if test="fSign != null">f_sign,</if>
  1040. <if test="fDetentioncargo != null">f_detentioncargo,</if>
  1041. <if test="fBooksmarks != null">f_booksmarks,</if>
  1042. <if test="fShippername != null">f_shippername,</if>
  1043. <if test="fShipperattn != null">f_shipperattn,</if>
  1044. <if test="fShippertel != null">f_shippertel,</if>
  1045. <if test="fConsigneername != null">f_consigneername,</if>
  1046. <if test="fConsigneeattn != null">f_consigneeattn,</if>
  1047. <if test="fConsigneetel != null">f_consigneetel,</if>
  1048. <if test="fInsurance != null">f_insurance,</if>
  1049. <if test="fInsuranceamt != null">f_insuranceamt,</if>
  1050. <if test="fClosedate != null">f_closedate,</if>
  1051. <if test="fDocmentdate != null">f_docmentdate,</if>
  1052. <if test="fVslid != null">f_vslid,</if>
  1053. <if test="fVoyid != null">f_voyid,</if>
  1054. <if test="fTypeid != null">f_typeid,</if>
  1055. <if test="fPaymode != null">f_paymode,</if>
  1056. <if test="fLaneid != null">f_laneid,</if>
  1057. <if test="fCntval != null">f_cntval,</if>
  1058. <if test="freeContainerDate != null">free_container_date,</if>
  1059. <if test="fBusinessAttribution != null">f_business_attribution,</if>
  1060. <if test="fSupervisionUnit != null">f_supervision_unit,</if>
  1061. <if test="fDeclarationElements != null">f_declaration_elements,</if>
  1062. <if test="fPartNumber != null">f_part_number,</if>
  1063. <if test="fIfinspection != null">f_ifinspection,</if>
  1064. <if test="fValue != null">f_value,</if>
  1065. <if test="fWeighingDate != null">f_weighing_date,</if>
  1066. <if test="fIfsampling != null">f_ifsampling,</if>
  1067. <if test="sendSampleDate != null">send_sample_date,</if>
  1068. <if test="fIfweightRecovery != null">f_ifweight_recovery,</if>
  1069. <if test="weightRecoveryDate != null">weight_recovery_date,</if>
  1070. <if test="warehouseStatus != null">warehouse_status,</if>
  1071. <if test="fTimes != null">f_times,</if>
  1072. <if test="fDateChanged != null">f_date_changed,</if>
  1073. <if test="fChargetype != null">f_chargetype,</if>
  1074. <if test="fWeighWeight != null">f_weigh_weight,</if>
  1075. <if test="fPredictBranch != null">f_predict_branch,</if>
  1076. <if test="fGrade != null">f_grade,</if>
  1077. <if test="fDeliveryDetails != null">f_delivery_details,</if>
  1078. <if test="fSalesmanId != null">f_salesman_id,</if>
  1079. <if test="fItemstatus != null">f_itemstatus,</if>
  1080. <if test="fUpdeteStatus != null">f_updete_status,</if>
  1081. <if test="fSubmitUpdate != null">f_submit_update,</if>
  1082. <if test="fDeleteStatus != null">f_delete_status,</if>
  1083. <if test="fRemarksFees != null">f_remarks_fees,</if>
  1084. <if test="fCargoPlanning != null">f_cargo_planning,</if>
  1085. <if test="fFeeStatus != null">f_fee_status,</if>
  1086. <if test="fArrivalStatus != null">f_arrival_status,</if>
  1087. <if test="fDismountStatus != null">f_dismount_status,</if>
  1088. <if test="fServiceitemsNew != null">f_serviceitems_new,</if>
  1089. <if test="fReceivable != null">f_receivable,</if>
  1090. <if test="fRecycle != null">f_recycle,</if>
  1091. <if test="fDue != null">f_due,</if>
  1092. <if test="fPay != null">f_pay,</if>
  1093. <if test="fCaregoStatus != null">f_carego_status,</if>
  1094. </trim>
  1095. <trim prefix="values (" suffix=")" suffixOverrides=",">
  1096. <if test="fBillno != null">#{fBillno},</if>
  1097. <if test="fCustomsdeclartion != null">#{fCustomsdeclartion},</if>
  1098. <if test="fOriginalbillno != null">#{fOriginalbillno},</if>
  1099. <if test="fDeptid != null">#{fDeptid},</if>
  1100. <if test="fBsdeptid != null">#{fBsdeptid},</if>
  1101. <if test="fContacts != null">#{fContacts},</if>
  1102. <if test="fTel != null">#{fTel},</if>
  1103. <if test="fCorpid != null">#{fCorpid},</if>
  1104. <if test="fShipper != null">#{fShipper},</if>
  1105. <if test="fTocorpid != null">#{fTocorpid},</if>
  1106. <if test="fStltypeid != null">#{fStltypeid},</if>
  1107. <if test="fBscorpno != null">#{fBscorpno},</if>
  1108. <if test="fWarehouseid != null">#{fWarehouseid},</if>
  1109. <if test="fStorekeeper != null">#{fStorekeeper},</if>
  1110. <if test="fChargedate != null">#{fChargedate},</if>
  1111. <if test="fBsdate != null">#{fBsdate},</if>
  1112. <if test="fPlanqty != null">#{fPlanqty},</if>
  1113. <if test="fPlangrossweight != null">#{fPlangrossweight},</if>
  1114. <if test="fPlannetweight != null">#{fPlannetweight},</if>
  1115. <if test="fPlanvolumn != null">#{fPlanvolumn},</if>
  1116. <if test="fQty != null">#{fQty},</if>
  1117. <if test="fGrossweight != null">#{fGrossweight},</if>
  1118. <if test="fNetweight != null">#{fNetweight},</if>
  1119. <if test="fVolumn != null">#{fVolumn},</if>
  1120. <if test="fTrademodeid != null">#{fTrademodeid},</if>
  1121. <if test="fBillingway != null">#{fBillingway},</if>
  1122. <if test="fSbu != null">#{fSbu},</if>
  1123. <if test="fFeetunit != null">#{fFeetunit},</if>
  1124. <if test="fMblno != null">#{fMblno},</if>
  1125. <if test="fEmblno != null">#{fEmblno},</if>
  1126. <if test="fCompany != null">#{fCompany},</if>
  1127. <if test="fVslvoy != null">#{fVslvoy},</if>
  1128. <if test="fEta != null">#{fEta},</if>
  1129. <if test="fMarks != null">#{fMarks},</if>
  1130. <if test="fCustomno != null">#{fCustomno},</if>
  1131. <if test="fIfweigh != null">#{fIfweigh},</if>
  1132. <if test="fIfpledge != null">#{fIfpledge},</if>
  1133. <if test="fIfdamage != null">#{fIfdamage},</if>
  1134. <if test="fBankcorpid != null">#{fBankcorpid},</if>
  1135. <if test="fBilltype != null">#{fBilltype},</if>
  1136. <if test="fBillstatus != null">#{fBillstatus},</if>
  1137. <if test="delFlag != null">#{delFlag},</if>
  1138. <if test="createBy != null">#{createBy},</if>
  1139. <if test="createTime != null">#{createTime},</if>
  1140. <if test="fItemsStatus != null">#{fItemsStatus},</if>
  1141. <if test="updateBy != null">#{updateBy},</if>
  1142. <if test="updateTime != null">#{updateTime},</if>
  1143. <if test="remark != null">#{remark},</if>
  1144. <if test="fBillingDeadline != null">#{fBillingDeadline},</if>
  1145. <if test="fProductName != null">#{fProductName},</if>
  1146. <if test="fReviewDate != null">#{fReviewDate},</if>
  1147. <if test="fTruckno != null">#{fTruckno},</if>
  1148. <if test="fDriverName != null">#{fDriverName},</if>
  1149. <if test="fDriverTel != null">#{fDriverTel},</if>
  1150. <if test="fDriverIdCar != null">#{fDriverIdCar},</if>
  1151. <if test="fBusinessType != null">#{fBusinessType},</if>
  1152. <if test="fLabour != null">#{fLabour},</if>
  1153. <if test="fFleet != null">#{fFleet},</if>
  1154. <if test="fInwarehouseid != null">#{fInwarehouseid},</if>
  1155. <if test="fBstime != null">#{fBstime},</if>
  1156. <if test="fCartype != null">#{fCartype},</if>
  1157. <if test="fGoodsid != null">#{fGoodsid},</if>
  1158. <if test="fNewTrademodeid != null">#{fNewTrademodeid},</if>
  1159. <if test="fLoadportid != null">#{fLoadportid},</if>
  1160. <if test="fDestportid != null">#{fDestportid},</if>
  1161. <if test="fServiceitems != null">#{fServiceitems},</if>
  1162. <if test="fInvoceobj != null">#{fInvoceobj},</if>
  1163. <if test="fSign != null">#{fSign},</if>
  1164. <if test="fDetentioncargo != null">#{fDetentioncargo},</if>
  1165. <if test="fBooksmarks != null">#{fBooksmarks},</if>
  1166. <if test="fShippername != null">#{fShippername},</if>
  1167. <if test="fShipperattn != null">#{fShipperattn},</if>
  1168. <if test="fShippertel != null">#{fShippertel},</if>
  1169. <if test="fConsigneername != null">#{fConsigneername},</if>
  1170. <if test="fConsigneeattn != null">#{fConsigneeattn},</if>
  1171. <if test="fConsigneetel != null">#{fConsigneetel},</if>
  1172. <if test="fInsurance != null">#{fInsurance},</if>
  1173. <if test="fInsuranceamt != null">#{fInsuranceamt},</if>
  1174. <if test="fClosedate != null">#{fClosedate},</if>
  1175. <if test="fDocmentdate != null">#{fDocmentdate},</if>
  1176. <if test="fVslid != null">#{fVslid},</if>
  1177. <if test="fVoyid != null">#{fVoyid},</if>
  1178. <if test="fTypeid != null">#{fTypeid},</if>
  1179. <if test="fPaymode != null">#{fPaymode},</if>
  1180. <if test="fLaneid != null">#{fLaneid},</if>
  1181. <if test="fCntval != null">#{fCntval},</if>
  1182. <if test="freeContainerDate != null">#{freeContainerDate},</if>
  1183. <if test="fBusinessAttribution != null">#{fBusinessAttribution},</if>
  1184. <if test="fSupervisionUnit != null">#{fSupervisionUnit},</if>
  1185. <if test="fDeclarationElements != null">#{fDeclarationElements},</if>
  1186. <if test="fPartNumber != null">#{fPartNumber},</if>
  1187. <if test="fIfinspection != null">#{fIfinspection},</if>
  1188. <if test="fValue != null">#{fValue},</if>
  1189. <if test="fWeighingDate != null">#{fWeighingDate},</if>
  1190. <if test="fIfsampling != null">#{fIfsampling},</if>
  1191. <if test="sendSampleDate != null">#{sendSampleDate},</if>
  1192. <if test="fIfweightRecovery != null">#{fIfweightRecovery},</if>
  1193. <if test="weightRecoveryDate != null">#{weightRecoveryDate},</if>
  1194. <if test="warehouseStatus != null">#{warehouseStatus},</if>
  1195. <if test="fTimes != null">#{fTimes},</if>
  1196. <if test="fDateChanged != null">#{fDateChanged},</if>
  1197. <if test="fChargetype != null">#{fChargetype},</if>
  1198. <if test="fWeighWeight != null">#{fWeighWeight},</if>
  1199. <if test="fPredictBranch != null">#{fPredictBranch},</if>
  1200. <if test="fGrade != null">#{fGrade},</if>
  1201. <if test="fDeliveryDetails != null">#{fDeliveryDetails},</if>
  1202. <if test="fSalesmanId != null">#{fSalesmanId},</if>
  1203. <if test="fItemstatus != null">#{fItemstatus},</if>
  1204. <if test="fUpdeteStatus != null">#{fUpdeteStatus},</if>
  1205. <if test="fSubmitUpdate != null">#{fSubmitUpdate},</if>
  1206. <if test="fDeleteStatus != null">#{fDeleteStatus},</if>
  1207. <if test="fRemarksFees != null">#{fRemarksFees},</if>
  1208. <if test="fCargoPlanning != null">#{fCargoPlanning},</if>
  1209. <if test="fFeeStatus != null">#{fFeeStatus},</if>
  1210. <if test="fArrivalStatus != null">#{fArrivalStatus},</if>
  1211. <if test="fDismountStatus != null">#{fDismountStatus},</if>
  1212. <if test="fServiceitemsNew != null">#{fServiceitemsNew},</if>
  1213. <if test="fReceivable != null">#{fReceivable},</if>
  1214. <if test="fRecycle != null">#{fRecycle},</if>
  1215. <if test="fDue != null">#{fDue},</if>
  1216. <if test="fPay != null">#{fPay},</if>
  1217. <if test="fCaregoStatus != null">#{fCaregoStatus},</if>
  1218. </trim>
  1219. </insert>
  1220. <update id="updateTWarehousebills" parameterType="TWarehousebills">
  1221. update t_warehousebills
  1222. <trim prefix="SET" suffixOverrides=",">
  1223. <if test="fBillno != null">f_billno = #{fBillno},</if>
  1224. <if test="fCustomsdeclartion != null">f_customsdeclartion = #{fCustomsdeclartion},</if>
  1225. <if test="fOriginalbillno != null">f_originalbillno = #{fOriginalbillno},</if>
  1226. <if test="fDeptid != null">f_deptid = #{fDeptid},</if>
  1227. <if test="fBsdeptid != null">f_bsdeptid = #{fBsdeptid},</if>
  1228. <if test="fContacts != null">f_contacts = #{fContacts},</if>
  1229. <if test="fTel != null">f_tel = #{fTel},</if>
  1230. <if test="fCorpid != null">f_corpid = #{fCorpid},</if>
  1231. <if test="fShipper != null">f_shipper = #{fShipper},</if>
  1232. <if test="fTocorpid != null">f_tocorpid = #{fTocorpid},</if>
  1233. <if test="fStltypeid != null">f_stltypeid = #{fStltypeid},</if>
  1234. <if test="fBscorpno != null">f_bscorpno = #{fBscorpno},</if>
  1235. <if test="fWarehouseid != null">f_warehouseid = #{fWarehouseid},</if>
  1236. <if test="fStorekeeper != null">f_storekeeper = #{fStorekeeper},</if>
  1237. <if test="fBsdate != null">f_bsdate = #{fBsdate},</if>
  1238. <if test="fChargedate != null">f_chargedate = #{fChargedate},</if>
  1239. <if test="fPlanqty != null">f_planqty = #{fPlanqty},</if>
  1240. <if test="fPlangrossweight != null">f_plangrossweight = #{fPlangrossweight},</if>
  1241. <if test="fPlannetweight != null">f_plannetweight = #{fPlannetweight},</if>
  1242. <if test="fPlanvolumn != null">f_planvolumn = #{fPlanvolumn},</if>
  1243. <if test="fQty != null">f_qty = #{fQty},</if>
  1244. <if test="fGrossweight != null">f_grossweight = #{fGrossweight},</if>
  1245. <if test="fNetweight != null">f_netweight = #{fNetweight},</if>
  1246. <if test="fVolumn != null">f_volumn = #{fVolumn},</if>
  1247. <if test="fTrademodeid != null">f_trademodeid = #{fTrademodeid},</if>
  1248. <if test="fBillingway != null">f_billingway = #{fBillingway},</if>
  1249. <if test="fSbu != null">f_sbu = #{fSbu},</if>
  1250. <if test="fFeetunit != null">f_feetunit = #{fFeetunit},</if>
  1251. <if test="fMblno != null">f_mblno = #{fMblno},</if>
  1252. <if test="fEmblno != null">f_emblno = #{fEmblno},</if>
  1253. f_company = #{fCompany},
  1254. <if test="fVslvoy != null">f_vslvoy = #{fVslvoy},</if>
  1255. <if test="fEta != null">f_eta = #{fEta},</if>
  1256. <if test="fMarks != null">f_marks = #{fMarks},</if>
  1257. <if test="fCustomno != null">f_customno = #{fCustomno},</if>
  1258. <if test="fIfweigh != null">f_ifweigh = #{fIfweigh},</if>
  1259. <if test="fIfpledge != null">f_ifpledge = #{fIfpledge},</if>
  1260. <if test="fIfdamage != null">f_ifdamage = #{fIfdamage},</if>
  1261. <if test="fBankcorpid != null">f_bankcorpid = #{fBankcorpid},</if>
  1262. <if test="fBilltype != null">f_billtype = #{fBilltype},</if>
  1263. <if test="fBillstatus != null">f_billstatus = #{fBillstatus},</if>
  1264. <if test="delFlag != null">del_flag = #{delFlag},</if>
  1265. <if test="createBy != null">create_by = #{createBy},</if>
  1266. <if test="createTime != null">create_time = #{createTime},</if>
  1267. <if test="fItemsStatus != null">f_items_status = #{fItemsStatus},</if>
  1268. <if test="updateBy != null">update_by = #{updateBy},</if>
  1269. <if test="updateTime != null">update_time = #{updateTime},</if>
  1270. <if test="remark != null">remark = #{remark},</if>
  1271. <if test="fBillingDeadline != null">f_billing_deadline = #{fBillingDeadline},</if>
  1272. <if test="fProductName != null">f_product_name = #{fProductName},</if>
  1273. <if test="fReviewDate != null">f_review_date = #{fReviewDate},</if>
  1274. <if test="fTruckno != null">f_truckno = #{fTruckno},</if>
  1275. <if test="fDriverName != null">f_driver_name = #{fDriverName},</if>
  1276. <if test="fDriverTel != null">f_driver_tel = #{fDriverTel},</if>
  1277. <if test="fDriverIdCar != null">f_driver_id_car = #{fDriverIdCar},</if>
  1278. <if test="fBusinessType != null">f_business_type = #{fBusinessType},</if>
  1279. f_labour = #{fLabour},
  1280. f_fleet = #{fFleet},
  1281. <if test="fInwarehouseid != null">f_inwarehouseid = #{fInwarehouseid},</if>
  1282. <if test="fBstime != null">f_bstime = #{fBstime},</if>
  1283. <if test="fCartype != null">f_cartype = #{fCartype},</if>
  1284. <if test="fGoodsid != null">f_goodsid = #{fGoodsid},</if>
  1285. <if test="fNewTrademodeid != null">f_new_trademodeid = #{fNewTrademodeid},</if>
  1286. <if test="fLoadportid != null">f_loadportid = #{fLoadportid},</if>
  1287. <if test="fDestportid != null">f_destportid = #{fDestportid},</if>
  1288. <if test="fServiceitems != null">f_serviceitems = #{fServiceitems},</if>
  1289. <if test="fInvoceobj != null">f_invoceobj = #{fInvoceobj},</if>
  1290. <if test="fSign != null">f_sign = #{fSign},</if>
  1291. <if test="fDetentioncargo != null">f_detentioncargo = #{fDetentioncargo},</if>
  1292. <if test="fBooksmarks != null">f_booksmarks = #{fBooksmarks},</if>
  1293. <if test="fShippername != null">f_shippername = #{fShippername},</if>
  1294. <if test="fShipperattn != null">f_shipperattn = #{fShipperattn},</if>
  1295. <if test="fShippertel != null">f_shippertel = #{fShippertel},</if>
  1296. <if test="fConsigneername != null">f_consigneername = #{fConsigneername},</if>
  1297. <if test="fConsigneeattn != null">f_consigneeattn = #{fConsigneeattn},</if>
  1298. <if test="fConsigneetel != null">f_consigneetel = #{fConsigneetel},</if>
  1299. <if test="fInsurance != null">f_insurance = #{fInsurance},</if>
  1300. <if test="fInsuranceamt != null">f_insuranceamt = #{fInsuranceamt},</if>
  1301. <if test="fClosedate != null">f_closedate = #{fClosedate},</if>
  1302. <if test="fDocmentdate != null">f_docmentdate = #{fDocmentdate},</if>
  1303. <if test="fVslid != null">f_vslid = #{fVslid},</if>
  1304. <if test="fVoyid != null">f_voyid = #{fVoyid},</if>
  1305. <if test="fTypeid != null">f_typeid = #{fTypeid},</if>
  1306. <if test="fPaymode != null">f_paymode = #{fPaymode},</if>
  1307. <if test="fLaneid != null">f_laneid = #{fLaneid},</if>
  1308. <if test="fCntval != null">f_cntval = #{fCntval},</if>
  1309. <if test="freeContainerDate != null">free_container_date = #{freeContainerDate},</if>
  1310. <if test="fBusinessAttribution != null">f_business_attribution = #{fBusinessAttribution},</if>
  1311. <if test="fSupervisionUnit != null">f_supervision_unit = #{fSupervisionUnit},</if>
  1312. <if test="fDeclarationElements != null">f_declaration_elements = #{fDeclarationElements},</if>
  1313. <if test="fPartNumber != null">f_part_number = #{fPartNumber},</if>
  1314. <if test="fIfinspection != null">f_ifinspection = #{fIfinspection},</if>
  1315. <if test="fValue != null">f_value = #{fValue},</if>
  1316. <if test="fWeighingDate != null">f_weighing_date = #{fWeighingDate},</if>
  1317. <if test="fIfsampling != null">f_ifsampling = #{fIfsampling},</if>
  1318. <if test="sendSampleDate != null">send_sample_date = #{sendSampleDate},</if>
  1319. <if test="fIfweightRecovery != null">f_ifweight_recovery = #{fIfweightRecovery},</if>
  1320. <if test="weightRecoveryDate != null">weight_recovery_date = #{weightRecoveryDate},</if>
  1321. <if test="warehouseStatus != null">warehouse_status = #{warehouseStatus},</if>
  1322. <if test="fTimes != null">f_times = #{fTimes},</if>
  1323. <if test="fDateChanged != null">f_date_changed = #{fDateChanged},</if>
  1324. <if test="fChargetype != null">f_chargetype = #{fChargetype},</if>
  1325. <if test="fWeighWeight != null">f_weigh_weight = #{fWeighWeight},</if>
  1326. <if test="fPredictBranch != null">f_predict_branch = #{fPredictBranch},</if>
  1327. <if test="fGrade != null">f_grade = #{fGrade},</if>
  1328. <if test="fDeliveryDetails != null">f_delivery_details = #{fDeliveryDetails},</if>
  1329. <if test="fSalesmanId != null">f_salesman_id = #{fSalesmanId},</if>
  1330. <if test="fItemstatus != null">f_itemstatus = #{fItemstatus},</if>
  1331. <if test="fUpdeteStatus != null">f_updete_status = #{fUpdeteStatus},</if>
  1332. <if test="fSubmitUpdate != null">f_submit_update = #{fSubmitUpdate},</if>
  1333. <if test="fDeleteStatus != null">f_delete_status = #{fDeleteStatus},</if>
  1334. <if test="fRemarksFees != null">f_remarks_fees = #{fRemarksFees},</if>
  1335. <if test="fCargoPlanning != null">f_cargo_planning = #{fCargoPlanning},</if>
  1336. <if test="fFeeStatus != null">f_fee_status = #{fFeeStatus},</if>
  1337. <if test="fArrivalStatus != null">f_arrival_status = #{fArrivalStatus},</if>
  1338. <if test="fDismountStatus != null">f_dismount_status = #{fDismountStatus},</if>
  1339. <if test="fServiceitemsNew != null">f_serviceitems_new = #{fServiceitemsNew},</if>
  1340. <if test="fReceivable != null">f_receivable = #{fReceivable},</if>
  1341. <if test="fRecycle != null">f_recycle = #{fRecycle},</if>
  1342. <if test="fDue != null">f_due = #{fDue},</if>
  1343. <if test="fPay != null">f_pay = #{fPay},</if>
  1344. <if test="fCaregoStatus != null">f_carego_status = #{fCaregoStatus},</if>
  1345. </trim>
  1346. where f_id = #{fId}
  1347. </update>
  1348. <update id="updateKaHeOrder" parameterType="TWarehousebills">
  1349. update t_warehousebills
  1350. <trim prefix="SET" suffixOverrides=",">
  1351. <if test="fBillno != null">f_billno = #{fBillno},</if>
  1352. <if test="fCustomsdeclartion != null">f_customsdeclartion = #{fCustomsdeclartion},</if>
  1353. <if test="fOriginalbillno != null">f_originalbillno = #{fOriginalbillno},</if>
  1354. <if test="fDeptid != null">f_deptid = #{fDeptid},</if>
  1355. <if test="fBsdeptid != null">f_bsdeptid = #{fBsdeptid},</if>
  1356. <if test="fContacts != null">f_contacts = #{fContacts},</if>
  1357. <if test="fTel != null">f_tel = #{fTel},</if>
  1358. <if test="fCorpid != null">f_corpid = #{fCorpid},</if>
  1359. <if test="fShipper != null">f_shipper = #{fShipper},</if>
  1360. <if test="fTocorpid != null">f_tocorpid = #{fTocorpid},</if>
  1361. <if test="fStltypeid != null">f_stltypeid = #{fStltypeid},</if>
  1362. <if test="fBscorpno != null and fBscorpno != ''">f_bscorpno = #{fBscorpno},</if>
  1363. <if test="fWarehouseid != null">f_warehouseid = #{fWarehouseid},</if>
  1364. <if test="fStorekeeper != null">f_storekeeper = #{fStorekeeper},</if>
  1365. <if test="fChargedate != null">f_chargedate = #{fChargedate},</if>
  1366. <if test="fBsdate != null">f_bsdate = #{fBsdate},</if>
  1367. <if test="fPlanqty != null">f_planqty = #{fPlanqty},</if>
  1368. <if test="fPlangrossweight != null">f_plangrossweight = #{fPlangrossweight},</if>
  1369. <if test="fPlannetweight != null">f_plannetweight = #{fPlannetweight},</if>
  1370. <if test="fPlanvolumn != null">f_planvolumn = #{fPlanvolumn},</if>
  1371. <if test="fQty != null">f_qty = #{fQty},</if>
  1372. <if test="fGrossweight != null">f_grossweight = #{fGrossweight},</if>
  1373. <if test="fNetweight != null">f_netweight = #{fNetweight},</if>
  1374. <if test="fVolumn != null">f_volumn = #{fVolumn},</if>
  1375. <if test="fTrademodeid != null">f_trademodeid = #{fTrademodeid},</if>
  1376. <if test="fBillingway != null">f_billingway = #{fBillingway},</if>
  1377. <if test="fSbu != null">f_sbu = #{fSbu},</if>
  1378. <if test="fFeetunit != null">f_feetunit = #{fFeetunit},</if>
  1379. <if test="fMblno != null">f_mblno = #{fMblno},</if>
  1380. <if test="fEmblno != null">f_emblno = #{fEmblno},</if>
  1381. <if test="fCompany != null">f_company = #{fCompany},</if>
  1382. <if test="fVslvoy != null">f_vslvoy = #{fVslvoy},</if>
  1383. <if test="fMarks != null and fMarks != ''">f_marks = #{fMarks},</if>
  1384. <if test="fEta != null">f_eta = #{fEta},</if>
  1385. <if test="fCustomno != null">f_customno = #{fCustomno},</if>
  1386. <if test="fIfweigh != null">f_ifweigh = #{fIfweigh},</if>
  1387. <if test="fIfpledge != null">f_ifpledge = #{fIfpledge},</if>
  1388. <if test="fIfdamage != null">f_ifdamage = #{fIfdamage},</if>
  1389. <if test="fBankcorpid != null">f_bankcorpid = #{fBankcorpid},</if>
  1390. <if test="fBilltype != null">f_billtype = #{fBilltype},</if>
  1391. <if test="fBillstatus != null">f_billstatus = #{fBillstatus},</if>
  1392. <if test="delFlag != null">del_flag = #{delFlag},</if>
  1393. <if test="createBy != null">create_by = #{createBy},</if>
  1394. <if test="createTime != null">create_time = #{createTime},</if>
  1395. <if test="fItemsStatus != null">f_items_status = #{fItemsStatus},</if>
  1396. <if test="updateBy != null">update_by = #{updateBy},</if>
  1397. <if test="updateTime != null">update_time = #{updateTime},</if>
  1398. <if test="remark != null">remark = #{remark},</if>
  1399. <if test="fBillingDeadline != null">f_billing_deadline = #{fBillingDeadline},</if>
  1400. <if test="fProductName != null">f_product_name = #{fProductName},</if>
  1401. <if test="fReviewDate != null and fBillstatus == 11" >f_review_date = #{fReviewDate},</if>
  1402. <if test="fReviewDate != null and fBillstatus != 11">f_review_date = null,</if>
  1403. <if test="fTruckno != null">f_truckno = #{fTruckno},</if>
  1404. <if test="fDriverName != null">f_driver_name = #{fDriverName},</if>
  1405. <if test="fDriverTel != null">f_driver_tel = #{fDriverTel},</if>
  1406. <if test="fDriverIdCar != null">f_driver_id_car = #{fDriverIdCar},</if>
  1407. <if test="fBusinessType != null">f_business_type = #{fBusinessType},</if>
  1408. <if test="fReviewDate == null">f_review_date = null,</if>
  1409. <if test="fLabour != null">f_labour = #{fLabour },</if>
  1410. <if test="fFleet != null">f_fleet = #{fFleet},</if>
  1411. <if test="fInwarehouseid != null">f_inwarehouseid = #{fInwarehouseid},</if>
  1412. <if test="fBstime != null">f_bstime = #{fBstime},</if>
  1413. <if test="fCartype != null">f_cartype = #{fCartype},</if>
  1414. <if test="fGoodsid != null">f_goodsid = #{fGoodsid},</if>
  1415. <if test="fNewTrademodeid != null">f_new_trademodeid = #{fNewTrademodeid},</if>
  1416. <if test="fLoadportid != null">f_loadportid = #{fLoadportid},</if>
  1417. <if test="fDestportid != null">f_destportid = #{fDestportid},</if>
  1418. <if test="fServiceitems != null">f_serviceitems = #{fServiceitems},</if>
  1419. <if test="fInvoceobj != null">f_invoceobj = #{fInvoceobj},</if>
  1420. <if test="fSign != null">f_sign = #{fSign},</if>
  1421. <if test="fDetentioncargo != null">f_detentioncargo = #{fDetentioncargo},</if>
  1422. <if test="fBooksmarks != null">f_booksmarks = #{fBooksmarks},</if>
  1423. <if test="fShippername != null">f_shippername = #{fShippername},</if>
  1424. <if test="fShipperattn != null">f_shipperattn = #{fShipperattn},</if>
  1425. <if test="fShippertel != null">f_shippertel = #{fShippertel},</if>
  1426. <if test="fConsigneername != null">f_consigneername = #{fConsigneername},</if>
  1427. <if test="fConsigneeattn != null">f_consigneeattn = #{fConsigneeattn},</if>
  1428. <if test="fConsigneetel != null">f_consigneetel = #{fConsigneetel},</if>
  1429. <if test="fInsurance != null">f_insurance = #{fInsurance},</if>
  1430. <if test="fInsuranceamt != null">f_insuranceamt = #{fInsuranceamt},</if>
  1431. <if test="fClosedate != null">f_closedate = #{fClosedate},</if>
  1432. <if test="fDocmentdate != null">f_docmentdate = #{fDocmentdate},</if>
  1433. <if test="fVslid != null">f_vslid = #{fVslid},</if>
  1434. <if test="fVoyid != null">f_voyid = #{fVoyid},</if>
  1435. <if test="fPaymode != null">f_paymode = #{fPaymode},</if>
  1436. <if test="fLaneid != null">f_laneid = #{fLaneid},</if>
  1437. <if test="fTypeid != null">f_typeid = #{fTypeid},</if>
  1438. <if test="freeContainerDate != null">free_container_date = #{freeContainerDate},</if>
  1439. <if test="fBusinessAttribution != null">f_business_attribution = #{fBusinessAttribution},</if>
  1440. <if test="fSupervisionUnit != null">f_supervision_unit = #{fSupervisionUnit},</if>
  1441. <if test="fDeclarationElements != null">f_declaration_elements = #{fDeclarationElements},</if>
  1442. <if test="fPartNumber != null">f_part_number = #{fPartNumber},</if>
  1443. <if test="fIfinspection != null">f_ifinspection = #{fIfinspection},</if>
  1444. <if test="fValue != null">f_value = #{fValue},</if>
  1445. <if test="fWeighingDate != null">f_weighing_date = #{fWeighingDate},</if>
  1446. <if test="fIfsampling != null">f_ifsampling = #{fIfsampling},</if>
  1447. <if test="sendSampleDate != null">send_sample_date = #{sendSampleDate},</if>
  1448. <if test="fIfweightRecovery != null">f_ifweight_recovery = #{fIfweightRecovery},</if>
  1449. <if test="weightRecoveryDate != null">weight_recovery_date = #{weightRecoveryDate},</if>
  1450. <if test="warehouseStatus != null">warehouse_status = #{warehouseStatus},</if>
  1451. <if test="fTimes != null">f_times = #{fTimes},</if>
  1452. <if test="fDateChanged != null">f_date_changed = #{fDateChanged},</if>
  1453. <if test="fChargetype != null">f_chargetype = #{fChargetype},</if>
  1454. <if test="fWeighWeight != null">f_weigh_weight = #{fWeighWeight},</if>
  1455. <if test="fPredictBranch != null">f_predict_branch = #{fPredictBranch},</if>
  1456. <if test="fGrade != null">f_grade = #{fGrade},</if>
  1457. <if test="fDeliveryDetails != null">f_delivery_details = #{fDeliveryDetails},</if>
  1458. <if test="fSalesmanId != null">f_salesman_id = #{fSalesmanId},</if>
  1459. <if test="fItemstatus != null">f_itemstatus = #{fItemstatus},</if>
  1460. <if test="fUpdeteStatus != null">f_updete_status = #{fUpdeteStatus},</if>
  1461. <if test="fSubmitUpdate != null">f_submit_update = #{fSubmitUpdate},</if>
  1462. <if test="fDeleteStatus != null">f_delete_status = #{fDeleteStatus},</if>
  1463. <if test="fRemarksFees != null">f_remarks_fees = #{fRemarksFees},</if>
  1464. <if test="fCargoPlanning != null">f_cargo_planning = #{fCargoPlanning},</if>
  1465. <if test="fFeeStatus != null">f_fee_status = #{fFeeStatus},</if>
  1466. <if test="fArrivalStatus != null">f_arrival_status = #{fArrivalStatus},</if>
  1467. <if test="fDismountStatus != null">f_dismount_status = #{fDismountStatus},</if>
  1468. <if test="fServiceitemsNew != null">f_serviceitems_new = #{fServiceitemsNew},</if>
  1469. <if test="fReceivable != null">f_receivable = #{fReceivable},</if>
  1470. <if test="fRecycle != null">f_recycle = #{fRecycle},</if>
  1471. <if test="fDue != null">f_due = #{fDue},</if>
  1472. <if test="fPay != null">f_pay = #{fPay},</if>
  1473. <if test="fCaregoStatus != null">f_carego_status = #{fCaregoStatus},</if>
  1474. </trim>
  1475. where f_id = #{fId}
  1476. </update>
  1477. <delete id="deleteTWarehousebillsById" parameterType="Long">
  1478. delete
  1479. from t_warehousebills
  1480. where f_id = #{fId}
  1481. </delete>
  1482. <delete id="deleteTWarehousebillsByIds" parameterType="String">
  1483. delete
  1484. item.*,
  1485. bill.*,
  1486. fess.*,
  1487. enclosure.*
  1488. from
  1489. t_warehousebills bill
  1490. LEFT JOIN t_warehousebillsfees fess ON fess.f_pid = bill.f_id
  1491. LEFT JOIN t_enclosure enclosure ON enclosure.f_pid = bill.f_id
  1492. LEFT JOIN t_warehousebillsitems item ON item.f_pid = bill.f_id
  1493. where
  1494. bill.f_id in
  1495. <foreach item="fId" collection="array" open="(" separator="," close=")">
  1496. #{fId}
  1497. </foreach>
  1498. </delete>
  1499. <delete id="deleteKHTWarehousebillsByIds" parameterType="String">
  1500. delete
  1501. bill.*,
  1502. fess.*,
  1503. enclosure.*
  1504. from
  1505. t_warehousebills bill
  1506. LEFT JOIN t_warehousebills_cntr fess ON fess.f_pid = bill.f_id
  1507. LEFT JOIN t_warehousebills_cntritems enclosure ON enclosure.f_pid = bill.f_id
  1508. where
  1509. bill.f_id in
  1510. <foreach item="fId" collection="array" open="(" separator="," close=")">
  1511. #{fId}
  1512. </foreach>
  1513. </delete>
  1514. <update id="warehouseFollowUpdate">
  1515. update
  1516. t_warehousebills
  1517. <trim prefix="SET" suffixOverrides=",">
  1518. <if test="fettle != null">f_billstatus = #{fettle},</if>
  1519. <if test="auditItem != null and fettle == 6">f_review_date = #{auditItem},</if>
  1520. <if test="auditItem != null and fettle != 6">f_review_date = null,</if>
  1521. </trim>
  1522. where f_id = #{fPid}
  1523. </update>
  1524. <update id="warehouseApprovalUpdate">
  1525. update
  1526. t_warehousebills
  1527. SET ${auditItem.fidStatus} = #{fettle}
  1528. where f_id = #{auditItem.billId}
  1529. </update>
  1530. <select id="selectDetailedList" resultType="java.util.Map">
  1531. SELECT
  1532. t.f_id AS fId,
  1533. item.f_id AS fItemsId,
  1534. C.f_name AS fcorpid,
  1535. t.f_shipper AS fShipper,
  1536. t.f_mblno AS fMblno,
  1537. g.f_name AS fGoodsid,
  1538. dict.dict_label AS fBusinessType,
  1539. t.f_marks AS fMarks,
  1540. CASE
  1541. WHEN t.f_billtype = 'SJRK' THEN
  1542. '入库'
  1543. WHEN t.f_billtype = 'SJCK' THEN
  1544. '出库'
  1545. WHEN t.f_billtype = 'CKDB' THEN
  1546. '调拨'
  1547. WHEN t.f_billtype = 'HQZY' THEN
  1548. '货权转移'
  1549. WHEN t.f_billtype = 'HWTG' THEN
  1550. '货物通关'
  1551. END AS fBilltype,
  1552. item.f_bsdate AS fBsdate,
  1553. item.f_warehouse_information AS fWarehouseInformation,
  1554. dictTra.dict_label AS fTrademodeid,
  1555. CASE
  1556. WHEN t.f_billtype = 'SJRK' THEN
  1557. ( SELECT SUM( it.f_qty ) FROM t_warehousebillsitems it WHERE it.f_pid = item.f_pid ) ELSE 0
  1558. END AS fQtyRK,
  1559. CASE
  1560. WHEN t.f_billtype = 'SJRK' THEN
  1561. ( SELECT SUM( it.f_grossweight ) FROM t_warehousebillsitems it WHERE it.f_pid = item.f_pid ) ELSE 0
  1562. END AS fGrossweightRK,
  1563. CASE
  1564. WHEN t.f_billtype = 'SJRK' THEN
  1565. ( SELECT SUM( it.f_netweight ) FROM t_warehousebillsitems it WHERE it.f_pid = item.f_pid ) ELSE 0
  1566. END AS fNetweightRK,
  1567. CASE
  1568. WHEN t.f_billtype = 'SJCK' THEN
  1569. ( SELECT SUM( it.f_qty ) FROM t_warehousebillsitems it WHERE it.f_pid = item.f_pid ) ELSE 0
  1570. END AS fQtyCK,
  1571. CASE
  1572. WHEN t.f_billtype = 'SJCK' THEN
  1573. ( SELECT SUM( it.f_grossweight ) FROM t_warehousebillsitems it WHERE it.f_pid = item.f_pid ) ELSE 0
  1574. END AS fGrossweightCK,
  1575. CASE
  1576. WHEN t.f_billtype = 'SJCK' THEN
  1577. ( SELECT SUM( it.f_netweight ) FROM t_warehousebillsitems it WHERE it.f_pid = item.f_pid ) ELSE 0
  1578. END AS fNetweightCK,
  1579. CASE
  1580. WHEN t.f_billtype = 'CKDB' THEN
  1581. ( SELECT SUM( it.f_qty ) FROM t_warehousebillsitems it WHERE it.f_pid = item.f_pid ) ELSE 0
  1582. END AS fQtyDB,
  1583. CASE
  1584. WHEN t.f_billtype = 'CKDB' THEN
  1585. ( SELECT SUM( it.f_grossweight ) FROM t_warehousebillsitems it WHERE it.f_pid = item.f_pid ) ELSE 0
  1586. END AS fGrossweightDB,
  1587. CASE
  1588. WHEN t.f_billtype = 'CKDB' THEN
  1589. ( SELECT SUM( it.f_netweight ) FROM t_warehousebillsitems it WHERE it.f_pid = item.f_pid ) ELSE 0
  1590. END AS fNetweightDB,
  1591. CASE
  1592. WHEN t.f_billtype = 'HQZY' THEN
  1593. ( SELECT SUM( it.f_qty ) FROM t_warehousebillsitems it WHERE it.f_pid = item.f_pid ) ELSE 0
  1594. END AS fQtyHZ,
  1595. CASE
  1596. WHEN t.f_billtype = 'HQZY' THEN
  1597. ( SELECT SUM( it.f_grossweight ) FROM t_warehousebillsitems it WHERE it.f_pid = item.f_pid ) ELSE 0
  1598. END AS fGrossweightHZ,
  1599. CASE
  1600. WHEN t.f_billtype = 'HQZY' THEN
  1601. ( SELECT SUM( it.f_netweight ) FROM t_warehousebillsitems it WHERE it.f_pid = item.f_pid ) ELSE 0
  1602. END AS fNetweightHZ,
  1603. CASE
  1604. WHEN t.f_billtype = 'HWTG' THEN
  1605. ( SELECT SUM( it.f_qty ) FROM t_warehousebillsitems it WHERE it.f_pid = item.f_pid ) ELSE 0
  1606. END AS fQtyTG,
  1607. CASE
  1608. WHEN t.f_billtype = 'HWTG' THEN
  1609. ( SELECT SUM( it.f_grossweight ) FROM t_warehousebillsitems it WHERE it.f_pid = item.f_pid ) ELSE 0
  1610. END AS fGrossweightTG,
  1611. CASE
  1612. WHEN t.f_billtype = 'HWTG' THEN
  1613. ( SELECT SUM( it.f_netweight ) FROM t_warehousebillsitems it WHERE it.f_pid = item.f_pid ) ELSE 0
  1614. END AS fNetweightTG
  1615. FROM t_warehousebills t
  1616. LEFT JOIN t_warehousebillsitems item ON item.f_pid = t.f_id
  1617. LEFT JOIN t_goods g ON item.f_goodsid = g.f_id
  1618. LEFT JOIN t_corps C ON t.f_corpid = C.f_id
  1619. LEFT JOIN sys_dict_data dict ON dict.dict_value = item.f_business_type
  1620. LEFT JOIN sys_dict_data dictTra ON dictTra.dict_value = t.f_trademodeid
  1621. WHERE dict.STATUS = '0'
  1622. AND t.f_typeid IS NULL
  1623. AND dict.dict_type = 'storage_type'
  1624. AND dictTra.STATUS = '0'
  1625. AND dictTra.dict_type = 'data_trademodes'
  1626. AND item.f_billstatus = 40
  1627. AND item.f_mblno = #{fMblno}
  1628. AND (item.f_warehouselocid = #{fWarehouseLocationid} or
  1629. item.f_transfer_warehouselocid = #{fWarehouseLocationid})
  1630. AND t.f_trademodeid = #{fTrademodeids}
  1631. AND item.f_business_type = #{fBusinessType}
  1632. AND item.f_goodsid = #{fGoodsid}
  1633. AND item.f_marks = #{fMarks}
  1634. AND t.f_corpid = #{fCorpIds}
  1635. GROUP BY t.f_id
  1636. </select>
  1637. <select id="webVersionOrderList" parameterType="TWarehousebills" resultMap="TWarehousebillsResult">
  1638. SELECT
  1639. tw.f_id,
  1640. tw.f_billno,
  1641. tw.f_customsdeclartion,
  1642. tw.f_originalbillno,
  1643. tw.f_deptid,
  1644. tw.f_bsdeptid,
  1645. tw.f_contacts,
  1646. tw.f_tel,
  1647. tw.f_corpid,
  1648. tw.f_shipper,
  1649. tc.f_name corpName,
  1650. tw.f_tocorpid,
  1651. tw.f_stltypeid,
  1652. tw.f_bscorpno,
  1653. tw.f_warehouseid,
  1654. tw.f_storekeeper,
  1655. tw.f_chargedate,
  1656. tw.f_bsdate,
  1657. tw.f_planqty,
  1658. tw.f_plangrossweight,
  1659. tw.f_plannetweight,
  1660. tw.f_planvolumn,
  1661. tw.f_qty,
  1662. tw.f_grossweight,
  1663. tw.f_netweight,
  1664. tw.f_volumn,
  1665. tw.f_billingway,
  1666. tw.f_trademodeid,
  1667. tw.f_sbu,
  1668. tw.f_feetunit,
  1669. tw.f_mblno,
  1670. tw.f_marks,
  1671. tw.f_vslvoy,
  1672. tw.f_eta,
  1673. tw.f_customno,
  1674. tw.f_ifweigh,
  1675. tw.f_ifpledge,
  1676. tw.f_ifdamage,
  1677. tw.f_bankcorpid,
  1678. tw.f_billtype,
  1679. tw.f_billstatus,
  1680. tw.f_items_status,
  1681. tw.del_flag,
  1682. tw.create_by,
  1683. tw.create_time,
  1684. tw.update_by,
  1685. tw.update_time,
  1686. tw.remark,
  1687. tw.f_billing_deadline,
  1688. tw.f_product_name,
  1689. tw.f_review_date,
  1690. tw.f_truckno,
  1691. tw.f_driver_name,
  1692. tw.f_driver_tel,
  1693. tw.f_driver_id_car,
  1694. tw.f_business_type,
  1695. tw.f_labour,
  1696. tw.f_fleet,
  1697. tw.f_inwarehouseid,
  1698. tw.f_bstime,
  1699. tw.f_cartype,
  1700. tw.f_goodsid,
  1701. tw.f_new_trademodeid,
  1702. tw.f_loadportid,
  1703. address.f_name loadportidName,
  1704. tw.f_destportid,
  1705. ta.f_name destportidName,
  1706. tw.f_serviceitems,
  1707. sd.dict_label serviceitemsName,
  1708. tw.f_invoceobj,
  1709. sdi.dict_label invoceobjName,
  1710. tw.f_sign,
  1711. sdc.dict_label signName,
  1712. tw.f_detentioncargo,
  1713. sdt.dict_label detentioncargoName,
  1714. tw.f_booksmarks,
  1715. tw.f_shippername,
  1716. tw.f_shipperattn,
  1717. tw.f_shippertel,
  1718. tw.f_consigneername,
  1719. tw.f_consigneeattn,
  1720. tw.f_consigneetel,
  1721. tw.f_insurance,
  1722. sdd.dict_label insuranceName,
  1723. tw.f_insuranceamt,
  1724. tw.f_closedate,
  1725. tw.f_docmentdate,
  1726. tw.f_vslid,
  1727. tv.f_name vslidName,
  1728. tw.f_voyid,
  1729. ty.f_no voyidName,
  1730. tw.f_typeid,
  1731. tw.f_paymode,
  1732. sda.dict_label paymodeName,
  1733. tw.f_laneid,
  1734. tr.f_name laneidName,
  1735. tw.f_updete_status,
  1736. tw.f_submit_update,
  1737. tw.f_delete_status,
  1738. tw.f_cargo_planning,
  1739. tw.f_arrival_status,
  1740. tw.f_dismount_status,
  1741. tw.f_serviceitems_new
  1742. FROM t_warehousebills tw
  1743. LEFT JOIN t_address address ON address.f_id = tw.f_loadportid
  1744. LEFT JOIN t_address ta ON ta.f_id = tw.f_loadportid
  1745. LEFT JOIN t_address tr ON tr.f_id = tw.f_laneid
  1746. LEFT JOIN t_corps tc ON tc.f_id = tw.f_corpid
  1747. LEFT JOIN sys_dict_data sd ON sd.dict_value = tw.f_serviceitems
  1748. AND sd.dict_type = 'f_serviceitems'
  1749. LEFT JOIN sys_dict_data sdi ON sdi.dict_value = tw.f_invoceobj
  1750. AND sdi.dict_type = 'f_invoceobj'
  1751. LEFT JOIN sys_dict_data sdc ON sdc.dict_value = tw.f_sign
  1752. AND sdc.dict_type = 'f_sign'
  1753. LEFT JOIN sys_dict_data sdt ON sdt.dict_value = tw.f_detentioncargo
  1754. AND sdt.dict_type = 'f_detentioncargo'
  1755. LEFT JOIN sys_dict_data sdd ON sdd.dict_value = tw.f_insurance
  1756. AND sdd.dict_type = 'f_insurance'
  1757. LEFT JOIN sys_dict_data sda ON sda.dict_value = tw.f_paymode
  1758. AND sda.dict_type = 'f_paymode'
  1759. LEFT JOIN t_vessel tv ON tv.f_id = tw.f_vslid
  1760. LEFT JOIN t_voyage ty ON ty.f_id = tw.f_voyid
  1761. <where>
  1762. tw.f_typeid = '1'
  1763. and tw.del_flag = '0'
  1764. <if test="fId != null">and tw.f_id = #{fId}</if>
  1765. <if test="fBillno != null and fBillno != ''">and tw.f_billno = #{fBillno}</if>
  1766. <if test="fCustomsdeclartion != null and fCustomsdeclartion != ''">and tw.f_customsdeclartion =#{fCustomsdeclartion}</if>
  1767. <if test="fOriginalbillno != null and fOriginalbillno != ''">and tw.f_originalbillno = #{fOriginalbillno}</if>
  1768. <if test="fDeptid != null ">and tw.f_deptid = #{fDeptid}</if>
  1769. <if test="fBsdeptid != null ">and tw.f_bsdeptid = #{fBsdeptid}</if>
  1770. <if test="fContacts != null and fContacts != ''">and tw.f_contacts = #{fContacts}</if>
  1771. <if test="fTel != null and fTel != ''">and tw.f_tel = #{fTel}</if>
  1772. <if test="fCorpid != null ">and tw.f_corpid = #{fCorpid}</if>
  1773. <if test="fShipper != null and fShipper != ''">and tw.f_shipper like concat('%', #{fShipper}, '%')</if>
  1774. <if test="fTocorpid != null ">and tw.f_tocorpid = #{fTocorpid}</if>
  1775. <if test="fStltypeid != null ">and tw.f_stltypeid = #{fStltypeid}</if>
  1776. <if test="fBscorpno != null and fBscorpno != ''">and tw.f_bscorpno = #{fBscorpno}</if>
  1777. <if test="fWarehouseid != null ">and tw.f_warehouseid = #{fWarehouseid}</if>
  1778. <if test="fStorekeeper != null and fStorekeeper != ''">and tw.f_storekeeper = #{fStorekeeper}</if>
  1779. <if test="fChargedate != null ">and tw.f_chargedate = #{fChargedate}</if>
  1780. <if test="fBsdate != null ">and tw.f_bsdate = #{fBsdate}</if>
  1781. <if test="fPlanqty != null ">and tw.f_planqty = #{fPlanqty}</if>
  1782. <if test="fPlangrossweight != null ">and tw.f_plangrossweight = #{fPlangrossweight}</if>
  1783. <if test="fPlannetweight != null ">and tw.f_plannetweight = #{fPlannetweight}</if>
  1784. <if test="fPlanvolumn != null ">and tw.f_planvolumn = #{fPlanvolumn}</if>
  1785. <if test="fQty != null ">and tw.f_qty = #{fQty}</if>
  1786. <if test="fGrossweight != null ">and tw.f_grossweight = #{fGrossweight}</if>
  1787. <if test="fNetweight != null ">and tw.f_netweight = #{fNetweight}</if>
  1788. <if test="fVolumn != null ">and tw.f_volumn = #{fVolumn}</if>
  1789. <if test="fBillingway != null ">and tw.f_billingway = #{fBillingway}</if>
  1790. <if test="fTrademodeid != null ">and tw.f_trademodeid = #{fTrademodeid}</if>
  1791. <if test="fSbu != null ">and tw.f_sbu = #{fSbu}</if>
  1792. <if test="fFeetunit != null and fFeetunit != ''">and tw.f_feetunit = #{fFeetunit}</if>
  1793. <if test="fMblno != null and fMblno != ''">and tw.f_mblno = #{fMblno}</if>
  1794. <if test="fMarks != null and fMarks != ''">and tw.f_marks = #{fMarks}</if>
  1795. <if test="fVslvoy != null and fVslvoy != ''">and tw.f_vslvoy = #{fVslvoy}</if>
  1796. <if test="fEta != null ">and tw.f_eta = #{fEta}</if>
  1797. <if test="fCustomno != null and fCustomno != ''">and tw.f_customno = #{fCustomno}</if>
  1798. <if test="fIfweigh != null and fIfweigh != ''">and tw.f_ifweigh = #{fIfweigh}</if>
  1799. <if test="fIfpledge != null and fIfpledge != ''">and tw.f_ifpledge = #{fIfpledge}</if>
  1800. <if test="fIfdamage != null and fIfdamage != ''">and tw.f_ifdamage = #{fIfdamage}</if>
  1801. <if test="fBankcorpid != null and fBankcorpid != ''">and tw.f_bankcorpid = #{fBankcorpid}</if>
  1802. <if test="fBilltype != null and fBilltype != ''">and tw.f_billtype = #{fBilltype}</if>
  1803. <if test="fBillstatus != null ">and tw.f_billstatus = #{fBillstatus}</if>
  1804. <if test="fItemsStatus != null ">and tw.f_items_status = #{fItemsStatus}</if>
  1805. <if test="fBillingDeadline != null ">and tw.f_billing_deadline = #{fBillingDeadline}</if>
  1806. <if test="fProductName != null and fProductName != ''">and tw.f_product_name like concat('%',
  1807. #{fProductName}, '%')
  1808. </if>
  1809. <if test="fReviewDate != null ">and tw.f_review_date = #{fReviewDate}</if>
  1810. <if test="fTruckno != null and fTruckno != ''">and tw.f_truckno = #{fTruckno}</if>
  1811. <if test="fDriverName != null and fDriverName != ''">and tw.f_driver_name like concat('%', #{fDriverName},
  1812. '%')
  1813. </if>
  1814. <if test="fDriverTel != null and fDriverTel != ''">and tw.f_driver_tel = #{fDriverTel}</if>
  1815. <if test="fDriverIdCar != null and fDriverIdCar != ''">and tw.f_driver_id_car = #{fDriverIdCar}</if>
  1816. <if test="fBusinessType != null and fBusinessType != ''">and tw.f_business_type = #{fBusinessType}</if>
  1817. <if test="fLabour != null ">and tw.f_labour = #{fLabour}</if>
  1818. <if test="fFleet != null ">and tw.f_fleet = #{fFleet}</if>
  1819. <if test="fInwarehouseid != null ">and tw.f_inwarehouseid = #{fInwarehouseid}</if>
  1820. <if test="fBstime != null ">and tw.f_bstime = #{fBstime}</if>
  1821. <if test="fCartype != null ">and tw.f_cartype = #{fCartype}</if>
  1822. <if test="fGoodsid != null ">and tw.f_goodsid = #{fGoodsid}</if>
  1823. <if test="fNewTrademodeid != null ">and tw.f_new_trademodeid = #{fNewTrademodeid}</if>
  1824. <if test="fLoadportid != null ">and tw.f_loadportid = #{fLoadportid}</if>
  1825. <if test="fDestportid != null ">and tw.f_destportid = #{fDestportid}</if>
  1826. <if test="fServiceitems != null and fServiceitems != ''">and tw.f_serviceitems = #{fServiceitems}</if>
  1827. <if test="fInvoceobj != null and fInvoceobj != ''">and tw.f_invoceobj = #{fInvoceobj}</if>
  1828. <if test="fSign != null ">and tw.f_sign = #{fSign}</if>
  1829. <if test="fDetentioncargo != null ">and tw.f_detentioncargo = #{fDetentioncargo}</if>
  1830. <if test="fBooksmarks != null and fBooksmarks != ''">and tw.f_booksmarks = #{fBooksmarks}</if>
  1831. <if test="fShippername != null and fShippername != ''">and tw.f_shippername like concat('%',
  1832. #{fShippername}, '%')
  1833. </if>
  1834. <if test="fShipperattn != null and fShipperattn != ''">and tw.f_shipperattn = #{fShipperattn}</if>
  1835. <if test="fShippertel != null and fShippertel != ''">and tw.f_shippertel = #{fShippertel}</if>
  1836. <if test="fConsigneername != null and fConsigneername != ''">and tw.f_consigneername like concat('%',
  1837. #{fConsigneername}, '%')
  1838. </if>
  1839. <if test="fConsigneeattn != null and fConsigneeattn != ''">and tw.f_consigneeattn = #{fConsigneeattn}</if>
  1840. <if test="fConsigneetel != null and fConsigneetel != ''">and tw.f_consigneetel = #{fConsigneetel}</if>
  1841. <if test="fInsurance != null and fInsurance != ''">and tw.f_insurance = #{fInsurance}</if>
  1842. <if test="fInsuranceamt != null ">and tw.f_insuranceamt = #{fInsuranceamt}</if>
  1843. <if test="fClosedate != null ">and tw.f_closedate = #{fClosedate}</if>
  1844. <if test="fDocmentdate != null ">and tw.f_docmentdate = #{fDocmentdate}</if>
  1845. <if test="fVslid != null ">and tw.f_vslid = #{fVslid}</if>
  1846. <if test="fVoyid != null ">and tw.f_voyid = #{fVoyid}</if>
  1847. <if test="fTypeid != null ">and tw.f_typeid = #{fTypeid}</if>
  1848. <if test="fPaymode != null">and tw.f_paymode = #{fPaymode},</if>
  1849. <if test="fLaneid != null">and tw.f_laneid = #{fLaneid},</if>
  1850. <if test='timeInterval != null and timeInterval[0] != null and timeInterval[0]!= ""'>
  1851. and tw.create_time &gt;= #{timeInterval[0]}
  1852. </if>
  1853. <if test='timeInterval != null and timeInterval[1] != null and timeInterval[1]!= ""'>
  1854. and tw.create_time &lt;= #{timeInterval[1]}
  1855. </if>
  1856. <if test="fCargoPlanning != null "> and tw.f_cargo_planning = #{fCargoPlanning}</if>
  1857. <if test="fArrivalStatus != null "> and tw.f_arrival_status = #{fArrivalStatus}</if>
  1858. <if test="billList != null "> and tw.f_mblno in
  1859. <foreach item="fMblno" collection="billList" open="(" separator="," close=")">
  1860. #{fMblno}
  1861. </foreach>
  1862. </if>
  1863. </where>
  1864. ORDER BY tw.create_time DESC, tw.f_id DESC
  1865. </select>
  1866. <select id="ruoYiVersionOrderList" parameterType="TWarehousebills" resultType="map">
  1867. SELECT
  1868. DISTINCT
  1869. tw.f_id fId,
  1870. tw.f_billno fBillno,
  1871. tw.f_originalbillno fOriginalbillno,
  1872. tw.f_shipper fShipper,
  1873. tw.f_mblno fMblno,
  1874. sd.dict_label fServiceitems,
  1875. tk.dict_label fDestportMode,
  1876. tw.f_consigneername fConsigneername,
  1877. ta.f_name fName,
  1878. tw.f_bsdate fBsdate,
  1879. ty.f_ATD fAtd,
  1880. ty.f_ATA fAta,
  1881. tc.f_cntrcount fCntrcount,
  1882. tc.f_no fNo,
  1883. tv.f_name vslName,
  1884. ty.f_no voyNo,
  1885. tw.f_corpid fCorpid,
  1886. tp.f_name corpName,
  1887. tw.create_by createBy,
  1888. tw.create_time createTime,
  1889. tw.f_loadportid fLoadportid,
  1890. tre.f_name loadportName,
  1891. tw.f_destportid fDestportid,
  1892. ts.f_name destportName,
  1893. tc.f_name goodsName,
  1894. CASE
  1895. WHEN tw.f_billstatus = '1' and tw.f_updete_status = '2'and tw.f_submit_update = '2' and tw.f_delete_status = '2' and tw.f_dismount_status = '2' THEN
  1896. '下单新建'
  1897. WHEN tw.f_billstatus = '2' and tw.f_updete_status = '2'and tw.f_submit_update = '2' and tw.f_delete_status = '2' and tw.f_dismount_status = '2' THEN
  1898. '下单暂存'
  1899. WHEN tw.f_billstatus = '3' and tw.f_updete_status = '2'and tw.f_submit_update = '2' and tw.f_delete_status = '2' and tw.f_dismount_status = '2' THEN
  1900. '下单驳回'
  1901. WHEN tw.f_billstatus = '4' and tw.f_updete_status = '2'and tw.f_submit_update = '2' and tw.f_delete_status = '2' and tw.f_dismount_status = '2' THEN
  1902. '下单提交'
  1903. WHEN tw.f_billstatus = '5' and tw.f_updete_status = '2'and tw.f_submit_update = '2' and tw.f_delete_status = '2' and tw.f_dismount_status = '2' THEN
  1904. '下单审批中'
  1905. WHEN tw.f_billstatus = '6' and tw.f_updete_status = '2'and tw.f_submit_update = '2' and tw.f_delete_status = '2' and tw.f_dismount_status = '2' THEN
  1906. '下单审批通过'
  1907. WHEN tw.f_billstatus = '7' and tw.f_updete_status = '2'and tw.f_submit_update = '2' and tw.f_delete_status = '2' and tw.f_dismount_status = '2' THEN
  1908. '配船暂存'
  1909. WHEN tw.f_billstatus = '8' and tw.f_updete_status = '2'and tw.f_submit_update = '2' and tw.f_delete_status = '2' and tw.f_dismount_status = '2' THEN
  1910. '配船驳回'
  1911. WHEN tw.f_billstatus = '9' and tw.f_updete_status = '2'and tw.f_submit_update = '2' and tw.f_delete_status = '2' and tw.f_dismount_status = '2' THEN
  1912. '配船提交'
  1913. WHEN tw.f_billstatus = '10' and tw.f_updete_status = '2'and tw.f_submit_update = '2' and tw.f_delete_status = '2' and tw.f_dismount_status = '2' THEN
  1914. '配船审批中'
  1915. WHEN tw.f_billstatus = '11' and tw.f_updete_status = '2'and tw.f_submit_update = '2' and tw.f_delete_status = '2' and tw.f_dismount_status = '2' THEN
  1916. '配船审批通过'
  1917. WHEN tw.f_billstatus = '12' and tw.f_updete_status = '2'and tw.f_submit_update = '2' and tw.f_delete_status = '2' and tw.f_dismount_status = '2' THEN
  1918. '运单变更'
  1919. WHEN tw.f_updete_status = '3'and tw.f_submit_update = '2' and tw.f_delete_status = '2' and tw.f_dismount_status = '2' THEN
  1920. '申请变更驳回'
  1921. WHEN tw.f_updete_status = '4'and tw.f_submit_update = '2' and tw.f_delete_status = '2' and tw.f_dismount_status = '2' THEN
  1922. '申请变更提交'
  1923. WHEN tw.f_updete_status = '5'and tw.f_submit_update = '2' and tw.f_delete_status = '2' and tw.f_dismount_status = '2' THEN
  1924. '申请变更审批中'
  1925. WHEN tw.f_updete_status = '6'and tw.f_submit_update = '2' and tw.f_delete_status = '2' and tw.f_dismount_status = '2' THEN
  1926. '申请变更通过'
  1927. WHEN tw.f_submit_update = '3' and tw.f_delete_status = '2' and tw.f_dismount_status = '2' THEN
  1928. '提交变更驳回'
  1929. WHEN tw.f_submit_update = '4' and tw.f_delete_status = '2' and tw.f_dismount_status = '2' THEN
  1930. '提交变更审批'
  1931. WHEN tw.f_submit_update = '5' and tw.f_delete_status = '2' and tw.f_dismount_status = '2' THEN
  1932. '提交变更审批中'
  1933. WHEN tw.f_submit_update = '6' and tw.f_delete_status = '2' and tw.f_dismount_status = '2' THEN
  1934. '提交变更通过'
  1935. WHEN tw.f_delete_status = '3' and tw.f_dismount_status = '2' THEN
  1936. '申请删单驳回'
  1937. WHEN tw.f_delete_status = '4' and tw.f_dismount_status = '2' THEN
  1938. '申请删单提交'
  1939. WHEN tw.f_delete_status = '5' and tw.f_dismount_status = '2' THEN
  1940. '申请删单审批中'
  1941. WHEN tw.f_delete_status = '6' and tw.f_dismount_status = '2' THEN
  1942. '申请删单通过'
  1943. WHEN tw.f_dismount_status = '3' THEN
  1944. '拆单审批驳回'
  1945. WHEN tw.f_dismount_status = '4' THEN
  1946. '拆单审批提交'
  1947. WHEN tw.f_dismount_status = '5' THEN
  1948. '拆单审批中'
  1949. WHEN tw.f_dismount_status = '6' THEN
  1950. '拆单审批通过'
  1951. END AS fBillstatus,
  1952. CASE
  1953. WHEN tf.f_billstatus = '1' THEN
  1954. '新建'
  1955. WHEN tf.f_billstatus = '2' THEN
  1956. '暂存'
  1957. WHEN tf.f_billstatus = '3' THEN
  1958. '驳回'
  1959. WHEN tf.f_billstatus = '4' THEN
  1960. '提交'
  1961. WHEN tf.f_billstatus = '5' THEN
  1962. '审批中'
  1963. WHEN tf.f_billstatus = '6' THEN
  1964. '审批通过'
  1965. END AS moneyStatus,
  1966. tw.f_updete_status fUpdeteStatus,
  1967. tw.f_submit_update fSubmitUpdate,
  1968. tw.f_delete_status fDeleteStatus,
  1969. tw.f_cargo_planning fCargoPlanning,
  1970. tw.f_arrival_status fArrivalStatus,
  1971. tw.f_vslid fVslid,
  1972. tw.f_voyid fVoyid,
  1973. tw.remark remark,
  1974. IFNULL(tcntr.loadCntr,0) AS loadCntr,
  1975. tw.f_serviceitems_new AS fServiceitemsNew,
  1976. tw.f_receivable AS fReceivable,
  1977. tw.f_recycle AS fRecycle,
  1978. tw.f_due AS fDue,
  1979. tw.f_pay AS fPay,
  1980. CASE
  1981. WHEN tw.f_carego_status = '0' THEN '录入'
  1982. WHEN tw.f_carego_status = '1' THEN '未放货'
  1983. WHEN tw.f_carego_status = '2' THEN '放货'
  1984. WHEN tw.f_carego_status = '3' THEN '扣货'
  1985. END AS fCaregoStatus
  1986. FROM
  1987. t_warehousebills tw
  1988. LEFT JOIN t_address ta ON ta.f_id = tw.f_laneid
  1989. LEFT JOIN t_address tre ON tre.f_id = tw.f_loadportid
  1990. LEFT JOIN t_address ts ON ts.f_id = tw.f_destportid
  1991. LEFT JOIN sys_dict_data sd ON sd.dict_value = tw.f_serviceitems AND sd.dict_type = 'f_serviceitems'
  1992. LEFT JOIN sys_dict_data tk ON tk.dict_value = tw.f_serviceitems_new AND tk.dict_type = 'f_serviceitems'
  1993. <if test="fCntrno != null and fCntrno != ''">
  1994. LEFT JOIN t_warehousebills_cntritems items ON tw.f_id = items.f_pid
  1995. </if>
  1996. LEFT JOIN t_vessel tv ON tw.f_vslid = tv.f_id
  1997. LEFT JOIN t_voyage ty ON tw.f_voyid = ty.f_id
  1998. LEFT JOIN t_corps tp ON tw.f_corpid = tp.f_id
  1999. LEFT JOIN (
  2000. SELECT
  2001. th.f_pid,
  2002. th.f_cntrcount,
  2003. tr.f_no,
  2004. th.f_cntrid,
  2005. tg.f_name
  2006. FROM
  2007. t_warehousebills_cntr th
  2008. LEFT JOIN t_cntr tr ON th.f_cntrid = tr.f_id
  2009. LEFT JOIN t_goods tg ON th.f_goodsid = tg.f_id
  2010. ) tc ON tc.f_pid = tw.f_id
  2011. LEFT JOIN (SELECT f_pid,f_billstatus FROM t_warehousebillsfees GROUP BY f_pid)tf ON tf.f_pid = tw.f_id
  2012. LEFT JOIN (
  2013. SELECT
  2014. th.f_pid,
  2015. count(th.f_pid) loadCntr
  2016. FROM
  2017. t_warehousebills_cntritems th
  2018. GROUP BY th.f_pid
  2019. ) tcntr ON tcntr.f_pid = tw.f_id
  2020. <where>
  2021. tw.f_typeid = '1'
  2022. and tw.del_flag = '0'
  2023. <if test="fId != null">and tw.f_id = #{fId}</if>
  2024. <if test="fCaregoStatus != null and fCaregoStatus != ''">and tw.f_carego_status = #{fCaregoStatus}</if>
  2025. <if test="fCntrno != null and fCntrno != ''">and items.f_cntrno like concat('%', #{fCntrno}, '%')</if>
  2026. <if test="fBillno != null and fBillno != ''">and tw.f_billno like concat('%',#{fBillno}, '%')</if>
  2027. <if test="fCustomsdeclartion != null and fCustomsdeclartion != ''">and tw.f_customsdeclartion =
  2028. #{fCustomsdeclartion}
  2029. </if>
  2030. <if test="fOriginalbillno != null and fOriginalbillno != ''">and tw.f_originalbillno = #{fOriginalbillno}
  2031. </if>
  2032. <if test="fDeptid != null ">and tw.f_deptid = #{fDeptid}</if>
  2033. <if test="fBsdeptid != null ">and tw.f_bsdeptid = #{fBsdeptid}</if>
  2034. <if test="fContacts != null and fContacts != ''">and tw.f_contacts = #{fContacts}</if>
  2035. <if test="fTel != null and fTel != ''">and tw.f_tel = #{fTel}</if>
  2036. <if test="fCorpid != null ">and tw.f_corpid = #{fCorpid}</if>
  2037. <if test="fShipper != null and fShipper != ''">and tw.f_shipper like concat('%', #{fShipper}, '%')</if>
  2038. <if test="fTocorpid != null ">and tw.f_tocorpid = #{fTocorpid}</if>
  2039. <if test="fStltypeid != null ">and tw.f_stltypeid = #{fStltypeid}</if>
  2040. <if test="fBscorpno != null and fBscorpno != ''">and tw.f_bscorpno = #{fBscorpno}</if>
  2041. <if test="fWarehouseid != null ">and tw.f_warehouseid = #{fWarehouseid}</if>
  2042. <if test="fStorekeeper != null and fStorekeeper != ''">and tw.f_storekeeper = #{fStorekeeper}</if>
  2043. <if test="fChargedate != null ">and tw.f_chargedate = #{fChargedate}</if>
  2044. <if test="fBsdate != null ">and tw.f_bsdate = #{fBsdate}</if>
  2045. <if test="fPlanqty != null ">and tw.f_planqty = #{fPlanqty}</if>
  2046. <if test="fPlangrossweight != null ">and tw.f_plangrossweight = #{fPlangrossweight}</if>
  2047. <if test="fPlannetweight != null ">and tw.f_plannetweight = #{fPlannetweight}</if>
  2048. <if test="fPlanvolumn != null ">and tw.f_planvolumn = #{fPlanvolumn}</if>
  2049. <if test="fQty != null ">and tw.f_qty = #{fQty}</if>
  2050. <if test="fGrossweight != null ">and tw.f_grossweight = #{fGrossweight}</if>
  2051. <if test="fNetweight != null ">and tw.f_netweight = #{fNetweight}</if>
  2052. <if test="fVolumn != null ">and tw.f_volumn = #{fVolumn}</if>
  2053. <if test="fBillingway != null ">and tw.f_billingway = #{fBillingway}</if>
  2054. <if test="fTrademodeid != null ">and tw.f_trademodeid = #{fTrademodeid}</if>
  2055. <if test="fSbu != null ">and tw.f_sbu = #{fSbu}</if>
  2056. <if test="fFeetunit != null and fFeetunit != ''">and tw.f_feetunit = #{fFeetunit}</if>
  2057. <if test="fMblno != null and fMblno != ''">and tw.f_mblno like concat('%',
  2058. #{fMblno}, '%')</if>
  2059. <if test="fMarks != null and fMarks != ''">and tw.f_marks = #{fMarks}</if>
  2060. <if test="fVslvoy != null and fVslvoy != ''">and tw.f_vslvoy = #{fVslvoy}</if>
  2061. <if test="fEta != null ">and tw.f_eta = #{fEta}</if>
  2062. <if test="fCustomno != null and fCustomno != ''">and tw.f_customno = #{fCustomno}</if>
  2063. <if test="fIfweigh != null and fIfweigh != ''">and tw.f_ifweigh = #{fIfweigh}</if>
  2064. <if test="fIfpledge != null and fIfpledge != ''">and tw.f_ifpledge = #{fIfpledge}</if>
  2065. <if test="fIfdamage != null and fIfdamage != ''">and tw.f_ifdamage = #{fIfdamage}</if>
  2066. <if test="fBankcorpid != null and fBankcorpid != ''">and tw.f_bankcorpid = #{fBankcorpid}</if>
  2067. <if test="fBilltype != null and fBilltype != ''">and tw.f_billtype = #{fBilltype}</if>
  2068. <if test="fBillstatus != null and (fBillstatus == 4 or fBillstatus == 6 or fBillstatus == 9 or fBillstatus == 11)">
  2069. and tw.f_billstatus = #{fBillstatus}
  2070. and tw.f_updete_status = 2
  2071. and tw.f_submit_update = 2
  2072. and tw.f_delete_status = 2
  2073. </if>
  2074. <if test="fBillstatus != null and fBillstatus == 10">
  2075. and tw.f_billstatus in ('3','8')
  2076. and tw.f_updete_status in ('2','3')
  2077. and tw.f_submit_update in ('2','3')
  2078. and tw.f_delete_status in ('2','3')
  2079. </if>
  2080. <if test="fBillstatus != null and fBillstatus == 12">
  2081. AND (tw.f_updete_status != 2
  2082. OR tw.f_submit_update != 2
  2083. OR tw.f_delete_status != 2 )
  2084. </if>
  2085. <if test="fItemsStatus != null ">and tw.f_items_status = #{fItemsStatus}</if>
  2086. <if test="fBillingDeadline != null ">and tw.f_billing_deadline = #{fBillingDeadline}</if>
  2087. <if test="fProductName != null and fProductName != ''">and tw.f_product_name like concat('%',
  2088. #{fProductName}, '%')
  2089. </if>
  2090. <if test="fReviewDate != null ">and tw.f_review_date = #{fReviewDate}</if>
  2091. <if test="fTruckno != null and fTruckno != ''">and tw.f_truckno = #{fTruckno}</if>
  2092. <if test="fDriverName != null and fDriverName != ''">and tw.f_driver_name like concat('%', #{fDriverName},
  2093. '%')
  2094. </if>
  2095. <if test="fDriverTel != null and fDriverTel != ''">and tw.f_driver_tel = #{fDriverTel}</if>
  2096. <if test="fDriverIdCar != null and fDriverIdCar != ''">and tw.f_driver_id_car = #{fDriverIdCar}</if>
  2097. <if test="fBusinessType != null and fBusinessType != ''">and tw.f_business_type = #{fBusinessType}</if>
  2098. <if test="fLabour != null ">and tw.f_labour = #{fLabour}</if>
  2099. <if test="fFleet != null ">and tw.f_fleet = #{fFleet}</if>
  2100. <if test="fInwarehouseid != null ">and tw.f_inwarehouseid = #{fInwarehouseid}</if>
  2101. <if test="fBstime != null ">and tw.f_bstime = #{fBstime}</if>
  2102. <if test="fCartype != null ">and tw.f_cartype = #{fCartype}</if>
  2103. <if test="fGoodsid != null ">and tw.f_goodsid = #{fGoodsid}</if>
  2104. <if test="fNewTrademodeid != null ">and tw.f_new_trademodeid = #{fNewTrademodeid}</if>
  2105. <if test="fLoadportid != null ">and tw.f_loadportid = #{fLoadportid}</if>
  2106. <if test="fDestportid != null ">and tw.f_destportid = #{fDestportid}</if>
  2107. <if test="fServiceitems != null and fServiceitems != ''">and tw.f_serviceitems = #{fServiceitems}</if>
  2108. <if test="fInvoceobj != null and fInvoceobj != ''">and tw.f_invoceobj = #{fInvoceobj}</if>
  2109. <if test="fSign != null ">and tw.f_sign = #{fSign}</if>
  2110. <if test="fDetentioncargo != null ">and tw.f_detentioncargo = #{fDetentioncargo}</if>
  2111. <if test="fBooksmarks != null and fBooksmarks != ''">and tw.f_booksmarks = #{fBooksmarks}</if>
  2112. <if test="fShippername != null and fShippername != ''">and tw.f_shippername like concat('%',
  2113. #{fShippername}, '%')
  2114. </if>
  2115. <if test="fShipperattn != null and fShipperattn != ''">and tw.f_shipperattn = #{fShipperattn}</if>
  2116. <if test="fShippertel != null and fShippertel != ''">and tw.f_shippertel = #{fShippertel}</if>
  2117. <if test="fConsigneername != null and fConsigneername != ''">and tw.f_consigneername like concat('%',
  2118. #{fConsigneername}, '%')
  2119. </if>
  2120. <if test="fConsigneeattn != null and fConsigneeattn != ''">and tw.f_consigneeattn = #{fConsigneeattn}</if>
  2121. <if test="fConsigneetel != null and fConsigneetel != ''">and tw.f_consigneetel = #{fConsigneetel}</if>
  2122. <if test="fInsurance != null and fInsurance != ''">and tw.f_insurance = #{fInsurance}</if>
  2123. <if test="fInsuranceamt != null ">and tw.f_insuranceamt = #{fInsuranceamt}</if>
  2124. <if test="fClosedate != null ">and tw.f_closedate = #{fClosedate}</if>
  2125. <if test="fDocmentdate != null ">and tw.f_docmentdate = #{fDocmentdate}</if>
  2126. <if test="fVslid != null ">and tw.f_vslid = #{fVslid}</if>
  2127. <if test="fVoyid != null ">and tw.f_voyid = #{fVoyid}</if>
  2128. <if test="fTypeid != null ">and tw.f_typeid = #{fTypeid}</if>
  2129. <if test="fPaymode != null">and tw.f_paymode = #{fPaymode},</if>
  2130. <if test="fLaneid != null">and tw.f_laneid = #{fLaneid},</if>
  2131. <if test='startTime != null'>
  2132. and tw.create_time &gt;= #{startTime}
  2133. </if>
  2134. <if test='endTime != null'>
  2135. and tw.create_time &lt;= #{endTime}
  2136. </if>
  2137. <if test="fCntrid != null ">and tc.f_cntrid = #{fCntrid}</if>
  2138. <if test="fCntrcount != null ">and tc.f_cntrcount = #{fCntrcount}</if>
  2139. <if test="vslidName != null and vslidName != ''">and tv.f_name like concat('%',
  2140. #{vslidName}, '%')
  2141. </if>
  2142. <if test="voyidName != null and voyidName != ''">and ty.f_no like concat('%',
  2143. #{voyidName}, '%')
  2144. </if>
  2145. <if test="boxNumber != null and boxNumber != ''">and tc.f_no like concat('%',
  2146. #{voyidName}, '%')
  2147. </if>
  2148. <if test="createBy != null and createBy != ''">and tw.create_by = #{createBy}</if>
  2149. <if test='cLoadDate != null and cLoadDate[0] != null and cLoadDate[0]!= ""'>
  2150. and tw.create_time &gt;= #{cLoadDate[0]}
  2151. </if>
  2152. <if test='cLoadDate != null and cLoadDate[1] != null and cLoadDate[1]!= ""'>
  2153. and tw.create_time &lt;= #{cLoadDate[1]}
  2154. </if>
  2155. <if test='timeInterval != null and timeInterval[0] != null and timeInterval[0]!= ""'>
  2156. and ty.f_ATD &gt;= #{timeInterval[0]}
  2157. </if>
  2158. <if test='timeInterval != null and timeInterval[1] != null and timeInterval[1]!= ""'>
  2159. and ty.f_ATD &lt;= #{timeInterval[1]}
  2160. </if>
  2161. <if test="fCargoPlanning != null "> and tw.f_cargo_planning = #{fCargoPlanning}</if>
  2162. <if test="fArrivalStatus != null and fArrivalStatus != 3"> and tw.f_arrival_status = #{fArrivalStatus}</if>
  2163. <if test="fArrivalStatus != null and fArrivalStatus == 3"> and tw.f_arrival_status != '2'</if>
  2164. </where>
  2165. ORDER BY tw.create_time DESC, tw.f_id DESC
  2166. </select>
  2167. <select id="ruoYiVersionOrderList1" parameterType="TWarehousebills" resultType="map">
  2168. SELECT
  2169. tw.f_id fId,
  2170. tw.f_billno fBillno,
  2171. tw.f_originalbillno fOriginalbillno,
  2172. tw.f_shipper fShipper,
  2173. tw.f_mblno fMblno,
  2174. sd.dict_label fServiceitems,
  2175. tw.f_consigneername fConsigneername,
  2176. ta.f_name fName,
  2177. tw.f_bsdate fBsdate,
  2178. tc.f_cntrcount fCntrcount,
  2179. tc.f_no fNo,
  2180. tv.f_name vslName,
  2181. ty.f_no voyNo,
  2182. tw.f_corpid fCorpid,
  2183. tp.f_name corpName,
  2184. tw.create_by createBy,
  2185. tw.create_time createTime,
  2186. tw.f_loadportid fLoadportid,
  2187. tre.f_name loadportName,
  2188. tw.f_destportid fDestportid,
  2189. ts.f_name destportName,
  2190. tc.f_name goodsName,
  2191. tw.f_billstatus fBillstatus,
  2192. CASE
  2193. WHEN tw.f_billstatus = '1' and tw.f_updete_status = '2'and tw.f_submit_update = '2' and tw.f_delete_status = '2' and tw.f_dismount_status = '2' THEN
  2194. '下单新建'
  2195. WHEN tw.f_billstatus = '2' and tw.f_updete_status = '2'and tw.f_submit_update = '2' and tw.f_delete_status = '2' and tw.f_dismount_status = '2' THEN
  2196. '下单暂存'
  2197. WHEN tw.f_billstatus = '3' and tw.f_updete_status = '2'and tw.f_submit_update = '2' and tw.f_delete_status = '2' and tw.f_dismount_status = '2' THEN
  2198. '下单驳回'
  2199. WHEN tw.f_billstatus = '4' and tw.f_updete_status = '2'and tw.f_submit_update = '2' and tw.f_delete_status = '2' and tw.f_dismount_status = '2' THEN
  2200. '下单提交'
  2201. WHEN tw.f_billstatus = '5' and tw.f_updete_status = '2'and tw.f_submit_update = '2' and tw.f_delete_status = '2' and tw.f_dismount_status = '2' THEN
  2202. '下单审批中'
  2203. WHEN tw.f_billstatus = '6' and tw.f_updete_status = '2'and tw.f_submit_update = '2' and tw.f_delete_status = '2' and tw.f_dismount_status = '2' THEN
  2204. '下单审批通过'
  2205. WHEN tw.f_billstatus = '7' and tw.f_updete_status = '2'and tw.f_submit_update = '2' and tw.f_delete_status = '2' and tw.f_dismount_status = '2' THEN
  2206. '配船暂存'
  2207. WHEN tw.f_billstatus = '8' and tw.f_updete_status = '2'and tw.f_submit_update = '2' and tw.f_delete_status = '2' and tw.f_dismount_status = '2' THEN
  2208. '配船驳回'
  2209. WHEN tw.f_billstatus = '9' and tw.f_updete_status = '2'and tw.f_submit_update = '2' and tw.f_delete_status = '2' and tw.f_dismount_status = '2' THEN
  2210. '配船提交'
  2211. WHEN tw.f_billstatus = '10' and tw.f_updete_status = '2'and tw.f_submit_update = '2' and tw.f_delete_status = '2' and tw.f_dismount_status = '2' THEN
  2212. '配船审批中'
  2213. WHEN tw.f_billstatus = '11' and tw.f_updete_status = '2'and tw.f_submit_update = '2' and tw.f_delete_status = '2' and tw.f_dismount_status = '2' THEN
  2214. '配船审批通过'
  2215. WHEN tw.f_billstatus = '12' and tw.f_updete_status = '2'and tw.f_submit_update = '2' and tw.f_delete_status = '2' and tw.f_dismount_status = '2' THEN
  2216. '运单变更'
  2217. WHEN tw.f_updete_status = '3'and tw.f_submit_update = '2' and tw.f_delete_status = '2' and tw.f_dismount_status = '2' THEN
  2218. '申请变更驳回'
  2219. WHEN tw.f_updete_status = '4'and tw.f_submit_update = '2' and tw.f_delete_status = '2' and tw.f_dismount_status = '2' THEN
  2220. '申请变更提交'
  2221. WHEN tw.f_updete_status = '5'and tw.f_submit_update = '2' and tw.f_delete_status = '2' and tw.f_dismount_status = '2' THEN
  2222. '申请变更审批中'
  2223. WHEN tw.f_updete_status = '6'and tw.f_submit_update = '2' and tw.f_delete_status = '2' and tw.f_dismount_status = '2' THEN
  2224. '申请变更通过'
  2225. WHEN tw.f_submit_update = '3' and tw.f_delete_status = '2' and tw.f_dismount_status = '2' THEN
  2226. '提交变更驳回'
  2227. WHEN tw.f_submit_update = '4' and tw.f_delete_status = '2' and tw.f_dismount_status = '2' THEN
  2228. '提交变更审批'
  2229. WHEN tw.f_submit_update = '5' and tw.f_delete_status = '2' and tw.f_dismount_status = '2' THEN
  2230. '提交变更审批中'
  2231. WHEN tw.f_submit_update = '6' and tw.f_delete_status = '2' and tw.f_dismount_status = '2' THEN
  2232. '提交变更通过'
  2233. WHEN tw.f_delete_status = '3' and tw.f_dismount_status = '2' THEN
  2234. '申请删单驳回'
  2235. WHEN tw.f_delete_status = '4' and tw.f_dismount_status = '2' THEN
  2236. '申请删单提交'
  2237. WHEN tw.f_delete_status = '5' and tw.f_dismount_status = '2' THEN
  2238. '申请删单审批中'
  2239. WHEN tw.f_delete_status = '6' and tw.f_dismount_status = '2' THEN
  2240. '申请删单通过'
  2241. WHEN tw.f_dismount_status = '3' THEN
  2242. '拆单审批驳回'
  2243. WHEN tw.f_dismount_status = '4' THEN
  2244. '拆单审批提交'
  2245. WHEN tw.f_dismount_status = '5' THEN
  2246. '拆单审批中'
  2247. WHEN tw.f_dismount_status = '6' THEN
  2248. '拆单审批通过'
  2249. END AS fBillstatusName,
  2250. CASE
  2251. WHEN tf.f_billstatus = '1' THEN
  2252. '新建'
  2253. WHEN tf.f_billstatus = '2' THEN
  2254. '暂存'
  2255. WHEN tf.f_billstatus = '3' THEN
  2256. '驳回'
  2257. WHEN tf.f_billstatus = '4' THEN
  2258. '提交'
  2259. WHEN tf.f_billstatus = '5' THEN
  2260. '审批中'
  2261. WHEN tf.f_billstatus = '6' THEN
  2262. '审批通过'
  2263. END AS moneyStatus,
  2264. tw.f_updete_status fUpdeteStatus,
  2265. tw.f_submit_update fSubmitUpdate,
  2266. tw.f_delete_status fDeleteStatus,
  2267. ROUND(IFNULL(tf.fAmount,0),2) fAmount,
  2268. tw.f_cargo_planning fCargoPlanning,
  2269. tw.f_arrival_status,
  2270. tw.remark remark,
  2271. tw.f_serviceitems_new AS fServiceitemsNew
  2272. FROM
  2273. t_warehousebills tw
  2274. LEFT JOIN t_address ta ON ta.f_id = tw.f_laneid
  2275. LEFT JOIN t_address tre ON tre.f_id = tw.f_loadportid
  2276. LEFT JOIN t_address ts ON ts.f_id = tw.f_destportid
  2277. LEFT JOIN sys_dict_data sd ON sd.dict_value = tw.f_serviceitems
  2278. AND sd.dict_type = 'f_serviceitems'
  2279. LEFT JOIN t_vessel tv ON tw.f_vslid = tv.f_id
  2280. LEFT JOIN t_voyage ty ON tw.f_voyid = ty.f_id
  2281. LEFT JOIN t_corps tp ON tw.f_corpid = tp.f_id
  2282. LEFT JOIN (
  2283. SELECT
  2284. th.f_pid,
  2285. th.f_cntrcount,
  2286. tr.f_no,
  2287. th.f_cntrid,
  2288. tg.f_name
  2289. FROM
  2290. t_warehousebills_cntr th
  2291. LEFT JOIN t_cntr tr ON th.f_cntrid = tr.f_id
  2292. LEFT JOIN t_goods tg ON th.f_goodsid = tg.f_id
  2293. ) tc ON tc.f_pid = tw.f_id
  2294. LEFT JOIN (SELECT f_pid,f_billstatus,IFNULL(SUM(f_amount),0) fAmount FROM t_warehousebillsfees GROUP BY f_pid)tf ON tf.f_pid = tw.f_id
  2295. <where>
  2296. tw.f_typeid = '1'
  2297. and tw.del_flag = '0'
  2298. <if test="fId != null">and tw.f_id = #{fId}</if>
  2299. <if test="fBillno != null and fBillno != ''">and tw.f_billno = #{fBillno}</if>
  2300. <if test="fCustomsdeclartion != null and fCustomsdeclartion != ''">and tw.f_customsdeclartion =
  2301. #{fCustomsdeclartion}
  2302. </if>
  2303. <if test="fOriginalbillno != null and fOriginalbillno != ''">and tw.f_originalbillno = #{fOriginalbillno}
  2304. </if>
  2305. <if test="fDeptid != null ">and tw.f_deptid = #{fDeptid}</if>
  2306. <if test="fBsdeptid != null ">and tw.f_bsdeptid = #{fBsdeptid}</if>
  2307. <if test="fContacts != null and fContacts != ''">and tw.f_contacts = #{fContacts}</if>
  2308. <if test="fTel != null and fTel != ''">and tw.f_tel = #{fTel}</if>
  2309. <if test="fCorpid != null ">and tw.f_corpid = #{fCorpid}</if>
  2310. <if test="fShipper != null and fShipper != ''">and tw.f_shipper like concat('%', #{fShipper}, '%')</if>
  2311. <if test="fTocorpid != null ">and tw.f_tocorpid = #{fTocorpid}</if>
  2312. <if test="fStltypeid != null ">and tw.f_stltypeid = #{fStltypeid}</if>
  2313. <if test="fBscorpno != null and fBscorpno != ''">and tw.f_bscorpno = #{fBscorpno}</if>
  2314. <if test="fWarehouseid != null ">and tw.f_warehouseid = #{fWarehouseid}</if>
  2315. <if test="fStorekeeper != null and fStorekeeper != ''">and tw.f_storekeeper = #{fStorekeeper}</if>
  2316. <if test="fChargedate != null ">and tw.f_chargedate = #{fChargedate}</if>
  2317. <if test="fBsdate != null ">and tw.f_bsdate = #{fBsdate}</if>
  2318. <if test="fPlanqty != null ">and tw.f_planqty = #{fPlanqty}</if>
  2319. <if test="fPlangrossweight != null ">and tw.f_plangrossweight = #{fPlangrossweight}</if>
  2320. <if test="fPlannetweight != null ">and tw.f_plannetweight = #{fPlannetweight}</if>
  2321. <if test="fPlanvolumn != null ">and tw.f_planvolumn = #{fPlanvolumn}</if>
  2322. <if test="fQty != null ">and tw.f_qty = #{fQty}</if>
  2323. <if test="fGrossweight != null ">and tw.f_grossweight = #{fGrossweight}</if>
  2324. <if test="fNetweight != null ">and tw.f_netweight = #{fNetweight}</if>
  2325. <if test="fVolumn != null ">and tw.f_volumn = #{fVolumn}</if>
  2326. <if test="fBillingway != null ">and tw.f_billingway = #{fBillingway}</if>
  2327. <if test="fTrademodeid != null ">and tw.f_trademodeid = #{fTrademodeid}</if>
  2328. <if test="fSbu != null ">and tw.f_sbu = #{fSbu}</if>
  2329. <if test="fFeetunit != null and fFeetunit != ''">and tw.f_feetunit = #{fFeetunit}</if>
  2330. <if test="fMblno != null and fMblno != ''">and tw.f_mblno = #{fMblno}</if>
  2331. <if test="fMarks != null and fMarks != ''">and tw.f_marks = #{fMarks}</if>
  2332. <if test="fVslvoy != null and fVslvoy != ''">and tw.f_vslvoy = #{fVslvoy}</if>
  2333. <if test="fEta != null ">and tw.f_eta = #{fEta}</if>
  2334. <if test="fCustomno != null and fCustomno != ''">and tw.f_customno = #{fCustomno}</if>
  2335. <if test="fIfweigh != null and fIfweigh != ''">and tw.f_ifweigh = #{fIfweigh}</if>
  2336. <if test="fIfpledge != null and fIfpledge != ''">and tw.f_ifpledge = #{fIfpledge}</if>
  2337. <if test="fIfdamage != null and fIfdamage != ''">and tw.f_ifdamage = #{fIfdamage}</if>
  2338. <if test="fBankcorpid != null and fBankcorpid != ''">and tw.f_bankcorpid = #{fBankcorpid}</if>
  2339. <if test="fBilltype != null and fBilltype != ''">and tw.f_billtype = #{fBilltype}</if>
  2340. <if test="fBillstatus != null and (fBillstatus == 4 or fBillstatus == 6 or fBillstatus == 9 or fBillstatus == 11)">
  2341. and tw.f_billstatus = #{fBillstatus}
  2342. and tw.f_updete_status = 2
  2343. and tw.f_submit_update = 2
  2344. and tw.f_delete_status = 2
  2345. </if>
  2346. <if test="fBillstatus != null and fBillstatus == 10">
  2347. and tw.f_billstatus in ('3','8')
  2348. and tw.f_updete_status in ('2','3')
  2349. and tw.f_submit_update in ('2','3')
  2350. and tw.f_delete_status in ('2','3')
  2351. </if>
  2352. <if test="fBillstatus != null and fBillstatus == 12">
  2353. AND (tw.f_updete_status != 2
  2354. OR tw.f_submit_update != 2
  2355. OR tw.f_delete_status != 2 )
  2356. </if>
  2357. <if test="fItemsStatus != null ">and tw.f_items_status = #{fItemsStatus}</if>
  2358. <if test="fBillingDeadline != null ">and tw.f_billing_deadline = #{fBillingDeadline}</if>
  2359. <if test="fProductName != null and fProductName != ''">and tw.f_product_name like concat('%',
  2360. #{fProductName}, '%')
  2361. </if>
  2362. <if test="fReviewDate != null ">and tw.f_review_date = #{fReviewDate}</if>
  2363. <if test="fTruckno != null and fTruckno != ''">and tw.f_truckno = #{fTruckno}</if>
  2364. <if test="fDriverName != null and fDriverName != ''">and tw.f_driver_name like concat('%', #{fDriverName},
  2365. '%')
  2366. </if>
  2367. <if test="fDriverTel != null and fDriverTel != ''">and tw.f_driver_tel = #{fDriverTel}</if>
  2368. <if test="fDriverIdCar != null and fDriverIdCar != ''">and tw.f_driver_id_car = #{fDriverIdCar}</if>
  2369. <if test="fBusinessType != null and fBusinessType != ''">and tw.f_business_type = #{fBusinessType}</if>
  2370. <if test="fLabour != null ">and tw.f_labour = #{fLabour}</if>
  2371. <if test="fFleet != null ">and tw.f_fleet = #{fFleet}</if>
  2372. <if test="fInwarehouseid != null ">and tw.f_inwarehouseid = #{fInwarehouseid}</if>
  2373. <if test="fBstime != null ">and tw.f_bstime = #{fBstime}</if>
  2374. <if test="fCartype != null ">and tw.f_cartype = #{fCartype}</if>
  2375. <if test="fGoodsid != null ">and tw.f_goodsid = #{fGoodsid}</if>
  2376. <if test="fNewTrademodeid != null ">and tw.f_new_trademodeid = #{fNewTrademodeid}</if>
  2377. <if test="fLoadportid != null ">and tw.f_loadportid = #{fLoadportid}</if>
  2378. <if test="fDestportid != null ">and tw.f_destportid = #{fDestportid}</if>
  2379. <if test="fServiceitems != null and fServiceitems != ''">and tw.f_serviceitems = #{fServiceitems}</if>
  2380. <if test="fInvoceobj != null and fInvoceobj != ''">and tw.f_invoceobj = #{fInvoceobj}</if>
  2381. <if test="fSign != null ">and tw.f_sign = #{fSign}</if>
  2382. <if test="fDetentioncargo != null ">and tw.f_detentioncargo = #{fDetentioncargo}</if>
  2383. <if test="fBooksmarks != null and fBooksmarks != ''">and tw.f_booksmarks = #{fBooksmarks}</if>
  2384. <if test="fShippername != null and fShippername != ''">and tw.f_shippername like concat('%',
  2385. #{fShippername}, '%')
  2386. </if>
  2387. <if test="fShipperattn != null and fShipperattn != ''">and tw.f_shipperattn = #{fShipperattn}</if>
  2388. <if test="fShippertel != null and fShippertel != ''">and tw.f_shippertel = #{fShippertel}</if>
  2389. <if test="fConsigneername != null and fConsigneername != ''">and tw.f_consigneername like concat('%',
  2390. #{fConsigneername}, '%')
  2391. </if>
  2392. <if test="fConsigneeattn != null and fConsigneeattn != ''">and tw.f_consigneeattn = #{fConsigneeattn}</if>
  2393. <if test="fConsigneetel != null and fConsigneetel != ''">and tw.f_consigneetel = #{fConsigneetel}</if>
  2394. <if test="fInsurance != null and fInsurance != ''">and tw.f_insurance = #{fInsurance}</if>
  2395. <if test="fInsuranceamt != null ">and tw.f_insuranceamt = #{fInsuranceamt}</if>
  2396. <if test="fClosedate != null ">and tw.f_closedate = #{fClosedate}</if>
  2397. <if test="fDocmentdate != null ">and tw.f_docmentdate = #{fDocmentdate}</if>
  2398. <if test="fVslid != null ">and tw.f_vslid = #{fVslid}</if>
  2399. <if test="fVoyid != null ">and tw.f_voyid = #{fVoyid}</if>
  2400. <if test="fTypeid != null ">and tw.f_typeid = #{fTypeid}</if>
  2401. <if test="fPaymode != null">and tw.f_paymode = #{fPaymode},</if>
  2402. <if test="fLaneid != null">and tw.f_laneid = #{fLaneid},</if>
  2403. <if test='startTime != null'>
  2404. and tw.create_time &gt;= #{startTime}
  2405. </if>
  2406. <if test='endTime != null'>
  2407. and tw.create_time &lt;= #{endTime}
  2408. </if>
  2409. <if test="fCntrid != null ">and tc.f_cntrid = #{fCntrid}</if>
  2410. <if test="fCntrcount != null ">and tc.f_cntrcount = #{fCntrcount}</if>
  2411. <if test="vslidName != null and vslidName != ''">and tv.f_name like concat('%',
  2412. #{vslidName}, '%')
  2413. </if>
  2414. <if test="voyidName != null and voyidName != ''">and ty.f_no like concat('%',
  2415. #{voyidName}, '%')
  2416. </if>
  2417. <if test="boxNumber != null and boxNumber != ''">and tc.f_no like concat('%',
  2418. #{voyidName}, '%')
  2419. </if>
  2420. <if test="createBy != null and createBy != ''">and tw.create_by = #{createBy}</if>
  2421. <if test='cLoadDate != null and cLoadDate[0] != null and cLoadDate[0]!= ""'>
  2422. and tw.f_bsdate &gt;= #{cLoadDate[0]}
  2423. </if>
  2424. <if test='cLoadDate != null and cLoadDate[1] != null and cLoadDate[1]!= ""'>
  2425. and tw.f_bsdate &lt;= #{cLoadDate[1]}
  2426. </if>
  2427. <if test="fCargoPlanning != null "> and tw.f_cargo_planning = #{fCargoPlanning}</if>
  2428. <if test="fArrivalStatus != null "> and tw.f_arrival_status = #{fArrivalStatus}</if>
  2429. </where>
  2430. ORDER BY tw.create_time DESC, tw.f_id DESC
  2431. </select>
  2432. <select id="webVersionOrderById" parameterType="TWarehousebills" resultMap="TWarehousebillsResult">
  2433. SELECT tw.f_id,
  2434. tw.f_billno,
  2435. tw.f_customsdeclartion,
  2436. tw.f_originalbillno,
  2437. tw.f_deptid,
  2438. tw.f_bsdeptid,
  2439. tw.f_contacts,
  2440. tw.f_tel,
  2441. tw.f_shipper,
  2442. tw.f_corpid,
  2443. tc.f_name corpName,
  2444. tw.f_tocorpid,
  2445. tw.f_stltypeid,
  2446. tw.f_bscorpno,
  2447. tw.f_warehouseid,
  2448. tw.f_storekeeper,
  2449. tw.f_chargedate,
  2450. tw.f_bsdate,
  2451. tw.f_planqty,
  2452. tw.f_plangrossweight,
  2453. tw.f_plannetweight,
  2454. tw.f_planvolumn,
  2455. tw.f_qty,
  2456. tw.f_grossweight,
  2457. tw.f_netweight,
  2458. tw.f_volumn,
  2459. tw.f_billingway,
  2460. tw.f_trademodeid,
  2461. tw.f_sbu,
  2462. tw.f_feetunit,
  2463. tw.f_mblno,
  2464. tw.f_marks,
  2465. tw.f_vslvoy,
  2466. tw.f_eta,
  2467. tw.f_customno,
  2468. tw.f_ifweigh,
  2469. tw.f_ifpledge,
  2470. tw.f_ifdamage,
  2471. tw.f_bankcorpid,
  2472. tw.f_billtype,
  2473. tw.f_billstatus,
  2474. tw.f_items_status,
  2475. tw.del_flag,
  2476. tw.create_by,
  2477. tw.create_time,
  2478. tw.update_by,
  2479. tw.update_time,
  2480. tw.remark,
  2481. tw.f_billing_deadline,
  2482. tw.f_product_name,
  2483. tw.f_review_date,
  2484. tw.f_truckno,
  2485. tw.f_driver_name,
  2486. tw.f_driver_tel,
  2487. tw.f_driver_id_car,
  2488. tw.f_business_type,
  2489. tw.f_labour,
  2490. tw.f_fleet,
  2491. tw.f_inwarehouseid,
  2492. tw.f_bstime,
  2493. tw.f_cartype,
  2494. tw.f_goodsid,
  2495. tw.f_new_trademodeid,
  2496. tw.f_loadportid,
  2497. address.f_name loadportidName,
  2498. tw.f_destportid,
  2499. ta.f_name destportidName,
  2500. tw.f_serviceitems,
  2501. sd.dict_label serviceitemsName,
  2502. tw.f_invoceobj,
  2503. sdi.dict_label invoceobjName,
  2504. tw.f_sign,
  2505. sdc.dict_label signName,
  2506. tw.f_detentioncargo,
  2507. sdt.dict_label detentioncargoName,
  2508. tw.f_booksmarks,
  2509. tw.f_shippername,
  2510. tw.f_shipperattn,
  2511. tw.f_shippertel,
  2512. tw.f_consigneername,
  2513. tw.f_consigneeattn,
  2514. tw.f_consigneetel,
  2515. tw.f_insurance,
  2516. sdd.dict_label insuranceName,
  2517. tw.f_insuranceamt,
  2518. tw.f_closedate,
  2519. tw.f_docmentdate,
  2520. tw.f_vslid,
  2521. tv.f_name vslidName,
  2522. tw.f_voyid,
  2523. ty.f_no voyidName,
  2524. tw.f_typeid,
  2525. tw.f_paymode,
  2526. sda.dict_label paymodeName,
  2527. tw.f_laneid,
  2528. tr.f_name laneidName,
  2529. tw.f_updete_status,
  2530. tw.f_submit_update,
  2531. tw.f_delete_status,
  2532. tw.f_cargo_planning,
  2533. tw.f_arrival_status,
  2534. tw.f_dismount_status,
  2535. tw.f_serviceitems_new,
  2536. tw.f_receivable,
  2537. tw.f_recycle,
  2538. tw.f_due,
  2539. tw.f_pay,
  2540. CASE
  2541. WHEN tw.f_carego_status = '0' THEN '录入'
  2542. WHEN tw.f_carego_status = '1' THEN '未放货'
  2543. WHEN tw.f_carego_status = '2' THEN '放货'
  2544. WHEN tw.f_carego_status = '3' THEN '扣货'
  2545. END AS fCaregoStatus
  2546. FROM t_warehousebills tw
  2547. LEFT JOIN t_address address ON address.f_id = tw.f_loadportid
  2548. LEFT JOIN t_address ta ON ta.f_id = tw.f_loadportid
  2549. LEFT JOIN t_address tr ON tr.f_id = tw.f_laneid
  2550. LEFT JOIN t_corps tc ON tc.f_id = tw.f_corpid
  2551. LEFT JOIN sys_dict_data sd ON sd.dict_value = tw.f_serviceitems
  2552. AND sd.dict_type = 'f_serviceitems'
  2553. LEFT JOIN sys_dict_data sdi ON sdi.dict_value = tw.f_invoceobj
  2554. AND sdi.dict_type = 'f_invoceobj'
  2555. LEFT JOIN sys_dict_data sdc ON sdc.dict_value = tw.f_sign
  2556. AND sdc.dict_type = 'f_sign'
  2557. LEFT JOIN sys_dict_data sdt ON sdt.dict_value = tw.f_detentioncargo
  2558. AND sdt.dict_type = 'f_detentioncargo'
  2559. LEFT JOIN sys_dict_data sdd ON sdd.dict_value = tw.f_insurance
  2560. AND sdd.dict_type = 'f_insurance'
  2561. LEFT JOIN sys_dict_data sda ON sda.dict_value = tw.f_paymode
  2562. AND sda.dict_type = 'f_paymode'
  2563. LEFT JOIN t_vessel tv ON tv.f_id = tw.f_vslid
  2564. LEFT JOIN t_voyage ty ON ty.f_id = tw.f_voyid
  2565. where 1= 1
  2566. <if test="fMblno != null and fMblno != ''">and tw.f_mblno = #{fMblno} </if>
  2567. <if test="fId != null ">and tw.f_id = #{fId} </if>
  2568. </select>
  2569. <select id="selectTWarehousebillsfMblno" parameterType="TWarehousebills" resultMap="TWarehousebillsResult">
  2570. SELECT
  2571. f_id,
  2572. f_mblno
  2573. FROM
  2574. t_warehousebills
  2575. WHERE
  2576. f_typeid = '1'
  2577. and del_flag = '0'
  2578. and f_mblno = #{fMblno}
  2579. </select>
  2580. <select id="selectAppStockList" parameterType="TWarehousebills" resultType="Map">
  2581. SELECT DISTINCT
  2582. w.f_id fId,
  2583. w.f_corpid fCorpid,
  2584. c.f_name corpName,
  2585. w.f_shipper fShipper,
  2586. w.f_bsdate fBsdate,
  2587. g.f_name goodsName,
  2588. w.f_mblno fMblno,
  2589. w.f_qty fQty,
  2590. w.f_cntval fCntval,
  2591. w.f_planqty fPlanqty,
  2592. t.f_name fWarehouseName,
  2593. w.f_planvolumn fPlanvolumn,
  2594. w.f_plannetweight fPlannetweight,
  2595. w.f_plangrossweight fPlangrossweight,
  2596. IFNULL(ROUND(w.f_grossweight/1000,2),0) fGrossweight,
  2597. w.f_grossweight fGrossweights,
  2598. w.f_storekeeper fStorekeeper,
  2599. w.create_by createBy,
  2600. w.f_warehouseid fWarehouseid,
  2601. w.f_driver_tel fDriverTel,
  2602. w.f_trademodeid fTrademodeid,
  2603. w.f_product_name fProductName,
  2604. CASE
  2605. WHEN w.f_billtype = 'SJRK'
  2606. AND w.f_items_status = '1' THEN
  2607. '计划'
  2608. WHEN w.f_billtype = 'SJRK'
  2609. AND w.f_items_status = '2' THEN
  2610. '待入库'
  2611. WHEN w.f_billtype = 'SJRK'
  2612. AND w.f_items_status = '3' THEN
  2613. '入库中'
  2614. WHEN w.f_billtype = 'SJRK'
  2615. AND w.f_items_status = '4' THEN
  2616. '已入库'
  2617. WHEN w.f_billtype = 'SJCK'
  2618. AND w.f_items_status = '1' THEN
  2619. '计划'
  2620. WHEN w.f_billtype = 'SJCK'
  2621. AND w.f_items_status = '2' THEN
  2622. '待出库'
  2623. WHEN w.f_billtype = 'SJCK'
  2624. AND w.f_items_status = '3' THEN
  2625. '出库中'
  2626. WHEN w.f_billtype = 'SJCK'
  2627. AND w.f_items_status = '4' THEN
  2628. '已出库'
  2629. WHEN w.f_billtype = 'CKDB'
  2630. AND w.f_items_status = '1' THEN
  2631. '计划'
  2632. WHEN w.f_billtype = 'CKDB'
  2633. AND w.f_items_status = '2' THEN
  2634. '待调拨'
  2635. WHEN w.f_billtype = 'CKDB'
  2636. AND w.f_items_status = '3' THEN
  2637. '调拨中'
  2638. WHEN w.f_billtype = 'CKDB'
  2639. AND w.f_items_status = '4' THEN
  2640. '已调拨'
  2641. WHEN w.f_billtype = 'HWTG'
  2642. AND w.f_items_status = '1' THEN
  2643. '计划'
  2644. WHEN w.f_billtype = 'HWTG'
  2645. AND w.f_items_status = '2' THEN
  2646. '待调拨'
  2647. WHEN w.f_billtype = 'HWTG'
  2648. AND w.f_items_status = '3' THEN
  2649. '调拨中'
  2650. WHEN w.f_billtype = 'HWTG'
  2651. AND w.f_items_status = '4' THEN
  2652. '已调拨'
  2653. END AS fBillstatus
  2654. FROM
  2655. t_warehousebills w
  2656. LEFT JOIN t_corps c ON c.f_id = w.f_corpid
  2657. LEFT JOIN t_goods g ON g.f_id = w.f_goodsid
  2658. LEFT JOIN t_warehouse t ON t.f_id = w.f_warehouseid
  2659. left join sys_user u on w.create_by = u.user_name
  2660. left join sys_user u1 on w.f_storekeeper = u1.user_name
  2661. left join sys_dept d on w.f_bsdeptid = d.dept_id
  2662. where
  2663. w.f_billtype = #{fBilltype}
  2664. AND w.f_billstatus != 6
  2665. <if test="fItemsStatus == null and timeInterval == null and fMblno == null">
  2666. and IF( w.f_planqty IS NOT NULL, w.f_planqty != w.f_qty, w.f_id != '')
  2667. </if>
  2668. <if test="fCorpid != null and fCorpid != ''">and w.f_corpid = #{fCorpid}</if>
  2669. <if test="fShipper != null and fShipper != ''">and w.f_shipper like concat('%', #{fShipper}, '%')</if>
  2670. <if test="fMblno != null ">and w.f_mblno like concat('%', #{fMblno}, '%')</if>
  2671. <if test="fItemsStatus != null ">and w.f_items_status = #{fItemsStatus}</if>
  2672. <if test="fBillstatus != null ">and w.f_billstatus = #{fBillstatus}</if>
  2673. <if test='timeInterval != null and timeInterval[0] != null and timeInterval[0]!= ""'>
  2674. and w.f_bsdate &gt;= #{timeInterval[0]}
  2675. </if>
  2676. <if test='timeInterval != null and timeInterval[1] != null and timeInterval[1]!= ""'>
  2677. and w.f_bsdate &lt;= #{timeInterval[1]}
  2678. </if>
  2679. <if test="external != null and external != ''">
  2680. and w.f_corpid = (select f_pid from t_customer_contact where f_tel = #{external})
  2681. </if>
  2682. <if test="external == null or external == ''">${params.dataScope}</if>
  2683. order by w.f_id desc
  2684. </select>
  2685. <select id="selectWarehouseItemListById" resultType="java.util.Map">
  2686. SELECT
  2687. t.f_id fId,
  2688. t.f_pid fPid,
  2689. w.f_shipper fShipper,
  2690. c.f_name corpName,
  2691. t.f_bsdate fBsdate,
  2692. g.f_name goodsName,
  2693. t.f_mblno fMblno,
  2694. t.f_warehouse_information fWarehouseInformation,
  2695. t.f_forkliftman fForkliftman,
  2696. t.f_truckno fTruckno,
  2697. t.f_cntrno fCntrno,
  2698. cntr.f_name cntrtypes,
  2699. t.f_cntrtype fCntrtype,
  2700. t.f_qty fQty,
  2701. IFNULL(ROUND(w.f_grossweight/1000,2),0) fGrossweight,
  2702. t.f_grossweight fGrossweights,
  2703. t.f_cntqty fCntqty,
  2704. fleet.f_name fleetName,
  2705. t.f_driver_name fDriverName,
  2706. t.f_driver_tel fDriverTel,
  2707. CASE
  2708. WHEN t.f_billstatus = '10' THEN
  2709. '计划'
  2710. WHEN t.f_billstatus = '20' THEN
  2711. IF(w.f_billtype = 'SJRK', '待入库', IF(w.f_billtype = 'SJCK','待出库', IF(w.f_billtype = 'CKDB', '待调拨',IF(w.f_billtype = 'HWTG', '待通关', IF(w.f_billtype = 'HQZY', '待转移', '无')))))
  2712. WHEN t.f_billstatus = '30' THEN
  2713. IF(w.f_billtype = 'SJRK', '入库中', IF(w.f_billtype = 'SJCK','出库中', IF(w.f_billtype = 'CKDB', '调拨中',IF(w.f_billtype = 'HWTG', '通关中', IF(w.f_billtype = 'HQZY', '转移中', '无')))))
  2714. WHEN t.f_billstatus = '40' THEN
  2715. IF(w.f_billtype = 'SJRK', '已入库', IF(w.f_billtype = 'SJCK','已出库', IF(w.f_billtype = 'CKDB', '已调拨',IF(w.f_billtype = 'HWTG', '已通关', IF(w.f_billtype = 'HQZY', '已转移', '无')))))
  2716. END fBillstatus
  2717. FROM
  2718. t_warehousebills w
  2719. LEFT JOIN t_warehousebillsitems t ON t.f_pid = w.f_id
  2720. LEFT JOIN t_corps fleet ON fleet.f_id = t.f_fleet
  2721. LEFT JOIN t_corps c ON c.f_id = w.f_corpid
  2722. LEFT JOIN t_goods g ON g.f_id = t.f_goodsid
  2723. LEFT JOIN t_cntr cntr ON cntr.f_id = t.f_cntrtype
  2724. where
  2725. t.f_pid = #{fId}
  2726. </select>
  2727. <select id="selectSingleAnalysis" parameterType="com.ruoyi.reportManagement.domain.SingleAnalysisExcel" resultType="com.ruoyi.reportManagement.domain.SingleAnalysisExcel">
  2728. SELECT
  2729. DISTINCT
  2730. c.f_name corpName,
  2731. #{fMblno} fMblno,
  2732. w.f_product_name goodsName,
  2733. d.dict_label fBusinessType,
  2734. w.f_cntval fCntval,
  2735. IF(item.f_billtype = 'SJRK' || item.f_billtype = 'HQZY' AND w.f_tocorpid = #{fCorpid} || item.f_billtype = 'CKDB', date_format( item.f_bsdate, '%Y-%m-%d' ), NULL) inBsdate,
  2736. IF(item.f_billtype = 'SJRK' || item.f_billtype = 'HQZY' AND w.f_tocorpid = #{fCorpid} || item.f_billtype = 'CKDB' AND ware.f_id = item.f_transfer_warehouselocid, item.f_qty, 0) inQty,
  2737. IF(item.f_billtype = 'SJRK' || item.f_billtype = 'HQZY' AND w.f_corpid = #{fCorpid} || item.f_billtype = 'CKDB' AND ware.f_id = item.f_transfer_warehouselocid, item.f_grossweight, 0.00) inGrossweight,
  2738. IF(item.f_billtype = 'SJCK' || item.f_billtype = 'HQZY' AND w.f_corpid = #{fCorpid}, date_format( item.f_bsdate, '%Y-%m-%d' ), NULL ) outBsdate,
  2739. IF( item.f_billtype = 'SJCK' || item.f_billtype = 'HQZY' AND w.f_corpid = #{fCorpid}, item.f_qty, 0 ) outQty,
  2740. IF( item.f_billtype = 'SJCK' || item.f_billtype = 'HQZY' AND w.f_corpid = #{fCorpid}, item.f_grossweight, 0.00 ) outGrossweight,
  2741. CASE
  2742. WHEN item.f_billtype = 'SJRK' THEN
  2743. '入库'
  2744. WHEN item.f_billtype = 'SJCK' THEN
  2745. '出库'
  2746. WHEN item.f_billtype = 'CKDB' and ware.f_charg = 1 THEN
  2747. '调拨'
  2748. WHEN item.f_billtype = 'HQZY' THEN
  2749. '货权转移'
  2750. WHEN item.f_billtype = 'HWTG' THEN
  2751. '货物通关'
  2752. END AS fBilltype,
  2753. 0 fQtyblc,
  2754. 0 fGrossweightblc,
  2755. item.f_truckno fTruckno,
  2756. tf.f_billing_days fBillingDays,
  2757. tf.f_amt fAmt,
  2758. item.remark
  2759. FROM
  2760. t_warehousebills w
  2761. LEFT JOIN t_warehousebillsitems item ON item.f_pid = w.f_id
  2762. LEFT JOIN t_warehousebillsfees tf ON item.f_id = tf.src_id
  2763. LEFT JOIN t_corps c ON c.f_id = w.f_corpid
  2764. LEFT JOIN t_warehouse ware ON IF(item.f_billtype = 'CKDB', ware.f_id = item.f_transfer_warehouselocid, ware.f_id = item.f_warehouselocid)
  2765. LEFT JOIN sys_dict_data d ON d.dict_value = w.f_business_type
  2766. WHERE
  2767. w.f_corpid = #{fCorpid}
  2768. AND item.f_mblno = #{fMblno}
  2769. AND IF(item.f_billtype = 'CKDB' and ware.f_charg = 0, w.f_id = '', w.f_id != '')
  2770. AND IF( item.f_billtype = 'SJRK', d.dict_type = 'st_in_type', IF(item.f_billtype = 'SJCK', d.dict_type = 'st_out_type', d.dict_type = 'st_trans_type'))
  2771. <if test='bsdateList != null and bsdateList[0] != null and bsdateList[0]!= ""'>
  2772. AND item.f_bsdate &gt;= #{bsdateList[0]}
  2773. </if>
  2774. <if test='bsdateList != null and bsdateList[1] != null and bsdateList[1]!= ""'>
  2775. AND item.f_bsdate &lt;= #{bsdateList[1]}
  2776. </if>
  2777. order by item.f_bsdate asc
  2778. </select>
  2779. <select id="selectSingleAnalysisFees" parameterType="com.ruoyi.reportManagement.domain.SingleAnalysisFeesExcel" resultType="com.ruoyi.reportManagement.domain.SingleAnalysisFeesExcel">
  2780. SELECT
  2781. DISTINCT
  2782. f.f_id,
  2783. date_format( f.create_time, '%Y-%m-%d' ) createTime,
  2784. d.dict_label fBusinessType,
  2785. fee.f_name fFeeid,
  2786. f.f_qty fQty,
  2787. f.f_unitprice fUnitprice,
  2788. f.f_amount fAmount,
  2789. f.remark
  2790. FROM
  2791. t_warehousebills w
  2792. LEFT JOIN t_warehousebillsitems item ON item.f_pid = w.f_id
  2793. LEFT JOIN t_warehousebillsfees f ON f.f_pid = w.f_id
  2794. LEFT JOIN t_fees fee ON fee.f_id = f.f_feeid
  2795. LEFT JOIN t_warehouse ware ON IF(item.f_billtype = 'CKDB', ware.f_id = item.f_transfer_warehouselocid, ware.f_id = item.f_warehouselocid)
  2796. LEFT JOIN sys_dict_data d ON d.dict_value = f.f_business_type
  2797. WHERE
  2798. item.f_mblno = #{fMblno}
  2799. AND IF(item.f_billtype = 'CKDB' and ware.f_charg = 0, w.f_id = '', w.f_id != '')
  2800. AND IF( item.f_billtype = 'SJRK', d.dict_type = 'st_in_type', IF(item.f_billtype = 'SJCK', d.dict_type = 'st_out_type', d.dict_type = 'st_trans_type'))
  2801. <if test='bsdateList != null and bsdateList[0] != null and bsdateList[0]!= ""'>
  2802. AND item.f_bsdate &gt;= #{bsdateList[0]}
  2803. </if>
  2804. <if test='bsdateList != null and bsdateList[1] != null and bsdateList[1]!= ""'>
  2805. AND item.f_bsdate &lt;= #{bsdateList[1]}
  2806. </if>
  2807. order by f.create_time asc
  2808. </select>
  2809. <!--凯和导出清单根据船名航次-->
  2810. <select id="deriveInventory" parameterType="TWarehousebills" resultType="com.ruoyi.shipping.excel.DeriveInventoryExcel">
  2811. SELECT
  2812. @rank:=@rank + 1 AS rankNo,
  2813. a.*
  2814. FROM
  2815. (
  2816. SELECT
  2817. tw.f_mblno AS fMblno, /*提单号*/
  2818. twc.f_cntrno AS fCntrno, /*箱号*/
  2819. twc.f_sealno AS fSealno, /*铅封号*/
  2820. substring(tr.f_no,1,2) AS measure, /*尺寸*/
  2821. substring(tr.f_no,3,2) AS genre, /*类型*/
  2822. twc.f_cntrweight AS fCntrweight, /*重量*/
  2823. CASE
  2824. WHEN tcr.f_soc = '0' THEN tc.f_name
  2825. WHEN tcr.f_soc = '1' THEN '凯和志诚'
  2826. END AS boxCompany,/*箱公司最新*/
  2827. pro.dict_label AS boxCompanyOld, /*箱公司旧*/
  2828. td.f_name AS portOfDeparture, /*始发港*/
  2829. ts.f_name AS destinationPort, /*目的港*/
  2830. tg.f_name AS goodName, /*货名*/
  2831. concat_ws('-', sd.dict_label, tk.dict_label) AS transitClause, /*运输条款*/
  2832. tc.f_name AS bookingCompany, /*订舱公司*/
  2833. tw.f_consigneername AS fConsigneername, /*收货公司名称*/
  2834. tw.f_consigneeattn AS fConsigneeattn, /*收货公司地址*/
  2835. tw.f_consigneetel AS fConsigneetel /*收货公司电话*/
  2836. FROM
  2837. t_warehousebills_cntritems twc
  2838. LEFT JOIN t_warehousebills tw ON twc.f_pid = tw.f_id
  2839. LEFT JOIN t_warehousebills_cntr tcr ON tcr.f_pid = tw.f_id
  2840. LEFT JOIN t_corps tc ON tc.f_id = tw.f_corpid
  2841. LEFT JOIN t_cntr tr ON tr.f_id = twc.f_cntrid
  2842. LEFT JOIN t_cntrno tro ON tro.f_no = twc.f_cntrno
  2843. LEFT JOIN sys_dict_data pro ON pro.dict_value = tro.f_owner AND pro.dict_type = 'f_owner'
  2844. LEFT JOIN t_address td ON td.f_id = tw.f_loadportid
  2845. LEFT JOIN t_address ts ON ts.f_id = tw.f_destportid
  2846. LEFT JOIN t_goods tg ON tg.f_id = tcr.f_goodsid
  2847. LEFT JOIN sys_dict_data sd ON sd.dict_value = tw.f_serviceitems AND sd.dict_type = 'f_serviceitems'
  2848. LEFT JOIN sys_dict_data tk ON tk.dict_value = tw.f_serviceitems_new AND tk.dict_type = 'f_serviceitems'
  2849. <where>
  2850. tw.f_typeid = '1'
  2851. and tw.del_flag = '0'
  2852. <if test="fBillno != null and fBillno != ''">and tw.f_billno = #{fBillno}</if>
  2853. <if test="fCntrid != null ">and tcr.f_cntrid = #{fCntrid}</if>
  2854. <if test="fCntrcount != null ">and tc.f_cntrcount = #{fCntrcount}</if>
  2855. <if test="fMblno != null and fMblno != ''">and tw.f_mblno = #{fMblno}</if>
  2856. <if test="fVslid != null ">and tw.f_vslid = #{fVslid}</if>
  2857. <if test="fVoyid != null ">and tw.f_voyid = #{fVoyid}</if>
  2858. <if test="fServiceitems != null and fServiceitems != ''">and tw.f_serviceitems = #{fServiceitems}</if>
  2859. <if test="fConsigneername != null and fConsigneername != ''">and tw.f_consigneername like concat('%',
  2860. #{fConsigneername}, '%')
  2861. </if>
  2862. <if test='cLoadDate != null and cLoadDate[0] != null and cLoadDate[0]!= ""'>
  2863. and tw.create_time &gt;= #{cLoadDate[0]}
  2864. </if>
  2865. <if test='cLoadDate != null and cLoadDate[1] != null and cLoadDate[1]!= ""'>
  2866. and tw.create_time &lt;= #{cLoadDate[1]}
  2867. </if>
  2868. <if test="fCargoPlanning != null "> and tw.f_cargo_planning = #{fCargoPlanning}</if>
  2869. <if test="fArrivalStatus != null "> and tw.f_arrival_status = #{fArrivalStatus}</if>
  2870. </where>
  2871. ORDER BY tw.f_mblno,twc.f_cntrno
  2872. )a,
  2873. (SELECT @rank:= 0) b
  2874. </select>
  2875. <!--凯和导出清单根据船名航次-->
  2876. <select id="voyageDetails" parameterType="TWarehousebills" resultType="map">
  2877. SELECT
  2878. @rank:=@rank + 1 AS rankNo,
  2879. a.*
  2880. FROM
  2881. (
  2882. SELECT DISTINCT
  2883. tw.f_id fId,
  2884. tw.f_mblno fMblno,
  2885. ty.f_no voyNo,
  2886. tc.f_no fCntrno,
  2887. tc.f_cntrcount fCntrcount,
  2888. tre.f_name loadportName,
  2889. ts.f_name destportName,
  2890. sd.dict_label fLoadportMode,
  2891. tk.dict_label fDestportMode,
  2892. tc.f_name goodsName,
  2893. date_format(ty.f_ETD, '%Y-%m-%d') fEtd,
  2894. date_format(ty.f_ETA, '%Y-%m-%d') fEta,
  2895. tcp.f_name corpName,
  2896. tw.f_shippername fShippername,
  2897. tw.f_consigneername fConsigneername,
  2898. tw.f_consigneeattn fConsigneeattn,
  2899. tw.f_consigneetel fConsigneetel
  2900. FROM
  2901. t_warehousebills tw
  2902. LEFT JOIN t_corps tcp ON tcp.f_id = tw.f_corpid
  2903. LEFT JOIN t_address tre ON tre.f_id = tw.f_loadportid
  2904. LEFT JOIN t_address ts ON ts.f_id = tw.f_destportid
  2905. LEFT JOIN sys_dict_data sd ON sd.dict_value = tw.f_serviceitems AND sd.dict_type = 'f_serviceitems'
  2906. LEFT JOIN sys_dict_data tk ON tk.dict_value = tw.f_serviceitems_new AND tk.dict_type = 'f_serviceitems'
  2907. <if test="fCntrno != null and fCntrno != ''">
  2908. LEFT JOIN t_warehousebills_cntritems items ON tw.f_id = items.f_pid
  2909. </if>
  2910. LEFT JOIN t_voyage ty ON tw.f_voyid = ty.f_id
  2911. LEFT JOIN (
  2912. SELECT
  2913. th.f_pid,
  2914. th.f_cntrcount,
  2915. tr.f_no,
  2916. th.f_cntrid,
  2917. tg.f_name
  2918. FROM
  2919. t_warehousebills_cntr th
  2920. LEFT JOIN t_cntr tr ON th.f_cntrid = tr.f_id
  2921. LEFT JOIN t_goods tg ON th.f_goodsid = tg.f_id
  2922. ) tc ON tc.f_pid = tw.f_id
  2923. <where>
  2924. tw.f_typeid = '1'
  2925. and tw.del_flag = '0'
  2926. <if test="fCntrno != null and fCntrno != ''">and items.f_cntrno like concat('%', #{fCntrno}, '%')</if>
  2927. <if test="fCorpid != null ">and tw.f_corpid = #{fCorpid}</if>
  2928. <if test="fMblno != null and fMblno != ''">and tw.f_mblno like concat('%', #{fMblno}, '%')</if>
  2929. <if test="fLoadportid != null ">and tw.f_loadportid = #{fLoadportid}</if>
  2930. <if test="fDestportid != null ">and tw.f_destportid = #{fDestportid}</if>
  2931. <if test="fVslid != null ">and tw.f_vslid = #{fVslid}</if>
  2932. <if test="fVoyid != null ">and tw.f_voyid = #{fVoyid}</if>
  2933. <if test="createBy != null and createBy != ''">and tw.create_by = #{createBy}</if>
  2934. <if test='cLoadDate != null and cLoadDate[0] != null and cLoadDate[0]!= ""'>
  2935. and tw.create_time &gt;= #{cLoadDate[0]}
  2936. </if>
  2937. <if test='cLoadDate != null and cLoadDate[1] != null and cLoadDate[1]!= ""'>
  2938. and tw.create_time &lt;= #{cLoadDate[1]}
  2939. </if>
  2940. <if test='timeInterval != null and timeInterval[0] != null and timeInterval[0]!= ""'>
  2941. and ty.f_ATD &gt;= #{timeInterval[0]}
  2942. </if>
  2943. <if test='timeInterval != null and timeInterval[1] != null and timeInterval[1]!= ""'>
  2944. and ty.f_ATD &lt;= #{timeInterval[1]}
  2945. </if>
  2946. </where>
  2947. ORDER BY tw.create_time DESC, tw.f_id DESC
  2948. ) a,
  2949. (SELECT @rank:= 0) b
  2950. </select>
  2951. <select id="selectTWarehousebillsByIds" parameterType="String" resultMap="TWarehousebillsResult">
  2952. select f_id,f_vslid, f_voyid,f_arrival_status,f_billno,f_cargo_planning from t_warehousebills
  2953. where f_id in
  2954. <foreach item="fId" collection="array" open="(" separator="," close=")">
  2955. #{fId}
  2956. </foreach>
  2957. </select>
  2958. <update id="updateTWarehousebillsByIds">
  2959. update
  2960. t_warehousebills
  2961. <trim prefix="SET" suffixOverrides=",">
  2962. <if test="fVessel != null">f_vslid = #{fVessel},</if>
  2963. <if test="fVoyage != null">f_voyid = #{fVoyage},</if>
  2964. <if test="fCargoPlanning != null">f_cargo_planning = #{fCargoPlanning},</if>
  2965. <if test="fLoadportid != null">f_loadportid = #{fLoadportid},</if>
  2966. <if test="fDestportid != null">f_destportid = #{fDestportid},</if>
  2967. <if test="fLaneid != null">f_laneid = #{fLaneid},</if>
  2968. </trim>
  2969. where f_id in
  2970. <foreach item="fId" collection="fIds" open="(" separator="," close=")">
  2971. #{fId}
  2972. </foreach>
  2973. </update>
  2974. <!--凯和单航次配船-->
  2975. <select id="singleVoyageByShip" parameterType="TWarehousebills" resultType="com.ruoyi.shipping.excel.SingleVoyageByShipExcel">
  2976. SELECT
  2977. tv.f_name vslName,
  2978. ty.f_no voyNo,
  2979. ty.f_ATD fAtd,
  2980. ty.f_ATA fAta,
  2981. ta.f_name fName,
  2982. tre.f_name loadportName,
  2983. ts.f_name destportName,
  2984. tw.f_vslid fVslid,
  2985. tw.f_voyid fVoyid,
  2986. tw.f_arrival_status fArrivalStatus
  2987. FROM
  2988. t_warehousebills tw
  2989. LEFT JOIN sys_dict_data sd ON sd.dict_value = tw.f_serviceitems
  2990. AND sd.dict_type = 'f_serviceitems'
  2991. LEFT JOIN t_vessel tv ON tw.f_vslid = tv.f_id
  2992. LEFT JOIN t_voyage ty ON tw.f_voyid = ty.f_id
  2993. LEFT JOIN t_address ta ON ta.f_id = ty.f_laneid
  2994. LEFT JOIN t_address tre ON tre.f_id = ty.f_portofloadid
  2995. LEFT JOIN t_address ts ON ts.f_id = ty.f_distinationid
  2996. LEFT JOIN t_corps tp ON tw.f_corpid = tp.f_id
  2997. LEFT JOIN (
  2998. SELECT
  2999. th.f_pid,
  3000. th.f_cntrcount,
  3001. tr.f_no,
  3002. th.f_cntrid,
  3003. tg.f_name
  3004. FROM
  3005. t_warehousebills_cntr th
  3006. LEFT JOIN t_cntr tr ON th.f_cntrid = tr.f_id
  3007. LEFT JOIN t_goods tg ON th.f_goodsid = tg.f_id
  3008. ) tc ON tc.f_pid = tw.f_id
  3009. LEFT JOIN (SELECT f_pid,f_billstatus FROM t_warehousebillsfees GROUP BY f_pid,f_billstatus)tf ON tf.f_pid = tw.f_id
  3010. where
  3011. tw.f_typeid = '1'
  3012. and tw.del_flag = '0'
  3013. and tw.f_cargo_planning = '0'
  3014. and tw.f_arrival_status != '2'
  3015. <if test="fVslid != null ">and tw.f_vslid = #{fVslid}</if>
  3016. <if test="fVoyid != null ">and tw.f_voyid = #{fVoyid}</if>
  3017. GROUP BY tw.f_vslid,tw.f_voyid
  3018. </select>
  3019. <select id="selectByItemId" resultMap="TWarehousebillsResult">
  3020. SELECT
  3021. w.f_id,
  3022. w.f_billno,
  3023. w.is_calculate_storage_fees
  3024. FROM
  3025. t_warehousebills w
  3026. LEFT JOIN t_warehousebillsitems i ON i.f_pid = w.f_id
  3027. where i.f_id = #{id}
  3028. </select>
  3029. <select id="selectByMblnoOrCntrnoCount" resultType="int">
  3030. SELECT COUNT(DISTINCT w.f_id) FROM
  3031. t_warehousebills w
  3032. LEFT JOIN t_warehousebillsitems item ON item.f_pid = w.f_id
  3033. <where>
  3034. w.f_mblno = #{dto.fMblno}
  3035. and w.f_bsdate = #{dto.fBsdate}
  3036. <if test="dto.fCntrno != null ">and item.f_cntrno = #{dto.fCntrno}</if>
  3037. </where>
  3038. </select>
  3039. <select id="selectWhgenlegDetailById" resultMap="WarehousebillsVOResult">
  3040. SELECT w.f_id, w.f_mblno, w.f_bsdate, SUM( item.f_qty ) f_qty, SUM( item.f_grossweight ) f_grossweight,
  3041. SUM( item.f_netweight ) f_netweight, w.f_billtype
  3042. FROM
  3043. t_whgenleg leg
  3044. LEFT JOIN t_warehousebills w ON w.f_corpid = leg.f_corpid
  3045. AND leg.f_trademodeid = w.f_trademodeid
  3046. LEFT JOIN t_warehousebillsitems item ON item.f_pid = w.f_id
  3047. AND item.f_marks = leg.f_marks
  3048. AND item.f_business_type = leg.f_business_type
  3049. AND item.f_originalbilldate = leg.f_bsdate
  3050. AND item.f_warehouselocid = leg.f_warehouse_locationid
  3051. AND item.f_goodsid = leg.f_goodsid
  3052. WHERE
  3053. leg.f_id = #{id}
  3054. AND w.f_billtype IN ( 'SJRK', 'SJCK' )
  3055. AND item.f_billstatus = 40
  3056. AND IF ( w.f_billtype = 'SJCK', item.f_mblno = leg.f_mblno, leg.f_mblno = w.f_mblno )
  3057. GROUP BY
  3058. w.f_id
  3059. </select>
  3060. <select id="selecStorageFeeList" resultType="Map">
  3061. SELECT DISTINCT w.f_id AS fId, w.f_billno AS fBillno, corp.f_name AS fCorpid, w.f_billing_deadline AS fBillingDeadline, w.remark,
  3062. w.f_billstatus AS fBillstatus, w.create_by AS createBy, w.create_time AS createTime, w.f_fee_status fFeeStatus
  3063. FROM t_warehousebills w LEFT JOIN t_warehousebillsitems item ON item.f_pid = w.f_id
  3064. LEFT JOIN t_corps corp ON corp.f_id = w.f_corpid
  3065. left join sys_user u on w.create_by = u.user_name
  3066. left join sys_user u1 on w.f_storekeeper = u1.user_name
  3067. left join sys_dept d on w.f_bsdeptid = d.dept_id
  3068. <where>
  3069. w.f_billtype = 'JSCCF'
  3070. <if test="fFeeStatus != null and fFeeStatus != ''">and w.f_fee_status = #{fFeeStatus}</if>
  3071. <if test="fBillstatus != null and fBillstatus != ''">and w.f_billstatus = #{fBillstatus}</if>
  3072. <if test="fMarks != null and fMarks != ''">and w.f_marks = #{fMarks}</if>
  3073. <if test="createBy != null and createBy != ''">and w.create_by = #{createBy}</if>
  3074. <if test='timeInterval2 != null and timeInterval2[0] != null and timeInterval2[1]!= ""'>
  3075. and w.f_billing_deadline BETWEEN #{timeInterval2[0]} AND #{timeInterval2[1]}
  3076. </if>
  3077. <if test="fBillno != null and fBillno != ''">and w.f_billno like concat('%', #{fBillno}, '%')</if>
  3078. <if test="fMblno != null and fMblno != ''">and w.f_mblno like concat('%', #{fMblno}, '%')</if>
  3079. <if test="fCorpid != null and fCorpid != ''">and w.f_corpid = #{fCorpid}</if>
  3080. </where>
  3081. ${params.dataScope}
  3082. ORDER BY w.f_bsdate DESC, w.f_bstime DESC,w.f_id DESC,w.f_billstatus
  3083. </select>
  3084. <select id="inAndOutStockList" resultType="map">
  3085. select
  3086. tb.f_mblno as fMblno,
  3087. tg.f_name as goodsName,
  3088. tb.f_marks as fMarks,
  3089. tb.f_bsdate as fBsdate,
  3090. tb.f_planqty as fPlanqty,
  3091. case tb.f_billtype when 'SJRK' then '入库' when 'SJCK' then '出库' end as fBilltype,
  3092. case
  3093. when tb.f_billtype = 'SJRK' and tb.f_items_status = '1' then '计划'
  3094. when tb.f_billtype = 'SJRK' and tb.f_items_status = '2' then '待入库'
  3095. when tb.f_billtype = 'SJRK' and tb.f_items_status = '3' then '入库中'
  3096. when tb.f_billtype = 'SJRK' and tb.f_items_status = '4' then '已入库'
  3097. when tb.f_billtype = 'SJCK' and tb.f_items_status = '1' then '计划'
  3098. when tb.f_billtype = 'SJCK' and tb.f_items_status = '2' then '待出库'
  3099. when tb.f_billtype = 'SJCK' and tb.f_items_status = '3' then '出库中'
  3100. when tb.f_billtype = 'SJCK' and tb.f_items_status = '4' then '已出库'
  3101. end as fBillstatus
  3102. from t_warehousebills tb
  3103. left join t_goods tg on tg.f_id = tb.f_goodsid
  3104. where
  3105. if(tb.f_planqty is not null, tb.f_planqty != tb.f_qty, tb.f_id != '')
  3106. and tb.f_billstatus != 6
  3107. and tb.f_billtype in ('SJRK', 'SJCK')
  3108. <if test="external != null and external != ''">
  3109. and tb.f_corpid = (select f_pid from t_customer_contact where f_tel = #{external})
  3110. </if>
  3111. order by tb.f_bsdate desc
  3112. </select>
  3113. <select id="getActiveCorpCount" resultType="int">
  3114. select count(fName) from (
  3115. select t1.f_bsdate as fBsdate, t3.f_name as fName
  3116. from t_warehousebillsitems t1
  3117. left join t_warehousebills t2 on t2.f_id = t1.f_pid
  3118. left join t_corps t3 on t3.f_id = t2.f_corpid
  3119. where t1.f_billtype = 'SJRK'
  3120. and t1.f_billstatus = 40
  3121. group by fName
  3122. ) temp
  3123. <where>
  3124. <if test="beginTime != null and beginTime != ''">and fBsdate &gt;= #{beginTime}</if>
  3125. <if test="endTime != null and endTime != ''">and fBsdate &lt;= #{endTime}</if>
  3126. </where>
  3127. </select>
  3128. <select id="getInactiveCorpList" resultType="com.ruoyi.warehouseBusiness.excel.CorpAnalysis">
  3129. select * from (
  3130. select t1.f_bsdate as fBsdate, t3.f_name as fName
  3131. from t_warehousebillsitems t1
  3132. left join t_warehousebills t2 on t2.f_id = t1.f_pid
  3133. left join t_corps t3 on t3.f_id = t2.f_corpid
  3134. where t1.f_billtype = 'SJRK'
  3135. and t1.f_billstatus = 40
  3136. group by fName
  3137. ) temp
  3138. <where>
  3139. <if test="beginTime != null and beginTime != ''">and fBsdate &gt;= #{beginTime}</if>
  3140. <if test="endTime != null and endTime != ''">and fBsdate &lt;= #{endTime}</if>
  3141. </where>
  3142. order by fBsdate desc
  3143. </select>
  3144. </mapper>