TWhgenlegMapper.xml 84 KB

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