TWarehousebillsMapper.xml 113 KB

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