| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper
- PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
- "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.ruoyi.warehouseBusiness.mapper.TWarehouseBillsMapper">
- <resultMap type="TWarehousebills" id="TWarehousebillsResult">
- <result property="fId" column="f_id" />
- <result property="fBillno" column="f_billno" />
- <result property="fCustomsdeclartion" column="f_customsdeclartion" />
- <result property="fOriginalbillno" column="f_originalbillno" />
- <result property="fDeptid" column="f_deptid" />
- <result property="fBsdeptid" column="f_bsdeptid" />
- <result property="fContacts" column="f_contacts" />
- <result property="fTel" column="f_tel" />
- <result property="fCorpid" column="f_corpid" />
- <result property="fShipper" column="f_shipper" />
- <result property="fTocorpid" column="f_tocorpid" />
- <result property="fStltypeid" column="f_stltypeid" />
- <result property="fBscorpno" column="f_bscorpno" />
- <result property="fWarehouseid" column="f_warehouseid" />
- <result property="fStorekeeper" column="f_storekeeper" />
- <result property="fChargedate" column="f_chargedate" />
- <result property="fBsdate" column="f_bsdate" />
- <result property="fPlanqty" column="f_planqty" />
- <result property="fPlangrossweight" column="f_plangrossweight" />
- <result property="fPlannetweight" column="f_plannetweight" />
- <result property="fPlanvolumn" column="f_planvolumn" />
- <result property="fQty" column="f_qty" />
- <result property="fGrossweight" column="f_grossweight" />
- <result property="fNetweight" column="f_netweight" />
- <result property="fVolumn" column="f_volumn" />
- <result property="fTrademodeid" column="f_trademodeid" />
- <result property="fBillingway" column="f_billingway" />
- <result property="fSbu" column="f_sbu" />
- <result property="fFeetunit" column="f_feetunit" />
- <result property="fMblno" column="f_mblno" />
- <result property="fEmblno" column="f_emblno" />
- <result property="fCompany" column="f_company" />
- <result property="fVslvoy" column="f_vslvoy" />
- <result property="fEta" column="f_eta" />
- <result property="fMarks" column="f_marks" />
- <result property="fCustomno" column="f_customno" />
- <result property="fEmsSeqNo" column="f_ems_seq_no" />
- <result property="fIfweigh" column="f_ifweigh" />
- <result property="fIfpledge" column="f_ifpledge" />
- <result property="fIfdamage" column="f_ifdamage" />
- <result property="fBankcorpid" column="f_bankcorpid" />
- <result property="fBilltype" column="f_billtype" />
- <result property="fBillstatus" column="f_billstatus" />
- <result property="delFlag" column="del_flag" />
- <result property="createBy" column="create_by" />
- <result property="createTime" column="create_time" />
- <result property="fItemsStatus" column="f_items_status" />
- <result property="updateBy" column="update_by" />
- <result property="updateTime" column="update_time" />
- <result property="remark" column="remark" />
- <result property="fBillingDeadline" column="f_billing_deadline" />
- <result property="fProductName" column="f_product_name" />
- <result property="fReviewDate" column="f_review_date" />
- <result property="fTruckno" column="f_truckno" />
- <result property="fDriverName" column="f_driver_name" />
- <result property="fDriverTel" column="f_driver_tel" />
- <result property="fDriverIdCar" column="f_driver_id_car" />
- <result property="fBusinessType" column="f_business_type" />
- <result property="fLabour" column="f_labour" />
- <result property="fFleet" column="f_fleet" />
- <result property="fInwarehouseid" column="f_inwarehouseid" />
- <result property="fBstime" column="f_bstime" />
- <result property="fCartype" column="f_cartype" />
- <result property="fGoodsid" column="f_goodsid" />
- <result property="fNewTrademodeid" column="f_new_trademodeid" />
- <result property="fLoadportid" column="f_loadportid" />
- <result property="fDestportid" column="f_destportid" />
- <result property="fServiceitems" column="f_serviceitems" />
- <result property="fInvoceobj" column="f_invoceobj" />
- <result property="fSign" column="f_sign" />
- <result property="fDetentioncargo" column="f_detentioncargo" />
- <result property="fBooksmarks" column="f_booksmarks" />
- <result property="fShippername" column="f_shippername" />
- <result property="fShipperattn" column="f_shipperattn" />
- <result property="fShippertel" column="f_shippertel" />
- <result property="fConsigneername" column="f_consigneername" />
- <result property="fConsigneeattn" column="f_consigneeattn" />
- <result property="fConsigneetel" column="f_consigneetel" />
- <result property="fInsurance" column="f_insurance" />
- <result property="fInsuranceamt" column="f_insuranceamt" />
- <result property="fClosedate" column="f_closedate" />
- <result property="fDocmentdate" column="f_docmentdate" />
- <result property="fVslid" column="f_vslid" />
- <result property="fVoyid" column="f_voyid" />
- <result property="fTypeid" column="f_typeid" />
- <result property="fPaymode" column="f_paymode" />
- <result property="fLaneid" column="f_laneid" />
- <result property="fCntval" column="f_cntval" />
- <result property="freeContainerDate" column="free_container_date" />
- <result property="fBusinessAttribution" column="f_business_attribution" />
- <result property="fSupervisionUnit" column="f_supervision_unit" />
- <result property="fDeclarationElements" column="f_declaration_elements" />
- <result property="fPartNumber" column="f_part_number" />
- <result property="fIfinspection" column="f_ifinspection" />
- <result property="fValue" column="f_value" />
- <result property="fWeighingDate" column="f_weighing_date" />
- <result property="fIfsampling" column="f_ifsampling" />
- <result property="sendSampleDate" column="send_sample_date" />
- <result property="fIfweightRecovery" column="f_ifweight_recovery" />
- <result property="weightRecoveryDate" column="weight_recovery_date" />
- <result property="warehouseStatus" column="warehouse_status" />
- <result property="fTimes" column="f_times" />
- <result property="fDateChanged" column="f_date_changed"/>
- <result property="fChargetype" column="f_chargetype"/>
- <result property="fWeighWeight" column="f_weigh_weight" />
- <result property="fPredictBranch" column="f_predict_branch" />
- <result property="fGrade" column="f_grade" />
- <result property="fDeliveryDetails" column="f_delivery_details" />
- <result property="fSalesmanId" column="f_salesman_id" />
- <result property="fItemstatus" column="f_itemstatus" />
- <result property="fUpdeteStatus" column="f_updete_status"/>
- <result property="fSubmitUpdate" column="f_submit_update"/>
- <result property="fDeleteStatus" column="f_delete_status"/>
- <result property="fRemarksFees" column="f_remarks_fees" />
- <result property="fCargoPlanning" column="f_cargo_planning" />
- <result property="fArrivalStatus" column="f_arrival_status" />
- <result property="fDismountStatus" column="f_dismount_status" />
- <result property="fFeeStatus" column="f_fee_status" />
- <result property="fServiceitemsNew" column="f_serviceitems_new" />
- <result property="fReceivable" column="f_receivable" />
- <result property="fRecycle" column="f_recycle" />
- <result property="fDue" column="f_due" />
- <result property="fPay" column="f_pay" />
- <result property="fCaregoStatus" column="f_carego_status" />
- <result property="fShipTwo" column="f_ship_two" />
- <result property="fVoyTwo" column="f_voy_two" />
- <result property="pickUpPerson" column="pick_up_person" />
- <result property="pickUpTime" column="pick_up_time" />
- <result property="facilityPerson" column="facility_person" />
- <result property="facilityTime" column="facility_time" />
- <result property="isPledge" column="is_pledge" />
- <result property="documentSummary" column="document_summary" />
- <result property="financialBillType" column="financial_bill_type" />
- </resultMap>
- <resultMap type="WarehouseBillsVO" id="WarehousebillsVOResult">
- <result property="fId" column="f_id" />
- <result property="fBillno" column="f_billno" />
- <result property="fMblno" column="f_mblno" />
- <result property="fBsdate" column="f_bsdate" />
- <result property="fQty" column="f_qty" />
- <result property="fGrossweight" column="f_grossweight" />
- <result property="fNetweight" column="f_netweight" />
- <result property="fBilltype" column="f_billtype" />
- </resultMap>
- <sql id="selectTWarehousebillsVo">
- 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,
- f_warehouseid, f_storekeeper, f_chargedate, f_bsdate, f_planqty, f_plangrossweight, f_plannetweight, f_planvolumn, f_qty, f_grossweight, f_netweight,
- 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,
- 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,
- 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,
- f_loadportid, f_destportid, f_serviceitems, f_invoceobj, f_sign, f_detentioncargo, f_booksmarks, f_shippername, f_shipperattn, f_shippertel, f_consigneername,
- f_consigneeattn, f_consigneetel, f_insurance, f_insuranceamt, f_closedate, f_docmentdate, f_vslid, f_voyid, f_typeid, f_paymode, f_laneid, f_cntval,
- 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,
- f_ifsampling, send_sample_date, f_ifweight_recovery, weight_recovery_date, warehouse_status, f_times ,f_date_changed, f_chargetype,f_weigh_weight,
- 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,
- 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,
- document_summary,financial_bill_type from t_warehousebills
- </sql>
- <select id="selectTWarehousebillsList" parameterType="TWarehousebills" resultMap="TWarehousebillsResult">
- select
- ware.*
- from
- t_warehousebills ware
- left join sys_user u on ware.create_by = u.user_name
- left join sys_dept d on ware.f_bsdeptid = d.dept_id
- <where>
- ware.f_typeid IS NULL
- <if test="fBillno != null and fBillno != ''">and f_billno = #{fBillno}</if>
- <if test="fCustomsdeclartion != null and fCustomsdeclartion != ''">and f_customsdeclartion =
- #{fCustomsdeclartion}
- </if>
- <if test="fOriginalbillno != null and fOriginalbillno != ''">and f_originalbillno = #{fOriginalbillno}</if>
- <if test="fDeptid != null ">and f_deptid = #{fDeptid}</if>
- <if test="fBsdeptid != null ">and f_bsdeptid = #{fBsdeptid}</if>
- <if test="fInwarehouseid != null ">and f_inwarehouseid = #{fInwarehouseid}</if>
- <if test="fContacts != null and fContacts != ''">and f_contacts = #{fContacts}</if>
- <if test="fTel != null and fTel != ''">and f_tel = #{fTel}</if>
- <if test="fCorpid != null ">and f_corpid = #{fCorpid}</if>
- <if test="fShipper != null and fShipper != ''">and f_shipper like concat('%', #{fShipper}, '%')</if>
- <if test="fTocorpid != null ">and f_tocorpid = #{fTocorpid}</if>
- <if test="fChargedate != null ">and f_chargedate = #{fChargedate}</if>
- <if test='timeInterval != null and timeInterval[0] != null and timeInterval[0]!= ""'>
- and f_bsdate >= #{timeInterval[0]}
- </if>
- <if test='timeInterval != null and timeInterval[1] != null and timeInterval[1]!= ""'>
- and f_bsdate <= #{timeInterval[1]}
- </if>
- <if test="fStltypeid != null ">and f_stltypeid = #{fStltypeid}</if>
- <if test="fBscorpno != null and fBscorpno != ''">and f_bscorpno = #{fBscorpno}</if>
- <if test="fWarehouseid != null ">and f_warehouseid = #{fWarehouseid}</if>
- <if test="fStorekeeper != null and fStorekeeper != ''">and f_storekeeper = #{fStorekeeper}</if>
- <if test="fBsdate != null ">and f_bsdate = #{fBsdate}</if>
- <if test="fPlanqty != null ">and f_planqty = #{fPlanqty}</if>
- <if test="fProductName != null and fProductName != ''">and f_product_name like concat('%', #{fProductName},
- '%')
- </if>
- <if test="fPlangrossweight != null ">and f_plangrossweight = #{fPlangrossweight}</if>
- <if test="fPlannetweight != null ">and f_plannetweight = #{fPlannetweight}</if>
- <if test="fPlanvolumn != null ">and f_planvolumn = #{fPlanvolumn}</if>
- <if test="fQty != null ">and f_qty = #{fQty}</if>
- <if test="fMarks != null and fMarks != ''">and f_marks = #{fMarks}</if>
- <if test="fGrossweight != null ">and f_grossweight = #{fGrossweight}</if>
- <if test="fNetweight != null ">and f_netweight = #{fNetweight}</if>
- <if test="fVolumn != null ">and f_volumn = #{fVolumn}</if>
- <if test="fTrademodeid != null ">and f_trademodeid = #{fTrademodeid}</if>
- <if test="fBillingway != null ">and f_billingway = #{fBillingway}</if>
- <if test="fSbu != null ">and f_sbu = #{fSbu}</if>
- <if test="fFeetunit != null and fFeetunit != ''">and f_feetunit = #{fFeetunit}</if>
- <if test="fMblno != null and fMblno != ''">and f_mblno = #{fMblno}</if>
- <if test="fEmblno != null and fEmblno != ''">and f_emblno = #{fEmblno}</if>
- <if test="fVslvoy != null and fVslvoy != ''">and f_vslvoy = #{fVslvoy}</if>
- <if test="fEta != null ">and f_eta = #{fEta}</if>
- <if test="fCustomno != null and fCustomno != ''">and f_customno = #{fCustomno}</if>
- <if test="fIfweigh != null and fIfweigh != ''">and f_ifweigh = #{fIfweigh}</if>
- <if test="fIfpledge != null and fIfpledge != ''">and f_ifpledge = #{fIfpledge}</if>
- <if test="fIfdamage != null and fIfdamage != ''">and f_ifdamage = #{fIfdamage}</if>
- <if test="fBankcorpid != null ">and f_bankcorpid = #{fBankcorpid}</if>
- <if test="fBillingDeadline != null ">and f_billing_deadline = #{fBillingDeadline}</if>
- <if test="fBilltype != null and fBilltype != ''">and f_billtype = #{fBilltype}</if>
- <if test="fBillstatus != null and fBillstatus != ''">and f_billstatus = #{fBillstatus}</if>
- <if test="fNewTrademodeid != null ">and f_new_trademodeid = #{fNewTrademodeid}</if>
- <if test="isPledge != null and isPledge != ''">and is_pledge = #{isPledge}</if>
- </where>
- ORDER BY ware.create_time desc
- ${params.dataScope}
- </select>
- <select id="selectWarehouseBusinessList" parameterType="TWarehousebills" resultType="Map">
- SELECT
- DISTINCT
- bill.f_id AS fId,
- corp.f_name AS fCorpid,
- corpTo.f_name AS fTocorpid,
- bill.f_shipper AS fShipper,
- bill.f_mblno AS fMblno,
- bill.f_emblno AS fEmblno,
- bill.f_company AS fCompany,
- corpSub.f_name AS fSbu,
- bill.f_marks AS fMarks,
- bill.remark AS remark,
- bill.f_planqty AS fPlanqty,
- bill.f_plangrossweight AS fPlangrossweight,
- bill.f_plannetweight AS fPlannetweight,
- bill.f_planvolumn AS fPlanvolumn,
- bill.f_bsdate AS fBsdate,
- bill.f_trademodeid AS fTrademodeid,
- bill.f_truckno AS fTruckno,
- bill.f_driver_name AS fDriverName,
- bill.f_driver_tel AS fDriverTel,
- bill.f_driver_id_car AS fDriverIdCar,
- dictIn.dict_label AS fBusinessType,
- ware.f_name AS fWarehouseid,
- bill.f_qty AS fQty,
- bill.f_cntval AS fCntval,
- bill.f_netweight AS fNetweight,
- bill.create_time AS createTime,
- ware1.f_name AS fInwarehouseid,
- bill.f_chargetype AS fChargetype,
- bill.create_by AS createBy,
- bill.f_grossweight AS fGrossweight,
- bill.f_product_name AS fProductName,
- bill.f_billing_deadline AS fBillingDeadline,
- bill.free_container_date AS freeContainerDate,
- bill.warehouse_status AS warehouseStatus,
- CASE
- WHEN bill.f_fee_status = '0'THEN ''
- WHEN bill.f_fee_status = '1'THEN '暂存'
- WHEN bill.f_fee_status = '2'THEN '部分入账'
- WHEN bill.f_fee_status = '3'THEN '全部入账'
- END AS fFeeStatus,
- CASE WHEN bill.f_billstatus = '1' THEN '录入'
- WHEN bill.f_billstatus = '2' THEN '暂存'
- WHEN bill.f_billstatus = '3' THEN '驳回'
- WHEN bill.f_billstatus = '4' THEN '请核'
- WHEN bill.f_billstatus = '5' THEN '审核中'
- WHEN bill.f_billstatus = '6' THEN '全部入账'
- END
- AS fBillstatus,
- CASE
- WHEN bill.f_billtype = 'SJRK'
- AND bill.f_items_status = '1' THEN
- '计划'
- WHEN bill.f_billtype = 'SJRK'
- AND bill.f_items_status = '2' THEN
- '待入库'
- WHEN bill.f_billtype = 'SJRK'
- AND bill.f_items_status = '3' THEN
- '入库中'
- WHEN bill.f_billtype = 'SJRK'
- AND bill.f_items_status = '4' THEN
- '已入库'
- WHEN bill.f_billtype = 'SJCK'
- AND bill.f_items_status = '1' THEN
- '计划'
- WHEN bill.f_billtype = 'SJCK'
- AND bill.f_items_status = '2' THEN
- '待出库'
- WHEN bill.f_billtype = 'SJCK'
- AND bill.f_items_status = '3' THEN
- '出库中'
- WHEN bill.f_billtype = 'SJCK'
- AND bill.f_items_status = '4' THEN
- '已出库'
- WHEN bill.f_billtype = 'CKDB'
- AND bill.f_items_status = '1' THEN
- '计划'
- WHEN bill.f_billtype = 'CKDB'
- AND bill.f_items_status = '2' THEN
- '待调拨'
- WHEN bill.f_billtype = 'CKDB'
- AND bill.f_items_status = '3' THEN
- '调拨中'
- WHEN bill.f_billtype = 'CKDB'
- AND bill.f_items_status = '4' THEN
- '已调拨'
- WHEN bill.f_billtype = 'HWTG'
- AND bill.f_items_status = '1' THEN
- '计划'
- WHEN bill.f_billtype = 'HWTG'
- AND bill.f_items_status = '2' THEN
- '待通关'
- WHEN bill.f_billtype = 'HWTG'
- AND bill.f_items_status = '3' THEN
- '通关中'
- WHEN bill.f_billtype = 'HWTG'
- AND bill.f_items_status = '4' THEN
- '已通关'
- WHEN bill.f_billtype = 'CDZZ'
- AND bill.f_items_status = '1' THEN
- '计划'
- WHEN bill.f_billtype = 'CDZZ'
- AND bill.f_items_status = '2' THEN
- '待直装'
- WHEN bill.f_billtype = 'CDZZ'
- AND bill.f_items_status = '3' THEN
- '直装中'
- WHEN bill.f_billtype = 'CDZZ'
- AND bill.f_items_status = '4' THEN
- '已直装'
- END AS fItemsStatus,
- bill.f_billno AS fBillno,
- g.f_name AS fGoodsid,
- bill.f_vslid AS fVslid,
- bill.f_voyid AS fVoyid,
- bill.f_storekeeper AS fStorekeeper,
- bill.f_remarks_fees AS fRemarksFees,
- twfD.f_amount as fReceivable,
- twfD.f_accamount as fRecycle,
- twfC.f_amount as fDue,
- twfC.f_accamount as fPay,
- twfD.f_invamount AS fApplyMoney,
- twfD.f_invnos AS invoiceNo,
- twfD.f_invoicing_date AS fAccbilldate,
- bill.is_pledge AS isPledge,
- bill.document_summary AS documentSummary,
- bill.financial_bill_type AS financialBillType
- FROM
- t_warehousebills bill
- LEFT JOIN t_goods g ON g.f_id = bill.f_goodsid
- left join sys_user u on bill.create_by = u.user_name
- left join sys_user u1 on bill.f_storekeeper = u1.user_name
- left join sys_dept d on bill.f_bsdeptid = d.dept_id
- LEFT JOIN t_corps corp ON corp.f_id = bill.f_corpid
- LEFT JOIN t_corps corpTo ON corpTo.f_id = bill.f_tocorpid
- LEFT JOIN t_corps corpSub ON corpSub.f_id = bill.f_sbu
- LEFT JOIN t_warehouse ware ON ware.f_id = bill.f_warehouseid
- LEFT JOIN t_warehouse ware1 ON ware1.f_id = bill.f_inwarehouseid
- LEFT JOIN t_warehousebillsitems item ON item.f_pid = bill.f_id
- LEFT JOIN t_goods goods ON goods.f_id = item.f_goodsid
- 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')
- LEFT JOIN (
- SELECT
- f_id,
- f_pid,
- SUM(f_amount) AS f_amount,
- SUM(f_accamount) AS f_accamount,
- GROUP_CONCAT(f_invnos SEPARATOR ',') AS f_invnos,
- GROUP_CONCAT(f_invamount SEPARATOR ',') AS f_invamount,
- GROUP_CONCAT(f_invoicing_date SEPARATOR ',') AS f_invoicing_date
- FROM
- t_warehousebillsfees
- WHERE f_dc = 'D'
- GROUP BY f_pid
- ) twfD ON twfD.f_pid = bill.f_id
- LEFT JOIN (
- SELECT
- f_id,
- f_pid,
- SUM(f_amount) AS f_amount,
- SUM(f_accamount) AS f_accamount
- FROM
- t_warehousebillsfees
- WHERE f_dc = 'C'
- GROUP BY f_pid
- ) twfC ON twfC.f_pid = bill.f_id
- <where>
- <if test="fTypeid == null or fTypeid == ''">and bill.f_typeid IS NULL</if>
- <if test="fTypeid != null and fTypeid != ''">and bill.f_typeid = #{fTypeid}</if>
- <if test="fFeeStatus != null and fFeeStatus != ''">and bill.f_fee_status = #{fFeeStatus}</if>
- <if test="fBillno != null and fBillno != ''">and bill.f_billno like concat('%', #{fBillno}, '%')</if>
- <if test="fTruckno != null and fTruckno != ''">and item.f_truckno like concat('%', #{fTruckno}, '%')</if>
- <if test="fCustomsdeclartion != null and fCustomsdeclartion != ''">and bill.f_customsdeclartion =
- #{fCustomsdeclartion}
- </if>
- <if test="fOriginalbillno != null and fOriginalbillno != ''">and bill.f_originalbillno =
- #{fOriginalbillno}
- </if>
- <if test="fDeptid != null ">and bill.f_deptid = #{fDeptid}</if>
- <if test="fInwarehouseid != null ">and bill.f_inwarehouseid = #{fInwarehouseid}</if>
- <if test="fBsdeptid != null ">and bill.f_bsdeptid = #{fBsdeptid}</if>
- <if test="fChargedate != null ">and bill.f_chargedate = #{fChargedate}</if>
- <if test='timeInterval != null and timeInterval[0] != null and timeInterval[0]!= ""'>
- and bill.f_bsdate >= #{timeInterval[0]}
- </if>
- <if test='timeInterval != null and timeInterval[1] != null and timeInterval[1]!= ""'>
- and bill.f_bsdate <= #{timeInterval[1]}
- </if>
- <if test='freeContainerList != null and freeContainerList[0] != null and freeContainerList[0]!= ""'>
- and bill.free_container_date >= #{freeContainerList[0]}
- </if>
- <if test='freeContainerList != null and freeContainerList[1] != null and freeContainerList[1]!= ""'>
- and bill.free_container_date <= #{freeContainerList[1]}
- </if>
- <if test="fGoodsid != null and fGoodsid != ''">and item.f_goodsid = #{fGoodsid}</if>
- <if test="fContacts != null and fContacts != ''">and bill.f_contacts = #{fContacts}</if>
- <if test="fTel != null and fTel != ''">and bill.f_tel = #{fTel}</if>
- <if test="fCorpid != null ">and bill.f_corpid = #{fCorpid}</if>
- <if test="fShipper != null and fShipper != ''">and bill.f_shipper like concat('%', #{fShipper}, '%')</if>
- <if test="fBillingDeadline != null ">and bill.f_billing_deadline = #{fBillingDeadline}</if>
- <if test="fTocorpid != null ">and bill.f_tocorpid = #{fTocorpid}</if>
- <if test="fMarks != null and fMarks != ''">and bill.f_marks like concat('%', #{fMarks}, '%')</if>
- <if test="fStltypeid != null ">and bill.f_stltypeid = #{fStltypeid}</if>
- <if test="fReviewDate != null ">and f_review_date = #{fReviewDate}</if>
- <if test="fBscorpno != null and fBscorpno != ''">and bill.f_bscorpno = #{fBscorpno}</if>
- <if test="fWarehouseid != null ">and bill.f_warehouseid = #{fWarehouseid}</if>
- <if test="fStorekeeper != null and fStorekeeper != ''">and bill.f_storekeeper = #{fStorekeeper}</if>
- <if test="fBsdate != null ">and bill.f_bsdate = #{fBsdate}</if>
- <if test="fPlanqty != null ">and bill.f_planqty = #{fPlanqty}</if>
- <if test="fPlangrossweight != null ">and bill.f_plangrossweight = #{fPlangrossweight}</if>
- <if test="fPlannetweight != null ">and bill.f_plannetweight = #{fPlannetweight}</if>
- <if test="fPlanvolumn != null ">and bill.f_planvolumn = #{fPlanvolumn}</if>
- <if test="fQty != null ">and bill.f_qty = #{fQty}</if>
- <if test="fGrossweight != null ">and bill.f_grossweight = #{fGrossweight}</if>
- <if test="fNetweight != null ">and bill.f_netweight = #{fNetweight}</if>
- <if test="fVolumn != null ">and bill.f_volumn = #{fVolumn}</if>
- <if test="fTrademodeid != null ">and bill.f_trademodeid = #{fTrademodeid}</if>
- <if test="fBillingway != null ">and bill.f_billingway = #{fBillingway}</if>
- <if test="fSbu != null ">and bill.f_sbu = #{fSbu}</if>
- <if test="fFeetunit != null and fFeetunit != ''">and bill.f_feetunit = #{fFeetunit}</if>
- <if test="fMblno != null and fMblno != ''">and (bill.f_mblno like concat('%', #{fMblno}, '%') or item.f_mblno like concat('%', #{fMblno}, '%'))</if>
- <if test="fEmblno != null and fEmblno != ''">and bill.f_emblno like concat('%', #{fEmblno}, '%')</if>
- <if test="fVslvoy != null and fVslvoy != ''">and bill.f_vslvoy = #{fVslvoy}</if>
- <if test="fEta != null ">and bill.f_eta = #{fEta}</if>
- <if test="fCustomno != null and fCustomno != ''">and bill.f_customno = #{fCustomno}</if>
- <if test="fIfweigh != null and fIfweigh != ''">and bill.f_ifweigh = #{fIfweigh}</if>
- <if test="fIfpledge != null and fIfpledge != ''">and bill.f_ifpledge = #{fIfpledge}</if>
- <if test="fIfdamage != null and fIfdamage != ''">and bill.f_ifdamage = #{fIfdamage}</if>
- <if test="fBankcorpid != null ">and bill.f_bankcorpid = #{fBankcorpid}</if>
- <if test="fBilltype != null">and bill.f_billtype = #{fBilltype}</if>
- <if test='timeInterval != null and timeInterval[0] != null and timeInterval[0]!= ""'>
- and bill.f_bsdate >= #{timeInterval[0]}
- </if>
- <if test='timeInterval != null and timeInterval[1] != null and timeInterval[1]!= ""'>
- and bill.f_bsdate <= #{timeInterval[1]}
- </if>
- <if test="fBilltype != null and fBilltype == 'SJRK'">
- AND dictIn.dict_type = 'st_in_type'
- AND dictIn.status = '0'
- </if>
- <if test="fBilltype != null and fBilltype == 'SJCK'">
- AND dictIn.dict_type = 'st_out_type'
- AND dictIn.status = '0'
- </if>
- <if test="fBilltype != null and fBilltype == 'CKDB'">
- AND dictIn.dict_type = 'st_trans_type'
- AND dictIn.status = '0'
- </if>
- <if test="fBilltype != null and fBilltype == 'HWTG'">
- AND dictIn.dict_type = 'st_trans_type'
- AND dictIn.status = '0'
- </if>
- <if test="fBilltype != null and fBilltype == 'CDZZ'"><!-- 场地直装 仿出库 -->
- AND dictIn.dict_type = 'st_out_type'
- AND dictIn.status = '0'
- </if>
- <if test="fBillstatus != null and fBillstatus != ''">and bill.f_billstatus = #{fBillstatus}</if>
- <if test="fItemsStatus != null and fItemsStatus != ''">and bill.f_items_status = #{fItemsStatus}</if>
- <if test="createBy != null and createBy != ''">and bill.create_by = #{createBy}</if>
- <if test="fNewTrademodeid != null ">and bill.f_new_trademodeid = #{fNewTrademodeid}</if>
- <if test="warehouseStatus != null and warehouseStatus != ''">and bill.warehouse_status = #{warehouseStatus}</if>
- <if test="fVslid != null ">and bill.f_vslid = #{fVslid}</if>
- <if test="fVoyid != null ">and bill.f_voyid = #{fVoyid}</if>
- <if test="isPledge != null and isPledge != ''">and bill.is_pledge = #{isPledge}</if>
- <if test="remark != null and remark != ''">and bill.remark like concat('%', #{remark}, '%')</if>
- <if test='timeInterval != null and timeInterval[0] != null and timeInterval[0]!= ""'>
- and bill.f_bsdate >= #{timeInterval[0]}
- </if>
- <if test='timeInterval != null and timeInterval[1] != null and timeInterval[1]!= ""'>
- and bill.f_bsdate <= #{timeInterval[1]}
- </if>
- </where>
- ${params.dataScope}
- ORDER BY bill.f_bsdate DESC, bill.f_bstime DESC,bill.f_id DESC,bill.f_billstatus
- </select>
- <select id="selectWarehouseBusinessList1" parameterType="TWarehousebills" resultType="Map">
- SELECT
- DISTINCT
- bill.f_id AS fId,
- corp.f_name AS fCorpid,
- corpTo.f_name AS fTocorpid,
- bill.f_shipper AS fShipper,
- bill.f_mblno AS fMblno,
- bill.f_emblno AS fEmblno,
- bill.f_company AS fCompany,
- corpSub.f_name AS fSbu,
- bill.f_marks AS fMarks,
- bill.remark AS remark,
- bill.f_planqty AS fPlanqty,
- bill.f_plangrossweight AS fPlangrossweight,
- bill.f_plannetweight AS fPlannetweight,
- bill.f_planvolumn AS fPlanvolumn,
- bill.f_bsdate AS fBsdate,
- dict.dict_label AS fTrademodeid,
- bill.f_truckno AS fTruckno,
- bill.f_driver_name AS fDriverName,
- bill.f_driver_tel AS fDriverTel,
- bill.f_driver_id_car AS fDriverIdCar,
- ware.f_name AS fWarehouseid,
- bill.f_qty AS fQty,
- bill.f_cntval AS fCntval,
- bill.f_chargetype AS fChargetype,
- bill.f_netweight AS fNetweight,
- bill.create_time AS createTime,
- ware1.f_name AS fInwarehouseid,
- bill.create_by AS createBy,
- bill.f_grossweight AS fGrossweight,
- bill.f_product_name AS fProductName,
- bill.f_billing_deadline AS fBillingDeadline,
- bill.free_container_date AS freeContainerDate,
- bill.warehouse_status AS warehouseStatus,
- CASE
- WHEN bill.f_fee_status = '0'THEN ''
- WHEN bill.f_fee_status = '1'THEN '暂存'
- WHEN bill.f_fee_status = '2'THEN '部分入账'
- WHEN bill.f_fee_status = '3'THEN '全部入账'
- END AS fFeeStatus,
- CASE
- WHEN bill.f_billtype = 'HQZY' AND bill.f_billstatus = '1' THEN '录入'
- WHEN bill.f_billtype = 'HQZY' AND bill.f_billstatus = '2' THEN '暂存'
- WHEN bill.f_billtype = 'HQZY' AND bill.f_billstatus = '3' THEN '驳回'
- WHEN bill.f_billtype = 'HQZY' AND bill.f_billstatus = '4' THEN '请核'
- WHEN bill.f_billtype = 'HQZY' AND bill.f_billstatus = '5' THEN '审核中'
- WHEN bill.f_billtype = 'HQZY' AND bill.f_billstatus = '6' THEN '全部入账'
- WHEN bill.f_billtype = 'JSCCF' AND bill.f_billstatus = '1' THEN '新建'
- WHEN bill.f_billtype = 'JSCCF' AND bill.f_billstatus = '2' THEN '暂存'
- WHEN bill.f_billtype = 'JSCCF' AND bill.f_billstatus = '3' THEN '审核驳回'
- WHEN bill.f_billtype = 'JSCCF' AND bill.f_billstatus = '4' THEN '提交审核'
- WHEN bill.f_billtype = 'JSCCF' AND bill.f_billstatus = '5' THEN '审核中'
- WHEN bill.f_billtype = 'JSCCF' AND bill.f_billstatus = '6' THEN '审核通过'
- END
- AS fBillstatus,
- CASE
- WHEN bill.f_billtype = 'HQZY'
- AND bill.f_items_status = '1' THEN
- '计划'
- WHEN bill.f_billtype = 'HQZY'
- AND bill.f_items_status = '2' THEN
- '待货转'
- WHEN bill.f_billtype = 'HQZY'
- AND bill.f_items_status = '3' THEN
- '货转中'
- WHEN bill.f_billtype = 'HQZY'
- AND bill.f_items_status = '4' THEN
- '已货转'
- END
- AS fItemsStatus,
- bill.f_billno AS fBillno,
- g.f_name AS fGoodsid,
- bill.f_storekeeper AS fStorekeeper,
- bill.f_remarks_fees AS fRemarksFees,
- tf.f_apply_money AS fApplyMoney,
- tf.invoice_no AS invoiceNo,
- tf.f_accbilldate AS fAccbilldate,
- bill.is_pledge AS isPledge
- FROM
- t_warehousebills bill
- LEFT JOIN t_goods g ON g.f_id = bill.f_goodsid
- left join sys_user u on bill.create_by = u.user_name
- left join sys_user u1 on bill.f_storekeeper = u1.user_name
- left join sys_dept d on bill.f_bsdeptid = d.dept_id
- LEFT JOIN t_corps corp ON corp.f_id = bill.f_corpid
- LEFT JOIN t_corps corpTo ON corpTo.f_id = bill.f_tocorpid
- LEFT JOIN t_corps corpSub ON corpSub.f_id = bill.f_sbu
- LEFT JOIN t_warehouse ware ON ware.f_id = bill.f_warehouseid
- LEFT JOIN t_warehouse ware1 ON ware1.f_id = bill.f_inwarehouseid
- LEFT JOIN t_warehousebillsitems item ON item.f_pid = bill.f_id
- LEFT JOIN t_goods goods ON goods.f_id = item.f_goodsid
- LEFT JOIN sys_dict_data dict ON dict.dict_value = bill.f_trademodeid
- LEFT JOIN t_fee tf on tf.t_mblno = bill.f_mblno
- <where>
- dict.status = '0'
- AND dict.dict_type = 'data_trademodes'
- AND bill.f_typeid IS NULL
- <if test="fFeeStatus != null and fFeeStatus != ''">and bill.f_fee_status = #{fFeeStatus}</if>
- <if test="fBillno != null and fBillno != ''">and bill.f_billno like concat('%', #{fBillno}, '%')</if>
- <if test="fTruckno != null and fTruckno != ''">and item.f_truckno like concat('%', #{fTruckno}, '%')</if>
- <if test="fCustomsdeclartion != null and fCustomsdeclartion != ''">and bill.f_customsdeclartion =
- #{fCustomsdeclartion}
- </if>
- <if test="fOriginalbillno != null and fOriginalbillno != ''">and bill.f_originalbillno =
- #{fOriginalbillno}
- </if>
- <if test="fDeptid != null ">and bill.f_deptid = #{fDeptid}</if>
- <if test="fInwarehouseid != null ">and bill.f_inwarehouseid = #{fInwarehouseid}</if>
- <if test="fBsdeptid != null ">and bill.f_bsdeptid = #{fBsdeptid}</if>
- <if test="fChargedate != null ">and bill.f_chargedate = #{fChargedate}</if>
- <if test='timeInterval != null and timeInterval[0] != null and timeInterval[0]!= ""'>
- and bill.f_bsdate >= #{timeInterval[0]}
- </if>
- <if test='timeInterval != null and timeInterval[1] != null and timeInterval[1]!= ""'>
- and bill.f_bsdate <= #{timeInterval[1]}
- </if>
- <if test='freeContainerList != null and freeContainerList[0] != null and freeContainerList[0]!= ""'>
- and bill.free_container_date >= #{freeContainerList[0]}
- </if>
- <if test='freeContainerList != null and freeContainerList[1] != null and freeContainerList[1]!= ""'>
- and bill.free_container_date <= #{freeContainerList[1]}
- </if>
- <if test="fGoodsid != null and fGoodsid != ''">and item.f_goodsid = #{fGoodsid}</if>
- <if test="fContacts != null and fContacts != ''">and bill.f_contacts = #{fContacts}</if>
- <if test="fTel != null and fTel != ''">and bill.f_tel = #{fTel}</if>
- <if test="fCorpid != null ">and bill.f_corpid = #{fCorpid}</if>
- <if test="fShipper != null and fShipper != ''">and bill.f_shipper like concat('%', #{fShipper}, '%')</if>
- <if test="fBillingDeadline != null ">and bill.f_billing_deadline = #{fBillingDeadline}</if>
- <if test='timeInterval2 != null and timeInterval2[0] != null and timeInterval2[0]!= ""'><!-- 仓储费增加计费截止日期区间查询 -->
- and bill.f_billing_deadline >= #{timeInterval2[0]}
- </if>
- <if test='timeInterval2 != null and timeInterval2[1] != null and timeInterval2[1]!= ""'>
- and bill.f_billing_deadline <= #{timeInterval2[1]}
- </if>
- <if test="fTocorpid != null ">and bill.f_tocorpid = #{fTocorpid}</if>
- <if test="fMarks != null and fMarks != ''">and bill.f_marks like concat('%', #{fMarks}, '%')</if>
- <if test="fStltypeid != null ">and bill.f_stltypeid = #{fStltypeid}</if>
- <if test="fReviewDate != null ">and f_review_date = #{fReviewDate}</if>
- <if test="fBscorpno != null and fBscorpno != ''">and bill.f_bscorpno = #{fBscorpno}</if>
- <if test="fWarehouseid != null ">and bill.f_warehouseid = #{fWarehouseid}</if>
- <if test="fStorekeeper != null and fStorekeeper != ''">and bill.f_storekeeper = #{fStorekeeper}</if>
- <if test="fBsdate != null ">and bill.f_bsdate = #{fBsdate}</if>
- <if test="fPlanqty != null ">and bill.f_planqty = #{fPlanqty}</if>
- <if test="fPlangrossweight != null ">and bill.f_plangrossweight = #{fPlangrossweight}</if>
- <if test="fPlannetweight != null ">and bill.f_plannetweight = #{fPlannetweight}</if>
- <if test="fPlanvolumn != null ">and bill.f_planvolumn = #{fPlanvolumn}</if>
- <if test="fQty != null ">and bill.f_qty = #{fQty}</if>
- <if test="fGrossweight != null ">and bill.f_grossweight = #{fGrossweight}</if>
- <if test="fNetweight != null ">and bill.f_netweight = #{fNetweight}</if>
- <if test="fVolumn != null ">and bill.f_volumn = #{fVolumn}</if>
- <if test="fTrademodeid != null ">and bill.f_trademodeid = #{fTrademodeid}</if>
- <if test="fBillingway != null ">and bill.f_billingway = #{fBillingway}</if>
- <if test="fSbu != null ">and bill.f_sbu = #{fSbu}</if>
- <if test="fFeetunit != null and fFeetunit != ''">and bill.f_feetunit = #{fFeetunit}</if>
- <if test="fMblno != null and fMblno != ''">and bill.f_mblno like concat('%', #{fMblno}, '%')</if>
- <if test="fEmblno != null and fEmblno != ''">and bill.f_emblno like concat('%', #{fEmblno}, '%')</if>
- <if test="fVslvoy != null and fVslvoy != ''">and bill.f_vslvoy = #{fVslvoy}</if>
- <if test="fEta != null ">and bill.f_eta = #{fEta}</if>
- <if test="fCustomno != null and fCustomno != ''">and bill.f_customno = #{fCustomno}</if>
- <if test="fIfweigh != null and fIfweigh != ''">and bill.f_ifweigh = #{fIfweigh}</if>
- <if test="fIfpledge != null and fIfpledge != ''">and bill.f_ifpledge = #{fIfpledge}</if>
- <if test="fIfdamage != null and fIfdamage != ''">and bill.f_ifdamage = #{fIfdamage}</if>
- <if test="fBankcorpid != null ">and bill.f_bankcorpid = #{fBankcorpid}</if>
- <if test="fBilltype != null and fBilltype != ''">
- and bill.f_billtype = #{fBilltype}
- </if>
- <if test="fBillstatus != null and fBillstatus != ''">and bill.f_billstatus = #{fBillstatus}</if>
- <if test="fItemsStatus != null and fItemsStatus != ''">and bill.f_items_status = #{fItemsStatus}</if>
- <if test="createBy != null and createBy != ''">and bill.create_by = #{createBy}</if>
- <if test="fNewTrademodeid != null ">and bill.f_new_trademodeid = #{fNewTrademodeid}</if>
- <if test="warehouseStatus != null and warehouseStatus != ''">and bill.warehouse_status = #{warehouseStatus}</if>
- <if test="isPledge != null and isPledge != ''">and bill.is_pledge = #{isPledge}</if>
- </where>
- ${params.dataScope}
- ORDER BY bill.f_bsdate DESC, bill.f_bstime DESC,bill.f_id DESC,bill.f_billstatus
- </select>
- <select id="selectTWarehousebillsById" parameterType="Long" resultMap="TWarehousebillsResult">
- <include refid="selectTWarehousebillsVo"/>
- where f_id = #{fId}
- ORDER BY f_bsdate desc
- </select>
- <select id="getOtherFinance" resultType="com.ruoyi.warehouseBusiness.excel.OtherFinanceExcel">
- select
- tw.f_bsdate AS fBsdate,
- tw.document_summary as documentSummary,
- tw.financial_bill_type as financialBillType,
- d.damount as amountD,
- d.tfdname as feesNameD,
- d.dremark as remarkD,
- c.camount as amountC,
- c.tfcname as feesNameC,
- c.cremark as remarkC,
- tw.remark as remark
- from t_warehousebills tw
- LEFT JOIN (
- SELECT
- twfd.f_pid,
- ROUND( IFNULL( SUM( twfd.f_amount ), '' )) AS damount,
- tf.f_name as tfdname,
- twfd.remark as dremark
- FROM t_warehousebills tw
- left join t_warehousebillsfees twfd on twfd.f_pid = tw.f_id and twfd.f_dc = "D"
- left join t_fees tf on tf.f_id = twfd.f_feeid
- GROUP BY
- twfd.f_pid
- ) d ON d.f_pid = tw.f_id
- LEFT JOIN (
- SELECT
- twfc.f_pid,
- ROUND( IFNULL( SUM( twfc.f_amount ), '' )) AS camount,
- tf.f_name as tfcname,
- twfc.remark as cremark
- FROM t_warehousebills tw
- left join t_warehousebillsfees twfc on twfc.f_pid = tw.f_id and twfc.f_dc = "C"
- left join t_fees tf on tf.f_id = twfc.f_feeid
- GROUP BY
- twfc.f_pid
- ) c ON c.f_pid = tw.f_id
- WHERE
- tw.f_billtype = 'QTZW'
- <if test="remark != null and remark != ''">and tw.remark like concat('%', #{remark}, '%')</if>
- <if test='timeInterval != null and timeInterval[0] != null and timeInterval[0]!= ""'>
- and tw.f_bsdate >= #{timeInterval[0]}
- </if>
- <if test='timeInterval != null and timeInterval[1] != null and timeInterval[1]!= ""'>
- and tw.f_bsdate <= #{timeInterval[1]}
- </if>
- </select>
- <select id="selectTWarehousebillsItemsList"
- resultType="com.ruoyi.warehouseBusiness.domain.TWareHouseExcelItems">
- SELECT
- ( @ii := @ii + 1 ) AS fId,
- CASE
- wi.f_billtype
- WHEN 'SJRK' THEN
- '入库'
- WHEN 'SJCK' THEN
- '出库'
- WHEN 'KCZZ' THEN
- '库存总账'
- END AS fBilltype,
- ware.f_name AS warehouseName,
- wi.f_mblno AS fMblno,
- wi.f_product_name AS fGoodsid,
- wi.f_marks AS fMarks,
- wi.f_bsdate AS fBsdate,
- dict.dict_label AS fFeeUnitid,
- wi.f_billing_qty AS fBillingQty,
- wi.f_chargedate AS fChargedate,
- wi.f_billing_deadline AS fBillingDeadline,
- wi.f_billing_days AS fBillingDays,
- wi.f_inventory_days AS fInventoryDays,
- wi.f_amt AS fAmt,
- wi.price_date_remarks AS priceDateRemarks,
- wi.remark AS remark
- FROM
- t_warehousebills w
- LEFT JOIN t_warehousebillsfees wi ON w.f_id = wi.f_pid
- LEFT JOIN t_warehouse ware ON ware.f_id = wi.f_warehouseid
- LEFT JOIN sys_dict_data dict ON dict.dict_value = wi.f_billingway,
- ( SELECT @ii := 0 ) AS ii
- WHERE w.f_id = #{fId}
- AND w.f_typeid IS NULL
- AND dict.status = '0'
- AND dict.dict_type = 'data_unitfees'
- </select>
- <select id="selectInStockDetail" resultType="com.ruoyi.warehouseBusiness.excel.StorageDetail">
- SELECT
- wi.f_mblno AS fMblno,
- tg.f_name AS fProductName,
- wi.f_packagespecs AS fPackagespecs,
- dict.dict_label AS fBusinessType,
- wi.f_bsdate AS inStockDate,
- wi.f_qty AS fQtyD,
- wi.f_grossweight AS fGrossweightD
- FROM t_warehousebillsitems wi
- LEFT JOIN t_warehousebills w ON wi.f_pid = w.f_id
- LEFT JOIN t_goods tg ON wi.f_goodsid = tg.f_id
- LEFT JOIN sys_dict_data dict ON w.f_business_type = dict.dict_value
- WHERE
- wi.f_billstatus = 40
- AND dict.status = 0
- <if test="billType != null and billType!= '' and billType== 'SJRK'">
- AND wi.f_billtype = 'SJRK'
- AND dict.dict_type = 'st_in_type'
- <if test="fId != null and fId!= ''">
- AND wi.f_mblno = (select distinct f_mblno from t_warehousebills where f_id = #{fId})
- AND wi.f_warehouselocid in (
- SELECT DISTINCT * FROM (
- SELECT wi.f_warehouselocid
- FROM t_warehousebillsitems wi
- LEFT JOIN t_warehousebillsfees wf ON wf.src_id = wi.f_id
- WHERE wf.f_pid = #{fId} and wf.f_billtype = 'SJCK'
- UNION ALL
- SELECT wh.f_warehouse_locationid
- FROM t_whgenleg wh
- LEFT JOIN t_warehousebillsfees wf ON wf.src_id = wh.f_id
- WHERE wf.f_pid = #{fId} and wf.f_billtype = 'KCZZ'
- ) as wh
- )
- </if>
- </if>
- <if test="billType != null and billType!= '' and billType== 'CKDB'">
- AND wi.f_billtype = 'CKDB'
- AND dict.dict_type = 'st_trans_type'
- <if test="fId != null and fId!= ''">
- AND wi.f_mblno = (select distinct f_mblno from t_warehousebills where f_id = #{fId})
- AND wi.f_transfer_warehouselocid in (
- SELECT DISTINCT * FROM (
- SELECT wi.f_warehouselocid
- FROM t_warehousebillsitems wi
- LEFT JOIN t_warehousebillsfees wf ON wf.src_id = wi.f_id
- WHERE wf.f_pid = #{fId} and wf.f_billtype = 'SJCK'
- UNION ALL
- SELECT wh.f_warehouse_locationid
- FROM t_whgenleg wh
- LEFT JOIN t_warehousebillsfees wf ON wf.src_id = wh.f_id
- WHERE wf.f_pid = #{fId} and wf.f_billtype = 'KCZZ'
- ) as wh
- )
- </if>
- </if>
- <if test="fId != null and fId!= ''">
- AND wi.f_bsdate >= (select min(f_chargedate) from t_warehousebillsfees where f_pid = #{fId})
- </if>
- </select>
- <select id="selectNotInStockDetail" resultType="com.ruoyi.warehouseBusiness.excel.StorageDetail">
- SELECT
- wf.f_mblno AS fMblno,
- wf.f_product_name AS fProductName,
- wi.f_packagespecs AS fPackagespecs,
- dict.dict_label AS fBusinessType,
- wf.f_chargedate AS inStockDate,
- wf.f_billing_deadline AS outStockDate,
- wi.f_truckno AS fTruckno,
- wi.f_qty AS fQtyC,
- wi.f_grossweight AS fGrossweightC,
- dictF.dict_label AS fBillingway,
- wf.f_billing_qty AS fBillingQty,
- wf.f_billing_days AS fBillingDays,
- wf.f_amount AS fAmount
- FROM t_warehousebillsfees wf
- LEFT JOIN t_warehousebillsitems wi ON wi.f_id = wf.src_id
- LEFT JOIN t_warehousebills w ON w.f_id = wi.f_pid
- LEFT JOIN sys_dict_data dict ON w.f_business_type = dict.dict_value
- LEFT JOIN sys_dict_data dictF ON wf.f_billingway = dictF.dict_value
- WHERE w.f_typeid IS NULL
- AND dict.status = '0'
- AND dictF.status = '0'
- AND dictF.dict_type = 'data_unitfees'
- <if test="fId != null and fId!= ''">AND wf.f_pid = #{fId}</if>
- <if test="billType != null and billType!= '' and billType== 'SJCK'">
- AND wf.f_billtype = 'SJCK'
- AND dict.dict_type = 'st_out_type'
- </if>
- <if test="billType != null and billType!= '' and billType== 'HQZY'">
- AND wf.f_billtype = 'HQZY'
- AND dict.dict_type = 'st_goodstf_type'
- </if>
- </select>
- <select id="selectInventoryDetail" resultType="com.ruoyi.warehouseBusiness.excel.StorageDetail">
- SELECT
- wf.f_mblno AS fMblno,
- wf.f_product_name AS fProductName,
- wi.f_packagespecs AS fPackagespecs,
- '在库' AS fBusinessType,
- wf.f_bsdate AS inStockDate,
- dictF.dict_label AS fBillingway,
- wf.f_billing_qty AS fBillingQty,
- wf.f_billing_days AS fBillingDays,
- wf.f_amount AS fAmount
- FROM t_warehousebillsfees wf
- LEFT JOIN t_warehousebillsitems wi ON wi.f_id = wf.src_id
- LEFT JOIN t_warehousebills w ON w.f_id = wi.f_pid
- LEFT JOIN sys_dict_data dictF ON wf.f_billingway = dictF.dict_value
- WHERE w.f_typeid IS NULL
- AND dictF.status = '0'
- AND dictF.dict_type = 'data_unitfees'
- AND wf.f_billtype = 'KCZZ'
- <if test="fId != null and fId!= ''">AND wf.f_pid = #{fId}</if>
- </select>
- <select id="selectInventorySJRKList" parameterType="TWarehousebills" resultType="Map">
- SELECT
- leg.f_id AS fId,
- co.f_name AS fName,
- leg.f_shipper AS fShipper,
- it.f_bsdate AS fBsdate,
- leg.f_mblno AS fMblno,
- it.f_business_type AS fBusinessType,
- dict.dict_label AS fBusinessTypes,
- it.f_marks AS fMarks ,
- goo.f_name AS fGoodsName,
- it.f_warehouse_information AS fWarehouseLocationids,
- dicttr.dict_label AS fTrademodeid,
- it.f_qty AS fQty,
- it.f_grossweight AS fGrossweight,
- it.f_netweight AS fNetweight,
- it.f_driver_name AS fDriverName,
- it.f_truckno AS fTruckno,
- it.f_driver_id_car AS fDriverIdCar,
- CASE
- it.f_billtype
- WHEN 'SJRK' THEN
- '入库'
- WHEN 'SJCK' THEN
- '出库'
- WHEN 'CKDB' THEN
- '调拨'
- END AS fBilltype
- FROM
- t_warehousebills leg
- left join sys_user u on leg.create_by = u.user_name
- left join sys_user u1 on leg.f_salesman_id = u1.user_name
- left join sys_dept d on leg.f_bsdeptid = d.dept_id
- LEFT JOIN t_warehousebillsitems it ON leg.f_id = it.f_pid
- LEFT JOIN t_goods goo ON it.f_goodsid = goo.f_id
- LEFT JOIN t_corps co ON leg.f_corpid = co.f_id
- LEFT JOIN sys_dict_data dict ON dict.dict_value = it.f_business_type
- LEFT JOIN t_warehouse ware ON ware.f_id = it.f_warehouselocid
- LEFT JOIN sys_dict_data dicttr ON dicttr.dict_value = leg.f_trademodeid
- <where>
- dict.status = '0'
- AND leg.f_typeid IS NULL
- AND dict.dict_type = 'storage_type'
- AND dicttr.STATUS = '0'
- AND dicttr.dict_type = 'data_trademodes'
- AND leg.f_billtype in ('SJRK','CKDB')
- AND it.f_billstatus = 40
- <if test="fGoodsid != null ">and it.f_goodsid = #{fGoodsid}</if>
- <if test="fTrademodeid != null ">and leg.f_trademodeid = #{fTrademodeid}</if>
- <if test="fNewTrademodeid != null ">and leg.f_new_trademodeid = #{fNewTrademodeid}</if>
- <if test="fCorpid != null ">and leg.f_corpid = #{fCorpid}</if>
- <if test="fShipper != null and fShipper != ''">and leg.f_shipper like concat('%', #{fShipper}, '%')</if>
- <if test="fMblno != null ">and it.f_mblno like concat('%',#{fMblno},'%')</if>
- <if test="fEmblno != null ">and it.f_emblno like concat('%',#{fEmblno},'%')</if>
- <if test="fLocation != null and fLocation ==1 ">
- and it.f_warehouselocid = #{fWarehouseid}
- </if>
- <if test="fLocation != null and fLocation ==0 ">
- and ware.ancestors LIKE concat('%', #{fWarehouseid}, '%')
- </if>
- <if test='timeInterval != null and timeInterval[0] != null and timeInterval[0]!= ""'>
- and it.f_bsdate >= #{timeInterval[0]}
- </if>
- <if test='timeInterval != null and timeInterval[1] != null and timeInterval[1]!= ""'>
- and it.f_bsdate <= #{timeInterval[1]}
- </if>
- </where>
- ${params.dataScope}
- </select>
- <select id="selectInventorySJCKList" parameterType="TWarehousebills" resultType="Map">
- SELECT
- leg.f_id AS fId,
- co.f_name AS fName,
- leg.f_shipper AS fShipper,
- it.f_bsdate AS fBsdate,
- leg.f_mblno AS fMblno,
- it.f_business_type AS fBusinessType,
- dict.dict_label AS fBusinessTypes,
- it.f_marks AS fMarks ,
- goo.f_name AS fGoodsName,
- dicttr.dict_label AS fTrademodeid,
- it.f_qty AS fQty,
- it.f_grossweight AS fGrossweight,
- it.f_netweight AS fNetweight,
- it.f_driver_name AS fDriverName,
- it.f_truckno AS fTruckno,
- it.f_driver_id_car AS fDriverIdCar,
- CASE
- it.f_billtype
- WHEN 'SJRK' THEN
- '入库'
- WHEN 'SJCK' THEN
- '出库'
- WHEN 'CKDB' THEN
- '调拨'
- END AS fBilltype ,
- CASE
- it.f_billtype
- WHEN 'SJRK' THEN
- it.f_warehouse_information
- WHEN 'SJCK' THEN
- it.f_warehouse_information
- WHEN 'CKDB' THEN
- it.f_orgwarehouse_information
- END AS fWarehouseLocationids
- FROM
- t_warehousebills leg
- left join sys_user u on leg.create_by = u.user_name
- left join sys_user u1 on leg.f_salesman_id = u1.user_name
- left join sys_dept d on leg.f_bsdeptid = d.dept_id
- LEFT JOIN t_warehousebillsitems it ON leg.f_id = it.f_pid
- LEFT JOIN t_goods goo ON it.f_goodsid = goo.f_id
- LEFT JOIN t_corps co ON leg.f_corpid = co.f_id
- LEFT JOIN sys_dict_data dict ON dict.dict_value = it.f_business_type
- LEFT JOIN t_warehouse ware ON ware.f_id = it.f_warehouselocid
- LEFT JOIN sys_dict_data dicttr ON dicttr.dict_value = leg.f_trademodeid
- <where>
- dict.status = '0'
- AND leg.f_typeid IS NULL
- AND dict.dict_type = 'storage_type'
- AND dicttr.STATUS = '0'
- AND dicttr.dict_type = 'data_trademodes'
- AND leg.f_billtype in ('SJCK','CKDB')
- AND it.f_billstatus = 40
- <if test="fGoodsid != null ">and it.f_goodsid = #{fGoodsid}</if>
- <if test="fTrademodeid != null ">and leg.f_trademodeid = #{fTrademodeid}</if>
- <if test="fNewTrademodeid != null ">and leg.f_new_trademodeid = #{fNewTrademodeid}</if>
- <if test="fCorpid != null ">and leg.f_corpid = #{fCorpid}</if>
- <if test="fShipper != null and fShipper != ''">and leg.f_shipper like concat('%', #{fShipper}, '%')</if>
- <if test="fMblno != null ">and it.f_mblno like concat('%',#{fMblno},'%')</if>
- <if test="fEmblno != null ">and it.f_emblno like concat('%',#{fEmblno},'%')</if>
- <if test="fLocation != null and fLocation ==1 ">
- and it.f_warehouselocid = #{fWarehouseid}
- </if>
- <if test="fLocation != null and fLocation ==0 ">
- and ware.ancestors LIKE concat('%', #{fWarehouseid}, '%')
- </if>
- <if test='timeInterval != null and timeInterval[0] != null and timeInterval[0]!= ""'>
- and it.f_bsdate >= #{timeInterval[0]}
- </if>
- <if test='timeInterval != null and timeInterval[1] != null and timeInterval[1]!= ""'>
- and it.f_bsdate <= #{timeInterval[1]}
- </if>
- </where>
- ${params.dataScope}
- </select>
- <select id="selectTWarehousebillsItemList"
- resultType="com.ruoyi.reportManagement.domain.TWareHouseItemsExcel">
- SELECT
- ( @ii := @ii + 1 ) AS fId,
- co.f_name AS fCorpid,
- leg.f_shipper AS fShipper,
- it.f_bsdate AS fBsdate,
- leg.f_mblno AS fMblno,
- CASE
- leg.f_billtype
- WHEN 'SJRK' THEN
- '入库'
- WHEN 'SJCK' THEN
- '出库'
- WHEN 'CKDB' THEN
- '调拨'
- WHEN 'HQZY' THEN
- '货权转移'
- END AS fBilltype ,
- dict.dict_label AS fBusinessType,
- it.f_marks AS fMarks,
- go.f_name AS fGoodsid,
- it.f_warehouse_information AS fWarehouseInformation,
- dicttr.dict_label AS fTrademodeid,
- it.f_qty AS fQty,
- it.f_grossweight AS fGrossweight,
- it.f_netweight AS fNetweight,
- it.f_driver_name AS fDrivername,
- it.f_truckno AS fTruckno,
- it.f_driver_id_car AS fDriverIdCar
- FROM
- t_warehousebills leg
- LEFT JOIN t_warehousebillsitems it ON leg.f_id = it.f_pid
- LEFT JOIN t_goods go ON it.f_goodsid = go.f_id
- LEFT JOIN t_corps co ON leg.f_corpid = co.f_id
- LEFT JOIN sys_dict_data dict ON dict.dict_value = it.f_business_type
- LEFT JOIN t_warehouse_area area ON area.f_id = it.f_warehouselocid
- LEFT JOIN sys_dict_data dicttr ON dicttr.dict_value = leg.f_trademodeid,(
- SELECT
- @ii := 0
- ) AS ii
- WHERE
- dict.STATUS = '0'
- AND leg.f_typeid IS NULL
- AND dict.dict_type = 'storage_type'
- AND dicttr.STATUS = '0'
- AND dicttr.dict_type = 'data_trademodes'
- AND leg.f_billtype IN (
- 'SJRk',
- 'SJCK'
- )
- <if test="fBilltype != null">AND leg.f_billtype = #{fBilltype}</if>
- <if test="fGoodsid != null ">and it.f_goodsid = #{fGoodsid}</if>
- <if test="fTrademodeid != null ">and leg.f_trademodeid = #{fTrademodeid}</if>
- <if test="fNewTrademodeid != null ">and leg.f_new_trademodeid = #{fNewTrademodeid}</if>
- <if test="fCorpid != null ">and leg.f_corpid = #{fCorpid}</if>
- <if test="fShipper != null and fShipper != ''">and leg.f_shipper like concat('%', #{fShipper}, '%')</if>
- <if test="fMblno != null ">and leg.f_mblno = #{fMblno}</if>
- <if test="fEmblno != null ">and leg.f_emblno = #{fEmblno}</if>
- <if test="fLocation != null and fLocation ==1 ">
- and it.f_warehouselocid = #{fWarehouseid}
- </if>
- <if test="fLocation != null and fLocation ==0 ">
- and ware.ancestors LIKE concat('%', #{fWarehouseid}, '%')
- </if>
- <if test='timeInterval != null and timeInterval[0] != null and timeInterval[0]!= ""'>
- and it.f_bsdate >= #{timeInterval[0]}
- </if>
- <if test='timeInterval != null and timeInterval[1] != null and timeInterval[1]!= ""'>
- and it.f_bsdate <= #{timeInterval[1]}
- </if>
- </select>
- <select id="selectContainMblno" parameterType="TWarehousebills" resultType="int">
- SELECT
- count( f_id )
- FROM
- t_warehousebills
- where
- f_mblno = #{fMblno}
- AND f_bsdate = #{fBsdate}
- AND f_billtype = #{fBilltype}
- </select>
- <insert id="insertTWarehousebills" parameterType="TWarehousebills" useGeneratedKeys="true" keyProperty="fId">
- insert into t_warehousebills
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="fBillno != null">f_billno,</if>
- <if test="fCustomsdeclartion != null">f_customsdeclartion,</if>
- <if test="fOriginalbillno != null">f_originalbillno,</if>
- <if test="fDeptid != null">f_deptid,</if>
- <if test="fBsdeptid != null">f_bsdeptid,</if>
- <if test="fContacts != null">f_contacts,</if>
- <if test="fTel != null">f_tel,</if>
- <if test="fCorpid != null">f_corpid,</if>
- <if test="fShipper != null">f_shipper,</if>
- <if test="fTocorpid != null">f_tocorpid,</if>
- <if test="fStltypeid != null">f_stltypeid,</if>
- <if test="fBscorpno != null">f_bscorpno,</if>
- <if test="fWarehouseid != null">f_warehouseid,</if>
- <if test="fStorekeeper != null">f_storekeeper,</if>
- <if test="fChargedate != null">f_chargedate,</if>
- <if test="fBsdate != null">f_bsdate,</if>
- <if test="fPlanqty != null">f_planqty,</if>
- <if test="fPlangrossweight != null">f_plangrossweight,</if>
- <if test="fPlannetweight != null">f_plannetweight,</if>
- <if test="fPlanvolumn != null">f_planvolumn,</if>
- <if test="fQty != null">f_qty,</if>
- <if test="fGrossweight != null">f_grossweight,</if>
- <if test="fNetweight != null">f_netweight,</if>
- <if test="fVolumn != null">f_volumn,</if>
- <if test="fTrademodeid != null">f_trademodeid,</if>
- <if test="fBillingway != null">f_billingway,</if>
- <if test="fSbu != null">f_sbu,</if>
- <if test="fFeetunit != null">f_feetunit,</if>
- <if test="fMblno != null">f_mblno,</if>
- <if test="fEmblno != null">f_emblno,</if>
- <if test="fCompany != null">f_company,</if>
- <if test="fVslvoy != null">f_vslvoy,</if>
- <if test="fEta != null">f_eta,</if>
- <if test="fMarks != null">f_marks,</if>
- <if test="fCustomno != null">f_customno,</if>
- <if test="fEmsSeqNo != null">f_ems_seq_no,</if>
- <if test="fIfweigh != null">f_ifweigh,</if>
- <if test="fIfpledge != null">f_ifpledge,</if>
- <if test="fIfdamage != null">f_ifdamage,</if>
- <if test="fBankcorpid != null">f_bankcorpid,</if>
- <if test="fBilltype != null">f_billtype,</if>
- <if test="fBillstatus != null">f_billstatus,</if>
- <if test="delFlag != null">del_flag,</if>
- <if test="createBy != null">create_by,</if>
- <if test="createTime != null">create_time,</if>
- <if test="fItemsStatus != null">f_items_status,</if>
- <if test="updateBy != null">update_by,</if>
- <if test="updateTime != null">update_time,</if>
- <if test="remark != null">remark,</if>
- <if test="fBillingDeadline != null">f_billing_deadline,</if>
- <if test="fProductName != null">f_product_name,</if>
- <if test="fReviewDate != null">f_review_date,</if>
- <if test="fTruckno != null">f_truckno,</if>
- <if test="fDriverName != null">f_driver_name,</if>
- <if test="fDriverTel != null">f_driver_tel,</if>
- <if test="fDriverIdCar != null">f_driver_id_car,</if>
- <if test="fBusinessType != null">f_business_type,</if>
- <if test="fLabour != null">f_labour,</if>
- <if test="fFleet != null">f_fleet,</if>
- <if test="fInwarehouseid != null">f_inwarehouseid,</if>
- <if test="fBstime != null">f_bstime,</if>
- <if test="fCartype != null">f_cartype,</if>
- <if test="fGoodsid != null">f_goodsid,</if>
- <if test="fNewTrademodeid != null">f_new_trademodeid,</if>
- <if test="fLoadportid != null">f_loadportid,</if>
- <if test="fDestportid != null">f_destportid,</if>
- <if test="fServiceitems != null">f_serviceitems,</if>
- <if test="fInvoceobj != null">f_invoceobj,</if>
- <if test="fSign != null">f_sign,</if>
- <if test="fDetentioncargo != null">f_detentioncargo,</if>
- <if test="fBooksmarks != null">f_booksmarks,</if>
- <if test="fShippername != null">f_shippername,</if>
- <if test="fShipperattn != null">f_shipperattn,</if>
- <if test="fShippertel != null">f_shippertel,</if>
- <if test="fConsigneername != null">f_consigneername,</if>
- <if test="fConsigneeattn != null">f_consigneeattn,</if>
- <if test="fConsigneetel != null">f_consigneetel,</if>
- <if test="fInsurance != null">f_insurance,</if>
- <if test="fInsuranceamt != null">f_insuranceamt,</if>
- <if test="fClosedate != null">f_closedate,</if>
- <if test="fDocmentdate != null">f_docmentdate,</if>
- <if test="fVslid != null">f_vslid,</if>
- <if test="fVoyid != null">f_voyid,</if>
- <if test="fTypeid != null">f_typeid,</if>
- <if test="fPaymode != null">f_paymode,</if>
- <if test="fLaneid != null">f_laneid,</if>
- <if test="fCntval != null">f_cntval,</if>
- <if test="freeContainerDate != null">free_container_date,</if>
- <if test="fBusinessAttribution != null">f_business_attribution,</if>
- <if test="fSupervisionUnit != null">f_supervision_unit,</if>
- <if test="fDeclarationElements != null">f_declaration_elements,</if>
- <if test="fPartNumber != null">f_part_number,</if>
- <if test="fIfinspection != null">f_ifinspection,</if>
- <if test="fValue != null">f_value,</if>
- <if test="fWeighingDate != null">f_weighing_date,</if>
- <if test="fIfsampling != null">f_ifsampling,</if>
- <if test="sendSampleDate != null">send_sample_date,</if>
- <if test="fIfweightRecovery != null">f_ifweight_recovery,</if>
- <if test="weightRecoveryDate != null">weight_recovery_date,</if>
- <if test="warehouseStatus != null">warehouse_status,</if>
- <if test="fTimes != null">f_times,</if>
- <if test="fDateChanged != null">f_date_changed,</if>
- <if test="fChargetype != null">f_chargetype,</if>
- <if test="fWeighWeight != null">f_weigh_weight,</if>
- <if test="fPredictBranch != null">f_predict_branch,</if>
- <if test="fGrade != null">f_grade,</if>
- <if test="fDeliveryDetails != null">f_delivery_details,</if>
- <if test="fSalesmanId != null">f_salesman_id,</if>
- <if test="fItemstatus != null">f_itemstatus,</if>
- <if test="fUpdeteStatus != null">f_updete_status,</if>
- <if test="fSubmitUpdate != null">f_submit_update,</if>
- <if test="fDeleteStatus != null">f_delete_status,</if>
- <if test="fRemarksFees != null">f_remarks_fees,</if>
- <if test="fCargoPlanning != null">f_cargo_planning,</if>
- <if test="fFeeStatus != null">f_fee_status,</if>
- <if test="fArrivalStatus != null">f_arrival_status,</if>
- <if test="fDismountStatus != null">f_dismount_status,</if>
- <if test="fServiceitemsNew != null">f_serviceitems_new,</if>
- <if test="fReceivable != null">f_receivable,</if>
- <if test="fRecycle != null">f_recycle,</if>
- <if test="fDue != null">f_due,</if>
- <if test="fPay != null">f_pay,</if>
- <if test="fCaregoStatus != null">f_carego_status,</if>
- <if test="fShipTwo != null">f_ship_two,</if>
- <if test="fVoyTwo != null">f_voy_two,</if>
- <if test="pickUpPerson != null">pick_up_person,</if>
- <if test="pickUpTime != null">pick_up_time,</if>
- <if test="facilityPerson != null">facility_person,</if>
- <if test="facilityTime != null">facility_time,</if>
- <if test="isPledge != null and isPledge != ''">is_pledge,</if>
- <if test="documentSummary != null and documentSummary != ''">document_summary,</if>
- <if test="financialBillType != null and financialBillType != ''">financial_bill_type,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="fBillno != null">#{fBillno},</if>
- <if test="fCustomsdeclartion != null">#{fCustomsdeclartion},</if>
- <if test="fOriginalbillno != null">#{fOriginalbillno},</if>
- <if test="fDeptid != null">#{fDeptid},</if>
- <if test="fBsdeptid != null">#{fBsdeptid},</if>
- <if test="fContacts != null">#{fContacts},</if>
- <if test="fTel != null">#{fTel},</if>
- <if test="fCorpid != null">#{fCorpid},</if>
- <if test="fShipper != null">#{fShipper},</if>
- <if test="fTocorpid != null">#{fTocorpid},</if>
- <if test="fStltypeid != null">#{fStltypeid},</if>
- <if test="fBscorpno != null">#{fBscorpno},</if>
- <if test="fWarehouseid != null">#{fWarehouseid},</if>
- <if test="fStorekeeper != null">#{fStorekeeper},</if>
- <if test="fChargedate != null">#{fChargedate},</if>
- <if test="fBsdate != null">#{fBsdate},</if>
- <if test="fPlanqty != null">#{fPlanqty},</if>
- <if test="fPlangrossweight != null">#{fPlangrossweight},</if>
- <if test="fPlannetweight != null">#{fPlannetweight},</if>
- <if test="fPlanvolumn != null">#{fPlanvolumn},</if>
- <if test="fQty != null">#{fQty},</if>
- <if test="fGrossweight != null">#{fGrossweight},</if>
- <if test="fNetweight != null">#{fNetweight},</if>
- <if test="fVolumn != null">#{fVolumn},</if>
- <if test="fTrademodeid != null">#{fTrademodeid},</if>
- <if test="fBillingway != null">#{fBillingway},</if>
- <if test="fSbu != null">#{fSbu},</if>
- <if test="fFeetunit != null">#{fFeetunit},</if>
- <if test="fMblno != null">#{fMblno},</if>
- <if test="fEmblno != null">#{fEmblno},</if>
- <if test="fCompany != null">#{fCompany},</if>
- <if test="fVslvoy != null">#{fVslvoy},</if>
- <if test="fEta != null">#{fEta},</if>
- <if test="fMarks != null">#{fMarks},</if>
- <if test="fCustomno != null">#{fCustomno},</if>
- <if test="fEmsSeqNo != null">#{fEmsSeqNo},</if>
- <if test="fIfweigh != null">#{fIfweigh},</if>
- <if test="fIfpledge != null">#{fIfpledge},</if>
- <if test="fIfdamage != null">#{fIfdamage},</if>
- <if test="fBankcorpid != null">#{fBankcorpid},</if>
- <if test="fBilltype != null">#{fBilltype},</if>
- <if test="fBillstatus != null">#{fBillstatus},</if>
- <if test="delFlag != null">#{delFlag},</if>
- <if test="createBy != null">#{createBy},</if>
- <if test="createTime != null">#{createTime},</if>
- <if test="fItemsStatus != null">#{fItemsStatus},</if>
- <if test="updateBy != null">#{updateBy},</if>
- <if test="updateTime != null">#{updateTime},</if>
- <if test="remark != null">#{remark},</if>
- <if test="fBillingDeadline != null">#{fBillingDeadline},</if>
- <if test="fProductName != null">#{fProductName},</if>
- <if test="fReviewDate != null">#{fReviewDate},</if>
- <if test="fTruckno != null">#{fTruckno},</if>
- <if test="fDriverName != null">#{fDriverName},</if>
- <if test="fDriverTel != null">#{fDriverTel},</if>
- <if test="fDriverIdCar != null">#{fDriverIdCar},</if>
- <if test="fBusinessType != null">#{fBusinessType},</if>
- <if test="fLabour != null">#{fLabour},</if>
- <if test="fFleet != null">#{fFleet},</if>
- <if test="fInwarehouseid != null">#{fInwarehouseid},</if>
- <if test="fBstime != null">#{fBstime},</if>
- <if test="fCartype != null">#{fCartype},</if>
- <if test="fGoodsid != null">#{fGoodsid},</if>
- <if test="fNewTrademodeid != null">#{fNewTrademodeid},</if>
- <if test="fLoadportid != null">#{fLoadportid},</if>
- <if test="fDestportid != null">#{fDestportid},</if>
- <if test="fServiceitems != null">#{fServiceitems},</if>
- <if test="fInvoceobj != null">#{fInvoceobj},</if>
- <if test="fSign != null">#{fSign},</if>
- <if test="fDetentioncargo != null">#{fDetentioncargo},</if>
- <if test="fBooksmarks != null">#{fBooksmarks},</if>
- <if test="fShippername != null">#{fShippername},</if>
- <if test="fShipperattn != null">#{fShipperattn},</if>
- <if test="fShippertel != null">#{fShippertel},</if>
- <if test="fConsigneername != null">#{fConsigneername},</if>
- <if test="fConsigneeattn != null">#{fConsigneeattn},</if>
- <if test="fConsigneetel != null">#{fConsigneetel},</if>
- <if test="fInsurance != null">#{fInsurance},</if>
- <if test="fInsuranceamt != null">#{fInsuranceamt},</if>
- <if test="fClosedate != null">#{fClosedate},</if>
- <if test="fDocmentdate != null">#{fDocmentdate},</if>
- <if test="fVslid != null">#{fVslid},</if>
- <if test="fVoyid != null">#{fVoyid},</if>
- <if test="fTypeid != null">#{fTypeid},</if>
- <if test="fPaymode != null">#{fPaymode},</if>
- <if test="fLaneid != null">#{fLaneid},</if>
- <if test="fCntval != null">#{fCntval},</if>
- <if test="freeContainerDate != null">#{freeContainerDate},</if>
- <if test="fBusinessAttribution != null">#{fBusinessAttribution},</if>
- <if test="fSupervisionUnit != null">#{fSupervisionUnit},</if>
- <if test="fDeclarationElements != null">#{fDeclarationElements},</if>
- <if test="fPartNumber != null">#{fPartNumber},</if>
- <if test="fIfinspection != null">#{fIfinspection},</if>
- <if test="fValue != null">#{fValue},</if>
- <if test="fWeighingDate != null">#{fWeighingDate},</if>
- <if test="fIfsampling != null">#{fIfsampling},</if>
- <if test="sendSampleDate != null">#{sendSampleDate},</if>
- <if test="fIfweightRecovery != null">#{fIfweightRecovery},</if>
- <if test="weightRecoveryDate != null">#{weightRecoveryDate},</if>
- <if test="warehouseStatus != null">#{warehouseStatus},</if>
- <if test="fTimes != null">#{fTimes},</if>
- <if test="fDateChanged != null">#{fDateChanged},</if>
- <if test="fChargetype != null">#{fChargetype},</if>
- <if test="fWeighWeight != null">#{fWeighWeight},</if>
- <if test="fPredictBranch != null">#{fPredictBranch},</if>
- <if test="fGrade != null">#{fGrade},</if>
- <if test="fDeliveryDetails != null">#{fDeliveryDetails},</if>
- <if test="fSalesmanId != null">#{fSalesmanId},</if>
- <if test="fItemstatus != null">#{fItemstatus},</if>
- <if test="fUpdeteStatus != null">#{fUpdeteStatus},</if>
- <if test="fSubmitUpdate != null">#{fSubmitUpdate},</if>
- <if test="fDeleteStatus != null">#{fDeleteStatus},</if>
- <if test="fRemarksFees != null">#{fRemarksFees},</if>
- <if test="fCargoPlanning != null">#{fCargoPlanning},</if>
- <if test="fFeeStatus != null">#{fFeeStatus},</if>
- <if test="fArrivalStatus != null">#{fArrivalStatus},</if>
- <if test="fDismountStatus != null">#{fDismountStatus},</if>
- <if test="fServiceitemsNew != null">#{fServiceitemsNew},</if>
- <if test="fReceivable != null">#{fReceivable},</if>
- <if test="fRecycle != null">#{fRecycle},</if>
- <if test="fDue != null">#{fDue},</if>
- <if test="fPay != null">#{fPay},</if>
- <if test="fCaregoStatus != null">#{fCaregoStatus},</if>
- <if test="fShipTwo != null">#{fShipTwo},</if>
- <if test="fVoyTwo != null">#{fVoyTwo},</if>
- <if test="pickUpPerson != null">#{pickUpPerson},</if>
- <if test="pickUpTime != null">#{pickUpTime},</if>
- <if test="facilityPerson != null">#{facilityPerson},</if>
- <if test="facilityTime != null">#{facilityTime},</if>
- <if test="isPledge != null and isPledge != ''">#{isPledge},</if>
- <if test="documentSummary != null and documentSummary != ''">#{documentSummary},</if>
- <if test="financialBillType != null and financialBillType != ''">#{financialBillType},</if>
- </trim>
- </insert>
- <update id="updateTWarehousebills" parameterType="TWarehousebills">
- update t_warehousebills
- <trim prefix="SET" suffixOverrides=",">
- <if test="fBillno != null">f_billno = #{fBillno},</if>
- <if test="fCustomsdeclartion != null">f_customsdeclartion = #{fCustomsdeclartion},</if>
- <if test="fOriginalbillno != null">f_originalbillno = #{fOriginalbillno},</if>
- <if test="fDeptid != null">f_deptid = #{fDeptid},</if>
- <if test="fBsdeptid != null">f_bsdeptid = #{fBsdeptid},</if>
- <if test="fContacts != null">f_contacts = #{fContacts},</if>
- <if test="fTel != null">f_tel = #{fTel},</if>
- <if test="fCorpid != null">f_corpid = #{fCorpid},</if>
- <if test="fShipper != null">f_shipper = #{fShipper},</if>
- <if test="fTocorpid != null">f_tocorpid = #{fTocorpid},</if>
- <if test="fStltypeid != null">f_stltypeid = #{fStltypeid},</if>
- <if test="fBscorpno != null">f_bscorpno = #{fBscorpno},</if>
- <if test="fWarehouseid != null">f_warehouseid = #{fWarehouseid},</if>
- <if test="fStorekeeper != null">f_storekeeper = #{fStorekeeper},</if>
- <if test="fBsdate != null">f_bsdate = #{fBsdate},</if>
- <if test="fChargedate != null">f_chargedate = #{fChargedate},</if>
- <if test="fPlanqty != null">f_planqty = #{fPlanqty},</if>
- <if test="fPlangrossweight != null">f_plangrossweight = #{fPlangrossweight},</if>
- <if test="fPlannetweight != null">f_plannetweight = #{fPlannetweight},</if>
- <if test="fPlanvolumn != null">f_planvolumn = #{fPlanvolumn},</if>
- <if test="fQty != null">f_qty = #{fQty},</if>
- <if test="fGrossweight != null">f_grossweight = #{fGrossweight},</if>
- <if test="fNetweight != null">f_netweight = #{fNetweight},</if>
- <if test="fVolumn != null">f_volumn = #{fVolumn},</if>
- <if test="fTrademodeid != null">f_trademodeid = #{fTrademodeid},</if>
- <if test="fBillingway != null">f_billingway = #{fBillingway},</if>
- <if test="fSbu != null">f_sbu = #{fSbu},</if>
- <if test="fFeetunit != null">f_feetunit = #{fFeetunit},</if>
- <if test="fMblno != null">f_mblno = #{fMblno},</if>
- <if test="fEmblno != null">f_emblno = #{fEmblno},</if>
- f_company = #{fCompany},
- <if test="fVslvoy != null">f_vslvoy = #{fVslvoy},</if>
- <if test="fEta != null">f_eta = #{fEta},</if>
- <if test="fMarks != null">f_marks = #{fMarks},</if>
- <if test="fCustomno != null">f_customno = #{fCustomno},</if>
- <if test="fEmsSeqNo != null">f_ems_seq_no = #{fEmsSeqNo},</if>
- <if test="fIfweigh != null">f_ifweigh = #{fIfweigh},</if>
- <if test="fIfpledge != null">f_ifpledge = #{fIfpledge},</if>
- <if test="fIfdamage != null">f_ifdamage = #{fIfdamage},</if>
- <if test="fBankcorpid != null">f_bankcorpid = #{fBankcorpid},</if>
- <if test="fBilltype != null">f_billtype = #{fBilltype},</if>
- <if test="fBillstatus != null">f_billstatus = #{fBillstatus},</if>
- <if test="delFlag != null">del_flag = #{delFlag},</if>
- <if test="createBy != null">create_by = #{createBy},</if>
- <if test="createTime != null">create_time = #{createTime},</if>
- <if test="fItemsStatus != null">f_items_status = #{fItemsStatus},</if>
- <if test="updateBy != null">update_by = #{updateBy},</if>
- <if test="updateTime != null">update_time = #{updateTime},</if>
- <if test="remark != null">remark = #{remark},</if>
- <if test="fBillingDeadline != null">f_billing_deadline = #{fBillingDeadline},</if>
- <if test="fProductName != null">f_product_name = #{fProductName},</if>
- <if test="fReviewDate != null">f_review_date = #{fReviewDate},</if>
- <if test="fTruckno != null">f_truckno = #{fTruckno},</if>
- <if test="fDriverName != null">f_driver_name = #{fDriverName},</if>
- <if test="fDriverTel != null">f_driver_tel = #{fDriverTel},</if>
- <if test="fDriverIdCar != null">f_driver_id_car = #{fDriverIdCar},</if>
- <if test="fBusinessType != null">f_business_type = #{fBusinessType},</if>
- f_labour = #{fLabour},
- f_fleet = #{fFleet},
- <if test="fInwarehouseid != null">f_inwarehouseid = #{fInwarehouseid},</if>
- <if test="fBstime != null">f_bstime = #{fBstime},</if>
- <if test="fCartype != null">f_cartype = #{fCartype},</if>
- <if test="fGoodsid != null">f_goodsid = #{fGoodsid},</if>
- <if test="fNewTrademodeid != null">f_new_trademodeid = #{fNewTrademodeid},</if>
- <if test="fLoadportid != null">f_loadportid = #{fLoadportid},</if>
- <if test="fDestportid != null">f_destportid = #{fDestportid},</if>
- <if test="fServiceitems != null">f_serviceitems = #{fServiceitems},</if>
- <if test="fInvoceobj != null">f_invoceobj = #{fInvoceobj},</if>
- <if test="fSign != null">f_sign = #{fSign},</if>
- <if test="fDetentioncargo != null">f_detentioncargo = #{fDetentioncargo},</if>
- <if test="fBooksmarks != null">f_booksmarks = #{fBooksmarks},</if>
- <if test="fShippername != null">f_shippername = #{fShippername},</if>
- <if test="fShipperattn != null">f_shipperattn = #{fShipperattn},</if>
- <if test="fShippertel != null">f_shippertel = #{fShippertel},</if>
- <if test="fConsigneername != null">f_consigneername = #{fConsigneername},</if>
- <if test="fConsigneeattn != null">f_consigneeattn = #{fConsigneeattn},</if>
- <if test="fConsigneetel != null">f_consigneetel = #{fConsigneetel},</if>
- <if test="fInsurance != null">f_insurance = #{fInsurance},</if>
- <if test="fInsuranceamt != null">f_insuranceamt = #{fInsuranceamt},</if>
- <if test="fClosedate != null">f_closedate = #{fClosedate},</if>
- <if test="fDocmentdate != null">f_docmentdate = #{fDocmentdate},</if>
- <if test="fVslid != null">f_vslid = #{fVslid},</if>
- <if test="fVoyid != null">f_voyid = #{fVoyid},</if>
- <if test="fTypeid != null">f_typeid = #{fTypeid},</if>
- <if test="fPaymode != null">f_paymode = #{fPaymode},</if>
- <if test="fLaneid != null">f_laneid = #{fLaneid},</if>
- <if test="fCntval != null">f_cntval = #{fCntval},</if>
- <if test="freeContainerDate != null">free_container_date = #{freeContainerDate},</if>
- <if test="fBusinessAttribution != null">f_business_attribution = #{fBusinessAttribution},</if>
- <if test="fSupervisionUnit != null">f_supervision_unit = #{fSupervisionUnit},</if>
- <if test="fDeclarationElements != null">f_declaration_elements = #{fDeclarationElements},</if>
- <if test="fPartNumber != null">f_part_number = #{fPartNumber},</if>
- <if test="fIfinspection != null">f_ifinspection = #{fIfinspection},</if>
- <if test="fValue != null">f_value = #{fValue},</if>
- <if test="fWeighingDate != null">f_weighing_date = #{fWeighingDate},</if>
- <if test="fIfsampling != null">f_ifsampling = #{fIfsampling},</if>
- <if test="sendSampleDate != null">send_sample_date = #{sendSampleDate},</if>
- <if test="fIfweightRecovery != null">f_ifweight_recovery = #{fIfweightRecovery},</if>
- <if test="weightRecoveryDate != null">weight_recovery_date = #{weightRecoveryDate},</if>
- <if test="warehouseStatus != null">warehouse_status = #{warehouseStatus},</if>
- <if test="fTimes != null">f_times = #{fTimes},</if>
- <if test="fDateChanged != null">f_date_changed = #{fDateChanged},</if>
- <if test="fChargetype != null">f_chargetype = #{fChargetype},</if>
- <if test="fWeighWeight != null">f_weigh_weight = #{fWeighWeight},</if>
- <if test="fPredictBranch != null">f_predict_branch = #{fPredictBranch},</if>
- <if test="fGrade != null">f_grade = #{fGrade},</if>
- <if test="fDeliveryDetails != null">f_delivery_details = #{fDeliveryDetails},</if>
- <if test="fSalesmanId != null">f_salesman_id = #{fSalesmanId},</if>
- <if test="fItemstatus != null">f_itemstatus = #{fItemstatus},</if>
- <if test="fUpdeteStatus != null">f_updete_status = #{fUpdeteStatus},</if>
- <if test="fSubmitUpdate != null">f_submit_update = #{fSubmitUpdate},</if>
- <if test="fDeleteStatus != null">f_delete_status = #{fDeleteStatus},</if>
- <if test="fRemarksFees != null">f_remarks_fees = #{fRemarksFees},</if>
- <if test="fCargoPlanning != null">f_cargo_planning = #{fCargoPlanning},</if>
- <if test="fFeeStatus != null">f_fee_status = #{fFeeStatus},</if>
- <if test="fArrivalStatus != null">f_arrival_status = #{fArrivalStatus},</if>
- <if test="fDismountStatus != null">f_dismount_status = #{fDismountStatus},</if>
- <if test="fServiceitemsNew != null">f_serviceitems_new = #{fServiceitemsNew},</if>
- <if test="fReceivable != null">f_receivable = #{fReceivable},</if>
- <if test="fRecycle != null">f_recycle = #{fRecycle},</if>
- <if test="fDue != null">f_due = #{fDue},</if>
- <if test="fPay != null">f_pay = #{fPay},</if>
- <if test="fCaregoStatus != null">f_carego_status = #{fCaregoStatus},</if>
- <if test="fShipTwo != null">f_ship_two = #{fShipTwo},</if>
- <if test="fVoyTwo != null">f_voy_two = #{fVoyTwo},</if>
- <if test="pickUpPerson != null">pick_up_person = #{pickUpPerson},</if>
- <if test="pickUpTime != null">pick_up_time = #{pickUpTime},</if>
- <if test="facilityPerson != null">facility_person = #{facilityPerson},</if>
- <if test="facilityTime != null">facility_time = #{facilityTime},</if>
- <if test="isPledge != null and isPledge != ''">is_pledge = #{isPledge},</if>
- <if test="documentSummary != null and documentSummary != ''">document_summary = #{documentSummary},</if>
- <if test="financialBillType != null and financialBillType != ''">financial_bill_type = #{financialBillType},</if>
- </trim>
- where f_id = #{fId}
- </update>
- <update id="updateKaHeOrder" parameterType="TWarehousebills">
- update t_warehousebills
- <trim prefix="SET" suffixOverrides=",">
- <if test="fBillno != null">f_billno = #{fBillno},</if>
- <if test="fCustomsdeclartion != null">f_customsdeclartion = #{fCustomsdeclartion},</if>
- <if test="fOriginalbillno != null">f_originalbillno = #{fOriginalbillno},</if>
- <if test="fDeptid != null">f_deptid = #{fDeptid},</if>
- <if test="fBsdeptid != null">f_bsdeptid = #{fBsdeptid},</if>
- <if test="fContacts != null">f_contacts = #{fContacts},</if>
- <if test="fTel != null">f_tel = #{fTel},</if>
- <if test="fCorpid != null">f_corpid = #{fCorpid},</if>
- <if test="fShipper != null">f_shipper = #{fShipper},</if>
- <if test="fTocorpid != null">f_tocorpid = #{fTocorpid},</if>
- <if test="fStltypeid != null">f_stltypeid = #{fStltypeid},</if>
- <if test="fBscorpno != null and fBscorpno != ''">f_bscorpno = #{fBscorpno},</if>
- <if test="fWarehouseid != null">f_warehouseid = #{fWarehouseid},</if>
- <if test="fStorekeeper != null">f_storekeeper = #{fStorekeeper},</if>
- <if test="fChargedate != null">f_chargedate = #{fChargedate},</if>
- <if test="fBsdate != null">f_bsdate = #{fBsdate},</if>
- <if test="fPlanqty != null">f_planqty = #{fPlanqty},</if>
- <if test="fPlangrossweight != null">f_plangrossweight = #{fPlangrossweight},</if>
- <if test="fPlannetweight != null">f_plannetweight = #{fPlannetweight},</if>
- <if test="fPlanvolumn != null">f_planvolumn = #{fPlanvolumn},</if>
- <if test="fQty != null">f_qty = #{fQty},</if>
- <if test="fGrossweight != null">f_grossweight = #{fGrossweight},</if>
- <if test="fNetweight != null">f_netweight = #{fNetweight},</if>
- <if test="fVolumn != null">f_volumn = #{fVolumn},</if>
- <if test="fTrademodeid != null">f_trademodeid = #{fTrademodeid},</if>
- <if test="fBillingway != null">f_billingway = #{fBillingway},</if>
- <if test="fSbu != null">f_sbu = #{fSbu},</if>
- <if test="fFeetunit != null">f_feetunit = #{fFeetunit},</if>
- <if test="fMblno != null">f_mblno = #{fMblno},</if>
- <if test="fEmblno != null">f_emblno = #{fEmblno},</if>
- <if test="fCompany != null">f_company = #{fCompany},</if>
- <if test="fVslvoy != null">f_vslvoy = #{fVslvoy},</if>
- <if test="fMarks != null and fMarks != ''">f_marks = #{fMarks},</if>
- <if test="fEta != null">f_eta = #{fEta},</if>
- <if test="fCustomno != null">f_customno = #{fCustomno},</if>
- <if test="fIfweigh != null">f_ifweigh = #{fIfweigh},</if>
- <if test="fIfpledge != null">f_ifpledge = #{fIfpledge},</if>
- <if test="fIfdamage != null">f_ifdamage = #{fIfdamage},</if>
- <if test="fBankcorpid != null">f_bankcorpid = #{fBankcorpid},</if>
- <if test="fBilltype != null">f_billtype = #{fBilltype},</if>
- <if test="fBillstatus != null">f_billstatus = #{fBillstatus},</if>
- <if test="delFlag != null">del_flag = #{delFlag},</if>
- <if test="createBy != null">create_by = #{createBy},</if>
- <if test="createTime != null">create_time = #{createTime},</if>
- <if test="fItemsStatus != null">f_items_status = #{fItemsStatus},</if>
- <if test="updateBy != null">update_by = #{updateBy},</if>
- <if test="updateTime != null">update_time = #{updateTime},</if>
- <if test="remark != null">remark = #{remark},</if>
- <if test="fBillingDeadline != null">f_billing_deadline = #{fBillingDeadline},</if>
- <if test="fProductName != null">f_product_name = #{fProductName},</if>
- <if test="fReviewDate != null and fBillstatus == 11" >f_review_date = #{fReviewDate},</if>
- <if test="fReviewDate != null and fBillstatus != 11">f_review_date = null,</if>
- <if test="fTruckno != null">f_truckno = #{fTruckno},</if>
- <if test="fDriverName != null">f_driver_name = #{fDriverName},</if>
- <if test="fDriverTel != null">f_driver_tel = #{fDriverTel},</if>
- <if test="fDriverIdCar != null">f_driver_id_car = #{fDriverIdCar},</if>
- <if test="fBusinessType != null">f_business_type = #{fBusinessType},</if>
- <if test="fReviewDate == null">f_review_date = null,</if>
- <if test="fLabour != null">f_labour = #{fLabour },</if>
- <if test="fFleet != null">f_fleet = #{fFleet},</if>
- <if test="fInwarehouseid != null">f_inwarehouseid = #{fInwarehouseid},</if>
- <if test="fBstime != null">f_bstime = #{fBstime},</if>
- <if test="fCartype != null">f_cartype = #{fCartype},</if>
- <if test="fGoodsid != null">f_goodsid = #{fGoodsid},</if>
- <if test="fNewTrademodeid != null">f_new_trademodeid = #{fNewTrademodeid},</if>
- <if test="fLoadportid != null">f_loadportid = #{fLoadportid},</if>
- <if test="fDestportid != null">f_destportid = #{fDestportid},</if>
- <if test="fServiceitems != null">f_serviceitems = #{fServiceitems},</if>
- <if test="fInvoceobj != null">f_invoceobj = #{fInvoceobj},</if>
- <if test="fSign != null">f_sign = #{fSign},</if>
- <if test="fDetentioncargo != null">f_detentioncargo = #{fDetentioncargo},</if>
- <if test="fBooksmarks != null">f_booksmarks = #{fBooksmarks},</if>
- <if test="fShippername != null">f_shippername = #{fShippername},</if>
- <if test="fShipperattn != null">f_shipperattn = #{fShipperattn},</if>
- <if test="fShippertel != null">f_shippertel = #{fShippertel},</if>
- <if test="fConsigneername != null">f_consigneername = #{fConsigneername},</if>
- <if test="fConsigneeattn != null">f_consigneeattn = #{fConsigneeattn},</if>
- <if test="fConsigneetel != null">f_consigneetel = #{fConsigneetel},</if>
- <if test="fInsurance != null">f_insurance = #{fInsurance},</if>
- <if test="fInsuranceamt != null">f_insuranceamt = #{fInsuranceamt},</if>
- <if test="fClosedate != null">f_closedate = #{fClosedate},</if>
- <if test="fDocmentdate != null">f_docmentdate = #{fDocmentdate},</if>
- <if test="fVslid != null">f_vslid = #{fVslid},</if>
- <if test="fVoyid != null">f_voyid = #{fVoyid},</if>
- <if test="fPaymode != null">f_paymode = #{fPaymode},</if>
- <if test="fLaneid != null">f_laneid = #{fLaneid},</if>
- <if test="fTypeid != null">f_typeid = #{fTypeid},</if>
- <if test="freeContainerDate != null">free_container_date = #{freeContainerDate},</if>
- <if test="fBusinessAttribution != null">f_business_attribution = #{fBusinessAttribution},</if>
- <if test="fSupervisionUnit != null">f_supervision_unit = #{fSupervisionUnit},</if>
- <if test="fDeclarationElements != null">f_declaration_elements = #{fDeclarationElements},</if>
- <if test="fPartNumber != null">f_part_number = #{fPartNumber},</if>
- <if test="fIfinspection != null">f_ifinspection = #{fIfinspection},</if>
- <if test="fValue != null">f_value = #{fValue},</if>
- <if test="fWeighingDate != null">f_weighing_date = #{fWeighingDate},</if>
- <if test="fIfsampling != null">f_ifsampling = #{fIfsampling},</if>
- <if test="sendSampleDate != null">send_sample_date = #{sendSampleDate},</if>
- <if test="fIfweightRecovery != null">f_ifweight_recovery = #{fIfweightRecovery},</if>
- <if test="weightRecoveryDate != null">weight_recovery_date = #{weightRecoveryDate},</if>
- <if test="warehouseStatus != null">warehouse_status = #{warehouseStatus},</if>
- <if test="fTimes != null">f_times = #{fTimes},</if>
- <if test="fDateChanged != null">f_date_changed = #{fDateChanged},</if>
- <if test="fChargetype != null">f_chargetype = #{fChargetype},</if>
- <if test="fWeighWeight != null">f_weigh_weight = #{fWeighWeight},</if>
- <if test="fPredictBranch != null">f_predict_branch = #{fPredictBranch},</if>
- <if test="fGrade != null">f_grade = #{fGrade},</if>
- <if test="fDeliveryDetails != null">f_delivery_details = #{fDeliveryDetails},</if>
- <if test="fSalesmanId != null">f_salesman_id = #{fSalesmanId},</if>
- <if test="fItemstatus != null">f_itemstatus = #{fItemstatus},</if>
- <if test="fUpdeteStatus != null">f_updete_status = #{fUpdeteStatus},</if>
- <if test="fSubmitUpdate != null">f_submit_update = #{fSubmitUpdate},</if>
- <if test="fDeleteStatus != null">f_delete_status = #{fDeleteStatus},</if>
- <if test="fRemarksFees != null">f_remarks_fees = #{fRemarksFees},</if>
- <if test="fCargoPlanning != null">f_cargo_planning = #{fCargoPlanning},</if>
- <if test="fFeeStatus != null">f_fee_status = #{fFeeStatus},</if>
- <if test="fArrivalStatus != null">f_arrival_status = #{fArrivalStatus},</if>
- <if test="fDismountStatus != null">f_dismount_status = #{fDismountStatus},</if>
- <if test="fServiceitemsNew != null">f_serviceitems_new = #{fServiceitemsNew},</if>
- <if test="fReceivable != null">f_receivable = #{fReceivable},</if>
- <if test="fRecycle != null">f_recycle = #{fRecycle},</if>
- <if test="fDue != null">f_due = #{fDue},</if>
- <if test="fPay != null">f_pay = #{fPay},</if>
- <if test="fCaregoStatus != null">f_carego_status = #{fCaregoStatus},</if>
- <if test="fShipTwo != null">f_ship_two = #{fShipTwo},</if>
- <if test="fVoyTwo != null">f_voy_two = #{fVoyTwo},</if>
- <if test="pickUpPerson != null">pick_up_person = #{pickUpPerson},</if>
- <if test="pickUpTime != null">pick_up_time = #{pickUpTime},</if>
- <if test="facilityPerson != null">facility_person = #{facilityPerson},</if>
- <if test="facilityTime != null">facility_time = #{facilityTime},</if>
- <if test="isPledge != null and isPledge != ''">is_pledge = #{isPledge},</if>
- </trim>
- where f_id = #{fId}
- </update>
- <delete id="deleteTWarehousebillsById" parameterType="Long">
- delete
- from t_warehousebills
- where f_id = #{fId}
- </delete>
- <delete id="deleteTWarehousebillsByIds" parameterType="String">
- delete
- item.*,
- elabel.*,
- bill.*,
- fess.*,
- enclosure.*
- from
- t_warehousebills bill
- LEFT JOIN t_warehousebillsfees fess ON fess.f_pid = bill.f_id
- LEFT JOIN t_enclosure enclosure ON enclosure.f_pid = bill.f_id
- LEFT JOIN t_warehousebillsitems item ON item.f_pid = bill.f_id
- LEFT JOIN t_warehousebillsitems_elabel elabel ON elabel.f_pid = item.f_id
- where
- bill.f_id in
- <foreach item="fId" collection="array" open="(" separator="," close=")">
- #{fId}
- </foreach>
- </delete>
- <delete id="deleteKHTWarehousebillsByIds" parameterType="String">
- delete
- bill.*,
- fess.*,
- enclosure.*
- from
- t_warehousebills bill
- LEFT JOIN t_warehousebills_cntr fess ON fess.f_pid = bill.f_id
- LEFT JOIN t_warehousebills_cntritems enclosure ON enclosure.f_pid = bill.f_id
- where
- bill.f_id in
- <foreach item="fId" collection="array" open="(" separator="," close=")">
- #{fId}
- </foreach>
- </delete>
- <update id="warehouseFollowUpdate">
- update
- t_warehousebills
- <trim prefix="SET" suffixOverrides=",">
- <if test="fettle != null">f_billstatus = #{fettle},</if>
- <if test="auditItem != null and fettle == 6">f_review_date = #{auditItem},</if>
- <if test="auditItem != null and fettle != 6">f_review_date = null,</if>
- </trim>
- where f_id = #{fPid}
- </update>
- <update id="warehouseApprovalUpdate">
- update
- t_warehousebills
- SET ${auditItem.fidStatus} = #{fettle}
- where f_id = #{auditItem.billId}
- </update>
- <select id="selectDetailedList" resultType="java.util.Map">
- SELECT
- t.f_id AS fId,
- item.f_id AS fItemsId,
- C.f_name AS fcorpid,
- t.f_shipper AS fShipper,
- t.f_mblno AS fMblno,
- g.f_name AS fGoodsid,
- dict.dict_label AS fBusinessType,
- t.f_marks AS fMarks,
- CASE
- WHEN t.f_billtype = 'SJRK' THEN
- '入库'
- WHEN t.f_billtype = 'SJCK' THEN
- '出库'
- WHEN t.f_billtype = 'CKDB' THEN
- '调拨'
- WHEN t.f_billtype = 'HQZY' THEN
- '货权转移'
- WHEN t.f_billtype = 'HWTG' THEN
- '货物通关'
- END AS fBilltype,
- item.f_bsdate AS fBsdate,
- item.f_warehouse_information AS fWarehouseInformation,
- dictTra.dict_label AS fTrademodeid,
- CASE
- WHEN t.f_billtype = 'SJRK' THEN
- ( SELECT SUM( it.f_qty ) FROM t_warehousebillsitems it WHERE it.f_pid = item.f_pid ) ELSE 0
- END AS fQtyRK,
- CASE
- WHEN t.f_billtype = 'SJRK' THEN
- ( SELECT SUM( it.f_grossweight ) FROM t_warehousebillsitems it WHERE it.f_pid = item.f_pid ) ELSE 0
- END AS fGrossweightRK,
- CASE
- WHEN t.f_billtype = 'SJRK' THEN
- ( SELECT SUM( it.f_netweight ) FROM t_warehousebillsitems it WHERE it.f_pid = item.f_pid ) ELSE 0
- END AS fNetweightRK,
- CASE
- WHEN t.f_billtype = 'SJCK' THEN
- ( SELECT SUM( it.f_qty ) FROM t_warehousebillsitems it WHERE it.f_pid = item.f_pid ) ELSE 0
- END AS fQtyCK,
- CASE
- WHEN t.f_billtype = 'SJCK' THEN
- ( SELECT SUM( it.f_grossweight ) FROM t_warehousebillsitems it WHERE it.f_pid = item.f_pid ) ELSE 0
- END AS fGrossweightCK,
- CASE
- WHEN t.f_billtype = 'SJCK' THEN
- ( SELECT SUM( it.f_netweight ) FROM t_warehousebillsitems it WHERE it.f_pid = item.f_pid ) ELSE 0
- END AS fNetweightCK,
- CASE
- WHEN t.f_billtype = 'CKDB' THEN
- ( SELECT SUM( it.f_qty ) FROM t_warehousebillsitems it WHERE it.f_pid = item.f_pid ) ELSE 0
- END AS fQtyDB,
- CASE
- WHEN t.f_billtype = 'CKDB' THEN
- ( SELECT SUM( it.f_grossweight ) FROM t_warehousebillsitems it WHERE it.f_pid = item.f_pid ) ELSE 0
- END AS fGrossweightDB,
- CASE
- WHEN t.f_billtype = 'CKDB' THEN
- ( SELECT SUM( it.f_netweight ) FROM t_warehousebillsitems it WHERE it.f_pid = item.f_pid ) ELSE 0
- END AS fNetweightDB,
- CASE
- WHEN t.f_billtype = 'HQZY' THEN
- ( SELECT SUM( it.f_qty ) FROM t_warehousebillsitems it WHERE it.f_pid = item.f_pid ) ELSE 0
- END AS fQtyHZ,
- CASE
- WHEN t.f_billtype = 'HQZY' THEN
- ( SELECT SUM( it.f_grossweight ) FROM t_warehousebillsitems it WHERE it.f_pid = item.f_pid ) ELSE 0
- END AS fGrossweightHZ,
- CASE
- WHEN t.f_billtype = 'HQZY' THEN
- ( SELECT SUM( it.f_netweight ) FROM t_warehousebillsitems it WHERE it.f_pid = item.f_pid ) ELSE 0
- END AS fNetweightHZ,
- CASE
- WHEN t.f_billtype = 'HWTG' THEN
- ( SELECT SUM( it.f_qty ) FROM t_warehousebillsitems it WHERE it.f_pid = item.f_pid ) ELSE 0
- END AS fQtyTG,
- CASE
- WHEN t.f_billtype = 'HWTG' THEN
- ( SELECT SUM( it.f_grossweight ) FROM t_warehousebillsitems it WHERE it.f_pid = item.f_pid ) ELSE 0
- END AS fGrossweightTG,
- CASE
- WHEN t.f_billtype = 'HWTG' THEN
- ( SELECT SUM( it.f_netweight ) FROM t_warehousebillsitems it WHERE it.f_pid = item.f_pid ) ELSE 0
- END AS fNetweightTG
- FROM t_warehousebills t
- LEFT JOIN t_warehousebillsitems item ON item.f_pid = t.f_id
- LEFT JOIN t_goods g ON item.f_goodsid = g.f_id
- LEFT JOIN t_corps C ON t.f_corpid = C.f_id
- LEFT JOIN sys_dict_data dict ON dict.dict_value = item.f_business_type
- LEFT JOIN sys_dict_data dictTra ON dictTra.dict_value = t.f_trademodeid
- WHERE dict.STATUS = '0'
- AND t.f_typeid IS NULL
- AND dict.dict_type = 'storage_type'
- AND dictTra.STATUS = '0'
- AND dictTra.dict_type = 'data_trademodes'
- AND item.f_billstatus = 40
- AND item.f_mblno = #{fMblno}
- AND (item.f_warehouselocid = #{fWarehouseLocationid} or
- item.f_transfer_warehouselocid = #{fWarehouseLocationid})
- AND t.f_trademodeid = #{fTrademodeids}
- AND item.f_business_type = #{fBusinessType}
- AND item.f_goodsid = #{fGoodsid}
- AND item.f_marks = #{fMarks}
- AND t.f_corpid = #{fCorpIds}
- GROUP BY t.f_id
- </select>
- <select id="webVersionOrderList" parameterType="TWarehousebills" resultMap="TWarehousebillsResult">
- SELECT
- tw.f_id,
- tw.f_billno,
- tw.f_customsdeclartion,
- tw.f_originalbillno,
- tw.f_deptid,
- tw.f_bsdeptid,
- tw.f_contacts,
- tw.f_tel,
- tw.f_corpid,
- tw.f_shipper,
- tc.f_name corpName,
- tw.f_tocorpid,
- tw.f_stltypeid,
- tw.f_bscorpno,
- tw.f_warehouseid,
- tw.f_storekeeper,
- tw.f_chargedate,
- tw.f_bsdate,
- tw.f_planqty,
- tw.f_plangrossweight,
- tw.f_plannetweight,
- tw.f_planvolumn,
- tw.f_qty,
- tw.f_grossweight,
- tw.f_netweight,
- tw.f_volumn,
- tw.f_billingway,
- tw.f_trademodeid,
- tw.f_sbu,
- tw.f_feetunit,
- tw.f_mblno,
- tw.f_marks,
- tw.f_vslvoy,
- tw.f_eta,
- tw.f_customno,
- tw.f_ifweigh,
- tw.f_ifpledge,
- tw.f_ifdamage,
- tw.f_bankcorpid,
- tw.f_billtype,
- tw.f_billstatus,
- tw.f_items_status,
- tw.del_flag,
- tw.create_by,
- tw.create_time,
- tw.update_by,
- tw.update_time,
- tw.remark,
- tw.f_billing_deadline,
- tw.f_product_name,
- tw.f_review_date,
- tw.f_truckno,
- tw.f_driver_name,
- tw.f_driver_tel,
- tw.f_driver_id_car,
- tw.f_business_type,
- tw.f_labour,
- tw.f_fleet,
- tw.f_inwarehouseid,
- tw.f_bstime,
- tw.f_cartype,
- tw.f_goodsid,
- tw.f_new_trademodeid,
- tw.f_loadportid,
- address.f_name loadportidName,
- tw.f_destportid,
- ta.f_name destportidName,
- tw.f_serviceitems,
- sd.dict_label serviceitemsName,
- tw.f_invoceobj,
- sdi.dict_label invoceobjName,
- tw.f_sign,
- sdc.dict_label signName,
- tw.f_detentioncargo,
- sdt.dict_label detentioncargoName,
- tw.f_booksmarks,
- tw.f_shippername,
- tw.f_shipperattn,
- tw.f_shippertel,
- tw.f_consigneername,
- tw.f_consigneeattn,
- tw.f_consigneetel,
- tw.f_insurance,
- sdd.dict_label insuranceName,
- tw.f_insuranceamt,
- tw.f_closedate,
- tw.f_docmentdate,
- tw.f_vslid,
- tv.f_name vslidName,
- tw.f_voyid,
- ty.f_no voyidName,
- tw.f_typeid,
- tw.f_paymode,
- sda.dict_label paymodeName,
- tw.f_laneid,
- tr.f_name laneidName,
- tw.f_updete_status,
- tw.f_submit_update,
- tw.f_delete_status,
- tw.f_cargo_planning,
- tw.f_arrival_status,
- tw.f_dismount_status,
- tw.f_serviceitems_new
- FROM t_warehousebills tw
- LEFT JOIN t_address address ON address.f_id = tw.f_loadportid
- LEFT JOIN t_address ta ON ta.f_id = tw.f_loadportid
- LEFT JOIN t_address tr ON tr.f_id = tw.f_laneid
- LEFT JOIN t_corps tc ON tc.f_id = tw.f_corpid
- LEFT JOIN sys_dict_data sd ON sd.dict_value = tw.f_serviceitems
- AND sd.dict_type = 'f_serviceitems'
- LEFT JOIN sys_dict_data sdi ON sdi.dict_value = tw.f_invoceobj
- AND sdi.dict_type = 'f_invoceobj'
- LEFT JOIN sys_dict_data sdc ON sdc.dict_value = tw.f_sign
- AND sdc.dict_type = 'f_sign'
- LEFT JOIN sys_dict_data sdt ON sdt.dict_value = tw.f_detentioncargo
- AND sdt.dict_type = 'f_detentioncargo'
- LEFT JOIN sys_dict_data sdd ON sdd.dict_value = tw.f_insurance
- AND sdd.dict_type = 'f_insurance'
- LEFT JOIN sys_dict_data sda ON sda.dict_value = tw.f_paymode
- AND sda.dict_type = 'f_paymode'
- LEFT JOIN t_vessel tv ON tv.f_id = tw.f_vslid
- LEFT JOIN t_voyage ty ON ty.f_id = tw.f_voyid
- <where>
- tw.f_typeid = '1'
- and tw.del_flag = '0'
- <if test="fId != null">and tw.f_id = #{fId}</if>
- <if test="fBillno != null and fBillno != ''">and tw.f_billno = #{fBillno}</if>
- <if test="fCustomsdeclartion != null and fCustomsdeclartion != ''">and tw.f_customsdeclartion =#{fCustomsdeclartion}</if>
- <if test="fOriginalbillno != null and fOriginalbillno != ''">and tw.f_originalbillno = #{fOriginalbillno}</if>
- <if test="fDeptid != null ">and tw.f_deptid = #{fDeptid}</if>
- <if test="fBsdeptid != null ">and tw.f_bsdeptid = #{fBsdeptid}</if>
- <if test="fContacts != null and fContacts != ''">and tw.f_contacts = #{fContacts}</if>
- <if test="fTel != null and fTel != ''">and tw.f_tel = #{fTel}</if>
- <if test="fCorpid != null ">and tw.f_corpid = #{fCorpid}</if>
- <if test="fShipper != null and fShipper != ''">and tw.f_shipper like concat('%', #{fShipper}, '%')</if>
- <if test="fTocorpid != null ">and tw.f_tocorpid = #{fTocorpid}</if>
- <if test="fStltypeid != null ">and tw.f_stltypeid = #{fStltypeid}</if>
- <if test="fBscorpno != null and fBscorpno != ''">and tw.f_bscorpno = #{fBscorpno}</if>
- <if test="fWarehouseid != null ">and tw.f_warehouseid = #{fWarehouseid}</if>
- <if test="fStorekeeper != null and fStorekeeper != ''">and tw.f_storekeeper = #{fStorekeeper}</if>
- <if test="fChargedate != null ">and tw.f_chargedate = #{fChargedate}</if>
- <if test="fBsdate != null ">and tw.f_bsdate = #{fBsdate}</if>
- <if test="fPlanqty != null ">and tw.f_planqty = #{fPlanqty}</if>
- <if test="fPlangrossweight != null ">and tw.f_plangrossweight = #{fPlangrossweight}</if>
- <if test="fPlannetweight != null ">and tw.f_plannetweight = #{fPlannetweight}</if>
- <if test="fPlanvolumn != null ">and tw.f_planvolumn = #{fPlanvolumn}</if>
- <if test="fQty != null ">and tw.f_qty = #{fQty}</if>
- <if test="fGrossweight != null ">and tw.f_grossweight = #{fGrossweight}</if>
- <if test="fNetweight != null ">and tw.f_netweight = #{fNetweight}</if>
- <if test="fVolumn != null ">and tw.f_volumn = #{fVolumn}</if>
- <if test="fBillingway != null ">and tw.f_billingway = #{fBillingway}</if>
- <if test="fTrademodeid != null ">and tw.f_trademodeid = #{fTrademodeid}</if>
- <if test="fSbu != null ">and tw.f_sbu = #{fSbu}</if>
- <if test="fFeetunit != null and fFeetunit != ''">and tw.f_feetunit = #{fFeetunit}</if>
- <if test="fMblno != null and fMblno != ''">and tw.f_mblno = #{fMblno}</if>
- <if test="fMarks != null and fMarks != ''">and tw.f_marks = #{fMarks}</if>
- <if test="fVslvoy != null and fVslvoy != ''">and tw.f_vslvoy = #{fVslvoy}</if>
- <if test="fEta != null ">and tw.f_eta = #{fEta}</if>
- <if test="fCustomno != null and fCustomno != ''">and tw.f_customno = #{fCustomno}</if>
- <if test="fIfweigh != null and fIfweigh != ''">and tw.f_ifweigh = #{fIfweigh}</if>
- <if test="fIfpledge != null and fIfpledge != ''">and tw.f_ifpledge = #{fIfpledge}</if>
- <if test="fIfdamage != null and fIfdamage != ''">and tw.f_ifdamage = #{fIfdamage}</if>
- <if test="fBankcorpid != null and fBankcorpid != ''">and tw.f_bankcorpid = #{fBankcorpid}</if>
- <if test="fBilltype != null and fBilltype != ''">and tw.f_billtype = #{fBilltype}</if>
- <if test="fBillstatus != null ">and tw.f_billstatus = #{fBillstatus}</if>
- <if test="fItemsStatus != null ">and tw.f_items_status = #{fItemsStatus}</if>
- <if test="fBillingDeadline != null ">and tw.f_billing_deadline = #{fBillingDeadline}</if>
- <if test="fProductName != null and fProductName != ''">and tw.f_product_name like concat('%',
- #{fProductName}, '%')
- </if>
- <if test="fReviewDate != null ">and tw.f_review_date = #{fReviewDate}</if>
- <if test="fTruckno != null and fTruckno != ''">and tw.f_truckno = #{fTruckno}</if>
- <if test="fDriverName != null and fDriverName != ''">and tw.f_driver_name like concat('%', #{fDriverName},
- '%')
- </if>
- <if test="fDriverTel != null and fDriverTel != ''">and tw.f_driver_tel = #{fDriverTel}</if>
- <if test="fDriverIdCar != null and fDriverIdCar != ''">and tw.f_driver_id_car = #{fDriverIdCar}</if>
- <if test="fBusinessType != null and fBusinessType != ''">and tw.f_business_type = #{fBusinessType}</if>
- <if test="fLabour != null ">and tw.f_labour = #{fLabour}</if>
- <if test="fFleet != null ">and tw.f_fleet = #{fFleet}</if>
- <if test="fInwarehouseid != null ">and tw.f_inwarehouseid = #{fInwarehouseid}</if>
- <if test="fBstime != null ">and tw.f_bstime = #{fBstime}</if>
- <if test="fCartype != null ">and tw.f_cartype = #{fCartype}</if>
- <if test="fGoodsid != null ">and tw.f_goodsid = #{fGoodsid}</if>
- <if test="fNewTrademodeid != null ">and tw.f_new_trademodeid = #{fNewTrademodeid}</if>
- <if test="fLoadportid != null ">and tw.f_loadportid = #{fLoadportid}</if>
- <if test="fDestportid != null ">and tw.f_destportid = #{fDestportid}</if>
- <if test="fServiceitems != null and fServiceitems != ''">and tw.f_serviceitems = #{fServiceitems}</if>
- <if test="fInvoceobj != null and fInvoceobj != ''">and tw.f_invoceobj = #{fInvoceobj}</if>
- <if test="fSign != null ">and tw.f_sign = #{fSign}</if>
- <if test="fDetentioncargo != null ">and tw.f_detentioncargo = #{fDetentioncargo}</if>
- <if test="fBooksmarks != null and fBooksmarks != ''">and tw.f_booksmarks = #{fBooksmarks}</if>
- <if test="fShippername != null and fShippername != ''">and tw.f_shippername like concat('%',
- #{fShippername}, '%')
- </if>
- <if test="fShipperattn != null and fShipperattn != ''">and tw.f_shipperattn = #{fShipperattn}</if>
- <if test="fShippertel != null and fShippertel != ''">and tw.f_shippertel = #{fShippertel}</if>
- <if test="fConsigneername != null and fConsigneername != ''">and tw.f_consigneername like concat('%',
- #{fConsigneername}, '%')
- </if>
- <if test="fConsigneeattn != null and fConsigneeattn != ''">and tw.f_consigneeattn = #{fConsigneeattn}</if>
- <if test="fConsigneetel != null and fConsigneetel != ''">and tw.f_consigneetel = #{fConsigneetel}</if>
- <if test="fInsurance != null and fInsurance != ''">and tw.f_insurance = #{fInsurance}</if>
- <if test="fInsuranceamt != null ">and tw.f_insuranceamt = #{fInsuranceamt}</if>
- <if test="fClosedate != null ">and tw.f_closedate = #{fClosedate}</if>
- <if test="fDocmentdate != null ">and tw.f_docmentdate = #{fDocmentdate}</if>
- <if test="fVslid != null ">and tw.f_vslid = #{fVslid}</if>
- <if test="fVoyid != null ">and tw.f_voyid = #{fVoyid}</if>
- <if test="fTypeid != null ">and tw.f_typeid = #{fTypeid}</if>
- <if test="fPaymode != null">and tw.f_paymode = #{fPaymode},</if>
- <if test="fLaneid != null">and tw.f_laneid = #{fLaneid},</if>
- <if test='timeInterval != null and timeInterval[0] != null and timeInterval[0]!= ""'>
- and tw.create_time >= #{timeInterval[0]}
- </if>
- <if test='timeInterval != null and timeInterval[1] != null and timeInterval[1]!= ""'>
- and tw.create_time <= #{timeInterval[1]}
- </if>
- <if test="fCargoPlanning != null "> and tw.f_cargo_planning = #{fCargoPlanning}</if>
- <if test="fArrivalStatus != null "> and tw.f_arrival_status = #{fArrivalStatus}</if>
- <if test="billList != null "> and tw.f_mblno in
- <foreach item="fMblno" collection="billList" open="(" separator="," close=")">
- #{fMblno}
- </foreach>
- </if>
- </where>
- ORDER BY tw.create_time DESC, tw.f_id DESC
- </select>
- <select id="ruoYiVersionOrderList" parameterType="TWarehousebills" resultType="map">
- SELECT
- DISTINCT
- tw.f_id fId,
- tw.f_billno fBillno,
- tw.f_originalbillno fOriginalbillno,
- tw.f_shipper fShipper,
- tw.f_mblno fMblno,
- sd.dict_label fServiceitems,
- tk.dict_label fDestportMode,
- tw.f_consigneername fConsigneername,
- tw.f_consigneetel fConsigneetel,
- tw.f_eta fEta,
- tw.f_marks fMarks,
- ta.f_name fName,
- tw.f_bsdate fBsdate,
- ty.f_ATD fAtd,
- ty.f_ATA fAta,
- tc.f_cntrcount fCntrcount,
- tc.f_no fNo,
- tv.f_name vslName,
- ty.f_no voyNo,
- tw.f_corpid fCorpid,
- tp.f_name corpName,
- tp.f_no shipAgentNo,
- tw.create_by createBy,
- tw.create_time createTime,
- tw.f_loadportid fLoadportid,
- tre.f_name loadportName,
- tw.f_destportid fDestportid,
- ts.f_name destportName,
- tc.f_name goodsName,
- CASE
- 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
- '下单新建'
- 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
- '下单暂存'
- 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
- '下单驳回'
- 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
- '下单提交'
- 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
- '下单审批中'
- 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
- '下单审批通过'
- 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
- '配船暂存'
- 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
- '配船驳回'
- 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
- '配船提交'
- 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
- '配船审批中'
- 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
- '配船审批通过'
- 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
- '运单变更'
- 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
- '申请变更驳回'
- 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
- '申请变更提交'
- 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
- '申请变更审批中'
- 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
- '申请变更通过'
- WHEN tw.f_submit_update = '3' and tw.f_delete_status = '2' and tw.f_dismount_status = '2' THEN
- '提交变更驳回'
- WHEN tw.f_submit_update = '4' and tw.f_delete_status = '2' and tw.f_dismount_status = '2' THEN
- '提交变更审批'
- WHEN tw.f_submit_update = '5' and tw.f_delete_status = '2' and tw.f_dismount_status = '2' THEN
- '提交变更审批中'
- WHEN tw.f_submit_update = '6' and tw.f_delete_status = '2' and tw.f_dismount_status = '2' THEN
- '提交变更通过'
- WHEN tw.f_delete_status = '3' and tw.f_dismount_status = '2' THEN
- '申请删单驳回'
- WHEN tw.f_delete_status = '4' and tw.f_dismount_status = '2' THEN
- '申请删单提交'
- WHEN tw.f_delete_status = '5' and tw.f_dismount_status = '2' THEN
- '申请删单审批中'
- WHEN tw.f_delete_status = '6' and tw.f_dismount_status = '2' THEN
- '申请删单通过'
- WHEN tw.f_dismount_status = '3' THEN
- '拆单审批驳回'
- WHEN tw.f_dismount_status = '4' THEN
- '拆单审批提交'
- WHEN tw.f_dismount_status = '5' THEN
- '拆单审批中'
- WHEN tw.f_dismount_status = '6' THEN
- '拆单审批通过'
- END AS fBillstatus,
- CASE
- WHEN tf.f_billstatus = '1' THEN
- '新建'
- WHEN tf.f_billstatus = '2' THEN
- '暂存'
- WHEN tf.f_billstatus = '3' THEN
- '驳回'
- WHEN tf.f_billstatus = '4' THEN
- '提交'
- WHEN tf.f_billstatus = '5' THEN
- '审批中'
- WHEN tf.f_billstatus = '6' THEN
- '审批通过'
- END AS moneyStatus,
- tw.f_updete_status fUpdeteStatus,
- tw.f_submit_update fSubmitUpdate,
- tw.f_delete_status fDeleteStatus,
- tw.f_cargo_planning fCargoPlanning,
- tw.f_arrival_status fArrivalStatus,
- tw.f_vslid fVslid,
- tw.f_voyid fVoyid,
- tw.remark remark,
- IFNULL(tcntr.loadCntr,0) AS loadCntr,
- tw.f_serviceitems_new AS fServiceitemsNew,
- tw.f_receivable AS fReceivable,
- tw.f_recycle AS fRecycle,
- tw.f_due AS fDue,
- tw.f_pay AS fPay,
- CASE
- WHEN tw.f_carego_status = '0' THEN '录入'
- WHEN tw.f_carego_status = '1' THEN '未放货'
- WHEN tw.f_carego_status = '2' THEN '放货'
- WHEN tw.f_carego_status = '3' THEN '扣货'
- END AS fCaregoStatus,
- tv1.f_name fShipTwoName,
- ty1.f_no fVoyTwoName,
- tw.pick_up_person AS pickUpPerson,
- tw.pick_up_time AS pickUpTime,
- tw.facility_person AS facilityPerson,
- tw.facility_time AS facilityTime,
- tv.f_ename AS vesselNameEn,
- tp.f_typeid AS sendType,
- tp.f_contractno AS contractNo,
- tv.f_imo AS imo,
- ta.f_no AS mtdm,
- tv.f_ower AS shipCompany,
- tw.f_billtype AS billType,
- tw.f_paymode AS fPaymode
- FROM
- t_warehousebills tw
- LEFT JOIN t_address ta ON ta.f_id = tw.f_laneid
- LEFT JOIN t_address tre ON tre.f_id = tw.f_loadportid
- LEFT JOIN t_address ts ON ts.f_id = tw.f_destportid
- LEFT JOIN sys_dict_data sd ON sd.dict_value = tw.f_serviceitems AND sd.dict_type = 'f_serviceitems'
- LEFT JOIN sys_dict_data tk ON tk.dict_value = tw.f_serviceitems_new AND tk.dict_type = 'f_serviceitems'
- <if test="fCntrno != null and fCntrno != ''">
- LEFT JOIN t_warehousebills_cntritems items ON tw.f_id = items.f_pid
- </if>
- LEFT JOIN t_vessel tv ON tw.f_vslid = tv.f_id
- LEFT JOIN t_voyage ty ON tw.f_voyid = ty.f_id
- LEFT JOIN t_vessel tv1 ON tw.f_ship_two = tv1.f_id
- LEFT JOIN t_voyage ty1 ON tw.f_voy_two = ty1.f_id
- LEFT JOIN t_corps tp ON tw.f_corpid = tp.f_id
- LEFT JOIN (
- SELECT
- th.f_pid,
- th.f_cntrcount,
- tr.f_no,
- th.f_cntrid,
- tg.f_name
- FROM
- t_warehousebills_cntr th
- LEFT JOIN t_cntr tr ON th.f_cntrid = tr.f_id
- LEFT JOIN t_goods tg ON th.f_goodsid = tg.f_id
- ) tc ON tc.f_pid = tw.f_id
- LEFT JOIN (SELECT f_pid,f_billstatus FROM t_warehousebillsfees GROUP BY f_pid)tf ON tf.f_pid = tw.f_id
- LEFT JOIN (
- SELECT
- th.f_pid,
- count(th.f_pid) loadCntr
- FROM
- t_warehousebills_cntritems th
- GROUP BY th.f_pid
- ) tcntr ON tcntr.f_pid = tw.f_id
- <where>
- tw.f_typeid = '1'
- and tw.del_flag = '0'
- <if test="fId != null">and tw.f_id = #{fId}</if>
- <if test="fCaregoStatus != null and fCaregoStatus != ''">and tw.f_carego_status = #{fCaregoStatus}</if>
- <if test="fCntrno != null and fCntrno != ''">and items.f_cntrno like concat('%', #{fCntrno}, '%')</if>
- <if test="fBillno != null and fBillno != ''">and tw.f_billno like concat('%',#{fBillno}, '%')</if>
- <if test="fCustomsdeclartion != null and fCustomsdeclartion != ''">and tw.f_customsdeclartion =
- #{fCustomsdeclartion}
- </if>
- <if test="fOriginalbillno != null and fOriginalbillno != ''">and tw.f_originalbillno = #{fOriginalbillno}
- </if>
- <if test="fDeptid != null ">and tw.f_deptid = #{fDeptid}</if>
- <if test="fBsdeptid != null ">and tw.f_bsdeptid = #{fBsdeptid}</if>
- <if test="fContacts != null and fContacts != ''">and tw.f_contacts = #{fContacts}</if>
- <if test="fTel != null and fTel != ''">and tw.f_tel = #{fTel}</if>
- <if test="fCorpid != null ">and tw.f_corpid = #{fCorpid}</if>
- <if test="fShipper != null and fShipper != ''">and tw.f_shipper like concat('%', #{fShipper}, '%')</if>
- <if test="fTocorpid != null ">and tw.f_tocorpid = #{fTocorpid}</if>
- <if test="fStltypeid != null ">and tw.f_stltypeid = #{fStltypeid}</if>
- <if test="fBscorpno != null and fBscorpno != ''">and tw.f_bscorpno = #{fBscorpno}</if>
- <if test="fWarehouseid != null ">and tw.f_warehouseid = #{fWarehouseid}</if>
- <if test="fStorekeeper != null and fStorekeeper != ''">and tw.f_storekeeper = #{fStorekeeper}</if>
- <if test="fChargedate != null ">and tw.f_chargedate = #{fChargedate}</if>
- <if test="fBsdate != null ">and tw.f_bsdate = #{fBsdate}</if>
- <if test="fPlanqty != null ">and tw.f_planqty = #{fPlanqty}</if>
- <if test="fPlangrossweight != null ">and tw.f_plangrossweight = #{fPlangrossweight}</if>
- <if test="fPlannetweight != null ">and tw.f_plannetweight = #{fPlannetweight}</if>
- <if test="fPlanvolumn != null ">and tw.f_planvolumn = #{fPlanvolumn}</if>
- <if test="fQty != null ">and tw.f_qty = #{fQty}</if>
- <if test="fGrossweight != null ">and tw.f_grossweight = #{fGrossweight}</if>
- <if test="fNetweight != null ">and tw.f_netweight = #{fNetweight}</if>
- <if test="fVolumn != null ">and tw.f_volumn = #{fVolumn}</if>
- <if test="fBillingway != null ">and tw.f_billingway = #{fBillingway}</if>
- <if test="fTrademodeid != null ">and tw.f_trademodeid = #{fTrademodeid}</if>
- <if test="fSbu != null ">and tw.f_sbu = #{fSbu}</if>
- <if test="fFeetunit != null and fFeetunit != ''">and tw.f_feetunit = #{fFeetunit}</if>
- <if test="fMblno != null and fMblno != ''">and tw.f_mblno like concat('%',
- #{fMblno}, '%')</if>
- <if test="fMarks != null and fMarks != ''">and tw.f_marks = #{fMarks}</if>
- <if test="fVslvoy != null and fVslvoy != ''">and tw.f_vslvoy = #{fVslvoy}</if>
- <if test="fEta != null ">and tw.f_eta = #{fEta}</if>
- <if test="fCustomno != null and fCustomno != ''">and tw.f_customno = #{fCustomno}</if>
- <if test="fIfweigh != null and fIfweigh != ''">and tw.f_ifweigh = #{fIfweigh}</if>
- <if test="fIfpledge != null and fIfpledge != ''">and tw.f_ifpledge = #{fIfpledge}</if>
- <if test="fIfdamage != null and fIfdamage != ''">and tw.f_ifdamage = #{fIfdamage}</if>
- <if test="fBankcorpid != null and fBankcorpid != ''">and tw.f_bankcorpid = #{fBankcorpid}</if>
- <if test="fBilltype != null and fBilltype != ''">and tw.f_billtype = #{fBilltype}</if>
- <if test="fBillstatus != null and (fBillstatus == 4 or fBillstatus == 6 or fBillstatus == 9 or fBillstatus == 11)">
- and tw.f_billstatus = #{fBillstatus}
- and tw.f_updete_status = 2
- and tw.f_submit_update = 2
- and tw.f_delete_status = 2
- </if>
- <if test="fBillstatus != null and fBillstatus == 10">
- and tw.f_billstatus in ('3','8')
- and tw.f_updete_status in ('2','3')
- and tw.f_submit_update in ('2','3')
- and tw.f_delete_status in ('2','3')
- </if>
- <if test="fBillstatus != null and fBillstatus == 12">
- AND (tw.f_updete_status != 2
- OR tw.f_submit_update != 2
- OR tw.f_delete_status != 2 )
- </if>
- <if test="fItemsStatus != null ">and tw.f_items_status = #{fItemsStatus}</if>
- <if test="fBillingDeadline != null ">and tw.f_billing_deadline = #{fBillingDeadline}</if>
- <if test="fProductName != null and fProductName != ''">and tw.f_product_name like concat('%',
- #{fProductName}, '%')
- </if>
- <if test="fReviewDate != null ">and tw.f_review_date = #{fReviewDate}</if>
- <if test="fTruckno != null and fTruckno != ''">and tw.f_truckno = #{fTruckno}</if>
- <if test="fDriverName != null and fDriverName != ''">and tw.f_driver_name like concat('%', #{fDriverName},
- '%')
- </if>
- <if test="fDriverTel != null and fDriverTel != ''">and tw.f_driver_tel = #{fDriverTel}</if>
- <if test="fDriverIdCar != null and fDriverIdCar != ''">and tw.f_driver_id_car = #{fDriverIdCar}</if>
- <if test="fBusinessType != null and fBusinessType != ''">and tw.f_business_type = #{fBusinessType}</if>
- <if test="fLabour != null ">and tw.f_labour = #{fLabour}</if>
- <if test="fFleet != null ">and tw.f_fleet = #{fFleet}</if>
- <if test="fInwarehouseid != null ">and tw.f_inwarehouseid = #{fInwarehouseid}</if>
- <if test="fBstime != null ">and tw.f_bstime = #{fBstime}</if>
- <if test="fCartype != null ">and tw.f_cartype = #{fCartype}</if>
- <if test="fGoodsid != null ">and tw.f_goodsid = #{fGoodsid}</if>
- <if test="fNewTrademodeid != null ">and tw.f_new_trademodeid = #{fNewTrademodeid}</if>
- <if test="fLoadportid != null ">and tw.f_loadportid = #{fLoadportid}</if>
- <if test="fDestportid != null ">and tw.f_destportid = #{fDestportid}</if>
- <if test="fServiceitems != null and fServiceitems != ''">and tw.f_serviceitems = #{fServiceitems}</if>
- <if test="fInvoceobj != null and fInvoceobj != ''">and tw.f_invoceobj = #{fInvoceobj}</if>
- <if test="fSign != null ">and tw.f_sign = #{fSign}</if>
- <if test="fDetentioncargo != null ">and tw.f_detentioncargo = #{fDetentioncargo}</if>
- <if test="fBooksmarks != null and fBooksmarks != ''">and tw.f_booksmarks = #{fBooksmarks}</if>
- <if test="fShippername != null and fShippername != ''">and tw.f_shippername like concat('%',
- #{fShippername}, '%')
- </if>
- <if test="fShipperattn != null and fShipperattn != ''">and tw.f_shipperattn = #{fShipperattn}</if>
- <if test="fShippertel != null and fShippertel != ''">and tw.f_shippertel = #{fShippertel}</if>
- <if test="fConsigneername != null and fConsigneername != ''">and tw.f_consigneername like concat('%',
- #{fConsigneername}, '%')
- </if>
- <if test="fConsigneeattn != null and fConsigneeattn != ''">and tw.f_consigneeattn = #{fConsigneeattn}</if>
- <if test="fConsigneetel != null and fConsigneetel != ''">and tw.f_consigneetel = #{fConsigneetel}</if>
- <if test="fInsurance != null and fInsurance != ''">and tw.f_insurance = #{fInsurance}</if>
- <if test="fInsuranceamt != null ">and tw.f_insuranceamt = #{fInsuranceamt}</if>
- <if test="fClosedate != null ">and tw.f_closedate = #{fClosedate}</if>
- <if test="fDocmentdate != null ">and tw.f_docmentdate = #{fDocmentdate}</if>
- <if test="fVslid != null ">and tw.f_vslid = #{fVslid}</if>
- <if test="fVoyid != null ">and tw.f_voyid = #{fVoyid}</if>
- <if test="fTypeid != null ">and tw.f_typeid = #{fTypeid}</if>
- <if test="fPaymode != null">and tw.f_paymode = #{fPaymode},</if>
- <if test="fLaneid != null">and tw.f_laneid = #{fLaneid},</if>
- <if test='startTime != null'>
- and tw.create_time >= #{startTime}
- </if>
- <if test='endTime != null'>
- and tw.create_time <= #{endTime}
- </if>
- <if test="fCntrid != null ">and tc.f_cntrid = #{fCntrid}</if>
- <if test="fCntrcount != null ">and tc.f_cntrcount = #{fCntrcount}</if>
- <if test="vslidName != null and vslidName != ''">and tv.f_name like concat('%',
- #{vslidName}, '%')
- </if>
- <if test="voyidName != null and voyidName != ''">and ty.f_no like concat('%',
- #{voyidName}, '%')
- </if>
- <if test="boxNumber != null and boxNumber != ''">and tc.f_no like concat('%',
- #{boxNumber}, '%')
- </if>
- <if test="createBy != null and createBy != ''">and tw.create_by = #{createBy}</if>
- <if test='cLoadDate != null and cLoadDate[0] != null and cLoadDate[0]!= ""'>
- and tw.create_time >= #{cLoadDate[0]}
- </if>
- <if test='cLoadDate != null and cLoadDate[1] != null and cLoadDate[1]!= ""'>
- and tw.create_time <= #{cLoadDate[1]}
- </if>
- <if test='timeInterval != null and timeInterval[0] != null and timeInterval[0]!= ""'>
- and ty.f_ATD >= #{timeInterval[0]}
- </if>
- <if test='timeInterval != null and timeInterval[1] != null and timeInterval[1]!= ""'>
- and ty.f_ATD <= #{timeInterval[1]}
- </if>
- <if test="fCargoPlanning != null "> and tw.f_cargo_planning = #{fCargoPlanning}</if>
- <if test="fArrivalStatus != null and fArrivalStatus != 3"> and tw.f_arrival_status = #{fArrivalStatus}</if>
- <if test="fArrivalStatus != null and fArrivalStatus == 3"> and tw.f_arrival_status != '2'</if>
- <if test="fShipTwo != null "> and tw.f_ship_two = #{fShipTwo}</if>
- <if test="fVoyTwo != null "> and tw.f_voy_two = #{fVoyTwo}</if>
- </where>
- ORDER BY tw.create_time DESC, tw.f_id DESC
- </select>
- <select id="ruoYiVersionOrderList1" parameterType="TWarehousebills" resultType="map">
- SELECT
- tw.f_id fId,
- tw.f_billno fBillno,
- tw.f_originalbillno fOriginalbillno,
- tw.f_shipper fShipper,
- tw.f_mblno fMblno,
- sd.dict_label fServiceitems,
- tw.f_consigneername fConsigneername,
- ta.f_name fName,
- tw.f_bsdate fBsdate,
- tc.f_cntrcount fCntrcount,
- tc.f_no fNo,
- tv.f_name vslName,
- ty.f_no voyNo,
- tw.f_corpid fCorpid,
- tp.f_name corpName,
- tw.create_by createBy,
- tw.create_time createTime,
- tw.f_loadportid fLoadportid,
- tre.f_name loadportName,
- tw.f_destportid fDestportid,
- ts.f_name destportName,
- tc.f_name goodsName,
- tw.f_billstatus fBillstatus,
- CASE
- 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
- '下单新建'
- 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
- '下单暂存'
- 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
- '下单驳回'
- 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
- '下单提交'
- 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
- '下单审批中'
- 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
- '下单审批通过'
- 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
- '配船暂存'
- 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
- '配船驳回'
- 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
- '配船提交'
- 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
- '配船审批中'
- 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
- '配船审批通过'
- 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
- '运单变更'
- 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
- '申请变更驳回'
- 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
- '申请变更提交'
- 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
- '申请变更审批中'
- 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
- '申请变更通过'
- WHEN tw.f_submit_update = '3' and tw.f_delete_status = '2' and tw.f_dismount_status = '2' THEN
- '提交变更驳回'
- WHEN tw.f_submit_update = '4' and tw.f_delete_status = '2' and tw.f_dismount_status = '2' THEN
- '提交变更审批'
- WHEN tw.f_submit_update = '5' and tw.f_delete_status = '2' and tw.f_dismount_status = '2' THEN
- '提交变更审批中'
- WHEN tw.f_submit_update = '6' and tw.f_delete_status = '2' and tw.f_dismount_status = '2' THEN
- '提交变更通过'
- WHEN tw.f_delete_status = '3' and tw.f_dismount_status = '2' THEN
- '申请删单驳回'
- WHEN tw.f_delete_status = '4' and tw.f_dismount_status = '2' THEN
- '申请删单提交'
- WHEN tw.f_delete_status = '5' and tw.f_dismount_status = '2' THEN
- '申请删单审批中'
- WHEN tw.f_delete_status = '6' and tw.f_dismount_status = '2' THEN
- '申请删单通过'
- WHEN tw.f_dismount_status = '3' THEN
- '拆单审批驳回'
- WHEN tw.f_dismount_status = '4' THEN
- '拆单审批提交'
- WHEN tw.f_dismount_status = '5' THEN
- '拆单审批中'
- WHEN tw.f_dismount_status = '6' THEN
- '拆单审批通过'
- END AS fBillstatusName,
- CASE
- WHEN tf.f_billstatus = '1' THEN
- '新建'
- WHEN tf.f_billstatus = '2' THEN
- '暂存'
- WHEN tf.f_billstatus = '3' THEN
- '驳回'
- WHEN tf.f_billstatus = '4' THEN
- '提交'
- WHEN tf.f_billstatus = '5' THEN
- '审批中'
- WHEN tf.f_billstatus = '6' THEN
- '审批通过'
- END AS moneyStatus,
- tw.f_updete_status fUpdeteStatus,
- tw.f_submit_update fSubmitUpdate,
- tw.f_delete_status fDeleteStatus,
- ROUND(IFNULL(tf.fAmount,0),2) fAmount,
- tw.f_cargo_planning fCargoPlanning,
- tw.f_arrival_status,
- tw.remark remark,
- tw.f_serviceitems_new AS fServiceitemsNew
- FROM
- t_warehousebills tw
- LEFT JOIN t_address ta ON ta.f_id = tw.f_laneid
- LEFT JOIN t_address tre ON tre.f_id = tw.f_loadportid
- LEFT JOIN t_address ts ON ts.f_id = tw.f_destportid
- LEFT JOIN sys_dict_data sd ON sd.dict_value = tw.f_serviceitems
- AND sd.dict_type = 'f_serviceitems'
- LEFT JOIN t_vessel tv ON tw.f_vslid = tv.f_id
- LEFT JOIN t_voyage ty ON tw.f_voyid = ty.f_id
- LEFT JOIN t_corps tp ON tw.f_corpid = tp.f_id
- LEFT JOIN (
- SELECT
- th.f_pid,
- th.f_cntrcount,
- tr.f_no,
- th.f_cntrid,
- tg.f_name
- FROM
- t_warehousebills_cntr th
- LEFT JOIN t_cntr tr ON th.f_cntrid = tr.f_id
- LEFT JOIN t_goods tg ON th.f_goodsid = tg.f_id
- ) tc ON tc.f_pid = tw.f_id
- 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
- <where>
- tw.f_typeid = '1'
- and tw.del_flag = '0'
- <if test="fId != null">and tw.f_id = #{fId}</if>
- <if test="fBillno != null and fBillno != ''">and tw.f_billno = #{fBillno}</if>
- <if test="fCustomsdeclartion != null and fCustomsdeclartion != ''">and tw.f_customsdeclartion =
- #{fCustomsdeclartion}
- </if>
- <if test="fOriginalbillno != null and fOriginalbillno != ''">and tw.f_originalbillno = #{fOriginalbillno}
- </if>
- <if test="fDeptid != null ">and tw.f_deptid = #{fDeptid}</if>
- <if test="fBsdeptid != null ">and tw.f_bsdeptid = #{fBsdeptid}</if>
- <if test="fContacts != null and fContacts != ''">and tw.f_contacts = #{fContacts}</if>
- <if test="fTel != null and fTel != ''">and tw.f_tel = #{fTel}</if>
- <if test="fCorpid != null ">and tw.f_corpid = #{fCorpid}</if>
- <if test="fShipper != null and fShipper != ''">and tw.f_shipper like concat('%', #{fShipper}, '%')</if>
- <if test="fTocorpid != null ">and tw.f_tocorpid = #{fTocorpid}</if>
- <if test="fStltypeid != null ">and tw.f_stltypeid = #{fStltypeid}</if>
- <if test="fBscorpno != null and fBscorpno != ''">and tw.f_bscorpno = #{fBscorpno}</if>
- <if test="fWarehouseid != null ">and tw.f_warehouseid = #{fWarehouseid}</if>
- <if test="fStorekeeper != null and fStorekeeper != ''">and tw.f_storekeeper = #{fStorekeeper}</if>
- <if test="fChargedate != null ">and tw.f_chargedate = #{fChargedate}</if>
- <if test="fBsdate != null ">and tw.f_bsdate = #{fBsdate}</if>
- <if test="fPlanqty != null ">and tw.f_planqty = #{fPlanqty}</if>
- <if test="fPlangrossweight != null ">and tw.f_plangrossweight = #{fPlangrossweight}</if>
- <if test="fPlannetweight != null ">and tw.f_plannetweight = #{fPlannetweight}</if>
- <if test="fPlanvolumn != null ">and tw.f_planvolumn = #{fPlanvolumn}</if>
- <if test="fQty != null ">and tw.f_qty = #{fQty}</if>
- <if test="fGrossweight != null ">and tw.f_grossweight = #{fGrossweight}</if>
- <if test="fNetweight != null ">and tw.f_netweight = #{fNetweight}</if>
- <if test="fVolumn != null ">and tw.f_volumn = #{fVolumn}</if>
- <if test="fBillingway != null ">and tw.f_billingway = #{fBillingway}</if>
- <if test="fTrademodeid != null ">and tw.f_trademodeid = #{fTrademodeid}</if>
- <if test="fSbu != null ">and tw.f_sbu = #{fSbu}</if>
- <if test="fFeetunit != null and fFeetunit != ''">and tw.f_feetunit = #{fFeetunit}</if>
- <if test="fMblno != null and fMblno != ''">and tw.f_mblno = #{fMblno}</if>
- <if test="fMarks != null and fMarks != ''">and tw.f_marks = #{fMarks}</if>
- <if test="fVslvoy != null and fVslvoy != ''">and tw.f_vslvoy = #{fVslvoy}</if>
- <if test="fEta != null ">and tw.f_eta = #{fEta}</if>
- <if test="fCustomno != null and fCustomno != ''">and tw.f_customno = #{fCustomno}</if>
- <if test="fIfweigh != null and fIfweigh != ''">and tw.f_ifweigh = #{fIfweigh}</if>
- <if test="fIfpledge != null and fIfpledge != ''">and tw.f_ifpledge = #{fIfpledge}</if>
- <if test="fIfdamage != null and fIfdamage != ''">and tw.f_ifdamage = #{fIfdamage}</if>
- <if test="fBankcorpid != null and fBankcorpid != ''">and tw.f_bankcorpid = #{fBankcorpid}</if>
- <if test="fBilltype != null and fBilltype != ''">and tw.f_billtype = #{fBilltype}</if>
- <if test="fBillstatus != null and (fBillstatus == 4 or fBillstatus == 6 or fBillstatus == 9 or fBillstatus == 11)">
- and tw.f_billstatus = #{fBillstatus}
- and tw.f_updete_status = 2
- and tw.f_submit_update = 2
- and tw.f_delete_status = 2
- </if>
- <if test="fBillstatus != null and fBillstatus == 10">
- and tw.f_billstatus in ('3','8')
- and tw.f_updete_status in ('2','3')
- and tw.f_submit_update in ('2','3')
- and tw.f_delete_status in ('2','3')
- </if>
- <if test="fBillstatus != null and fBillstatus == 12">
- AND (tw.f_updete_status != 2
- OR tw.f_submit_update != 2
- OR tw.f_delete_status != 2 )
- </if>
- <if test="fItemsStatus != null ">and tw.f_items_status = #{fItemsStatus}</if>
- <if test="fBillingDeadline != null ">and tw.f_billing_deadline = #{fBillingDeadline}</if>
- <if test="fProductName != null and fProductName != ''">and tw.f_product_name like concat('%',
- #{fProductName}, '%')
- </if>
- <if test="fReviewDate != null ">and tw.f_review_date = #{fReviewDate}</if>
- <if test="fTruckno != null and fTruckno != ''">and tw.f_truckno = #{fTruckno}</if>
- <if test="fDriverName != null and fDriverName != ''">and tw.f_driver_name like concat('%', #{fDriverName},
- '%')
- </if>
- <if test="fDriverTel != null and fDriverTel != ''">and tw.f_driver_tel = #{fDriverTel}</if>
- <if test="fDriverIdCar != null and fDriverIdCar != ''">and tw.f_driver_id_car = #{fDriverIdCar}</if>
- <if test="fBusinessType != null and fBusinessType != ''">and tw.f_business_type = #{fBusinessType}</if>
- <if test="fLabour != null ">and tw.f_labour = #{fLabour}</if>
- <if test="fFleet != null ">and tw.f_fleet = #{fFleet}</if>
- <if test="fInwarehouseid != null ">and tw.f_inwarehouseid = #{fInwarehouseid}</if>
- <if test="fBstime != null ">and tw.f_bstime = #{fBstime}</if>
- <if test="fCartype != null ">and tw.f_cartype = #{fCartype}</if>
- <if test="fGoodsid != null ">and tw.f_goodsid = #{fGoodsid}</if>
- <if test="fNewTrademodeid != null ">and tw.f_new_trademodeid = #{fNewTrademodeid}</if>
- <if test="fLoadportid != null ">and tw.f_loadportid = #{fLoadportid}</if>
- <if test="fDestportid != null ">and tw.f_destportid = #{fDestportid}</if>
- <if test="fServiceitems != null and fServiceitems != ''">and tw.f_serviceitems = #{fServiceitems}</if>
- <if test="fInvoceobj != null and fInvoceobj != ''">and tw.f_invoceobj = #{fInvoceobj}</if>
- <if test="fSign != null ">and tw.f_sign = #{fSign}</if>
- <if test="fDetentioncargo != null ">and tw.f_detentioncargo = #{fDetentioncargo}</if>
- <if test="fBooksmarks != null and fBooksmarks != ''">and tw.f_booksmarks = #{fBooksmarks}</if>
- <if test="fShippername != null and fShippername != ''">and tw.f_shippername like concat('%',
- #{fShippername}, '%')
- </if>
- <if test="fShipperattn != null and fShipperattn != ''">and tw.f_shipperattn = #{fShipperattn}</if>
- <if test="fShippertel != null and fShippertel != ''">and tw.f_shippertel = #{fShippertel}</if>
- <if test="fConsigneername != null and fConsigneername != ''">and tw.f_consigneername like concat('%',
- #{fConsigneername}, '%')
- </if>
- <if test="fConsigneeattn != null and fConsigneeattn != ''">and tw.f_consigneeattn = #{fConsigneeattn}</if>
- <if test="fConsigneetel != null and fConsigneetel != ''">and tw.f_consigneetel = #{fConsigneetel}</if>
- <if test="fInsurance != null and fInsurance != ''">and tw.f_insurance = #{fInsurance}</if>
- <if test="fInsuranceamt != null ">and tw.f_insuranceamt = #{fInsuranceamt}</if>
- <if test="fClosedate != null ">and tw.f_closedate = #{fClosedate}</if>
- <if test="fDocmentdate != null ">and tw.f_docmentdate = #{fDocmentdate}</if>
- <if test="fVslid != null ">and tw.f_vslid = #{fVslid}</if>
- <if test="fVoyid != null ">and tw.f_voyid = #{fVoyid}</if>
- <if test="fTypeid != null ">and tw.f_typeid = #{fTypeid}</if>
- <if test="fPaymode != null">and tw.f_paymode = #{fPaymode},</if>
- <if test="fLaneid != null">and tw.f_laneid = #{fLaneid},</if>
- <if test='startTime != null'>
- and tw.create_time >= #{startTime}
- </if>
- <if test='endTime != null'>
- and tw.create_time <= #{endTime}
- </if>
- <if test="fCntrid != null ">and tc.f_cntrid = #{fCntrid}</if>
- <if test="fCntrcount != null ">and tc.f_cntrcount = #{fCntrcount}</if>
- <if test="vslidName != null and vslidName != ''">and tv.f_name like concat('%',
- #{vslidName}, '%')
- </if>
- <if test="voyidName != null and voyidName != ''">and ty.f_no like concat('%',
- #{voyidName}, '%')
- </if>
- <if test="boxNumber != null and boxNumber != ''">and tc.f_no like concat('%',
- #{voyidName}, '%')
- </if>
- <if test="createBy != null and createBy != ''">and tw.create_by = #{createBy}</if>
- <if test='cLoadDate != null and cLoadDate[0] != null and cLoadDate[0]!= ""'>
- and tw.f_bsdate >= #{cLoadDate[0]}
- </if>
- <if test='cLoadDate != null and cLoadDate[1] != null and cLoadDate[1]!= ""'>
- and tw.f_bsdate <= #{cLoadDate[1]}
- </if>
- <if test="fCargoPlanning != null "> and tw.f_cargo_planning = #{fCargoPlanning}</if>
- <if test="fArrivalStatus != null "> and tw.f_arrival_status = #{fArrivalStatus}</if>
- <if test="fShipTwo != null "> and tw.f_ship_two = #{fShipTwo}</if>
- <if test="fVoyTwo != null "> and tw.f_voy_two = #{fVoyTwo}</if>
- </where>
- ORDER BY tw.create_time DESC, tw.f_id DESC
- </select>
- <select id="webVersionOrderById" parameterType="TWarehousebills" resultMap="TWarehousebillsResult">
- SELECT tw.f_id,
- tw.f_billno,
- tw.f_customsdeclartion,
- tw.f_originalbillno,
- tw.f_deptid,
- tw.f_bsdeptid,
- tw.f_contacts,
- tw.f_tel,
- tw.f_shipper,
- tw.f_corpid,
- tc.f_name corpName,
- tw.f_tocorpid,
- tw.f_stltypeid,
- tw.f_bscorpno,
- tw.f_warehouseid,
- tw.f_storekeeper,
- tw.f_chargedate,
- tw.f_bsdate,
- tw.f_planqty,
- tw.f_plangrossweight,
- tw.f_plannetweight,
- tw.f_planvolumn,
- tw.f_qty,
- tw.f_grossweight,
- tw.f_netweight,
- tw.f_volumn,
- tw.f_billingway,
- tw.f_trademodeid,
- tw.f_sbu,
- tw.f_feetunit,
- tw.f_mblno,
- tw.f_marks,
- tw.f_vslvoy,
- tw.f_eta,
- tw.f_customno,
- tw.f_ifweigh,
- tw.f_ifpledge,
- tw.f_ifdamage,
- tw.f_bankcorpid,
- tw.f_billtype,
- tw.f_billstatus,
- tw.f_items_status,
- tw.del_flag,
- tw.create_by,
- tw.create_time,
- tw.update_by,
- tw.update_time,
- tw.remark,
- tw.f_billing_deadline,
- tw.f_product_name,
- tw.f_review_date,
- tw.f_truckno,
- tw.f_driver_name,
- tw.f_driver_tel,
- tw.f_driver_id_car,
- tw.f_business_type,
- tw.f_labour,
- tw.f_fleet,
- tw.f_inwarehouseid,
- tw.f_bstime,
- tw.f_cartype,
- tw.f_goodsid,
- tw.f_new_trademodeid,
- tw.f_loadportid,
- address.f_name loadportidName,
- tw.f_destportid,
- ta.f_name destportidName,
- tw.f_serviceitems,
- sd.dict_label serviceitemsName,
- tw.f_invoceobj,
- sdi.dict_label invoceobjName,
- tw.f_sign,
- sdc.dict_label signName,
- tw.f_detentioncargo,
- sdt.dict_label detentioncargoName,
- tw.f_booksmarks,
- tw.f_shippername,
- tw.f_shipperattn,
- tw.f_shippertel,
- tw.f_consigneername,
- tw.f_consigneeattn,
- tw.f_consigneetel,
- tw.f_insurance,
- sdd.dict_label insuranceName,
- tw.f_insuranceamt,
- tw.f_closedate,
- tw.f_docmentdate,
- tw.f_vslid,
- tv.f_name vslidName,
- tw.f_voyid,
- ty.f_no voyidName,
- tw.f_typeid,
- tw.f_paymode,
- sda.dict_label paymodeName,
- tw.f_laneid,
- tr.f_name laneidName,
- tw.f_updete_status,
- tw.f_submit_update,
- tw.f_delete_status,
- tw.f_cargo_planning,
- tw.f_arrival_status,
- tw.f_dismount_status,
- tw.f_serviceitems_new,
- tw.f_receivable,
- tw.f_recycle,
- tw.f_due,
- tw.f_pay,
- CASE
- WHEN tw.f_carego_status = '0' THEN '录入'
- WHEN tw.f_carego_status = '1' THEN '未放货'
- WHEN tw.f_carego_status = '2' THEN '放货'
- WHEN tw.f_carego_status = '3' THEN '扣货'
- END AS fCaregoStatus,
- tv1.f_name fShipTwoName,
- ty1.f_no fVoyTwoName,
- tw.f_ship_two,
- tw.f_voy_two,
- tw.pick_up_person,
- tw.pick_up_time,
- tw.facility_person,
- tw.facility_time
- FROM t_warehousebills tw
- LEFT JOIN t_address address ON address.f_id = tw.f_loadportid
- LEFT JOIN t_address ta ON ta.f_id = tw.f_loadportid
- LEFT JOIN t_address tr ON tr.f_id = tw.f_laneid
- LEFT JOIN t_corps tc ON tc.f_id = tw.f_corpid
- LEFT JOIN sys_dict_data sd ON sd.dict_value = tw.f_serviceitems
- AND sd.dict_type = 'f_serviceitems'
- LEFT JOIN sys_dict_data sdi ON sdi.dict_value = tw.f_invoceobj
- AND sdi.dict_type = 'f_invoceobj'
- LEFT JOIN sys_dict_data sdc ON sdc.dict_value = tw.f_sign
- AND sdc.dict_type = 'f_sign'
- LEFT JOIN sys_dict_data sdt ON sdt.dict_value = tw.f_detentioncargo
- AND sdt.dict_type = 'f_detentioncargo'
- LEFT JOIN sys_dict_data sdd ON sdd.dict_value = tw.f_insurance
- AND sdd.dict_type = 'f_insurance'
- LEFT JOIN sys_dict_data sda ON sda.dict_value = tw.f_paymode
- AND sda.dict_type = 'f_paymode'
- LEFT JOIN t_vessel tv ON tv.f_id = tw.f_vslid
- LEFT JOIN t_voyage ty ON ty.f_id = tw.f_voyid
- LEFT JOIN t_vessel tv1 ON tv1.f_id = tw.f_ship_two
- LEFT JOIN t_voyage ty1 ON ty1.f_id = tw.f_voy_two
- where 1= 1
- <if test="fMblno != null and fMblno != ''">and tw.f_mblno = #{fMblno} </if>
- <if test="fId != null ">and tw.f_id = #{fId} </if>
- </select>
- <select id="selectTWarehousebillsfMblno" parameterType="TWarehousebills" resultMap="TWarehousebillsResult">
- SELECT
- f_id,
- f_mblno
- FROM
- t_warehousebills
- WHERE
- f_typeid = '1'
- and del_flag = '0'
- and f_mblno = #{fMblno}
- </select>
- <select id="selectAppStockList" parameterType="TWarehousebills" resultType="Map">
- SELECT DISTINCT
- w.f_id fId,
- w.f_corpid fCorpid,
- c.f_name corpName,
- w.f_shipper fShipper,
- w.f_bsdate fBsdate,
- g.f_name goodsName,
- w.f_mblno fMblno,
- w.f_qty fQty,
- w.f_cntval fCntval,
- w.f_planqty fPlanqty,
- t.f_name fWarehouseName,
- w.f_planvolumn fPlanvolumn,
- w.f_plannetweight fPlannetweight,
- w.f_plangrossweight fPlangrossweight,
- IFNULL(ROUND(w.f_grossweight/1000,2),0) fGrossweight,
- w.f_grossweight fGrossweights,
- w.f_storekeeper fStorekeeper,
- w.create_by createBy,
- w.f_warehouseid fWarehouseid,
- w.f_driver_tel fDriverTel,
- w.f_trademodeid fTrademodeid,
- w.f_product_name fProductName,
- CASE
- WHEN w.f_billtype = 'SJRK'
- AND w.f_items_status = '1' THEN
- '计划'
- WHEN w.f_billtype = 'SJRK'
- AND w.f_items_status = '2' THEN
- '待入库'
- WHEN w.f_billtype = 'SJRK'
- AND w.f_items_status = '3' THEN
- '入库中'
- WHEN w.f_billtype = 'SJRK'
- AND w.f_items_status = '4' THEN
- '已入库'
- WHEN w.f_billtype = 'SJCK'
- AND w.f_items_status = '1' THEN
- '计划'
- WHEN w.f_billtype = 'SJCK'
- AND w.f_items_status = '2' THEN
- '待出库'
- WHEN w.f_billtype = 'SJCK'
- AND w.f_items_status = '3' THEN
- '出库中'
- WHEN w.f_billtype = 'SJCK'
- AND w.f_items_status = '4' THEN
- '已出库'
- WHEN w.f_billtype = 'CKDB'
- AND w.f_items_status = '1' THEN
- '计划'
- WHEN w.f_billtype = 'CKDB'
- AND w.f_items_status = '2' THEN
- '待调拨'
- WHEN w.f_billtype = 'CKDB'
- AND w.f_items_status = '3' THEN
- '调拨中'
- WHEN w.f_billtype = 'CKDB'
- AND w.f_items_status = '4' THEN
- '已调拨'
- WHEN w.f_billtype = 'HWTG'
- AND w.f_items_status = '1' THEN
- '计划'
- WHEN w.f_billtype = 'HWTG'
- AND w.f_items_status = '2' THEN
- '待调拨'
- WHEN w.f_billtype = 'HWTG'
- AND w.f_items_status = '3' THEN
- '调拨中'
- WHEN w.f_billtype = 'HWTG'
- AND w.f_items_status = '4' THEN
- '已调拨'
- END AS fBillstatus
- FROM
- t_warehousebills w
- LEFT JOIN t_corps c ON c.f_id = w.f_corpid
- LEFT JOIN t_goods g ON g.f_id = w.f_goodsid
- LEFT JOIN t_warehouse t ON t.f_id = w.f_warehouseid
- left join sys_user u on w.create_by = u.user_name
- left join sys_user u1 on w.f_storekeeper = u1.user_name
- left join sys_dept d on w.f_bsdeptid = d.dept_id
- where
- w.f_billtype = #{fBilltype}
- AND w.f_billstatus != 6
- <if test="fItemsStatus == null and timeInterval == null and fMblno == null">
- and IF( w.f_planqty IS NOT NULL, w.f_planqty != w.f_qty, w.f_id != '')
- </if>
- <if test="fCorpid != null and fCorpid != ''">and w.f_corpid = #{fCorpid}</if>
- <if test="fShipper != null and fShipper != ''">and w.f_shipper like concat('%', #{fShipper}, '%')</if>
- <if test="fMblno != null ">and w.f_mblno like concat('%', #{fMblno}, '%')</if>
- <if test="fItemsStatus != null ">and w.f_items_status = #{fItemsStatus}</if>
- <if test="fBillstatus != null ">and w.f_billstatus = #{fBillstatus}</if>
- <if test='timeInterval != null and timeInterval[0] != null and timeInterval[0]!= ""'>
- and w.f_bsdate >= #{timeInterval[0]}
- </if>
- <if test='timeInterval != null and timeInterval[1] != null and timeInterval[1]!= ""'>
- and w.f_bsdate <= #{timeInterval[1]}
- </if>
- <if test="external != null and external != ''">
- and w.f_corpid = (select f_pid from t_customer_contact where f_tel = #{external})
- </if>
- <if test="external == null or external == ''">${params.dataScope}</if>
- order by w.f_id desc
- </select>
- <select id="selectWarehouseItemListById" resultType="java.util.Map">
- SELECT
- t.f_id fId,
- t.f_pid fPid,
- w.f_shipper fShipper,
- c.f_name corpName,
- t.f_bsdate fBsdate,
- g.f_name goodsName,
- t.f_mblno fMblno,
- t.f_warehouse_information fWarehouseInformation,
- t.f_forkliftman fForkliftman,
- t.f_truckno fTruckno,
- t.f_cntrno fCntrno,
- cntr.f_name cntrtypes,
- t.f_cntrtype fCntrtype,
- t.f_qty fQty,
- IFNULL(ROUND(w.f_grossweight/1000,2),0) fGrossweight,
- t.f_grossweight fGrossweights,
- t.f_cntqty fCntqty,
- fleet.f_name fleetName,
- t.f_driver_name fDriverName,
- t.f_driver_tel fDriverTel,
- CASE
- WHEN t.f_billstatus = '10' THEN
- '计划'
- WHEN t.f_billstatus = '20' THEN
- 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', '待转移', '无')))))
- WHEN t.f_billstatus = '30' THEN
- 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', '转移中', '无')))))
- WHEN t.f_billstatus = '40' THEN
- 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', '已转移', '无')))))
- END fBillstatus
- FROM
- t_warehousebills w
- LEFT JOIN t_warehousebillsitems t ON t.f_pid = w.f_id
- LEFT JOIN t_corps fleet ON fleet.f_id = t.f_fleet
- LEFT JOIN t_corps c ON c.f_id = w.f_corpid
- LEFT JOIN t_goods g ON g.f_id = t.f_goodsid
- LEFT JOIN t_cntr cntr ON cntr.f_id = t.f_cntrtype
- where
- t.f_pid = #{fId}
- </select>
- <select id="selectSingleAnalysis" parameterType="com.ruoyi.reportManagement.domain.SingleAnalysisExcel" resultType="com.ruoyi.reportManagement.domain.SingleAnalysisExcel">
- SELECT
- DISTINCT
- c.f_name corpName,
- w.f_mblno fMblno,
- w.f_product_name goodsName,
- w.f_emblno fEmblno,
- d.dict_label fBusinessType,
- w.f_cntval fCntval,
- ware.f_warehouse_information fWName,
- dict.dict_label AS fBusinessTypes,
- w.f_marks AS fMarks,
- IF(item.f_billtype = 'SJRK' || item.f_billtype = 'HQZY' || item.f_billtype = 'CKDB', date_format( item.f_bsdate, '%Y-%m-%d' ), NULL) inBsdate,
- 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,
- 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,
- IF(item.f_billtype = 'SJCK' || item.f_billtype = 'HQZY', date_format( item.f_bsdate, '%Y-%m-%d' ), NULL ) outBsdate,
- IF( item.f_billtype = 'SJCK' || item.f_billtype = 'HQZY', item.f_qty, 0 ) outQty,
- IF( item.f_billtype = 'SJCK' || item.f_billtype = 'HQZY', item.f_grossweight, 0.00 ) outGrossweight,
- CASE
- WHEN item.f_billtype = 'SJRK' THEN
- '入库'
- WHEN item.f_billtype = 'SJCK' THEN
- '出库'
- WHEN item.f_billtype = 'CKDB' and ware.f_charg = 1 THEN
- '调拨'
- WHEN item.f_billtype = 'HQZY' THEN
- '货权转移'
- WHEN item.f_billtype = 'HWTG' THEN
- '货物通关'
- END AS fBilltype,
- (
- 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)
- -
- IF( item.f_billtype = 'SJCK' || item.f_billtype = 'HQZY', item.f_qty, 0 )
- ) AS fQtyblc,
- (
- 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)
- -
- IF( item.f_billtype = 'SJCK' || item.f_billtype = 'HQZY', item.f_grossweight, 0.00 )
- ) AS fGrossweightblc,
- item.f_truckno fTruckno,
- tf.f_billing_days fBillingDays,
- tf.f_amt fAmt,
- item.remark
- FROM
- t_warehousebills w
- LEFT JOIN t_warehousebillsitems item ON item.f_pid = w.f_id
- LEFT JOIN t_warehousebillsfees tf ON item.f_id = tf.src_id
- LEFT JOIN t_corps c ON c.f_id = w.f_corpid
- LEFT JOIN t_warehouse ware ON IF(item.f_billtype = 'CKDB', ware.f_id = item.f_transfer_warehouselocid, ware.f_id = item.f_warehouselocid)
- LEFT JOIN sys_dict_data d ON d.dict_value = w.f_business_type
- LEFT JOIN sys_dict_data dict ON dict.dict_value = item.f_business_type
- WHERE
- dict.status = '0' AND
- dict.dict_type = 'storage_type'
- <if test="fCorpid != null and fCorpid != ''">
- and w.f_corpid = #{fCorpid}
- </if>
- <if test="fMblno != null and fMblno != ''">
- AND item.f_mblno = #{fMblno}
- </if>
- AND IF(item.f_billtype = 'CKDB' and ware.f_charg = 0, w.f_id != '', w.f_id != '')
- 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')))
- <if test='bsdateList != null and bsdateList[0] != null and bsdateList[0]!= ""'>
- AND item.f_bsdate >= #{bsdateList[0]}
- </if>
- <if test='bsdateList != null and bsdateList[1] != null and bsdateList[1]!= ""'>
- AND item.f_bsdate <= #{bsdateList[1]}
- </if>
- <if test="fEmblno != null and fEmblno != ''">
- and w.f_emblno like concat('%', #{fEmblno}, '%')
- </if>
- order by item.f_bsdate asc
- </select>
- <select id="selectSingleAnalysisFees" parameterType="com.ruoyi.reportManagement.domain.SingleAnalysisFeesExcel" resultType="com.ruoyi.reportManagement.domain.SingleAnalysisFeesExcel">
- SELECT
- DISTINCT
- f.f_id,
- date_format( f.create_time, '%Y-%m-%d' ) createTime,
- d.dict_label fBusinessType,
- fee.f_name fFeeid,
- f.f_qty fQty,
- f.f_unitprice fUnitprice,
- f.f_amount fAmount,
- CASE
- WHEN f.f_dc = 'D' THEN '收'
- WHEN f.f_dc = 'C' THEN '付'
- END AS fDc,
- tc.f_name as fCName,
- f.remark
- FROM
- t_warehousebills w
- LEFT JOIN t_warehousebillsitems item ON item.f_pid = w.f_id
- LEFT JOIN t_warehousebillsfees f ON f.f_pid = w.f_id
- LEFT JOIN t_corps tc ON tc.f_id = f.f_corpid
- LEFT JOIN t_fees fee ON fee.f_id = f.f_feeid
- LEFT JOIN t_warehouse ware ON IF(item.f_billtype = 'CKDB', ware.f_id = item.f_transfer_warehouselocid, ware.f_id = item.f_warehouselocid)
- LEFT JOIN sys_dict_data d ON d.dict_value = f.f_business_type
- WHERE
- IF(item.f_billtype = 'CKDB' and ware.f_charg = 0, w.f_id != '', w.f_id != '')
- 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')))
- <if test='bsdateList != null and bsdateList[0] != null and bsdateList[0]!= ""'>
- AND item.f_bsdate >= #{bsdateList[0]}
- </if>
- <if test='bsdateList != null and bsdateList[1] != null and bsdateList[1]!= ""'>
- AND item.f_bsdate <= #{bsdateList[1]}
- </if>
- <if test="fMblno != null and fMblno != ''">
- and item.f_mblno = #{fMblno}
- </if>
- <if test="fEmblno != null and fEmblno != ''">
- and w.f_emblno like concat('%', #{fEmblno}, '%')
- </if>
- order by f.create_time asc
- </select>
- <!--凯和导出清单根据船名航次-->
- <select id="deriveInventory" parameterType="TWarehousebills" resultType="com.ruoyi.shipping.excel.DeriveInventoryExcel">
- SELECT
- @rank:=@rank + 1 AS rankNo,
- a.*
- FROM
- (
- SELECT
- tw.f_mblno AS fMblno, /*提单号*/
- twc.f_cntrno AS fCntrno, /*箱号*/
- twc.f_sealno AS fSealno, /*铅封号*/
- substring(tr.f_no,1,2) AS measure, /*尺寸*/
- substring(tr.f_no,3,2) AS genre, /*类型*/
- twc.f_cntrweight AS fCntrweight, /*重量*/
- CASE
- WHEN tcr.f_soc = '0' THEN tc.f_name
- WHEN tcr.f_soc = '1' THEN '凯和志诚'
- END AS boxCompany,/*箱公司最新*/
- pro.dict_label AS boxCompanyOld, /*箱公司旧*/
- td.f_name AS portOfDeparture, /*始发港*/
- ts.f_name AS destinationPort, /*目的港*/
- tg.f_name AS goodName, /*货名*/
- concat_ws('-', sd.dict_label, tk.dict_label) AS transitClause, /*运输条款*/
- tc.f_name AS bookingCompany, /*订舱公司*/
- tw.f_consigneername AS fConsigneername, /*收货公司名称*/
- tw.f_consigneeattn AS fConsigneeattn, /*收货公司地址*/
- tw.f_consigneetel AS fConsigneetel /*收货公司电话*/
- FROM
- t_warehousebills_cntritems twc
- LEFT JOIN t_warehousebills tw ON twc.f_pid = tw.f_id
- LEFT JOIN t_warehousebills_cntr tcr ON tcr.f_pid = tw.f_id
- LEFT JOIN t_corps tc ON tc.f_id = tw.f_corpid
- LEFT JOIN t_cntr tr ON tr.f_id = twc.f_cntrid
- LEFT JOIN t_cntrno tro ON tro.f_no = twc.f_cntrno
- LEFT JOIN sys_dict_data pro ON pro.dict_value = tro.f_owner AND pro.dict_type = 'f_owner'
- LEFT JOIN t_address td ON td.f_id = tw.f_loadportid
- LEFT JOIN t_address ts ON ts.f_id = tw.f_destportid
- LEFT JOIN t_goods tg ON tg.f_id = tcr.f_goodsid
- LEFT JOIN sys_dict_data sd ON sd.dict_value = tw.f_serviceitems AND sd.dict_type = 'f_serviceitems'
- LEFT JOIN sys_dict_data tk ON tk.dict_value = tw.f_serviceitems_new AND tk.dict_type = 'f_serviceitems'
- LEFT JOIN t_vessel tv ON tw.f_vslid = tv.f_id
- LEFT JOIN t_voyage ty ON tw.f_voyid = ty.f_id
- <where>
- tw.f_typeid = '1'
- and tw.del_flag = '0'
- <if test="fBillno != null and fBillno != ''">and tw.f_billno = #{fBillno}</if>
- <if test="fCntrid != null ">and tcr.f_cntrid = #{fCntrid}</if>
- <if test="fCntrcount != null ">and tc.f_cntrcount = #{fCntrcount}</if>
- <if test="fMblno != null and fMblno != ''">and tw.f_mblno = #{fMblno}</if>
- <if test="fVslid != null ">and tw.f_vslid = #{fVslid}</if>
- <if test="fVoyid != null ">and tw.f_voyid = #{fVoyid}</if>
- <if test="fServiceitems != null and fServiceitems != ''">and tw.f_serviceitems = #{fServiceitems}</if>
- <if test="fConsigneername != null and fConsigneername != ''">and tw.f_consigneername like concat('%',
- #{fConsigneername}, '%')
- </if>
- <if test='cLoadDate != null and cLoadDate[0] != null and cLoadDate[0]!= ""'>
- and tw.create_time >= #{cLoadDate[0]}
- </if>
- <if test='cLoadDate != null and cLoadDate[1] != null and cLoadDate[1]!= ""'>
- and tw.create_time <= #{cLoadDate[1]}
- </if>
- <if test="fCargoPlanning != null "> and tw.f_cargo_planning = #{fCargoPlanning}</if>
- <if test="fArrivalStatus != null "> and tw.f_arrival_status = #{fArrivalStatus}</if>
- <if test="fId != null">and tw.f_id = #{fId}</if>
- <if test="fCaregoStatus != null and fCaregoStatus != ''">and tw.f_carego_status = #{fCaregoStatus}</if>
- <if test="fCntrno != null and fCntrno != ''">and twc.f_cntrno like concat('%', #{fCntrno}, '%')</if>
- <if test="fCustomsdeclartion != null and fCustomsdeclartion != ''">and tw.f_customsdeclartion =
- #{fCustomsdeclartion}
- </if>
- <if test="fOriginalbillno != null and fOriginalbillno != ''">and tw.f_originalbillno = #{fOriginalbillno}
- </if>
- <if test="fDeptid != null ">and tw.f_deptid = #{fDeptid}</if>
- <if test="fBsdeptid != null ">and tw.f_bsdeptid = #{fBsdeptid}</if>
- <if test="fContacts != null and fContacts != ''">and tw.f_contacts = #{fContacts}</if>
- <if test="fTel != null and fTel != ''">and tw.f_tel = #{fTel}</if>
- <if test="fCorpid != null ">and tw.f_corpid = #{fCorpid}</if>
- <if test="fShipper != null and fShipper != ''">and tw.f_shipper like concat('%', #{fShipper}, '%')</if>
- <if test="fTocorpid != null ">and tw.f_tocorpid = #{fTocorpid}</if>
- <if test="fStltypeid != null ">and tw.f_stltypeid = #{fStltypeid}</if>
- <if test="fBscorpno != null and fBscorpno != ''">and tw.f_bscorpno = #{fBscorpno}</if>
- <if test="fWarehouseid != null ">and tw.f_warehouseid = #{fWarehouseid}</if>
- <if test="fStorekeeper != null and fStorekeeper != ''">and tw.f_storekeeper = #{fStorekeeper}</if>
- <if test="fChargedate != null ">and tw.f_chargedate = #{fChargedate}</if>
- <if test="fBsdate != null ">and tw.f_bsdate = #{fBsdate}</if>
- <if test="fPlanqty != null ">and tw.f_planqty = #{fPlanqty}</if>
- <if test="fPlangrossweight != null ">and tw.f_plangrossweight = #{fPlangrossweight}</if>
- <if test="fPlannetweight != null ">and tw.f_plannetweight = #{fPlannetweight}</if>
- <if test="fPlanvolumn != null ">and tw.f_planvolumn = #{fPlanvolumn}</if>
- <if test="fQty != null ">and tw.f_qty = #{fQty}</if>
- <if test="fGrossweight != null ">and tw.f_grossweight = #{fGrossweight}</if>
- <if test="fNetweight != null ">and tw.f_netweight = #{fNetweight}</if>
- <if test="fVolumn != null ">and tw.f_volumn = #{fVolumn}</if>
- <if test="fBillingway != null ">and tw.f_billingway = #{fBillingway}</if>
- <if test="fTrademodeid != null ">and tw.f_trademodeid = #{fTrademodeid}</if>
- <if test="fSbu != null ">and tw.f_sbu = #{fSbu}</if>
- <if test="fFeetunit != null and fFeetunit != ''">and tw.f_feetunit = #{fFeetunit}</if>
- <if test="fMblno != null and fMblno != ''">and tw.f_mblno like concat('%',
- #{fMblno}, '%')</if>
- <if test="fMarks != null and fMarks != ''">and tw.f_marks = #{fMarks}</if>
- <if test="fVslvoy != null and fVslvoy != ''">and tw.f_vslvoy = #{fVslvoy}</if>
- <if test="fEta != null ">and tw.f_eta = #{fEta}</if>
- <if test="fCustomno != null and fCustomno != ''">and tw.f_customno = #{fCustomno}</if>
- <if test="fIfweigh != null and fIfweigh != ''">and tw.f_ifweigh = #{fIfweigh}</if>
- <if test="fIfpledge != null and fIfpledge != ''">and tw.f_ifpledge = #{fIfpledge}</if>
- <if test="fIfdamage != null and fIfdamage != ''">and tw.f_ifdamage = #{fIfdamage}</if>
- <if test="fBankcorpid != null and fBankcorpid != ''">and tw.f_bankcorpid = #{fBankcorpid}</if>
- <if test="fBilltype != null and fBilltype != ''">and tw.f_billtype = #{fBilltype}</if>
- <if test="fBillstatus != null and (fBillstatus == 4 or fBillstatus == 6 or fBillstatus == 9 or fBillstatus == 11)">
- and tw.f_billstatus = #{fBillstatus}
- and tw.f_updete_status = 2
- and tw.f_submit_update = 2
- and tw.f_delete_status = 2
- </if>
- <if test="fBillstatus != null and fBillstatus == 10">
- and tw.f_billstatus in ('3','8')
- and tw.f_updete_status in ('2','3')
- and tw.f_submit_update in ('2','3')
- and tw.f_delete_status in ('2','3')
- </if>
- <if test="fBillstatus != null and fBillstatus == 12">
- AND (tw.f_updete_status != 2
- OR tw.f_submit_update != 2
- OR tw.f_delete_status != 2 )
- </if>
- <if test="fItemsStatus != null ">and tw.f_items_status = #{fItemsStatus}</if>
- <if test="fBillingDeadline != null ">and tw.f_billing_deadline = #{fBillingDeadline}</if>
- <if test="fProductName != null and fProductName != ''">and tw.f_product_name like concat('%',
- #{fProductName}, '%')
- </if>
- <if test="fReviewDate != null ">and tw.f_review_date = #{fReviewDate}</if>
- <if test="fTruckno != null and fTruckno != ''">and tw.f_truckno = #{fTruckno}</if>
- <if test="fDriverName != null and fDriverName != ''">and tw.f_driver_name like concat('%', #{fDriverName},
- '%')
- </if>
- <if test="fDriverTel != null and fDriverTel != ''">and tw.f_driver_tel = #{fDriverTel}</if>
- <if test="fDriverIdCar != null and fDriverIdCar != ''">and tw.f_driver_id_car = #{fDriverIdCar}</if>
- <if test="fBusinessType != null and fBusinessType != ''">and tw.f_business_type = #{fBusinessType}</if>
- <if test="fLabour != null ">and tw.f_labour = #{fLabour}</if>
- <if test="fFleet != null ">and tw.f_fleet = #{fFleet}</if>
- <if test="fInwarehouseid != null ">and tw.f_inwarehouseid = #{fInwarehouseid}</if>
- <if test="fBstime != null ">and tw.f_bstime = #{fBstime}</if>
- <if test="fCartype != null ">and tw.f_cartype = #{fCartype}</if>
- <if test="fGoodsid != null ">and tw.f_goodsid = #{fGoodsid}</if>
- <if test="fNewTrademodeid != null ">and tw.f_new_trademodeid = #{fNewTrademodeid}</if>
- <if test="fLoadportid != null ">and tw.f_loadportid = #{fLoadportid}</if>
- <if test="fDestportid != null ">and tw.f_destportid = #{fDestportid}</if>
- <if test="fServiceitems != null and fServiceitems != ''">and tw.f_serviceitems = #{fServiceitems}</if>
- <if test="fInvoceobj != null and fInvoceobj != ''">and tw.f_invoceobj = #{fInvoceobj}</if>
- <if test="fSign != null ">and tw.f_sign = #{fSign}</if>
- <if test="fDetentioncargo != null ">and tw.f_detentioncargo = #{fDetentioncargo}</if>
- <if test="fBooksmarks != null and fBooksmarks != ''">and tw.f_booksmarks = #{fBooksmarks}</if>
- <if test="fShippername != null and fShippername != ''">and tw.f_shippername like concat('%',
- #{fShippername}, '%')
- </if>
- <if test="fShipperattn != null and fShipperattn != ''">and tw.f_shipperattn = #{fShipperattn}</if>
- <if test="fShippertel != null and fShippertel != ''">and tw.f_shippertel = #{fShippertel}</if>
- <if test="fConsigneername != null and fConsigneername != ''">and tw.f_consigneername like concat('%',
- #{fConsigneername}, '%')
- </if>
- <if test="fConsigneeattn != null and fConsigneeattn != ''">and tw.f_consigneeattn = #{fConsigneeattn}</if>
- <if test="fConsigneetel != null and fConsigneetel != ''">and tw.f_consigneetel = #{fConsigneetel}</if>
- <if test="fInsurance != null and fInsurance != ''">and tw.f_insurance = #{fInsurance}</if>
- <if test="fInsuranceamt != null ">and tw.f_insuranceamt = #{fInsuranceamt}</if>
- <if test="fClosedate != null ">and tw.f_closedate = #{fClosedate}</if>
- <if test="fDocmentdate != null ">and tw.f_docmentdate = #{fDocmentdate}</if>
- <if test="fTypeid != null ">and tw.f_typeid = #{fTypeid}</if>
- <if test="fPaymode != null">and tw.f_paymode = #{fPaymode},</if>
- <if test="fLaneid != null">and tw.f_laneid = #{fLaneid},</if>
- <if test='startTime != null'>
- and tw.create_time >= #{startTime}
- </if>
- <if test='endTime != null'>
- and tw.create_time <= #{endTime}
- </if>
- <if test="fCntrid != null ">and tc.f_cntrid = #{fCntrid}</if>
- <if test="fCntrcount != null ">and tc.f_cntrcount = #{fCntrcount}</if>
- <if test="vslidName != null and vslidName != ''">and tv.f_name like concat('%',
- #{vslidName}, '%')
- </if>
- <if test="voyidName != null and voyidName != ''">and ty.f_no like concat('%',
- #{voyidName}, '%')
- </if>
- <if test="boxNumber != null and boxNumber != ''">and twc.f_cntrno like concat('%',
- #{boxNumber}, '%')
- </if>
- <if test="createBy != null and createBy != ''">and tw.create_by = #{createBy}</if>
- <if test='timeInterval != null and timeInterval[0] != null and timeInterval[0]!= ""'>
- and ty.f_ATD >= #{timeInterval[0]}
- </if>
- <if test='timeInterval != null and timeInterval[1] != null and timeInterval[1]!= ""'>
- and ty.f_ATD <= #{timeInterval[1]}
- </if>
- <if test="fShipTwo != null "> and tw.f_ship_two = #{fShipTwo}</if>
- <if test="fVoyTwo != null "> and tw.f_voy_two = #{fVoyTwo}</if>
- </where>
- ORDER BY tw.f_mblno,twc.f_cntrno
- )a,
- (SELECT @rank:= 0) b
- </select>
- <!--凯和导出清单根据船名航次-->
- <select id="voyageDetails" parameterType="TWarehousebills" resultType="map">
- SELECT
- @rank:=@rank + 1 AS rankNo,
- a.*
- FROM
- (
- SELECT DISTINCT
- tw.f_id fId,
- tw.f_mblno fMblno,
- ty.f_no voyNo,
- tc.f_no fCntrno,
- tc.f_cntrcount fCntrcount,
- tre.f_name loadportName,
- ts.f_name destportName,
- sd.dict_label fLoadportMode,
- tk.dict_label fDestportMode,
- tc.f_name goodsName,
- date_format(ty.f_ETD, '%Y-%m-%d') fEtd,
- date_format(ty.f_ETA, '%Y-%m-%d') fEta,
- tcp.f_name corpName,
- tw.f_shippername fShippername,
- tw.f_consigneername fConsigneername,
- tw.f_consigneeattn fConsigneeattn,
- tw.f_consigneetel fConsigneetel
- FROM
- t_warehousebills tw
- LEFT JOIN t_corps tcp ON tcp.f_id = tw.f_corpid
- LEFT JOIN t_address tre ON tre.f_id = tw.f_loadportid
- LEFT JOIN t_address ts ON ts.f_id = tw.f_destportid
- LEFT JOIN sys_dict_data sd ON sd.dict_value = tw.f_serviceitems AND sd.dict_type = 'f_serviceitems'
- LEFT JOIN sys_dict_data tk ON tk.dict_value = tw.f_serviceitems_new AND tk.dict_type = 'f_serviceitems'
- <if test="fCntrno != null and fCntrno != ''">
- LEFT JOIN t_warehousebills_cntritems items ON tw.f_id = items.f_pid
- </if>
- LEFT JOIN t_voyage ty ON tw.f_voyid = ty.f_id
- LEFT JOIN (
- SELECT
- th.f_pid,
- th.f_cntrcount,
- tr.f_no,
- th.f_cntrid,
- tg.f_name
- FROM
- t_warehousebills_cntr th
- LEFT JOIN t_cntr tr ON th.f_cntrid = tr.f_id
- LEFT JOIN t_goods tg ON th.f_goodsid = tg.f_id
- ) tc ON tc.f_pid = tw.f_id
- <where>
- tw.f_typeid = '1'
- and tw.del_flag = '0'
- <if test="fCntrno != null and fCntrno != ''">and items.f_cntrno like concat('%', #{fCntrno}, '%')</if>
- <if test="fCorpid != null ">and tw.f_corpid = #{fCorpid}</if>
- <if test="fMblno != null and fMblno != ''">and tw.f_mblno like concat('%', #{fMblno}, '%')</if>
- <if test="fLoadportid != null ">and tw.f_loadportid = #{fLoadportid}</if>
- <if test="fDestportid != null ">and tw.f_destportid = #{fDestportid}</if>
- <if test="fVslid != null ">and tw.f_vslid = #{fVslid}</if>
- <if test="fVoyid != null ">and tw.f_voyid = #{fVoyid}</if>
- <if test="createBy != null and createBy != ''">and tw.create_by = #{createBy}</if>
- <if test='cLoadDate != null and cLoadDate[0] != null and cLoadDate[0]!= ""'>
- and tw.create_time >= #{cLoadDate[0]}
- </if>
- <if test='cLoadDate != null and cLoadDate[1] != null and cLoadDate[1]!= ""'>
- and tw.create_time <= #{cLoadDate[1]}
- </if>
- <if test='timeInterval != null and timeInterval[0] != null and timeInterval[0]!= ""'>
- and ty.f_ATD >= #{timeInterval[0]}
- </if>
- <if test='timeInterval != null and timeInterval[1] != null and timeInterval[1]!= ""'>
- and ty.f_ATD <= #{timeInterval[1]}
- </if>
- </where>
- ORDER BY tw.create_time DESC, tw.f_id DESC
- ) a,
- (SELECT @rank:= 0) b
- </select>
- <select id="selectTWarehousebillsByIds" parameterType="String" resultMap="TWarehousebillsResult">
- select f_id,f_vslid, f_voyid,f_arrival_status,f_billno,f_cargo_planning from t_warehousebills
- where f_id in
- <foreach item="fId" collection="array" open="(" separator="," close=")">
- #{fId}
- </foreach>
- </select>
- <update id="updateTWarehousebillsByIds">
- update
- t_warehousebills
- <trim prefix="SET" suffixOverrides=",">
- <if test="fVessel != null">f_vslid = #{fVessel},</if>
- <if test="fVoyage != null">f_voyid = #{fVoyage},</if>
- <if test="fCargoPlanning != null">f_cargo_planning = #{fCargoPlanning},</if>
- <if test="fLoadportid != null">f_loadportid = #{fLoadportid},</if>
- <if test="fDestportid != null">f_destportid = #{fDestportid},</if>
- <if test="fLaneid != null">f_laneid = #{fLaneid},</if>
- </trim>
- where f_id in
- <foreach item="fId" collection="fIds" open="(" separator="," close=")">
- #{fId}
- </foreach>
- </update>
- <!--凯和单航次配船-->
- <select id="singleVoyageByShip" parameterType="TWarehousebills" resultType="com.ruoyi.shipping.excel.SingleVoyageByShipExcel">
- SELECT
- tv.f_name vslName,
- ty.f_no voyNo,
- ty.f_ATD fAtd,
- ty.f_ATA fAta,
- ta.f_name fName,
- tre.f_name loadportName,
- ts.f_name destportName,
- tw.f_vslid fVslid,
- tw.f_voyid fVoyid,
- tw.f_arrival_status fArrivalStatus
- FROM
- t_warehousebills tw
- LEFT JOIN sys_dict_data sd ON sd.dict_value = tw.f_serviceitems
- AND sd.dict_type = 'f_serviceitems'
- LEFT JOIN t_vessel tv ON tw.f_vslid = tv.f_id
- LEFT JOIN t_voyage ty ON tw.f_voyid = ty.f_id
- LEFT JOIN t_address ta ON ta.f_id = ty.f_laneid
- LEFT JOIN t_address tre ON tre.f_id = ty.f_portofloadid
- LEFT JOIN t_address ts ON ts.f_id = ty.f_distinationid
- LEFT JOIN t_corps tp ON tw.f_corpid = tp.f_id
- LEFT JOIN (
- SELECT
- th.f_pid,
- th.f_cntrcount,
- tr.f_no,
- th.f_cntrid,
- tg.f_name
- FROM
- t_warehousebills_cntr th
- LEFT JOIN t_cntr tr ON th.f_cntrid = tr.f_id
- LEFT JOIN t_goods tg ON th.f_goodsid = tg.f_id
- ) tc ON tc.f_pid = tw.f_id
- LEFT JOIN (SELECT f_pid,f_billstatus FROM t_warehousebillsfees GROUP BY f_pid,f_billstatus)tf ON tf.f_pid = tw.f_id
- where
- tw.f_typeid = '1'
- and tw.del_flag = '0'
- and tw.f_cargo_planning = '0'
- and tw.f_arrival_status != '2'
- <if test="fVslid != null ">and tw.f_vslid = #{fVslid}</if>
- <if test="fVoyid != null ">and tw.f_voyid = #{fVoyid}</if>
- GROUP BY tw.f_vslid,tw.f_voyid
- </select>
- <select id="selectByItemId" resultMap="TWarehousebillsResult">
- SELECT
- w.f_id,
- w.f_billno,
- w.is_calculate_storage_fees
- FROM
- t_warehousebills w
- LEFT JOIN t_warehousebillsitems i ON i.f_pid = w.f_id
- where i.f_id = #{id}
- </select>
- <select id="selectByMblnoOrCntrnoCount" resultType="int">
- SELECT COUNT(DISTINCT w.f_id) FROM
- t_warehousebills w
- LEFT JOIN t_warehousebillsitems item ON item.f_pid = w.f_id
- <where>
- w.f_mblno = #{dto.fMblno}
- and w.f_bsdate = #{dto.fBsdate}
- <if test="dto.fCntrno != null ">and item.f_cntrno = #{dto.fCntrno}</if>
- </where>
- </select>
- <select id="selectWhgenlegDetailById" resultMap="WarehousebillsVOResult">
- SELECT w.f_id, w.f_mblno, w.f_bsdate, SUM( item.f_qty ) f_qty, SUM( item.f_grossweight ) f_grossweight,
- SUM( item.f_netweight ) f_netweight, w.f_billtype
- FROM
- t_whgenleg leg
- LEFT JOIN t_warehousebills w ON w.f_corpid = leg.f_corpid
- AND leg.f_trademodeid = w.f_trademodeid
- LEFT JOIN t_warehousebillsitems item ON item.f_pid = w.f_id
- AND item.f_marks = leg.f_marks
- AND item.f_business_type = leg.f_business_type
- AND item.f_originalbilldate = leg.f_bsdate
- AND item.f_warehouselocid = leg.f_warehouse_locationid
- AND item.f_goodsid = leg.f_goodsid
- WHERE
- leg.f_id = #{id}
- AND w.f_billtype IN ( 'SJRK', 'SJCK' )
- AND item.f_billstatus = 40
- AND IF ( w.f_billtype = 'SJCK', item.f_mblno = leg.f_mblno, leg.f_mblno = w.f_mblno )
- GROUP BY
- w.f_id
- </select>
- <select id="selecStorageFeeList" resultType="Map">
- 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,
- w.f_billstatus AS fBillstatus, w.create_by AS createBy, w.create_time AS createTime, w.f_fee_status fFeeStatus,
- w.f_trademodeid AS fTrademodeid,dict.dict_label AS fTrademodeName
- FROM t_warehousebills w LEFT JOIN t_warehousebillsitems item ON item.f_pid = w.f_id
- LEFT JOIN t_corps corp ON corp.f_id = w.f_corpid
- left join sys_user u on w.create_by = u.user_name
- left join sys_user u1 on w.f_storekeeper = u1.user_name
- left join sys_dept d on w.f_bsdeptid = d.dept_id
- LEFT JOIN sys_dict_data dict ON dict.dict_value = w.f_trademodeid
- <where>
- w.f_billtype = 'JSCCF'
- and dict.dict_type = 'data_trademodes'
- <if test="fFeeStatus != null and fFeeStatus != ''">and w.f_fee_status = #{fFeeStatus}</if>
- <if test="fBillstatus != null and fBillstatus != ''">and w.f_billstatus = #{fBillstatus}</if>
- <if test="fMarks != null and fMarks != ''">and w.f_marks = #{fMarks}</if>
- <if test="createBy != null and createBy != ''">and w.create_by = #{createBy}</if>
- <if test='timeInterval2 != null and timeInterval2[0] != null and timeInterval2[1]!= ""'>
- and w.f_billing_deadline BETWEEN #{timeInterval2[0]} AND #{timeInterval2[1]}
- </if>
- <if test="fBillno != null and fBillno != ''">and w.f_billno like concat('%', #{fBillno}, '%')</if>
- <if test="fMblno != null and fMblno != ''">and w.f_mblno like concat('%', #{fMblno}, '%')</if>
- <if test="fCorpid != null and fCorpid != ''">and w.f_corpid = #{fCorpid}</if>
- <if test="fTrademodeid != null and fTrademodeid != ''">and w.f_trademodeid = #{fTrademodeid}</if>
- </where>
- ${params.dataScope}
- ORDER BY w.f_bsdate DESC, w.f_bstime DESC,w.f_id DESC,w.f_billstatus
- </select>
- <select id="inAndOutStockList" resultType="map">
- select
- tb.f_mblno as fMblno,
- tg.f_name as goodsName,
- tb.f_marks as fMarks,
- tb.f_bsdate as fBsdate,
- tb.f_planqty as fPlanqty,
- case tb.f_billtype when 'SJRK' then '入库' when 'SJCK' then '出库' end as fBilltype,
- case
- when tb.f_billtype = 'SJRK' and tb.f_items_status = '1' then '计划'
- when tb.f_billtype = 'SJRK' and tb.f_items_status = '2' then '待入库'
- when tb.f_billtype = 'SJRK' and tb.f_items_status = '3' then '入库中'
- when tb.f_billtype = 'SJRK' and tb.f_items_status = '4' then '已入库'
- when tb.f_billtype = 'SJCK' and tb.f_items_status = '1' then '计划'
- when tb.f_billtype = 'SJCK' and tb.f_items_status = '2' then '待出库'
- when tb.f_billtype = 'SJCK' and tb.f_items_status = '3' then '出库中'
- when tb.f_billtype = 'SJCK' and tb.f_items_status = '4' then '已出库'
- end as fBillstatus
- from t_warehousebills tb
- left join t_goods tg on tg.f_id = tb.f_goodsid
- where
- if(tb.f_planqty is not null, tb.f_planqty != tb.f_qty, tb.f_id != '')
- and tb.f_billstatus != 6
- and tb.f_billtype in ('SJRK', 'SJCK')
- <if test="external != null and external != ''">
- and tb.f_corpid = (select f_pid from t_customer_contact where f_tel = #{external})
- </if>
- order by tb.f_bsdate desc
- </select>
- <select id="getActiveCorpCount" resultType="int">
- select count(fName) from (
- select t1.f_bsdate as fBsdate, t3.f_name as fName
- from t_warehousebillsitems t1
- left join t_warehousebills t2 on t2.f_id = t1.f_pid
- left join t_corps t3 on t3.f_id = t2.f_corpid
- where t1.f_billtype = 'SJRK'
- and t1.f_billstatus = 40
- group by fName
- ) temp
- <where>
- <if test="beginTime != null and beginTime != ''">and fBsdate >= #{beginTime}</if>
- <if test="endTime != null and endTime != ''">and fBsdate <= #{endTime}</if>
- </where>
- </select>
- <select id="getInactiveCorpList" resultType="com.ruoyi.warehouseBusiness.excel.CorpAnalysis">
- select * from (
- select t1.f_bsdate as fBsdate, t3.f_name as fName
- from t_warehousebillsitems t1
- left join t_warehousebills t2 on t2.f_id = t1.f_pid
- left join t_corps t3 on t3.f_id = t2.f_corpid
- where t1.f_billtype = 'SJRK'
- and t1.f_billstatus = 40
- group by fName
- ) temp
- <where>
- <if test="beginTime != null and beginTime != ''">and fBsdate >= #{beginTime}</if>
- <if test="endTime != null and endTime != ''">and fBsdate <= #{endTime}</if>
- </where>
- order by fBsdate desc
- </select>
- <select id="selectWareIdAndItemId" parameterType="java.util.Map" resultType="java.util.Map">
- SELECT
- ware.f_id AS fId,
- item.f_id AS itemId,
- item.f_mblno AS fMblno
- FROM
- t_warehousebills ware
- LEFT JOIN t_warehousebillsitems item ON ware.f_id = item.f_pid
- LEFT JOIN t_corps tc ON ware.f_corpid = tc.f_id
- LEFT JOIN t_goods tg ON item.f_goodsid = tg.f_id
- LEFT JOIN sys_dict_data sdd ON item.f_business_type = sdd.dict_value
- WHERE
- ware.del_flag = 0
- AND item.del_flag = 0
- AND sdd.dict_type = 'storage_type'
- AND item.f_billtype = 'SJRK'
- <if test="fCorpid != null ">AND ware.f_corpid = #{fCorpid}</if>
- <if test="fMblno != null and fMblno != ''">AND item.f_mblno = #{fMblno}</if>
- <if test="fOriginalbilldate != null ">AND item.f_originalbilldate = date_format(#{fOriginalbilldate},'%Y-%m-%d')</if>
- <if test="fGoodsid != null ">AND item.f_goodsid = #{fGoodsid}</if>
- <if test="fMarks != null and fMarks != ''">AND item.f_marks = #{fMarks}</if>
- <if test="fBusinessType != null ">AND item.f_business_type = #{fBusinessType}</if>
- </select>
- <select id="selectBYOriginalBillNo" resultMap="TWarehousebillsResult">
- <include refid="selectTWarehousebillsVo"/>
- WHERE
- del_flag = '0'
- and f_billno = #{originalBillNo}
- </select>
- </mapper>
|