TWarehousebillsMapper.xml 140 KB

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