TWarehousebillsMapper.xml 134 KB

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