TWarehousebillsMapper.xml 126 KB

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