TWhgenlegMapper.xml 82 KB

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