TWarehousebillsMapper.xml 113 KB

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