TWhgenlegMapper.xml 83 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628
  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.reportManagement.mapper.TWhgenlegMapper">
  6. <resultMap type="TWhgenleg" id="TWhgenlegResult">
  7. <result property="fId" column="f_id"/>
  8. <result property="fAccyear" column="f_accyear"/>
  9. <result property="fAccmonth" column="f_accmonth"/>
  10. <result property="fCorpid" column="f_corpid"/>
  11. <result property="fShipper" column="f_shipper"/>
  12. <result property="fMblno" column="f_mblno"/>
  13. <result property="fOriginalbillno" column="f_originalbillno"/>
  14. <result property="fWarehouseLocationid" column="f_warehouse_locationid"/>
  15. <result property="fGoodsid" column="f_goodsid"/>
  16. <result property="fChargedate" column="f_chargedate"/>
  17. <result property="fTrademodeid" column="f_trademodeid"/>
  18. <result property="fPreqty" column="f_preqty"/>
  19. <result property="fWarehouseid" column="f_warehouseid"/>
  20. <result property="fPregrossweight" column="f_pregrossweight"/>
  21. <result property="fPrenetweight" column="f_prenetweight"/>
  22. <result property="fBsdate" column="f_bsdate"/>
  23. <result property="fQtyd" column="f_qtyD"/>
  24. <result property="fVolumnd" column="f_volumnD"/>
  25. <result property="fBillingway" column="f_billingway"/>
  26. <result property="fGrossweightd" column="f_grossweightD"/>
  27. <result property="fNetweightd" column="f_netweightD"/>
  28. <result property="fVolumnc" column="f_volumnC"/>
  29. <result property="fVolumnblc" column="f_volumnblc"/>
  30. <result property="fQtyc" column="f_qtyC"/>
  31. <result property="fGrossweightc" column="f_grossweightC"/>
  32. <result property="fQtyblc" column="f_qtyblc"/>
  33. <result property="fGrossweightblc" column="f_grossweightblc"/>
  34. <result property="fNetweightc" column="f_netweightC"/>
  35. <result property="fNetweightblc" column="f_netweightblc"/>
  36. <result property="fCntrno" column="f_cntrno"/>
  37. <result property="fStatus" column="f_status"/>
  38. <result property="delFlag" column="del_flag"/>
  39. <result property="createBy" column="create_by"/>
  40. <result property="fMarks" column="f_marks"/>
  41. <result property="createTime" column="create_time"/>
  42. <result property="updateBy" column="update_by"/>
  43. <result property="updateTime" column="update_time"/>
  44. <result property="remark" column="remark"/>
  45. <result property="fBusinessType" column="f_business_type"/>
  46. <result property="fOriginalbilldate" column="f_originalbilldate"/>
  47. <result property="fLocalcntrno" column="f_localcntrno"/>
  48. <result property="fCustomno" column="f_customno"/>
  49. <result property="fEmsSeqNo" column="f_ems_seq_no"/>
  50. <result property="lockStatus" column="lock_status"/>
  51. <result property="belongTo" column="belong_to"/>
  52. <result property="lockTime" column="lock_time"/>
  53. <result property="unlockTime" column="unlock_time"/>
  54. <result property="wrNumber" column="wr_number"/>
  55. <result property="checklists" column="checklists"/>
  56. </resultMap>
  57. <resultMap type="CalculateStorageFeesInfoVO" id="StorageFeesInfoResult">
  58. <result property="fId" column="f_id"/>
  59. <result property="warehouse" column="f_warehouseid"/>
  60. <result property="fBillno" column="f_billno"/>
  61. <result property="fGoodsid" column="f_goodsid"/>
  62. <result property="fBsdate" column="f_bsdate"/>
  63. <result property="fBillingway" column="f_billingway"/>
  64. <result property="fBsdate" column="f_bsdate"/>
  65. <result property="fChargedate" column="f_chargedate"/>
  66. <result property="fSrcBsdate" column="f_src_bsdate"/>
  67. <result property="fOriginalbilldate" column="f_originalbilldate"/>
  68. <result property="fMblno" column="f_mblno"/>
  69. <result property="fVolumn" column="f_volumn"/>
  70. <result property="fMarks" column="f_marks"/>
  71. <result property="ifCntrno" column="if_cntrno"/>
  72. <result property="fBillingDays" column="f_billing_days"/>
  73. <result property="fIsInventory" column="f_is_inventory"/>
  74. <result property="fQty" column="f_qty"/>
  75. <result property="warehouseLocationid" column="f_warehouse_locationid"/>
  76. <result property="fOrgwarehouseInformation" column="f_orgwarehouse_information"/>
  77. <result property="fGrossweight" column="f_grossweight"/>
  78. <result property="fNetweight" column="f_netweight"/>
  79. <result property="fBilltype" column="f_billtype"/>
  80. <result property="fTypeid" column="f_typeid"/>
  81. <result property="fCntrno" column="f_cntrno"/>
  82. <result property="goodsName" column="goods_name"/>
  83. </resultMap>
  84. <resultMap type="whgenlegVO" id="WhgenlegInfoResult">
  85. <result property="fId" column="f_id"/>
  86. <result property="corpName" column="corp_name"/>
  87. <result property="fMblno" column="f_mblno"/>
  88. <result property="fBusinessType" column="f_business_type"/>
  89. <result property="fMarks" column="f_marks"/>
  90. <result property="fBsdate" column="f_bsdate"/>
  91. <result property="fTrademodeid" column="f_trademodeid"/>
  92. <result property="fBilltype" column="f_billtype"/>
  93. <result property="qty" column="f_qty"/>
  94. <result property="grossweight" column="f_netweight"/>
  95. <result property="netweight" column="f_grossweight"/>
  96. </resultMap>
  97. <sql id="selectTWhgenlegVo">
  98. select f_id, f_accyear, f_accmonth, f_corpid, f_shipper, f_mblno, f_originalbillno, f_warehouse_locationid, f_goodsid, f_trademodeid, f_preqty,
  99. f_pregrossweight, f_warehouseid, f_prenetweight, f_bsdate, f_chargedate, f_volumnD, f_qtyD, f_billingway, f_grossweightD, f_netweightD, f_volumnC,
  100. f_qtyC, f_grossweightC, f_qtyblc, f_grossweightblc, f_netweightC, f_netweightblc, f_cntrno, f_status, del_flag, f_marks, create_by,
  101. create_time, update_by, f_volumnblc, update_time, remark, f_business_type, f_originalbilldate, f_localcntrno,f_customno,f_ems_seq_no,
  102. lock_status, belong_to, lock_time, unlock_time, wr_number,checklists from t_whgenleg
  103. </sql>
  104. <select id="selectTWhgenlegList" parameterType="TWhgenleg" resultMap="TWhgenlegResult">
  105. select
  106. ware.*
  107. from
  108. t_whgenleg ware
  109. left join sys_user u on ware.create_by = u.user_name
  110. left join sys_dept d on u.dept_id = d.dept_id
  111. <where>
  112. <if test="fOriginalbillno != null and fOriginalbillno != ''">and f_originalbillno = #{fOriginalbillno}</if>
  113. <if test="fBsdate != null ">and f_bsdate = #{fBsdate}</if>
  114. <if test="fChargedate != null ">and f_chargedate = #{fChargedate}</if>
  115. <if test="fPreqty != null ">and f_preqty = #{fPreqty}</if>
  116. <if test="fWarehouseid != null ">and f_warehouseid = #{fWarehouseid}</if>
  117. <if test="fPregrossweight != null ">and f_pregrossweight = #{fPregrossweight}</if>
  118. <if test="fPrenetweight != null ">and f_prenetweight = #{fPrenetweight}</if>
  119. <if test="fQtyd != null ">and f_qtyD = #{fQtyd}</if>
  120. <if test="fVolumnd != null ">and f_volumnD = #{fVolumnd}</if>
  121. <if test="fBillingway != null ">and f_billingway = #{fBillingway}</if>
  122. <if test="fGrossweightd != null ">and f_grossweightD = #{fGrossweightd}</if>
  123. <if test="fNetweightd != null ">and f_netweightD = #{fNetweightd}</if>
  124. <if test="fVolumnc != null ">and f_volumnC = #{fVolumnc}</if>
  125. <if test="fCorpid != null ">and f_corpid = #{fCorpid}</if>
  126. <if test="fShipper != null and fShipper != ''">and f_shipper like concat('%', #{fShipper}, '%')</if>
  127. <if test="fBusinessType != null "> and f_business_type = #{fBusinessType}</if>
  128. <if test="fQtyc != null ">and f_qtyC = #{fQtyc}</if>
  129. <if test="fGrossweightc != null ">and f_grossweightC = #{fGrossweightc}</if>
  130. <if test="fQtyblc != null ">and f_qtyblc = #{fQtyblc}</if>
  131. <if test="fGrossweightblc != null ">and f_grossweightblc = #{fGrossweightblc}</if>
  132. <if test="fNetweightc != null ">and f_netweightC = #{fNetweightc}</if>
  133. <if test="fNetweightblc != null ">and f_netweightblc = #{fNetweightblc}</if>
  134. <if test="fCntrno != null and fCntrno != ''">and f_cntrno = #{fCntrno}</if>
  135. <if test="fStatus != null and fStatus != ''">and f_status = #{fStatus}</if>
  136. <if test="fMarks != null and fMarks != ''">and f_marks = #{fMarks}</if>
  137. <if test="fOriginalbilldate != null ">and f_originalbilldate = #{fOriginalbilldate}</if>
  138. <if test="checklists != null and checklists != ''">and checklists = #{checklists}</if>
  139. <if test="fMblno != null and fMblno != ''">and f_mblno like concat('%',#{fMblno},'%')</if>
  140. </where>
  141. ${params.dataScope}
  142. </select>
  143. <select id="selectTWhgenleg" parameterType="TWhgenleg" resultMap="TWhgenlegResult">
  144. <include refid="selectTWhgenlegVo"/>
  145. <where>
  146. <if test="fCorpid != null ">and f_corpid = #{fCorpid}</if>
  147. <if test="fShipper != null ">and f_shipper = #{fShipper}</if>
  148. <if test="fMblno != null ">and f_mblno = #{fMblno}</if>
  149. <if test="fCntrno != null ">and f_cntrno = #{fCntrno}</if>
  150. <if test="fBusinessType != null ">and f_business_type = #{fBusinessType}</if>
  151. <if test="fMarks != null ">and f_marks = #{fMarks}</if>
  152. <if test="fBsdate != null ">and f_bsdate = date_format(#{fBsdate},'%Y-%m-%d')</if>
  153. <if test="fOriginalbilldate != null ">and f_originalbilldate = #{fOriginalbilldate}</if>
  154. <if test="fWarehouseLocationid != null ">and f_warehouse_locationid = #{fWarehouseLocationid}</if>
  155. <if test="fGoodsid != null ">and f_goodsid = #{fGoodsid}</if>
  156. <if test="fTrademodeid != null ">and f_trademodeid = #{fTrademodeid}</if>
  157. </where>
  158. </select>
  159. <!--
  160. <select id="selectTWhgenleg" parameterType="TWhgenleg" resultMap="TWhgenlegResult">
  161. <include refid="selectTWhgenlegVo"/>
  162. <where>
  163. <if test="fCorpid != null ">and f_corpid = #{fCorpid}</if>
  164. <if test="fMblno != null ">and f_mblno = #{fMblno}</if>
  165. <if test="fCntrno != null ">and f_cntrno = #{fCntrno}</if>
  166. <if test="fBusinessType != null ">and f_business_type = #{fBusinessType}</if>
  167. <if test="fMarks != null ">and f_marks = #{fMarks}</if>
  168. <if test="fOriginalbilldate != null ">and f_originalbilldate = #{fOriginalbilldate}</if>
  169. <if test="fWarehouseLocationid != null ">and f_warehouse_locationid = #{fWarehouseLocationid}</if>
  170. <if test="fGoodsid != null ">and f_goodsid = #{fGoodsid}</if>
  171. <if test="fTrademodeid != null ">and f_trademodeid = #{fTrademodeid}</if>
  172. </where>
  173. </select>
  174. -->
  175. <select id="selectTWhgenlegById" parameterType="Long" resultMap="TWhgenlegResult">
  176. <include refid="selectTWhgenlegVo"/>
  177. where f_id = #{fId}
  178. </select>
  179. <insert id="insertTWhgenleg" parameterType="TWhgenleg">
  180. insert into t_whgenleg
  181. <trim prefix="(" suffix=")" suffixOverrides=",">
  182. <if test="fAccyear != null">f_accyear,</if>
  183. <if test="fAccmonth != null">f_accmonth,</if>
  184. <if test="fCorpid != null">f_corpid,</if>
  185. <if test="fShipper != null">f_shipper,</if>
  186. <if test="fMblno != null">f_mblno,</if>
  187. <if test="fOriginalbillno != null">f_originalbillno,</if>
  188. <if test="fWarehouseLocationid != null">f_warehouse_locationid,</if>
  189. <if test="fGoodsid != null">f_goodsid,</if>
  190. <if test="fTrademodeid != null">f_trademodeid,</if>
  191. <if test="fPreqty != null">f_preqty,</if>
  192. <if test="fPregrossweight != null">f_pregrossweight,</if>
  193. <if test="fWarehouseid != null">f_warehouseid,</if>
  194. <if test="fPrenetweight != null">f_prenetweight,</if>
  195. <if test="fBsdate != null">f_bsdate,</if>
  196. <if test="fChargedate != null">f_chargedate,</if>
  197. <if test="fVolumnd != null">f_volumnD,</if>
  198. <if test="fQtyd != null">f_qtyD,</if>
  199. <if test="fBillingway != null">f_billingway,</if>
  200. <if test="fGrossweightd != null">f_grossweightD,</if>
  201. <if test="fNetweightd != null">f_netweightD,</if>
  202. <if test="fVolumnc != null">f_volumnC,</if>
  203. <if test="fQtyc != null">f_qtyC,</if>
  204. <if test="fGrossweightc != null">f_grossweightC,</if>
  205. <if test="fQtyblc != null">f_qtyblc,</if>
  206. <if test="fGrossweightblc != null">f_grossweightblc,</if>
  207. <if test="fNetweightc != null">f_netweightC,</if>
  208. <if test="fNetweightblc != null">f_netweightblc,</if>
  209. <if test="fCntrno != null">f_cntrno,</if>
  210. <if test="fStatus != null">f_status,</if>
  211. <if test="delFlag != null">del_flag,</if>
  212. <if test="fMarks != null and fMarks != ''">f_marks,</if>
  213. <if test="createBy != null">create_by,</if>
  214. <if test="createTime != null">create_time,</if>
  215. <if test="updateBy != null">update_by,</if>
  216. <if test="fVolumnblc != null">f_volumnblc,</if>
  217. <if test="updateTime != null">update_time,</if>
  218. <if test="remark != null">remark,</if>
  219. <if test="fBusinessType != null">f_business_type,</if>
  220. <if test="fOriginalbilldate != null">f_originalbilldate,</if>
  221. <if test="fLocalcntrno != null">f_localcntrno,</if>
  222. <if test="fEmsSeqNo != null">f_ems_seq_no,</if>
  223. <if test="lockStatus != null">lock_status,</if>
  224. <if test="belongTo != null">belong_to,</if>
  225. <if test="lockTime != null">lock_time,</if>
  226. <if test="unlockTime != null">unlock_time,</if>
  227. <if test="wrNumber != null">wr_number,</if>
  228. <if test="checklists != null">checklists,</if>
  229. </trim>
  230. <trim prefix="values (" suffix=")" suffixOverrides=",">
  231. <if test="fAccyear != null">#{fAccyear},</if>
  232. <if test="fAccmonth != null">#{fAccmonth},</if>
  233. <if test="fCorpid != null">#{fCorpid},</if>
  234. <if test="fShipper != null">#{fShipper},</if>
  235. <if test="fMblno != null">#{fMblno},</if>
  236. <if test="fOriginalbillno != null">#{fOriginalbillno},</if>
  237. <if test="fWarehouseLocationid != null">#{fWarehouseLocationid},</if>
  238. <if test="fGoodsid != null">#{fGoodsid},</if>
  239. <if test="fTrademodeid != null">#{fTrademodeid},</if>
  240. <if test="fPreqty != null">#{fPreqty},</if>
  241. <if test="fPregrossweight != null">#{fPregrossweight},</if>
  242. <if test="fWarehouseid != null">#{fWarehouseid},</if>
  243. <if test="fPrenetweight != null">#{fPrenetweight},</if>
  244. <if test="fBsdate != null">#{fBsdate},</if>
  245. <if test="fChargedate != null">#{fChargedate},</if>
  246. <if test="fVolumnd != null">#{fVolumnd},</if>
  247. <if test="fQtyd != null">#{fQtyd},</if>
  248. <if test="fBillingway != null">#{fBillingway},</if>
  249. <if test="fGrossweightd != null">#{fGrossweightd},</if>
  250. <if test="fNetweightd != null">#{fNetweightd},</if>
  251. <if test="fVolumnc != null">#{fVolumnc},</if>
  252. <if test="fQtyc != null">#{fQtyc},</if>
  253. <if test="fGrossweightc != null">#{fGrossweightc},</if>
  254. <if test="fQtyblc != null">#{fQtyblc},</if>
  255. <if test="fGrossweightblc != null">#{fGrossweightblc},</if>
  256. <if test="fNetweightc != null">#{fNetweightc},</if>
  257. <if test="fNetweightblc != null">#{fNetweightblc},</if>
  258. <if test="fCntrno != null">#{fCntrno},</if>
  259. <if test="fStatus != null">#{fStatus},</if>
  260. <if test="delFlag != null">#{delFlag},</if>
  261. <if test="fMarks != null and fMarks != ''">#{fMarks},</if>
  262. <if test="createBy != null">#{createBy},</if>
  263. <if test="createTime != null">#{createTime},</if>
  264. <if test="updateBy != null">#{updateBy},</if>
  265. <if test="fVolumnblc != null">#{fVolumnblc},</if>
  266. <if test="updateTime != null">#{updateTime},</if>
  267. <if test="remark != null">#{remark},</if>
  268. <if test="fBusinessType != null">#{fBusinessType},</if>
  269. <if test="fOriginalbilldate != null">#{fOriginalbilldate},</if>
  270. <if test="fLocalcntrno != null">#{fLocalcntrno},</if>
  271. <if test="fEmsSeqNo != null">#{fEmsSeqNo},</if>
  272. <if test="lockStatus != null">#{lockStatus},</if>
  273. <if test="belongTo != null">#{belongTo},</if>
  274. <if test="lockTime != null">#{lockTime},</if>
  275. <if test="unlockTime != null">#{unlockTime},</if>
  276. <if test="wrNumber != null">#{wrNumber},</if>
  277. <if test="checklists != null">#{checklists},</if>
  278. </trim>
  279. </insert>
  280. <update id="updateTWhgenleg" parameterType="TWhgenleg">
  281. update t_whgenleg
  282. <trim prefix="SET" suffixOverrides=",">
  283. <if test="fAccyear != null">f_accyear = #{fAccyear},</if>
  284. <if test="fAccmonth != null">f_accmonth = #{fAccmonth},</if>
  285. <if test="fCorpid != null">f_corpid = #{fCorpid},</if>
  286. <if test="fShipper != null">f_shipper = #{fShipper},</if>
  287. <if test="fMblno != null">f_mblno = #{fMblno},</if>
  288. <if test="fOriginalbillno != null">f_originalbillno = #{fOriginalbillno},</if>
  289. <if test="fWarehouseLocationid != null">f_warehouse_locationid = #{fWarehouseLocationid},</if>
  290. <if test="fGoodsid != null">f_goodsid = #{fGoodsid},</if>
  291. <if test="fTrademodeid != null">f_trademodeid = #{fTrademodeid},</if>
  292. <if test="fPreqty != null">f_preqty = #{fPreqty},</if>
  293. <if test="fPregrossweight != null">f_pregrossweight = #{fPregrossweight},</if>
  294. <if test="fWarehouseid != null">f_warehouseid = #{fWarehouseid},</if>
  295. <if test="fPrenetweight != null">f_prenetweight = #{fPrenetweight},</if>
  296. <if test="fBsdate != null">f_bsdate = #{fBsdate},</if>
  297. <if test="fChargedate != null">f_chargedate = #{fChargedate},</if>
  298. <if test="fVolumnd != null">f_volumnD = #{fVolumnd},</if>
  299. <if test="fQtyd != null">f_qtyD = #{fQtyd},</if>
  300. <if test="fBillingway != null">f_billingway = #{fBillingway},</if>
  301. <if test="fGrossweightd != null">f_grossweightD = #{fGrossweightd},</if>
  302. <if test="fNetweightd != null">f_netweightD = #{fNetweightd},</if>
  303. <if test="fVolumnc != null">f_volumnC = #{fVolumnc},</if>
  304. <if test="fQtyc != null">f_qtyC = #{fQtyc},</if>
  305. <if test="fGrossweightc != null">f_grossweightC = #{fGrossweightc},</if>
  306. <if test="fQtyblc != null">f_qtyblc = #{fQtyblc},</if>
  307. <if test="fGrossweightblc != null">f_grossweightblc = #{fGrossweightblc},</if>
  308. <if test="fNetweightc != null">f_netweightC = #{fNetweightc},</if>
  309. <if test="fNetweightblc != null">f_netweightblc = #{fNetweightblc},</if>
  310. <if test="fCntrno != null">f_cntrno = #{fCntrno},</if>
  311. <if test="fStatus != null">f_status = #{fStatus},</if>
  312. <if test="delFlag != null">del_flag = #{delFlag},</if>
  313. <if test="fMarks != null and fMarks != ''">f_marks = #{fMarks},</if>
  314. <if test="createBy != null">create_by = #{createBy},</if>
  315. <if test="createTime != null">create_time = #{createTime},</if>
  316. <if test="updateBy != null">update_by = #{updateBy},</if>
  317. <if test="fVolumnblc != null">f_volumnblc = #{fVolumnblc},</if>
  318. <if test="updateTime != null">update_time = #{updateTime},</if>
  319. <if test="remark != null">remark = #{remark},</if>
  320. <if test="fBusinessType != null">f_business_type = #{fBusinessType},</if>
  321. <if test="fOriginalbilldate != null">f_originalbilldate = #{fOriginalbilldate},</if>
  322. <if test="fLocalcntrno != null">f_localcntrno = #{fLocalcntrno},</if>
  323. <if test="fEmsSeqNo != null">f_ems_seq_no = #{fEmsSeqNo},</if>
  324. <if test="lockStatus != null">lock_status = #{lockStatus},</if>
  325. <if test="belongTo != null">belong_to = #{belongTo},</if>
  326. <if test="lockTime != null">lock_time = #{lockTime},</if>
  327. <if test="unlockTime != null">unlock_time = #{unlockTime},</if>
  328. <if test="wrNumber != null">wr_number = #{wrNumber},</if>
  329. <if test="checklists != null and checklists != ''">checklists = #{checklists},</if>
  330. </trim>
  331. where f_id = #{fId}
  332. </update>
  333. <update id="updateTWhgenlegData" parameterType="Map">
  334. update t_whgenleg
  335. <trim prefix="SET" suffixOverrides=",">
  336. /*判断是否入库*/
  337. <if test="map.billType == 'SJRK'">
  338. f_qtyD = f_qtyD + #{map.warehousebillsitems.fQty},
  339. f_volumnD = f_volumnD + #{map.warehousebillsitems.fVolumn},
  340. f_netweightD = f_netweightD + #{map.warehousebillsitems.fNetweight},
  341. f_grossweightD = f_grossweightD + #{map.warehousebillsitems.fGrossweight},
  342. f_qtyblc = f_qtyblc + #{map.warehousebillsitems.fQty}
  343. ,f_chargedate = #{map.warehousebillsitems.fBsdate},
  344. checklists = #{map.warehousebillsitems.checklists},
  345. <if test="map.warehousebillsitems.fCustomno != null and map.warehousebillsitems.fCustomno != ''">
  346. ,f_customno = #{map.warehousebillsitems.fCustomno}
  347. </if>
  348. <if test="map.warehousebillsitems.remark != null and map.warehousebillsitems.remark != ''">
  349. ,remark = #{map.warehousebillsitems.remark}
  350. </if>
  351. </if>
  352. /*判断是否撤销入库*/
  353. <if test="map.billType == 'SJRKRevoke'">
  354. f_qtyD = f_qtyD - #{map.warehousebillsitems.fQty},
  355. f_volumnD = f_volumnD - #{map.warehousebillsitems.fVolumn},
  356. f_netweightD = f_netweightD - #{map.warehousebillsitems.fNetweight},
  357. f_grossweightD = f_grossweightD - #{map.warehousebillsitems.fGrossweight},
  358. f_qtyblc = f_qtyblc - #{map.warehousebillsitems.fQty}
  359. </if>
  360. /*判断是否出库*/
  361. <if test="map.billType == 'SJCK'">
  362. f_qtyC = f_qtyC + #{map.warehousebillsitems.fQty},
  363. f_volumnC = f_volumnC + #{map.warehousebillsitems.fVolumn},
  364. f_netweightC = f_netweightC + #{map.warehousebillsitems.fNetweight},
  365. f_grossweightC = f_grossweightC + #{map.warehousebillsitems.fGrossweight},
  366. f_qtyblc = f_qtyblc - #{map.warehousebillsitems.fQty}
  367. </if>
  368. /*判断是否撤销出库*/
  369. <if test="map.billType == 'SJCKRevoke'">
  370. f_qtyC = f_qtyC - #{map.warehousebillsitems.fQty},
  371. f_volumnC = f_volumnC - #{map.warehousebillsitems.fVolumn},
  372. f_netweightC = f_netweightC - #{map.warehousebillsitems.fNetweight},
  373. f_grossweightC = f_grossweightC - #{map.warehousebillsitems.fGrossweight},
  374. f_qtyblc = f_qtyblc + #{map.warehousebillsitems.fQty}
  375. </if>
  376. -- update_by = NOW()
  377. </trim>
  378. where f_id = #{map.whgenlegId}
  379. </update>
  380. <!--
  381. <update id="updateTWhgenlegData" parameterType="Map">
  382. update t_whgenleg
  383. <trim prefix="SET" suffixOverrides=",">
  384. /*判断是否入库*/
  385. <if test="map.billType == 'SJRK'">
  386. f_qtyD = f_qtyD + #{map.warehousebillsitems.fQty},
  387. f_volumnD = f_volumnD + #{map.warehousebillsitems.fVolumn},
  388. f_netweightD = f_netweightD + #{map.warehousebillsitems.fNetweight},
  389. f_grossweightD = f_grossweightD + #{map.warehousebillsitems.fGrossweight},
  390. f_qtyblc = f_qtyblc + #{map.warehousebillsitems.fQty}
  391. <if test="map.warehousebillsitems.fBilltype != null and map.warehousebillsitems.fBilltype == 'HQZY'">
  392. ,f_chargedate = #{map.warehousebillsitems.fBsdate}
  393. </if>
  394. <if test="map.warehousebillsitems.fBilltype != null and map.warehousebillsitems.fBilltype != 'HQZY'">
  395. ,f_chargedate = #{map.warehousebillsitems.fChargedate}
  396. </if>
  397. <if test="map.warehousebillsitems.fCustomno != null and map.warehousebillsitems.fCustomno != ''">
  398. ,f_customno = #{map.warehousebillsitems.fCustomno}
  399. </if>
  400. <if test="map.warehousebillsitems.remark != null and map.warehousebillsitems.remark != ''">
  401. ,remark = #{map.warehousebillsitems.remark}
  402. </if>
  403. </if>
  404. /*判断是否撤销入库*/
  405. <if test="map.billType == 'SJRKRevoke'">
  406. f_qtyD = f_qtyD - #{map.warehousebillsitems.fQty},
  407. f_volumnD = f_volumnD - #{map.warehousebillsitems.fVolumn},
  408. f_netweightD = f_netweightD - #{map.warehousebillsitems.fNetweight},
  409. f_grossweightD = f_grossweightD - #{map.warehousebillsitems.fGrossweight},
  410. f_qtyblc = f_qtyblc - #{map.warehousebillsitems.fQty}
  411. </if>
  412. /*判断是否出库*/
  413. <if test="map.billType == 'SJCK'">
  414. f_qtyC = f_qtyC + #{map.warehousebillsitems.fQty},
  415. f_volumnC = f_volumnC + #{map.warehousebillsitems.fVolumn},
  416. f_netweightC = f_netweightC + #{map.warehousebillsitems.fNetweight},
  417. f_grossweightC = f_grossweightC + #{map.warehousebillsitems.fGrossweight},
  418. f_qtyblc = f_qtyblc - #{map.warehousebillsitems.fQty}
  419. </if>
  420. /*判断是否撤销出库*/
  421. <if test="map.billType == 'SJCKRevoke'">
  422. f_qtyC = f_qtyC - #{map.warehousebillsitems.fQty},
  423. f_volumnC = f_volumnC - #{map.warehousebillsitems.fVolumn},
  424. f_netweightC = f_netweightC - #{map.warehousebillsitems.fNetweight},
  425. f_grossweightC = f_grossweightC - #{map.warehousebillsitems.fGrossweight},
  426. f_qtyblc = f_qtyblc + #{map.warehousebillsitems.fQty}
  427. </if>
  428. &#45;&#45; update_by = NOW()
  429. </trim>
  430. where f_id = #{map.whgenlegId}
  431. </update>
  432. -->
  433. <delete id="deleteTWhgenlegById" parameterType="Long">
  434. delete from t_whgenleg where f_id = #{fId}
  435. </delete>
  436. <delete id="deleteTWhgenlegByIds" parameterType="String">
  437. delete from t_whgenleg where f_id in
  438. <foreach item="fAccyear" collection="array" open="(" separator="," close=")">
  439. #{fId}
  440. </foreach>
  441. </delete>
  442. <select id="selectGoodsList" resultType="Map">
  443. SELECT
  444. t.f_goodsid AS fGoodsid,
  445. g.f_name AS fName
  446. FROM
  447. t_goods g
  448. RIGHT JOIN (
  449. SELECT
  450. f_goodsid AS f_goodsid
  451. FROM
  452. t_whgenleg
  453. GROUP BY
  454. f_goodsid
  455. ) t ON g.f_id = t.f_goodsid
  456. </select>
  457. <select id="selectGoodsListWhouse" resultType="Map">
  458. SELECT
  459. t.f_goodsid AS fGoodsid,
  460. g.f_name AS fName,
  461. w.f_name AS fWarehouseName,
  462. w.f_totalgross AS fTotalgross,
  463. t.f_grossweightblc AS fGrossweightD
  464. FROM
  465. t_goods g
  466. RIGHT JOIN (
  467. SELECT
  468. f_goodsid AS f_goodsid,
  469. f_warehouseid AS f_warehouseid,
  470. sum( f_grossweightblc ) AS f_grossweightblc
  471. FROM
  472. t_whgenleg
  473. GROUP BY
  474. f_goodsid,
  475. f_warehouseid
  476. ORDER BY
  477. sum( f_grossweightblc ) DESC
  478. ) t ON g.f_id = t.f_goodsid
  479. LEFT JOIN t_warehouse w ON w.f_id = t.f_warehouseid
  480. <where>
  481. <if test="fId != null ">and w.f_id = #{fId}</if>
  482. </where>
  483. </select>
  484. <select id="selectWareHouseList" resultType="Map">
  485. SELECT
  486. t.f_warehouseid AS fWarehouseid,
  487. w.f_name AS fName,
  488. t.f_grossweightblc AS fGrossweightD,
  489. w.f_totalgross AS fTotalgross
  490. FROM
  491. t_warehouse w
  492. RIGHT JOIN (
  493. SELECT
  494. f_warehouseid AS f_warehouseid,
  495. sum( f_grossweightblc ) AS f_grossweightblc
  496. FROM
  497. t_whgenleg
  498. GROUP BY
  499. f_warehouseid
  500. ORDER BY
  501. sum( f_grossweightblc ) DESC
  502. ) t ON w.f_id = t.f_warehouseid
  503. </select>
  504. <select id="selectWareHouseListWhouse" resultType="Map">
  505. SELECT
  506. t.f_warehouseid AS fWarehouseid,
  507. w.f_name AS fName,
  508. t.f_grossweightblc AS fGrossweightD,
  509. w.f_totalgross AS fTotalgross
  510. FROM
  511. t_warehouse w
  512. RIGHT JOIN (
  513. SELECT
  514. f_warehouseid AS f_warehouseid,
  515. sum( f_grossweightblc ) AS f_grossweightblc
  516. FROM
  517. t_whgenleg
  518. GROUP BY
  519. f_warehouseid
  520. ORDER BY
  521. sum( f_grossweightblc ) DESC
  522. ) t ON w.f_id = t.f_warehouseid
  523. <where>
  524. <if test="fId != null ">and w.f_id = #{fId}</if>
  525. </where>
  526. </select>
  527. <select id="selectCorpsList" resultType="Map">
  528. SELECT
  529. t.f_corpid AS fCorpid,
  530. c.f_name AS fName
  531. FROM
  532. t_corps c
  533. RIGHT JOIN (
  534. SELECT
  535. f_corpid AS f_corpid
  536. FROM
  537. t_whgenleg
  538. GROUP BY
  539. f_corpid
  540. ) t ON c.f_id = t.f_corpid
  541. </select>
  542. <select id="selectCorpsListWhouse" resultType="Map">
  543. SELECT
  544. t.f_corpid AS fCorpid,
  545. g.f_name AS fName,
  546. w.f_name AS fWarehouseName,
  547. w.f_totalgross AS fTotalgross,
  548. t.f_grossweightblc AS fGrossweightD
  549. FROM
  550. t_corps g
  551. RIGHT JOIN (
  552. SELECT
  553. f_corpid AS f_corpid,
  554. f_warehouseid AS f_warehouseid,
  555. sum( f_grossweightblc ) AS f_grossweightblc
  556. FROM
  557. t_whgenleg
  558. GROUP BY
  559. f_corpid,
  560. f_warehouseid
  561. ORDER BY
  562. sum( f_grossweightblc ) DESC
  563. ) t ON g.f_id = t.f_corpid
  564. LEFT JOIN t_warehouse w ON w.f_id = t.f_warehouseid
  565. <where>
  566. <if test="fId != null ">and w.f_id = #{fId}</if>
  567. </where>
  568. </select>
  569. <select id="selectDateFQtyblcListList" resultType="Map">
  570. SELECT
  571. t.f_originalbilldate AS fOriginalbilldate,
  572. sum(t.f_qtyblc) AS fQtyblc
  573. FROM
  574. t_whgenleg t
  575. WHERE
  576. t.f_originalbilldate &gt; #{map.frontday}
  577. AND t.f_originalbilldate &lt; #{map.nowadays}
  578. GROUP BY
  579. t.f_originalbilldate
  580. ORDER BY
  581. t.f_originalbilldate
  582. </select>
  583. <select id="getCorpsByfMblno" parameterType="string" resultType="Map">
  584. select
  585. tc.f_id as fId,
  586. tc.f_name as fName
  587. from t_warehousebills tw left join t_corps tc on tw.f_corpid = tc.f_id
  588. <where>
  589. <if test="fId != null and fId != ''">and tw.f_mblno like concat('%',#{fMblno},'%')</if>
  590. </where>
  591. group by tc.f_id, tc.f_name
  592. </select>
  593. <select id="selectStorageFeeItemList" parameterType="com.ruoyi.warehouseBusiness.domain.TWarehouseBills" resultType="Map">
  594. SELECT
  595. wh.f_id AS fId,
  596. wh.f_originalbillno AS fBillno,
  597. wh.f_goodsid AS fGoodsid,
  598. wh.f_originalbilldate AS fBsdate,
  599. wh.f_billingway AS fBillingway,
  600. wh.f_mblno AS fMblno,
  601. wh.f_chargedate AS fChargedate,
  602. wh.f_originalbilldate AS fOriginalbilldate,
  603. wh.f_marks AS fMarks,
  604. wh.f_cntrno AS fCntrno,
  605. wh.f_volumnblc AS fVolumn,
  606. wh.f_qtyblc AS fQty,
  607. wh.f_grossweightblc AS fGrossweight,
  608. wh.f_netweightblc AS fNetweight,
  609. wh.f_warehouseid AS warehouse,
  610. wh.f_warehouse_locationid AS warehouseLocationid,
  611. "KCZZ" AS fBilltype,
  612. goods.if_cntrno AS ifCntrno,
  613. goods.f_typeid AS fTypeid,
  614. goods.f_name AS fGoodsids
  615. FROM
  616. t_whgenleg wh
  617. LEFT JOIN t_goods goods ON goods.f_id = wh.f_goodsid
  618. LEFT JOIN t_warehouse ware ON ware.f_id = wh.f_warehouseid
  619. <where>
  620. wh.f_corpid = #{warehouse.fCorpid}
  621. and ware.f_charg = 1
  622. and wh.f_chargedate &lt; #{warehouse.fBillingDeadline}
  623. <if test="warehouse.fGoodsid != null and warehouse.fGoodsid != ''">and wh.f_goodsid = #{warehouse.fGoodsid}</if>
  624. <if test="warehouse.fMblno != null and warehouse.fMblno != ''">and wh.f_mblno like concat('%',#{warehouse.fMblno},'%')</if>
  625. <if test="warehouse.fWarehouseid != null and warehouse.fWarehouseid != ''">and wh.f_warehouseid = #{warehouse.fWarehouseid}</if>
  626. </where>
  627. </select>
  628. <select id="selectStorageFeeItemList1" resultType="java.util.Map" resultMap="StorageFeesInfoResult">
  629. SELECT
  630. wh.f_id,
  631. wh.f_originalbillno AS f_billno,
  632. wh.f_goodsid,
  633. wh.f_originalbilldate AS f_bsdate,
  634. wh.f_billingway,
  635. wh.f_mblno,
  636. wh.f_chargedate,
  637. wh.f_originalbilldate AS f_src_bsdate,
  638. wh.f_originalbilldate,
  639. wh.f_marks,
  640. wh.f_cntrno,
  641. wh.f_volumnblc AS f_volumn,
  642. wh.f_qtyblc AS f_qty,
  643. wh.f_grossweightblc AS f_grossweight,
  644. wh.f_netweightblc AS f_netweight,
  645. wh.f_warehouseid,
  646. wh.f_warehouse_locationid,
  647. 'KCZZ' AS f_billtype,
  648. goods.if_cntrno,
  649. goods.f_typeid AS f_typeid,
  650. goods.f_name AS goods_name
  651. FROM
  652. t_whgenleg wh
  653. LEFT JOIN t_goods goods ON goods.f_id = wh.f_goodsid
  654. LEFT JOIN t_warehouse ware ON ware.f_id = wh.f_warehouseid
  655. <where>
  656. wh.f_corpid = #{warehouse.fCorpid}
  657. and ware.f_charg = 1
  658. and wh.f_chargedate &lt; #{warehouse.fBillingDeadline}
  659. <if test="warehouse.fGoodsid != null and warehouse.fGoodsid != ''">and wh.f_goodsid = #{warehouse.fGoodsid}</if>
  660. <if test="warehouse.fMblno != null and warehouse.fMblno != ''">and wh.f_mblno like concat('%',#{warehouse.fMblno},'%')</if>
  661. <if test="warehouse.fWarehouseid != null and warehouse.fWarehouseid != ''">and wh.f_warehouseid = #{warehouse.fWarehouseid}</if>
  662. <if test="warehouse.fTrademodeid != null and warehouse.fTrademodeid != ''">and wh.f_trademodeid = #{warehouse.fTrademodeid}</if>
  663. </where>
  664. </select>
  665. <select id="selectInventoryList" parameterType="TWhgenleg" resultType="Map">
  666. select
  667. DISTINCT
  668. leg.f_id AS fId,
  669. leg.f_corpid AS fCorpIds,
  670. leg.f_bsdate AS fBsdate,
  671. corp.f_name AS fCorpid,
  672. leg.f_shipper AS fShipper,
  673. ware.f_warehouse_information AS fWarehouseids,
  674. area.f_name AS fWarehouseLocationids,
  675. leg.f_originalbillno AS fOriginalbillno,
  676. leg.f_warehouse_locationid AS fWarehouseLocationid,
  677. dict1.dict_label AS fTrademodeid,
  678. goods.f_name AS fGoodsids,
  679. leg.f_trademodeid AS fTrademodeids,
  680. goods.f_packagespecs AS fPackagespecs,
  681. leg.f_goodsid AS fGoodsid,
  682. leg.f_volumnD AS fVolumnD,
  683. leg.f_qtyD AS fQtyD,
  684. leg.f_mblno AS fMblno,
  685. leg.f_grossweightD AS fGrossweightD,
  686. leg.f_netweightD AS fNetweightD,
  687. leg.f_volumnC AS fVolumnC,
  688. leg.f_volumnblc AS fVolumnblc,
  689. leg.f_qtyC AS fQtyC,
  690. leg.f_business_type AS fBusinessType,
  691. leg.f_grossweightC AS fGrossweightC,
  692. leg.f_netweightC AS fNetweightC,
  693. leg.f_qtyblc AS fQtyblc,
  694. leg.f_billingway AS fBillingway,
  695. leg.f_chargedate AS fChargedate,
  696. leg.f_grossweightblc AS fGrossweightblc,
  697. leg.f_netweightblc AS fNetweightblc,
  698. leg.f_localcntrno AS fLocalcntrno,
  699. dict.dict_label AS fBusinessTypes,
  700. leg.f_marks AS fMarks,
  701. DATE_FORMAT( leg.create_time, '%Y-%m-%d' ) AS createTime,
  702. DATE_FORMAT( leg.f_originalbilldate, '%Y-%m-%d' ) AS fOriginalbilldate,
  703. leg.f_cntrno AS fCntrno
  704. FROM
  705. t_whgenleg leg
  706. LEFT JOIN t_warehousebillsitems wt on wt.f_marks = leg.f_marks
  707. left join sys_user u on leg.create_by = u.user_name
  708. left join sys_dept d on u.dept_id = d.dept_id
  709. LEFT JOIN t_corps corp ON corp.f_id = leg.f_corpid
  710. LEFT JOIN t_goods goods ON goods.f_id = leg.f_goodsid
  711. LEFT JOIN t_warehouse ware ON ware.f_id = leg.f_warehouse_locationid
  712. LEFT JOIN sys_dict_data dict ON dict.dict_value = leg.f_business_type
  713. LEFT JOIN t_warehouse_area area ON area.f_id = leg.f_warehouse_locationid
  714. LEFT JOIN sys_dict_data dict1 ON dict1.dict_value = leg.f_trademodeid
  715. <where>
  716. dict.status = '0'
  717. AND dict1.status = '0'
  718. AND dict.dict_type = 'storage_type'
  719. AND dict1.dict_type = 'data_trademodes'
  720. AND leg.f_qtyD != 0
  721. AND leg.f_qtyblc &gt; 0
  722. AND leg.f_grossweightblc &gt; 0
  723. AND leg.f_netweightblc &gt; 0
  724. AND leg.f_mblno = wt.f_mblno
  725. <if test="fOriginalbillno != null and fOriginalbillno != ''">and leg.f_originalbillno = #{fOriginalbillno}</if>
  726. <if test="fPreqty != null ">and leg.f_preqty = #{fPreqty}</if>
  727. <if test="fCorpid != null ">and leg.f_corpid = #{fCorpid}</if>
  728. <if test="fShipper != null and fShipper != ''">and leg.f_shipper like concat('%', #{fShipper}, '%')</if>
  729. <if test='orgStorageDate != null and orgStorageDate[0] != null and orgStorageDate[0]!= ""'>
  730. and leg.f_originalbilldate &gt;= #{orgStorageDate[0]}
  731. </if>
  732. <if test='orgStorageDate != null and orgStorageDate[1] != null and orgStorageDate[1]!= ""'>
  733. and leg.f_originalbilldate &lt;= #{orgStorageDate[1]}
  734. </if>
  735. <if test="fPregrossweight != null ">and leg.f_pregrossweight = #{fPregrossweight}</if>
  736. <if test="fPrenetweight != null ">and leg.f_prenetweight = #{fPrenetweight}</if>
  737. <if test="fQtyd != null ">and leg.f_qtyD = #{fQtyd}</if>
  738. <if test="fTrademodeid != null ">and leg.f_trademodeid = #{fTrademodeid}</if>
  739. <if test="fGoodsid != null ">and leg.f_goodsid = #{fGoodsid}</if>
  740. <if test="fVolumnd != null ">and leg.f_volumnD = #{fVolumnd}</if>
  741. <if test="fGrossweightd != null ">and leg.f_grossweightD = #{fGrossweightd}</if>
  742. <if test="fNetweightd != null ">and leg.f_netweightD = #{fNetweightd}</if>
  743. <if test="fVolumnc != null ">and leg.f_volumnC = #{fVolumnc}</if>
  744. <if test="fQtyc != null ">and leg.f_qtyC = #{fQtyc}</if>
  745. <if test="fOriginalbilldate != null ">and leg.f_originalbilldate = #{fOriginalbilldate}</if>
  746. <if test="fMarks != null and fMarks != ''">and leg.f_marks LIKE concat('%', #{fMarks}, '%')</if>
  747. <if test="fQtyblc != null ">and leg.f_qtyblc = #{fQtyblc}</if>
  748. <if test="fGrossweightc != null ">and leg.f_grossweightC = #{fGrossweightc}</if>
  749. <if test="fNetweightc != null ">and leg.f_netweightC = #{fNetweightc}</if>
  750. <if test="fGrossweightblc != null ">and leg.f_grossweightblc = #{fGrossweightblc}</if>
  751. <if test="fNetweightblc != null ">and leg.f_netweightblc = #{fNetweightblc}</if>
  752. <if test="fCntrno != null and fCntrno != ''">and leg.f_cntrno LIKE concat('%', #{fCntrno}, '%')</if>
  753. <if test="fMblno != null ">and leg.f_mblno LIKE concat('%', #{fMblno}, '%') </if>
  754. <if test="fStatus != null and fStatus != ''">and leg.f_status = #{fStatus}</if>
  755. <if test="fWarehouseid != null ">and leg.f_warehouseid = #{fWarehouseid} </if>
  756. <if test="fLocation != null and fLocation ==1 ">
  757. and leg.f_warehouse_locationid = #{fWarehouseLocationid}
  758. </if>
  759. <if test="fLocation != null and fLocation ==0 ">
  760. and ware.ancestors LIKE concat('%', #{fWarehouseLocationid}, '%')
  761. </if>
  762. </where>
  763. </select>
  764. <select id="selectInventoryMapList" parameterType="TWhgenleg" resultType="Map">
  765. select
  766. DISTINCT
  767. leg.f_id AS fId,
  768. leg.f_corpid AS fCorpIds,
  769. corp.f_name AS fCorpid,
  770. leg.f_shipper AS fShipper,
  771. <if test="isCntrno != 2 ">ware.f_warehouse_information AS fWarehouseids,</if>
  772. <if test="isCntrno == 2 ">ware.f_name AS fWarehouseids,</if>
  773. area.f_name AS fWarehouseLocationids,
  774. leg.f_originalbillno AS fOriginalbillno,
  775. leg.f_warehouse_locationid AS fWarehouseLocationid,
  776. dict1.dict_label AS fTrademodeid,
  777. goods.f_name AS fGoodsids,
  778. leg.f_trademodeid AS fTrademodeids,
  779. goods.f_packagespecs AS fPackagespecs,
  780. leg.f_goodsid AS fGoodsid,
  781. SUM(leg.f_volumnD) AS fVolumnD,
  782. SUM(leg.f_qtyD) AS fQtyD,
  783. leg.f_mblno AS fMblno,
  784. SUM(leg.f_grossweightD) AS fGrossweightD,
  785. SUM(leg.f_netweightD) AS fNetweightD,
  786. SUM(leg.f_volumnC) AS fVolumnC,
  787. SUM(leg.f_volumnblc) AS fVolumnblc,
  788. SUM(leg.f_qtyC) AS fQtyC,
  789. leg.f_business_type AS fBusinessType,
  790. SUM(leg.f_grossweightC) AS fGrossweightC,
  791. SUM(leg.f_netweightC) AS fNetweightC,
  792. SUM(leg.f_qtyblc) AS fQtyblc,
  793. leg.f_billingway AS fBillingway,
  794. leg.f_chargedate AS fChargedate,
  795. SUM(leg.f_grossweightblc) AS fGrossweightblc,
  796. SUM(leg.f_netweightblc) AS fNetweightblc,
  797. dict.dict_label AS fBusinessTypes,
  798. leg.f_marks AS fMarks,
  799. DATE_FORMAT( leg.create_time, '%Y-%m-%d' ) AS createTime,
  800. DATE_FORMAT( leg.f_originalbilldate, '%Y-%m-%d' ) AS fOriginalbilldate,
  801. leg.f_cntrno AS fCntrno,
  802. leg.f_localcntrno fLocalcntrno,
  803. leg.lock_status As lockStatus,
  804. leg.belong_to As belongTo,
  805. leg.lock_time As lockTime,
  806. leg.unlock_time As unlockTime,
  807. leg.wr_number As wrNumber
  808. FROM
  809. t_whgenleg leg
  810. left join sys_user u on leg.create_by = u.user_name
  811. left join sys_user u1 on leg.create_by = u1.user_name
  812. left join sys_dept d on u.dept_id = d.dept_id
  813. LEFT JOIN t_corps corp ON corp.f_id = leg.f_corpid
  814. LEFT JOIN t_customer_contact tc ON tc.f_pid = corp.f_id
  815. LEFT JOIN t_goods goods ON goods.f_id = leg.f_goodsid
  816. <if test="isCntrno != 2 ">LEFT JOIN t_warehouse ware ON ware.f_id = leg.f_warehouse_locationid</if>
  817. <if test="isCntrno == 2 ">LEFT JOIN t_warehouse ware ON ware.f_id = leg.f_warehouseid</if>
  818. LEFT JOIN sys_dict_data dict ON dict.dict_value = leg.f_business_type
  819. LEFT JOIN t_warehouse_area area ON area.f_id = leg.f_warehouse_locationid
  820. LEFT JOIN sys_dict_data dict1 ON dict1.dict_value = leg.f_trademodeid
  821. <where>
  822. dict.status = '0'
  823. AND dict1.status = '0'
  824. AND leg.f_qtyD != 0
  825. <if test="isMblno != null and isMblno == 0 ">
  826. AND leg.f_qtyblc != 0
  827. AND leg.f_grossweightblc != 0
  828. AND leg.f_netweightblc != 0
  829. </if>
  830. AND dict.dict_type = 'storage_type'
  831. AND dict1.dict_type = 'data_trademodes'
  832. <if test="fOriginalbillno != null and fOriginalbillno != ''">and leg.f_originalbillno = #{fOriginalbillno}</if>
  833. <if test="fTel != null and fTel != ''">and tc.f_tel = #{fTel}</if>
  834. <if test="fPreqty != null ">and leg.f_preqty = #{fPreqty}</if>
  835. <if test="fCorpid != null ">and leg.f_corpid = #{fCorpid}</if>
  836. <if test="fShipper != null and fShipper != ''">and leg.f_shipper like concat('%', #{fShipper}, '%')</if>
  837. <if test="fMblno != null ">and leg.f_mblno LIKE concat('%', #{fMblno}, '%') </if>
  838. <if test='orgStorageDate != null and orgStorageDate[0] != null and orgStorageDate[0]!= ""'>and leg.f_originalbilldate &gt;= #{orgStorageDate[0]}</if>
  839. <if test='orgStorageDate != null and orgStorageDate[1] != null and orgStorageDate[1]!= ""'>and leg.f_originalbilldate &lt;= #{orgStorageDate[1]}</if>
  840. <if test="fPregrossweight != null ">and leg.f_pregrossweight = #{fPregrossweight}</if>
  841. <if test="fPrenetweight != null ">and leg.f_prenetweight = #{fPrenetweight}</if>
  842. <if test="fQtyd != null ">and leg.f_qtyD = #{fQtyd}</if>
  843. <if test="fTrademodeid != null ">and leg.f_trademodeid = #{fTrademodeid}</if>
  844. <if test="fGoodsid != null ">and leg.f_goodsid = #{fGoodsid}</if>
  845. <if test="fVolumnd != null ">and leg.f_volumnD = #{fVolumnd}</if>
  846. <if test="fGrossweightd != null ">and leg.f_grossweightD = #{fGrossweightd}</if>
  847. <if test="fNetweightd != null ">and leg.f_netweightD = #{fNetweightd}</if>
  848. <if test="fVolumnc != null ">and leg.f_volumnC = #{fVolumnc}</if>
  849. <if test="fQtyc != null ">and leg.f_qtyC = #{fQtyc}</if>
  850. <if test="fOriginalbilldate != null ">and leg.f_originalbilldate = #{fOriginalbilldate}</if>
  851. <if test="fMarks != null and fMarks != ''">and leg.f_marks LIKE concat('%', #{fMarks}, '%')</if>
  852. <if test="fQtyblc != null ">and leg.f_qtyblc = #{fQtyblc}</if>
  853. <if test="fGrossweightc != null ">and leg.f_grossweightC = #{fGrossweightc}</if>
  854. <if test="fNetweightc != null ">and leg.f_netweightC = #{fNetweightc}</if>
  855. <if test="fGrossweightblc != null ">and leg.f_grossweightblc = #{fGrossweightblc}</if>
  856. <if test="fNetweightblc != null ">and leg.f_netweightblc = #{fNetweightblc}</if>
  857. <if test="fStatus != null and fStatus != ''">and leg.f_status = #{fStatus}</if>
  858. <if test="fWarehouseid != null ">and leg.f_warehouseid = #{fWarehouseid} </if>
  859. <if test="fLocation != null and fLocation ==1 ">and leg.f_warehouse_locationid = #{fWarehouseLocationid}</if>
  860. <if test="checklists != null and checklists !='' ">and leg.checklists = #{checklists}</if>
  861. <if test="fCntrno != null and fCntrno != ''">and leg.f_cntrno LIKE concat('%', #{fCntrno}, '%')</if>
  862. <if test="fLocalcntrno != null and fLocalcntrno != ''">and leg.f_localcntrno LIKE concat('%', #{fLocalcntrno}, '%')</if>
  863. <if test="fLocation != null and fLocation ==0 ">and ware.ancestors LIKE concat('%', #{fWarehouseLocationid}, '%')</if>
  864. <if test="isCntrno == null">
  865. GROUP BY leg.f_corpid, leg.f_originalbillno, leg.f_originalbilldate, leg.f_warehouse_locationid, leg.f_goodsid, leg.f_trademodeid,leg.f_marks
  866. </if>
  867. <if test="isCntrno == 1 ">
  868. GROUP BY leg.f_corpid, leg.f_originalbillno, leg.f_originalbilldate, leg.f_warehouse_locationid, leg.f_goodsid, leg.f_trademodeid,leg.f_cntrno,leg.f_marks
  869. </if>
  870. <if test="isCntrno == 2 ">GROUP BY leg.f_corpid, leg.f_mblno, leg.f_goodsid, leg.f_warehouseid,leg.f_marks</if>
  871. </where>
  872. ${params.dataScope}
  873. order by leg.f_bsdate desc
  874. </select>
  875. <select id="selectAppInventoryMapList" parameterType="TWhgenleg" resultType="Map">
  876. select
  877. DISTINCT
  878. leg.f_id AS fId,
  879. leg.f_corpid AS fCorpIds,
  880. corp.f_name AS fCorpid,
  881. leg.f_shipper AS fShipper,
  882. ware.f_warehouse_information AS fWarehouseids,
  883. area.f_name AS fWarehouseLocationids,
  884. leg.f_originalbillno AS fOriginalbillno,
  885. leg.f_warehouse_locationid AS fWarehouseLocationid,
  886. dict1.dict_label AS fTrademodeid,
  887. goods.f_name AS fGoodsids,
  888. leg.f_trademodeid AS fTrademodeids,
  889. goods.f_packagespecs AS fPackagespecs,
  890. leg.f_goodsid AS fGoodsid,
  891. IFNULL(SUM(leg.f_volumnD),0) AS fVolumnD,
  892. IFNULL(SUM(leg.f_qtyD),0) AS fQtyD,
  893. leg.f_mblno AS fMblno,
  894. ROUND(IFNULL(SUM(leg.f_grossweightD),0) / 1000, 2) AS fGrossweightD,
  895. ROUND(IFNULL(SUM(leg.f_netweightD),0) / 1000, 2) AS fNetweightD,
  896. IFNULL(SUM(leg.f_volumnC),0) AS fVolumnC,
  897. IFNULL(SUM(leg.f_volumnblc),0) AS fVolumnblc,
  898. SUM(leg.f_qtyC) AS fQtyC,
  899. leg.f_business_type AS fBusinessType,
  900. ROUND(IFNULL(SUM(leg.f_grossweightC),0) / 1000, 2) AS fGrossweightC,
  901. ROUND(IFNULL(SUM(leg.f_netweightC),0) / 1000, 2) AS fNetweightC,
  902. IFNULL(SUM(leg.f_qtyblc),0) AS fQtyblc,
  903. leg.f_billingway AS fBillingway,
  904. leg.f_chargedate AS fChargedate,
  905. ROUND(IFNULL(SUM(leg.f_grossweightblc),0) / 1000, 2) AS fGrossweightblc,
  906. ROUND(IFNULL(SUM(leg.f_netweightblc),0) / 1000, 2) AS fNetweightblc,
  907. dict.dict_label AS fBusinessTypes,
  908. leg.f_marks AS fMarks,
  909. DATE_FORMAT( leg.create_time, '%Y-%m-%d' ) AS createTime,
  910. DATE_FORMAT( leg.f_originalbilldate, '%Y-%m-%d' ) AS fOriginalbilldate,
  911. leg.f_cntrno AS fCntrno,
  912. leg.f_localcntrno fLocalcntrno
  913. FROM
  914. t_whgenleg leg
  915. left join sys_user u on leg.create_by = u.user_name
  916. left join sys_user u1 on leg.create_by = u1.user_name
  917. left join sys_dept d on u.dept_id = d.dept_id
  918. LEFT JOIN t_corps corp ON corp.f_id = leg.f_corpid
  919. LEFT JOIN t_customer_contact tc ON tc.f_pid = corp.f_id
  920. LEFT JOIN t_goods goods ON goods.f_id = leg.f_goodsid
  921. LEFT JOIN t_warehouse ware ON ware.f_id = leg.f_warehouse_locationid
  922. LEFT JOIN sys_dict_data dict ON dict.dict_value = leg.f_business_type
  923. LEFT JOIN t_warehouse_area area ON area.f_id = leg.f_warehouse_locationid
  924. LEFT JOIN sys_dict_data dict1 ON dict1.dict_value = leg.f_trademodeid
  925. <where>
  926. dict.status = '0'
  927. AND dict1.status = '0'
  928. AND leg.f_qtyD != 0
  929. AND dict.dict_type = 'storage_type'
  930. AND dict1.dict_type = 'data_trademodes'
  931. <if test="fOriginalbillno != null and fOriginalbillno != ''">and leg.f_originalbillno = #{fOriginalbillno}</if>
  932. <if test="fTel != null and fTel != ''">and tc.f_tel = #{fTel}</if>
  933. <if test="fPreqty != null ">and leg.f_preqty = #{fPreqty}</if>
  934. <if test="fCorpid != null ">and leg.f_corpid = #{fCorpid}</if>
  935. <if test="fShipper != null and fShipper != ''">and leg.f_shipper like concat('%', #{fShipper}, '%')</if>
  936. <if test="fMblno != null ">and leg.f_mblno LIKE concat('%', #{fMblno}, '%') </if>
  937. <if test='orgStorageDate != null and orgStorageDate[0] != null and orgStorageDate[0]!= ""'>
  938. and leg.f_originalbilldate &gt;= #{orgStorageDate[0]}
  939. </if>
  940. <if test='orgStorageDate != null and orgStorageDate[1] != null and orgStorageDate[1]!= ""'>
  941. and leg.f_originalbilldate &lt;= #{orgStorageDate[1]}
  942. </if>
  943. <if test="fPregrossweight != null ">and leg.f_pregrossweight = #{fPregrossweight}</if>
  944. <if test="fPrenetweight != null ">and leg.f_prenetweight = #{fPrenetweight}</if>
  945. <if test="fQtyd != null ">and leg.f_qtyD = #{fQtyd}</if>
  946. <if test="fTrademodeid != null ">and leg.f_trademodeid = #{fTrademodeid}</if>
  947. <if test="fGoodsid != null ">and leg.f_goodsid = #{fGoodsid}</if>
  948. <if test="fVolumnd != null ">and leg.f_volumnD = #{fVolumnd}</if>
  949. <if test="fGrossweightd != null ">and leg.f_grossweightD = #{fGrossweightd}</if>
  950. <if test="fNetweightd != null ">and leg.f_netweightD = #{fNetweightd}</if>
  951. <if test="fVolumnc != null ">and leg.f_volumnC = #{fVolumnc}</if>
  952. <if test="fQtyc != null ">and leg.f_qtyC = #{fQtyc}</if>
  953. <if test="fOriginalbilldate != null ">and leg.f_originalbilldate = #{fOriginalbilldate}</if>
  954. <if test="fMarks != null and fMarks != ''">and leg.f_marks LIKE concat('%', #{fMarks}, '%')</if>
  955. <if test="fQtyblc != null ">and leg.f_qtyblc = #{fQtyblc}</if>
  956. <if test="fGrossweightc != null ">and leg.f_grossweightC = #{fGrossweightc}</if>
  957. <if test="fNetweightc != null ">and leg.f_netweightC = #{fNetweightc}</if>
  958. <if test="fGrossweightblc != null ">and leg.f_grossweightblc = #{fGrossweightblc}</if>
  959. <if test="fNetweightblc != null ">and leg.f_netweightblc = #{fNetweightblc}</if>
  960. <if test="fStatus != null and fStatus != ''">and leg.f_status = #{fStatus}</if>
  961. <if test="fWarehouseid != null ">and leg.f_warehouseid = #{fWarehouseid} </if>
  962. <if test="fLocation != null and fLocation ==1 ">
  963. and leg.f_warehouse_locationid = #{fWarehouseLocationid}
  964. </if>
  965. <if test="fCntrno != null and fCntrno != ''">
  966. and leg.f_cntrno LIKE concat('%', #{fCntrno}, '%')
  967. </if>
  968. <if test="fLocalcntrno != null and fLocalcntrno != ''">
  969. and leg.f_localcntrno LIKE concat('%', #{fLocalcntrno}, '%')
  970. </if>
  971. <if test="fLocation != null and fLocation ==0 ">
  972. and ware.ancestors LIKE concat('%', #{fWarehouseLocationid}, '%')
  973. </if>
  974. GROUP BY leg.f_corpid,leg.f_originalbillno, leg.f_originalbilldate, leg.f_warehouse_locationid, leg.f_goodsid, leg.f_trademodeid
  975. <if test="isCntrno != null and isCntrno == 0 ">
  976. ,leg.f_cntrno
  977. </if>
  978. <if test="isMblno != null and isMblno == 0 ">
  979. ,leg.f_mblno
  980. </if>
  981. </where>
  982. ${params.dataScope}
  983. order by leg.f_bsdate desc
  984. </select>
  985. <select id="selectWhgenlegMessage" parameterType="TWhgenleg" resultType="com.ruoyi.reportManagement.excel.Whgenleg">
  986. select
  987. DISTINCT
  988. leg.f_id AS fId,
  989. leg.f_corpid AS fCorpIds,
  990. corp.f_name AS fCorpid,
  991. leg.f_shipper AS fShipper,
  992. <if test="isCntrno != 2 ">ware.f_warehouse_information AS fWarehouseids,</if>
  993. <if test="isCntrno == 2 ">ware.f_name AS fWarehouseids,</if>
  994. area.f_name AS fWarehouseLocationids,
  995. leg.f_originalbillno AS fOriginalbillno,
  996. leg.f_warehouse_locationid AS fWarehouseLocationid,
  997. dict1.dict_label AS fTrademodeid,
  998. goods.f_name AS fGoodsids,
  999. leg.f_trademodeid AS fTrademodeids,
  1000. goods.f_packagespecs AS fPackagespecs,
  1001. leg.f_goodsid AS fGoodsid,
  1002. SUM(leg.f_volumnD) AS fVolumnD,
  1003. SUM(leg.f_qtyD) AS fQtyD,
  1004. leg.f_mblno AS fMblno,
  1005. SUM(leg.f_grossweightD) AS fGrossweightD,
  1006. SUM(leg.f_netweightD) AS fNetweightD,
  1007. SUM(leg.f_volumnC) AS fVolumnC,
  1008. SUM(leg.f_volumnblc) AS fVolumnblc,
  1009. SUM(leg.f_qtyC) AS fQtyC,
  1010. leg.f_business_type AS fBusinessType,
  1011. SUM(leg.f_grossweightC) AS fGrossweightC,
  1012. SUM(leg.f_netweightC) AS fNetweightC,
  1013. SUM(leg.f_qtyblc) AS fQtyblc,
  1014. leg.f_billingway AS fBillingway,
  1015. leg.f_chargedate AS fChargedate,
  1016. SUM(leg.f_grossweightblc) AS fGrossweightblc,
  1017. SUM(leg.f_netweightblc) AS fNetweightblc,
  1018. leg.f_localcntrno AS fLocalcntrno,
  1019. dict.dict_label AS fBusinessTypes,
  1020. leg.f_marks AS fMarks,
  1021. DATE_FORMAT( leg.create_time, '%Y-%m-%d' ) AS createTime,
  1022. DATE_FORMAT( leg.f_originalbilldate, '%Y-%m-%d' ) AS fOriginalbilldate,
  1023. leg.f_cntrno AS fCntrno
  1024. FROM
  1025. t_whgenleg leg
  1026. left join sys_user u on leg.create_by = u.user_name
  1027. left join sys_dept d on u.dept_id = d.dept_id
  1028. LEFT JOIN t_corps corp ON corp.f_id = leg.f_corpid
  1029. LEFT JOIN t_goods goods ON goods.f_id = leg.f_goodsid
  1030. <if test="isCntrno != 2 ">LEFT JOIN t_warehouse ware ON ware.f_id = leg.f_warehouse_locationid</if>
  1031. <if test="isCntrno == 2 ">LEFT JOIN t_warehouse ware ON ware.f_id = leg.f_warehouseid</if>
  1032. LEFT JOIN sys_dict_data dict ON dict.dict_value = leg.f_business_type
  1033. LEFT JOIN t_warehouse_area area ON area.f_id = leg.f_warehouse_locationid
  1034. LEFT JOIN sys_dict_data dict1 ON dict1.dict_value = leg.f_trademodeid
  1035. <where>
  1036. dict.status = '0'
  1037. AND dict1.status = '0'
  1038. AND leg.f_qtyD != 0
  1039. <if test="isMblno != null and isMblno == 0 ">
  1040. AND leg.f_qtyblc != 0
  1041. AND leg.f_grossweightblc != 0
  1042. AND leg.f_netweightblc != 0
  1043. </if>
  1044. AND dict.dict_type = 'storage_type'
  1045. AND dict1.dict_type = 'data_trademodes'
  1046. <if test="fOriginalbillno != null and fOriginalbillno != ''">and leg.f_originalbillno = #{fOriginalbillno}</if>
  1047. <if test="fTel != null and fTel != ''">and tc.f_tel = #{fTel}</if>
  1048. <if test="fPreqty != null ">and leg.f_preqty = #{fPreqty}</if>
  1049. <if test="fCorpid != null ">and leg.f_corpid = #{fCorpid}</if>
  1050. <if test="fShipper != null and fShipper != ''">and leg.f_shipper like concat('%', #{fShipper}, '%')</if>
  1051. <if test="fMblno != null ">and leg.f_mblno LIKE concat('%', #{fMblno}, '%') </if>
  1052. <if test='orgStorageDate != null and orgStorageDate[0] != null and orgStorageDate[0]!= ""'>and leg.f_originalbilldate &gt;= #{orgStorageDate[0]}</if>
  1053. <if test='orgStorageDate != null and orgStorageDate[1] != null and orgStorageDate[1]!= ""'>and leg.f_originalbilldate &lt;= #{orgStorageDate[1]}</if>
  1054. <if test="fPregrossweight != null ">and leg.f_pregrossweight = #{fPregrossweight}</if>
  1055. <if test="fPrenetweight != null ">and leg.f_prenetweight = #{fPrenetweight}</if>
  1056. <if test="fQtyd != null ">and leg.f_qtyD = #{fQtyd}</if>
  1057. <if test="fTrademodeid != null ">and leg.f_trademodeid = #{fTrademodeid}</if>
  1058. <if test="fGoodsid != null ">and leg.f_goodsid = #{fGoodsid}</if>
  1059. <if test="fVolumnd != null ">and leg.f_volumnD = #{fVolumnd}</if>
  1060. <if test="fGrossweightd != null ">and leg.f_grossweightD = #{fGrossweightd}</if>
  1061. <if test="fNetweightd != null ">and leg.f_netweightD = #{fNetweightd}</if>
  1062. <if test="fVolumnc != null ">and leg.f_volumnC = #{fVolumnc}</if>
  1063. <if test="fQtyc != null ">and leg.f_qtyC = #{fQtyc}</if>
  1064. <if test="fOriginalbilldate != null ">and leg.f_originalbilldate = #{fOriginalbilldate}</if>
  1065. <if test="fMarks != null and fMarks != ''">and leg.f_marks LIKE concat('%', #{fMarks}, '%')</if>
  1066. <if test="fQtyblc != null ">and leg.f_qtyblc = #{fQtyblc}</if>
  1067. <if test="fGrossweightc != null ">and leg.f_grossweightC = #{fGrossweightc}</if>
  1068. <if test="fNetweightc != null ">and leg.f_netweightC = #{fNetweightc}</if>
  1069. <if test="fGrossweightblc != null ">and leg.f_grossweightblc = #{fGrossweightblc}</if>
  1070. <if test="fNetweightblc != null ">and leg.f_netweightblc = #{fNetweightblc}</if>
  1071. <if test="fStatus != null and fStatus != ''">and leg.f_status = #{fStatus}</if>
  1072. <if test="fWarehouseid != null ">and leg.f_warehouseid = #{fWarehouseid} </if>
  1073. <if test="fLocation != null and fLocation ==1 ">and leg.f_warehouse_locationid = #{fWarehouseLocationid}</if>
  1074. <if test="fCntrno != null and fCntrno != ''">and leg.f_cntrno LIKE concat('%', #{fCntrno}, '%')</if>
  1075. <if test="fLocalcntrno != null and fLocalcntrno != ''">and leg.f_localcntrno LIKE concat('%', #{fLocalcntrno}, '%')</if>
  1076. <if test="fLocation != null and fLocation ==0 ">and ware.ancestors LIKE concat('%', #{fWarehouseLocationid}, '%')</if>
  1077. <if test="isCntrno == null">
  1078. GROUP BY leg.f_corpid, leg.f_originalbillno, leg.f_originalbilldate, leg.f_warehouse_locationid, leg.f_goodsid, leg.f_trademodeid,leg.f_marks
  1079. </if>
  1080. <if test="isCntrno == 1 ">
  1081. GROUP BY leg.f_corpid, leg.f_originalbillno, leg.f_originalbilldate, leg.f_warehouse_locationid, leg.f_goodsid, leg.f_trademodeid,leg.f_cntrno,leg.f_marks
  1082. </if>
  1083. <if test="isCntrno == 2 ">GROUP BY leg.f_corpid, leg.f_mblno, leg.f_goodsid, leg.f_warehouseid ,leg.f_marks</if>
  1084. </where>
  1085. ${params.dataScope}
  1086. order by leg.f_bsdate desc
  1087. </select>
  1088. <select id="selectWhgenlegList" resultType="java.util.Map">
  1089. select
  1090. DISTINCT
  1091. leg.f_id AS fId,
  1092. corp.f_name AS fCorpid,
  1093. leg.f_shipper AS fShipper,
  1094. DATE_FORMAT( leg.f_originalbilldate, '%Y-%m-%d' ) AS fOriginalbilldate,
  1095. ware.f_warehouse_information AS fWarehouseids,
  1096. ware.f_no AS fWarehouseNo,
  1097. leg.f_mblno AS fMblno,
  1098. goods.f_id AS fGoodsId,
  1099. goods.f_ems_no AS fEmsNo,
  1100. leg.f_ems_seq_no AS fEmsSeqNo,
  1101. goods.f_goods_ts AS fCodeTs,
  1102. goods.f_wms_dcl_unit AS fWmsDclUnit,
  1103. goods.f_wms_law_unit AS fWmsLawUnit,
  1104. goods.f_name AS fGoodsids,
  1105. goods.f_no AS fGoodsno,
  1106. goods.f_packageid AS goodsPackageId,
  1107. goods.f_specs AS goodsfSpecs,
  1108. leg.f_qtyC AS fQtyC,
  1109. leg.f_warehouse_locationid AS fWLID,
  1110. leg.f_status AS fLegStatus,
  1111. dict.dict_label AS fBusinessTypes,
  1112. sdict.dict_label AS fGoodsType,
  1113. leg.f_marks AS fMarks,
  1114. leg.f_qtyblc AS fQtyblc,
  1115. leg.f_grossweightblc AS fGrossweightblc,
  1116. leg.f_netweightblc AS fNetweightblc,
  1117. cast(leg.f_netweightD AS DECIMAL) AS fNetweightD
  1118. FROM
  1119. t_whgenleg leg
  1120. LEFT JOIN t_corps corp ON corp.f_id = leg.f_corpid
  1121. LEFT JOIN t_goods goods ON goods.f_id = leg.f_goodsid
  1122. LEFT JOIN t_warehouse ware ON ware.f_id = leg.f_warehouse_locationid
  1123. LEFT JOIN sys_dict_data dict ON dict.dict_value = leg.f_business_type
  1124. LEFT JOIN sys_dict_data sdict ON sdict.dict_value = leg.f_trademodeid
  1125. LEFT JOIN t_warehouse_area area ON area.f_id = leg.f_warehouse_locationid
  1126. LEFT JOIN t_warehouse wh ON wh.f_id = leg.f_warehouseid
  1127. <where>
  1128. dict.status = '0'
  1129. AND dict.dict_type = 'storage_type'
  1130. AND sdict.`status` = '0'
  1131. AND sdict.dict_type = 'data_trademodes'
  1132. AND wh.supervise = 1
  1133. AND leg.f_qtyblc != 0
  1134. AND leg.f_grossweightblc != 0
  1135. AND leg.f_netweightblc != 0
  1136. </where>
  1137. </select>
  1138. <!--根据客户id或加上提单号查询库存不为0的仓库名-->
  1139. <select id="getWarehouse" parameterType="TWhgenleg" resultType="Map">
  1140. SELECT
  1141. DISTINCT
  1142. th.f_id AS fId,
  1143. th.f_name AS fName
  1144. FROM
  1145. t_whgenleg tw
  1146. LEFT JOIN t_warehouse th ON th.f_id = tw.f_warehouseid
  1147. WHERE
  1148. (tw.f_qtyblc > 0 OR tw.f_grossweightblc > 0 OR f_netweightblc > 0)
  1149. AND f_corpid = #{fCorpid}
  1150. AND f_mblno = #{fMblno}
  1151. </select>
  1152. <select id="queryChangedByFchargedate" resultType="java.lang.Integer">
  1153. SELECT
  1154. count( f_id )
  1155. FROM
  1156. t_whgenleg
  1157. WHERE
  1158. f_chargedate != #{time}
  1159. <foreach collection="ids" item="id" open="and f_id in(" separator="," close=")">
  1160. #{id}
  1161. </foreach>
  1162. </select>
  1163. <select id="selectStockDetailsList" resultMap="WhgenlegInfoResult">
  1164. SELECT
  1165. w.f_id, c.f_name, wh.f_mblno, t.f_business_type, t.f_marks, t.f_bsdate, t.f_billtype, w.f_trademodeid,
  1166. t.f_qty, t.f_grossweight, t.f_netweight
  1167. FROM
  1168. t_whgenleg wh
  1169. RIGHT JOIN t_corps c ON c.f_id = wh.f_corpid
  1170. RIGHT JOIN t_warehousebills w ON w.f_corpid = wh.f_corpid
  1171. AND w.f_trademodeid = wh.f_trademodeid
  1172. RIGHT JOIN t_warehousebillsitems t ON t.f_pid = w.f_id AND t.f_mblno = wh.f_mblno
  1173. AND t.f_business_type = wh.f_business_type
  1174. AND t.f_marks = wh.f_marks
  1175. AND t.f_goodsid = wh.f_goodsid
  1176. AND t.f_warehouselocid = wh.f_warehouse_locationid
  1177. AND IF(w.f_billtype = 'SJRK', t.f_originalbilldate = wh.f_bsdate, t.f_src_bsdate = wh.f_bsdate)
  1178. WHERE
  1179. wh.f_id = #{fId}
  1180. and w.f_billtype in ('SJRK', 'SJCK')
  1181. GROUP BY t.f_id
  1182. </select>
  1183. <select id="selectOtherDetailsList" resultMap="WhgenlegInfoResult">
  1184. SELECT
  1185. w.f_id, c.f_name, wh.f_mblno, t.f_business_type, t.f_marks, t.f_bsdate, t.f_billtype,
  1186. w.f_trademodeid, t.f_qty, t.f_grossweight, t.f_netweight
  1187. FROM
  1188. t_whgenleg wh
  1189. RIGHT JOIN t_corps c ON c.f_id = wh.f_corpid
  1190. RIGHT JOIN t_warehousebills w ON wh.f_corpid in (w.f_corpid, w.f_tocorpid)
  1191. AND IF ( w.f_billtype = 'HWTG', wh.f_trademodeid IN ( w.f_trademodeid, w.f_new_trademodeid ), w.f_trademodeid = wh.f_trademodeid )
  1192. RIGHT JOIN t_warehousebillsitems t ON t.f_pid = w.f_id
  1193. AND t.f_mblno = wh.f_mblno
  1194. AND t.f_business_type = wh.f_business_type
  1195. AND t.f_marks = wh.f_marks
  1196. AND t.f_goodsid = wh.f_goodsid
  1197. AND wh.f_warehouse_locationid IN ( t.f_warehouselocid, t.f_transfer_warehouselocid )
  1198. WHERE
  1199. wh.f_id = #{fId}
  1200. AND w.f_billtype IN ('CKDB','HWTG','HQZY')
  1201. GROUP BY t.f_id
  1202. </select>
  1203. <select id="stockStatistics" resultType="map">
  1204. select
  1205. <if test="mode == null or mode == ''">round(ifnull(sum(f_grossweightblc), 0) / 1000) as quantity</if>
  1206. <if test="mode != null and mode != ''">
  1207. case #{mode}
  1208. when '3' then round(ifnull(sum(f_volumnblc), 0))
  1209. when '2' then round(ifnull(sum(f_grossweightblc) / 1000, 0))
  1210. else ifnull(sum(f_qtyblc), 0)
  1211. end as quantity
  1212. </if>
  1213. from t_whgenleg
  1214. where
  1215. f_qtyD != 0
  1216. and f_qtyblc != 0
  1217. <if test="beginDate != null and beginDate != ''">and f_bsdate &gt;= #{beginDate}</if>
  1218. <if test="endDate != null and endDate != ''">and f_bsdate &lt;= #{endDate}</if>
  1219. <if test="external != null and external != ''">
  1220. and f_corpid = (select f_pid from t_customer_contact where f_tel = #{external})
  1221. </if>
  1222. <if test="warehouseId != null"> and f_warehouseid = #{warehouseId}</if>
  1223. <if test="customerId != null"> and f_corpid = #{customerId}</if>
  1224. </select>
  1225. <select id="stockTeuStatistics" resultType="map">
  1226. select
  1227. ifnull(sum(case tb.f_billtype when 'SJRK' then f_cntrcount end * tr.f_teu), 0) -
  1228. ifnull(sum(case tb.f_billtype when 'SJCK' then f_cntrcount end * tr.f_teu), 0) as quantity
  1229. from t_warehousebills_cntr twc
  1230. left join t_warehousebills tb on twc.f_pid = tb.f_id
  1231. left join t_cntr tr on twc.f_cntrid = tr.f_id
  1232. where tb.f_items_status = '4'
  1233. <if test="beginDate != null and beginDate != ''">and tb.f_bsdate &gt;= #{beginDate}</if>
  1234. <if test="endDate != null and endDate != ''">and tb.f_bsdate &lt;= #{endDate}</if>
  1235. <if test="external != null and external != ''">
  1236. and tb.f_corpid = (select f_pid from t_customer_contact where f_tel = #{external})
  1237. </if>
  1238. <if test="warehouseId != null"> and tb.f_warehouseid = #{warehouseId}</if>
  1239. <if test="customerId != null">and tb.f_corpid = #{customerId}</if>
  1240. </select>
  1241. <select id="stockDays" resultType="map">
  1242. select datediff(date_format(now(),'%Y-%m-%d'),date_format(min(f_bsdate),'%Y-%m-%d')) as stockDays
  1243. from t_whgenleg
  1244. where
  1245. f_qtyD != 0
  1246. and f_qtyblc != 0
  1247. <if test="external != null and external != ''">
  1248. and f_corpid = (select f_pid from t_customer_contact where f_tel = #{external})
  1249. </if>
  1250. <if test="warehouseId != null"> and f_warehouseid = #{warehouseId}</if>
  1251. <if test="customerId != null"> and f_corpid = #{customerId}</if>
  1252. </select>
  1253. <select id="stockAfterMonthList" resultType="map">
  1254. select
  1255. tw.f_mblno as fMblno,
  1256. tg.f_name as goodsName,
  1257. tw.f_bsdate as fBsdate,
  1258. tc.f_name as customerName,
  1259. round(ifnull(tw.f_grossweightblc, 0) / 1000, 2) as fGrossweight
  1260. from t_whgenleg tw
  1261. left join t_goods tg on tg.f_id = tw.f_goodsid
  1262. left join t_corps tc on tw.f_corpid = tc.f_id
  1263. where
  1264. tw.f_qtyD != 0
  1265. and tw.f_qtyblc != 0
  1266. and datediff(date_format(now(),'%Y-%m-%d'),date_format(tw.f_bsdate,'%Y-%m-%d')) &gt; 30
  1267. <if test="external != null and external != ''">
  1268. and tw.f_corpid = (select f_pid from t_customer_contact where f_tel = #{external})
  1269. </if>
  1270. order by tw.f_bsdate
  1271. </select>
  1272. <select id="biCustomerInfo" resultType="map">
  1273. select
  1274. ifnull(tw.f_shipper, tc.f_cname) as customerName,
  1275. <if test="mode == null or mode == ''">round(ifnull(sum(tw.f_grossweightblc), 0) / 1000) as quantity</if>
  1276. <if test="mode != null and mode != ''">
  1277. case #{mode}
  1278. when '3' then round(ifnull(sum(tw.f_volumnblc), 0))
  1279. when '2' then round(ifnull(sum(tw.f_grossweightblc) / 1000, 0))
  1280. else ifnull(sum(tw.f_qtyblc), 0)
  1281. end as quantity
  1282. </if>
  1283. from t_whgenleg tw left join t_corps tc on tw.f_corpid = tc.f_id
  1284. where
  1285. tw.f_qtyD != 0
  1286. and tw.f_qtyblc != 0
  1287. <if test="warehouseId != null"> and tw.f_warehouseid = #{warehouseId}</if>
  1288. <if test="external != null and external != ''">
  1289. and tw.f_corpid = (select f_pid from t_customer_contact where f_tel = #{external})
  1290. </if>
  1291. <if test="customerId != null"> and tw.f_corpid = #{customerId}</if>
  1292. group by customerName
  1293. order by quantity desc limit 10
  1294. </select>
  1295. <select id="biWarehouseInfo" resultType="map">
  1296. select
  1297. t.f_cname as customerName,
  1298. <if test="mode == null or mode == ''">round(ifnull(sum(tw.f_grossweightblc), 0) / 1000) as quantity</if>
  1299. <if test="mode != null and mode != ''">
  1300. case #{mode}
  1301. when '3' then round(ifnull(sum(tw.f_volumnblc), 0))
  1302. when '2' then round(ifnull(sum(tw.f_grossweightblc) / 1000, 0))
  1303. else ifnull(sum(tw.f_qtyblc), 0)
  1304. end as quantity
  1305. </if>
  1306. from t_whgenleg tw left join t_warehouse t on tw.f_warehouseid = t.f_id
  1307. where
  1308. tw.f_qtyD != 0
  1309. and tw.f_qtyblc != 0
  1310. <if test="external != null and external != ''">
  1311. and tw.f_corpid = (select f_pid from t_customer_contact where f_tel = #{external})
  1312. </if>
  1313. <if test="customerId != null"> and tw.f_corpid = #{customerId}</if>
  1314. group by customerName
  1315. order by quantity desc limit 10
  1316. </select>
  1317. <select id="biCustomerTeuInfo" resultType="map">
  1318. select
  1319. ifnull(tb.f_shipper, tc.f_cname) as customerName,
  1320. ifnull(sum(case tb.f_billtype when 'SJRK' then f_cntrcount end * tr.f_teu), 0) -
  1321. ifnull(sum(case tb.f_billtype when 'SJCK' then f_cntrcount end * tr.f_teu), 0) as quantity
  1322. from t_warehousebills_cntr twc
  1323. left join t_warehousebills tb on twc.f_pid = tb.f_id
  1324. left join t_corps tc on tb.f_corpid = tc.f_id
  1325. left join t_cntr tr on twc.f_cntrid = tr.f_id
  1326. where tb.f_items_status = '4'
  1327. <if test="external != null and external != ''">
  1328. and tb.f_corpid = (select f_pid from t_customer_contact where f_tel = #{external})
  1329. </if>
  1330. <if test="warehouseId != null"> and tb.f_warehouseid = #{warehouseId}</if>
  1331. <if test="customerId != null">and tb.f_corpid = #{customerId}</if>
  1332. group by customerName
  1333. order by quantity desc limit 10
  1334. </select>
  1335. <select id="biWarehouseTeuInfo" resultType="map">
  1336. select
  1337. t.f_cname as customerName,
  1338. ifnull(sum(case tb.f_billtype when 'SJRK' then f_cntrcount end * tr.f_teu), 0) -
  1339. ifnull(sum(case tb.f_billtype when 'SJCK' then f_cntrcount end * tr.f_teu), 0) as quantity
  1340. from t_warehousebills_cntr twc
  1341. left join t_warehousebills tb on twc.f_pid = tb.f_id
  1342. left join t_warehouse t on tb.f_warehouseid = t.f_id
  1343. left join t_cntr tr on twc.f_cntrid = tr.f_id
  1344. where tb.f_items_status = '4'
  1345. <if test="external != null and external != ''">
  1346. and tb.f_corpid = (select f_pid from t_customer_contact where f_tel = #{external})
  1347. </if>
  1348. <if test="warehouseId != null"> and tb.f_warehouseid = #{warehouseId}</if>
  1349. <if test="customerId != null">and tb.f_corpid = #{customerId}</if>
  1350. group by customerName
  1351. order by quantity desc limit 10
  1352. </select>
  1353. <select id="warehouseSupervise" resultType="map">
  1354. select f_id as fId,
  1355. parent_id as parentId,
  1356. f_no as fNo,
  1357. f_name as fName,
  1358. f_addr as fAddr,
  1359. f_contacts as fContacts,
  1360. f_tel as fTel
  1361. from t_warehouse
  1362. <where>
  1363. <if test="parent != null">
  1364. <if test="parent == 100">and supervise = 1</if>
  1365. and parent_id = #{parent}
  1366. </if>
  1367. </where>
  1368. </select>
  1369. <select id="selectStockList" resultType="Map">
  1370. select DISTINCT
  1371. t3.dict_label as cargoType,
  1372. t2.f_no as cargoNo,
  1373. t2.f_name as cargoName,
  1374. t1.f_qtyD as number,
  1375. t1.f_qtyblc as numberLeft,
  1376. t1.f_grossweightD as weight,
  1377. t1.f_grossweightblc as weightLeft,
  1378. t6.f_packagespecs as speci,
  1379. t6.f_sealno as bondedStatus,
  1380. t4.f_no as shelvesName,
  1381. t5.f_no as warehouseNo,
  1382. t5.f_name as warehouseName,
  1383. t1.f_originalbillno as takeVoucher,
  1384. date_format(t1.f_bsdate, '%Y-%m-%d %H:%i:%S') as inStorageDate,
  1385. t1.f_mblno as blNumber,
  1386. date_format(t1.update_time, '%Y-%m-%d %H:%i:%S') as latestOptDate,
  1387. t1.lock_status as lockStatus,
  1388. t1.belong_to as belongTo,
  1389. t1.lock_time as lockTime,
  1390. t1.unlock_time as unlockTime,
  1391. t1.wr_number as wrNumber
  1392. from t_whgenleg t1
  1393. left join t_goods t2 on t2.f_id = t1.f_goodsid
  1394. left join sys_dict_data t3 on t3.dict_value = t2.f_typeid
  1395. left join t_warehouse t4 on t4.f_id = t1.f_warehouse_locationid
  1396. left join t_warehouse t5 on t5.f_id = t1.f_warehouseid
  1397. left join t_warehousebillsitems t6 on t6.f_billno = t1.f_originalbillno
  1398. <where>
  1399. t3.status = '0'
  1400. and t3.dict_type = 'data_goods_category'
  1401. and t1.f_qtyD != 0
  1402. and t1.f_qtyblc &gt; 0
  1403. and t1.f_grossweightblc &gt; 0
  1404. <if test="billNo != null and billNo != ''">and t1.f_originalbillno = #{billNo}</if>
  1405. <if test="corpId != null ">and t1.f_corpid = #{corpId}</if>
  1406. </where>
  1407. </select>
  1408. <select id="selectBlNumber" resultType="java.util.Map">
  1409. select
  1410. t3.dict_label as cargoType,
  1411. t2.f_no as cargoNo,
  1412. t2.f_name as cargoName,
  1413. t1.f_qtyD as number,
  1414. t1.f_qtyblc as numberLeft,
  1415. t1.f_grossweightD as weight,
  1416. t1.f_grossweightblc as weightLeft,
  1417. t6.f_packagespecs as speci,
  1418. t6.f_sealno as bondedStatus,
  1419. t4.f_no as shelvesName,
  1420. t5.f_no as warehouseNo,
  1421. t5.f_name as warehouseName,
  1422. t1.f_originalbillno as takeVoucher,
  1423. date_format(t1.f_bsdate, '%Y-%m-%d %H:%i:%S') as inStorageDate,
  1424. t1.f_mblno as blNumber,
  1425. date_format(t1.update_time, '%Y-%m-%d %H:%i:%S') as latestOptDate,
  1426. t1.lock_status as lockStatus,
  1427. t1.belong_to as belongTo,
  1428. t1.lock_time as lockTime,
  1429. t1.unlock_time as unlockTime,
  1430. t1.wr_number as wrNumber
  1431. from t_whgenleg t1
  1432. left join t_goods t2 on t2.f_id = t1.f_goodsid
  1433. left join sys_dict_data t3 on t3.dict_value = t2.f_typeid
  1434. left join t_warehouse t4 on t4.f_id = t1.f_warehouse_locationid
  1435. left join t_warehouse t5 on t5.f_id = t1.f_warehouseid
  1436. left join t_warehousebillsitems t6 on t6.f_billno = t1.f_originalbillno
  1437. <where>
  1438. t3.status = '0'
  1439. and t3.dict_type = 'data_goods_category'
  1440. and t1.f_qtyD != 0
  1441. and t1.f_qtyblc &gt; 0
  1442. and t1.f_grossweightblc &gt; 0
  1443. <if test="blNumber != null and blNumber != ''">and t1.f_mblno = #{blNumber}</if>
  1444. <if test="billNo != null and billNo != ''">and t1.f_originalbillno = #{billNo}</if>
  1445. <if test="corpId != null ">and t1.f_corpid = #{corpId}</if>
  1446. </where>
  1447. </select>
  1448. <select id="selectBlNumberPage" resultType="java.util.Map">
  1449. select
  1450. t3.dict_label as cargoType,
  1451. t2.f_no as cargoNo,
  1452. t2.f_name as cargoName,
  1453. t1.f_qtyD as number,
  1454. t1.f_qtyblc as numberLeft,
  1455. t1.f_grossweightD as weight,
  1456. t1.f_grossweightblc as weightLeft,
  1457. t6.f_packagespecs as speci,
  1458. t6.f_sealno as bondedStatus,
  1459. t4.f_no as shelvesName,
  1460. t5.f_no as warehouseNo,
  1461. t5.f_name as warehouseName,
  1462. t1.f_originalbillno as takeVoucher,
  1463. date_format(t1.f_bsdate, '%Y-%m-%d %H:%i:%S') as inStorageDate,
  1464. t1.f_mblno as blNumber,
  1465. date_format(t1.update_time, '%Y-%m-%d %H:%i:%S') as latestOptDate,
  1466. t1.lock_status as lockStatus,
  1467. t1.belong_to as belongTo,
  1468. t1.lock_time as lockTime,
  1469. t1.unlock_time as unlockTime,
  1470. t1.wr_number as wrNumber
  1471. from t_whgenleg t1
  1472. left join t_goods t2 on t2.f_id = t1.f_goodsid
  1473. left join sys_dict_data t3 on t3.dict_value = t2.f_typeid
  1474. left join t_warehouse t4 on t4.f_id = t1.f_warehouse_locationid
  1475. left join t_warehouse t5 on t5.f_id = t1.f_warehouseid
  1476. left join t_warehousebillsitems t6 on t6.f_billno = t1.f_originalbillno
  1477. <where>
  1478. t3.status = '0'
  1479. and t3.dict_type = 'data_goods_category'
  1480. and t1.f_qtyD != 0
  1481. and t1.f_qtyblc &gt; 0
  1482. and t1.f_grossweightblc &gt; 0
  1483. <if test="blNumber != null and blNumber != ''">and t1.f_mblno = #{blNumber}</if>
  1484. <if test="billNo != null and billNo != ''">and t1.f_originalbillno = #{billNo}</if>
  1485. <if test="corpId != null ">and t1.f_corpid = #{corpId}</if>
  1486. ORDER BY t1.f_bsdate DESC
  1487. LIMIT #{pageNo},#{pageSize}
  1488. </where>
  1489. </select>
  1490. <select id="selectQueryAssets" resultType="java.util.Map">
  1491. select
  1492. t3.dict_label as cargoType,
  1493. t2.f_no as cargoNo,
  1494. t2.f_name as cargoName,
  1495. t1.f_qtyD as number,
  1496. t1.f_qtyblc as numberLeft,
  1497. t1.f_grossweightD as weight,
  1498. t1.f_grossweightblc as weightLeft,
  1499. t6.f_packagespecs as speci,
  1500. t6.f_sealno as bondedStatus,
  1501. t4.f_no as shelvesName,
  1502. t5.f_no as warehouseNo,
  1503. t5.f_name as warehouseName,
  1504. t1.f_originalbillno as takeVoucher,
  1505. date_format(t1.f_bsdate, '%Y-%m-%d %H:%i:%S') as inStorageDate,
  1506. t1.f_mblno as blNumber,
  1507. date_format(t1.update_time, '%Y-%m-%d %H:%i:%S') as latestOptDate,
  1508. t1.lock_status as lockStatus,
  1509. t1.belong_to as belongTo,
  1510. t1.lock_time as lockTime,
  1511. t1.unlock_time as unlockTime,
  1512. t1.wr_number as wrNumber
  1513. from t_whgenleg t1
  1514. left join t_goods t2 on t2.f_id = t1.f_goodsid
  1515. left join sys_dict_data t3 on t3.dict_value = t2.f_typeid
  1516. left join t_warehouse t4 on t4.f_id = t1.f_warehouse_locationid
  1517. left join t_warehouse t5 on t5.f_id = t1.f_warehouseid
  1518. left join t_warehousebillsitems t6 on t6.f_billno = t1.f_originalbillno
  1519. <where>
  1520. t3.status = '0'
  1521. and t3.dict_type = 'data_goods_category'
  1522. and t1.f_qtyD != 0
  1523. and t1.f_qtyblc &gt; 0
  1524. and t1.f_grossweightblc &gt; 0
  1525. <if test="blNumber != null and blNumber != ''">and t1.f_mblno = #{blNumber}</if>
  1526. <if test="corpId != null ">and t1.f_corpid = #{corpId}</if>
  1527. <if test="wrNumber != null and wrNumber != ''">and t4.f_no = #{wrNumber}</if>
  1528. <if test="cargoType != null and cargoType != ''">and t2.f_no = #{cargoType}</if>
  1529. </where>
  1530. </select>
  1531. <select id="selectfOriginalbillno" resultType="java.lang.String">
  1532. select f_originalbillno from t_whgenleg where f_mblno = #{billNo} LIMIT 1
  1533. </select>
  1534. <select id="selectStockListCk" resultType="Map">
  1535. select DISTINCT
  1536. t3.dict_label as cargoType,
  1537. t2.f_no as cargoNo,
  1538. t2.f_name as cargoName,
  1539. t1.f_qtyD as number,
  1540. t1.f_qtyblc as numberLeft,
  1541. t1.f_grossweightD as weight,
  1542. t1.f_grossweightblc as weightLeft,
  1543. t6.f_packagespecs as speci,
  1544. t6.f_sealno as bondedStatus,
  1545. t4.f_no as shelvesName,
  1546. t5.f_no as warehouseNo,
  1547. t5.f_name as warehouseName,
  1548. t1.f_originalbillno as takeVoucher,
  1549. date_format(t1.f_bsdate, '%Y-%m-%d %H:%i:%S') as inStorageDate,
  1550. t1.f_mblno as blNumber,
  1551. date_format(t1.update_time, '%Y-%m-%d %H:%i:%S') as latestOptDate,
  1552. t1.lock_status as lockStatus,
  1553. t1.belong_to as belongTo,
  1554. t1.lock_time as lockTime,
  1555. t1.unlock_time as unlockTime,
  1556. t1.wr_number as wrNumber
  1557. from t_whgenleg t1
  1558. left join t_goods t2 on t2.f_id = t1.f_goodsid
  1559. left join sys_dict_data t3 on t3.dict_value = t2.f_typeid
  1560. left join t_warehouse t4 on t4.f_id = t1.f_warehouse_locationid
  1561. left join t_warehouse t5 on t5.f_id = t1.f_warehouseid
  1562. left join t_warehousebillsitems t6 on t6.f_billno = t1.f_originalbillno
  1563. <where>
  1564. t3.dict_type = 'data_goods_category'
  1565. AND t3.status = 0
  1566. AND t1.f_qtyD != 0
  1567. AND t1.f_qtyblc > 0
  1568. AND t1.f_grossweightblc > 0
  1569. <if test="corpId != null "> AND t1.f_corpid = #{corpId}</if>
  1570. <if test="fMblno != null and fMblno != ''"> AND t1.f_mblno = #{fMblno}</if>
  1571. </where>
  1572. </select>
  1573. <update id="changeBelongTo" parameterType="TWhgenleg">
  1574. update t_whgenleg
  1575. <trim prefix="SET" suffixOverrides=",">
  1576. <if test="lockStatus != null">lock_status = #{lockStatus},</if>
  1577. <if test="belongTo != null">belong_to = #{belongTo},</if>
  1578. <if test="lockTime != null">lock_time = #{lockTime},</if>
  1579. <if test="unlockTime != null">unlock_time = #{unlockTime},</if>
  1580. <if test="wrNumber != null">wr_number = #{wrNumber},</if>
  1581. <if test="fCorpid != null">f_corpid = #{fCorpid},</if>
  1582. </trim>
  1583. where f_mblno = #{fOriginalbillno}
  1584. </update>
  1585. </mapper>