TWarehousebillsMapper.xml 200 KB

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