TWhgenlegMapper.xml 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617
  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="fMblno" column="f_mblno"/>
  12. <result property="fOriginalbillno" column="f_originalbillno"/>
  13. <result property="fWarehouseLocationid" column="f_warehouse_locationid"/>
  14. <result property="fGoodsid" column="f_goodsid"/>
  15. <result property="fChargedate" column="f_chargedate"/>
  16. <result property="fTrademodeid" column="f_trademodeid"/>
  17. <result property="fPreqty" column="f_preqty"/>
  18. <result property="fWarehouseid" column="f_warehouseid"/>
  19. <result property="fPregrossweight" column="f_pregrossweight"/>
  20. <result property="fPrenetweight" column="f_prenetweight"/>
  21. <result property="fQtyd" column="f_qtyD"/>
  22. <result property="fVolumnd" column="f_volumnD"/>
  23. <result property="fBillingway" column="f_billingway"/>
  24. <result property="fGrossweightd" column="f_grossweightD"/>
  25. <result property="fNetweightd" column="f_netweightD"/>
  26. <result property="fVolumnc" column="f_volumnC"/>
  27. <result property="fQtyc" column="f_qtyC"/>
  28. <result property="fGrossweightc" column="f_grossweightC"/>
  29. <result property="fQtyblc" column="f_qtyblc"/>
  30. <result property="fGrossweightblc" column="f_grossweightblc"/>
  31. <result property="fNetweightc" column="f_netweightC"/>
  32. <result property="fNetweightblc" column="f_netweightblc"/>
  33. <result property="fCntrno" column="f_cntrno"/>
  34. <result property="fStatus" column="f_status"/>
  35. <result property="delFlag" column="del_flag"/>
  36. <result property="createBy" column="create_by"/>
  37. <result property="fMarks" column="f_marks"/>
  38. <result property="createTime" column="create_time"/>
  39. <result property="updateBy" column="update_by"/>
  40. <result property="updateTime" column="update_time"/>
  41. <result property="remark" column="remark"/>
  42. <result property="fBusinessType" column="f_business_type"/>
  43. <result property="fOriginalbilldate" column="f_originalbilldate"/>
  44. </resultMap>
  45. <sql id="selectTWhgenlegVo">
  46. select f_id, f_accyear, f_accmonth, f_corpid, f_mblno, f_originalbillno, f_warehouse_locationid, f_goodsid, f_trademodeid, f_preqty, f_pregrossweight, f_warehouseid, f_prenetweight, f_chargedate, f_volumnD, f_qtyD, f_billingway, f_grossweightD, f_netweightD, f_volumnC, f_qtyC, f_grossweightC, f_qtyblc, f_grossweightblc, f_netweightC, f_netweightblc, f_cntrno, f_status, del_flag, f_marks, create_by, create_time, update_by, f_volumnblc, update_time, remark, f_business_type, f_originalbilldate from t_whgenleg
  47. </sql>
  48. <select id="selectTWhgenlegList" parameterType="TWhgenleg" resultMap="TWhgenlegResult">
  49. select
  50. ware.*
  51. from
  52. t_whgenleg ware
  53. left join sys_user u on ware.create_by = u.user_name
  54. left join sys_dept d on u.dept_id = d.dept_id
  55. <where>
  56. <if test="fOriginalbillno != null and fOriginalbillno != ''">and f_originalbillno = #{fOriginalbillno}</if>
  57. <if test="fChargedate != null ">and f_chargedate = #{fChargedate}</if>
  58. <if test="fPreqty != null ">and f_preqty = #{fPreqty}</if>
  59. <if test="fWarehouseid != null ">and f_warehouseid = #{fWarehouseid}</if>
  60. <if test="fPregrossweight != null ">and f_pregrossweight = #{fPregrossweight}</if>
  61. <if test="fPrenetweight != null ">and f_prenetweight = #{fPrenetweight}</if>
  62. <if test="fQtyd != null ">and f_qtyD = #{fQtyd}</if>
  63. <if test="fVolumnd != null ">and f_volumnD = #{fVolumnd}</if>
  64. <if test="fBillingway != null ">and f_billingway = #{fBillingway}</if>
  65. <if test="fGrossweightd != null ">and f_grossweightD = #{fGrossweightd}</if>
  66. <if test="fNetweightd != null ">and f_netweightD = #{fNetweightd}</if>
  67. <if test="fVolumnc != null ">and f_volumnC = #{fVolumnc}</if>
  68. <if test="fBusinessType != null "> and f_business_type = #{fBusinessType}</if>
  69. <if test="fQtyc != null ">and f_qtyC = #{fQtyc}</if>
  70. <if test="fGrossweightc != null ">and f_grossweightC = #{fGrossweightc}</if>
  71. <if test="fQtyblc != null ">and f_qtyblc = #{fQtyblc}</if>
  72. <if test="fGrossweightblc != null ">and f_grossweightblc = #{fGrossweightblc}</if>
  73. <if test="fNetweightc != null ">and f_netweightC = #{fNetweightc}</if>
  74. <if test="fNetweightblc != null ">and f_netweightblc = #{fNetweightblc}</if>
  75. <if test="fCntrno != null and fCntrno != ''">and f_cntrno = #{fCntrno}</if>
  76. <if test="fStatus != null and fStatus != ''">and f_status = #{fStatus}</if>
  77. <if test="fMarks != null and fMarks != ''">and f_marks = #{fMarks}</if>
  78. <if test="fOriginalbilldate != null ">and f_originalbilldate = #{fOriginalbilldate}</if>
  79. </where>
  80. ${params.dataScope}
  81. </select>
  82. <select id="selectTWhgenleg" parameterType="TWhgenleg" resultMap="TWhgenlegResult">
  83. <include refid="selectTWhgenlegVo"/>
  84. <where>
  85. <if test="fCorpid != null ">and f_corpid = #{fCorpid}</if>
  86. <if test="fMblno != null ">and f_mblno = #{fMblno}</if>
  87. <if test="fCntrno != null ">and f_cntrno = #{fCntrno}</if>
  88. <if test="fBusinessType != null ">and f_business_type = #{fBusinessType}</if>
  89. <if test="fMarks != null ">and f_marks = #{fMarks}</if>
  90. <if test="fOriginalbilldate != null ">and f_originalbilldate = #{fOriginalbilldate}</if>
  91. <if test="fWarehouseLocationid != null ">and f_warehouse_locationid = #{fWarehouseLocationid}</if>
  92. <if test="fGoodsid != null ">and f_goodsid = #{fGoodsid}</if>
  93. <if test="fTrademodeid != null ">and f_trademodeid = #{fTrademodeid}</if>
  94. </where>
  95. </select>
  96. <select id="selectTWhgenlegById" parameterType="Long" resultMap="TWhgenlegResult">
  97. <include refid="selectTWhgenlegVo"/>
  98. where f_id = #{fId}
  99. </select>
  100. <insert id="insertTWhgenleg" parameterType="TWhgenleg">
  101. insert into t_whgenleg
  102. <trim prefix="(" suffix=")" suffixOverrides=",">
  103. <if test="fAccyear != null">f_accyear,</if>
  104. <if test="fAccmonth != null">f_accmonth,</if>
  105. <if test="fCorpid != null">f_corpid,</if>
  106. <if test="fMblno != null">f_mblno,</if>
  107. <if test="fOriginalbillno != null">f_originalbillno,</if>
  108. <if test="fWarehouseLocationid != null">f_warehouse_locationid,</if>
  109. <if test="fGoodsid != null">f_goodsid,</if>
  110. <if test="fTrademodeid != null">f_trademodeid,</if>
  111. <if test="fPreqty != null">f_preqty,</if>
  112. <if test="fPregrossweight != null">f_pregrossweight,</if>
  113. <if test="fWarehouseid != null">f_warehouseid,</if>
  114. <if test="fPrenetweight != null">f_prenetweight,</if>
  115. <if test="fChargedate != null">f_chargedate,</if>
  116. <if test="fVolumnd != null">f_volumnD,</if>
  117. <if test="fQtyd != null">f_qtyD,</if>
  118. <if test="fBillingway != null">f_billingway,</if>
  119. <if test="fGrossweightd != null">f_grossweightD,</if>
  120. <if test="fNetweightd != null">f_netweightD,</if>
  121. <if test="fVolumnc != null">f_volumnC,</if>
  122. <if test="fQtyc != null">f_qtyC,</if>
  123. <if test="fGrossweightc != null">f_grossweightC,</if>
  124. <if test="fQtyblc != null">f_qtyblc,</if>
  125. <if test="fGrossweightblc != null">f_grossweightblc,</if>
  126. <if test="fNetweightc != null">f_netweightC,</if>
  127. <if test="fNetweightblc != null">f_netweightblc,</if>
  128. <if test="fCntrno != null">f_cntrno,</if>
  129. <if test="fStatus != null">f_status,</if>
  130. <if test="delFlag != null">del_flag,</if>
  131. <if test="fMarks != null and fMarks != ''">f_marks,</if>
  132. <if test="createBy != null">create_by,</if>
  133. <if test="createTime != null">create_time,</if>
  134. <if test="updateBy != null">update_by,</if>
  135. <if test="fVolumnblc != null">f_volumnblc,</if>
  136. <if test="updateTime != null">update_time,</if>
  137. <if test="remark != null">remark,</if>
  138. <if test="fBusinessType != null">f_business_type,</if>
  139. <if test="fOriginalbilldate != null">f_originalbilldate,</if>
  140. </trim>
  141. <trim prefix="values (" suffix=")" suffixOverrides=",">
  142. <if test="fAccyear != null">#{fAccyear},</if>
  143. <if test="fAccmonth != null">#{fAccmonth},</if>
  144. <if test="fCorpid != null">#{fCorpid},</if>
  145. <if test="fMblno != null">#{fMblno},</if>
  146. <if test="fOriginalbillno != null">#{fOriginalbillno},</if>
  147. <if test="fWarehouseLocationid != null">#{fWarehouseLocationid},</if>
  148. <if test="fGoodsid != null">#{fGoodsid},</if>
  149. <if test="fTrademodeid != null">#{fTrademodeid},</if>
  150. <if test="fPreqty != null">#{fPreqty},</if>
  151. <if test="fPregrossweight != null">#{fPregrossweight},</if>
  152. <if test="fWarehouseid != null">#{fWarehouseid},</if>
  153. <if test="fPrenetweight != null">#{fPrenetweight},</if>
  154. <if test="fChargedate != null">#{fChargedate},</if>
  155. <if test="fVolumnd != null">#{fVolumnd},</if>
  156. <if test="fQtyd != null">#{fQtyd},</if>
  157. <if test="fBillingway != null">#{fBillingway},</if>
  158. <if test="fGrossweightd != null">#{fGrossweightd},</if>
  159. <if test="fNetweightd != null">#{fNetweightd},</if>
  160. <if test="fVolumnc != null">#{fVolumnc},</if>
  161. <if test="fQtyc != null">#{fQtyc},</if>
  162. <if test="fGrossweightc != null">#{fGrossweightc},</if>
  163. <if test="fQtyblc != null">#{fQtyblc},</if>
  164. <if test="fGrossweightblc != null">#{fGrossweightblc},</if>
  165. <if test="fNetweightc != null">#{fNetweightc},</if>
  166. <if test="fNetweightblc != null">#{fNetweightblc},</if>
  167. <if test="fCntrno != null">#{fCntrno},</if>
  168. <if test="fStatus != null">#{fStatus},</if>
  169. <if test="delFlag != null">#{delFlag},</if>
  170. <if test="fMarks != null and fMarks != ''">#{fMarks},</if>
  171. <if test="createBy != null">#{createBy},</if>
  172. <if test="createTime != null">#{createTime},</if>
  173. <if test="updateBy != null">#{updateBy},</if>
  174. <if test="fVolumnblc != null">#{fVolumnblc},</if>
  175. <if test="updateTime != null">#{updateTime},</if>
  176. <if test="remark != null">#{remark},</if>
  177. <if test="fBusinessType != null">#{fBusinessType},</if>
  178. <if test="fOriginalbilldate != null">#{fOriginalbilldate},</if>
  179. </trim>
  180. </insert>
  181. <update id="updateTWhgenleg" parameterType="TWhgenleg">
  182. update t_whgenleg
  183. <trim prefix="SET" suffixOverrides=",">
  184. <if test="fAccyear != null">f_accyear = #{fAccyear},</if>
  185. <if test="fAccmonth != null">f_accmonth = #{fAccmonth},</if>
  186. <if test="fCorpid != null">f_corpid = #{fCorpid},</if>
  187. <if test="fMblno != null">f_mblno = #{fMblno},</if>
  188. <if test="fOriginalbillno != null">f_originalbillno = #{fOriginalbillno},</if>
  189. <if test="fWarehouseLocationid != null">f_warehouse_locationid = #{fWarehouseLocationid},</if>
  190. <if test="fGoodsid != null">f_goodsid = #{fGoodsid},</if>
  191. <if test="fTrademodeid != null">f_trademodeid = #{fTrademodeid},</if>
  192. <if test="fPreqty != null">f_preqty = #{fPreqty},</if>
  193. <if test="fPregrossweight != null">f_pregrossweight = #{fPregrossweight},</if>
  194. <if test="fWarehouseid != null">f_warehouseid = #{fWarehouseid},</if>
  195. <if test="fPrenetweight != null">f_prenetweight = #{fPrenetweight},</if>
  196. <if test="fChargedate != null">f_chargedate = #{fChargedate},</if>
  197. <if test="fVolumnd != null">f_volumnD = #{fVolumnd},</if>
  198. <if test="fQtyd != null">f_qtyD = #{fQtyd},</if>
  199. <if test="fBillingway != null">f_billingway = #{fBillingway},</if>
  200. <if test="fGrossweightd != null">f_grossweightD = #{fGrossweightd},</if>
  201. <if test="fNetweightd != null">f_netweightD = #{fNetweightd},</if>
  202. <if test="fVolumnc != null">f_volumnC = #{fVolumnc},</if>
  203. <if test="fQtyc != null">f_qtyC = #{fQtyc},</if>
  204. <if test="fGrossweightc != null">f_grossweightC = #{fGrossweightc},</if>
  205. <if test="fQtyblc != null">f_qtyblc = #{fQtyblc},</if>
  206. <if test="fGrossweightblc != null">f_grossweightblc = #{fGrossweightblc},</if>
  207. <if test="fNetweightc != null">f_netweightC = #{fNetweightc},</if>
  208. <if test="fNetweightblc != null">f_netweightblc = #{fNetweightblc},</if>
  209. <if test="fCntrno != null">f_cntrno = #{fCntrno},</if>
  210. <if test="fStatus != null">f_status = #{fStatus},</if>
  211. <if test="delFlag != null">del_flag = #{delFlag},</if>
  212. <if test="fMarks != null and fMarks != ''">f_marks = #{fMarks},</if>
  213. <if test="createBy != null">create_by = #{createBy},</if>
  214. <if test="createTime != null">create_time = #{createTime},</if>
  215. <if test="updateBy != null">update_by = #{updateBy},</if>
  216. <if test="fVolumnblc != null">f_volumnblc = #{fVolumnblc},</if>
  217. <if test="updateTime != null">update_time = #{updateTime},</if>
  218. <if test="remark != null">remark = #{remark},</if>
  219. <if test="fBusinessType != null">f_business_type = #{fBusinessType},</if>
  220. <if test="fOriginalbilldate != null">f_originalbilldate = #{fOriginalbilldate},</if>
  221. </trim>
  222. where f_id = #{fId}
  223. </update>
  224. <update id="updateTWhgenlegData" parameterType="Map">
  225. update t_whgenleg
  226. <trim prefix="SET" suffixOverrides=",">
  227. /*判断是否入库*/
  228. <if test="map.billType == 'SJRK'">
  229. f_qtyD = f_qtyD + #{map.warehousebillsitems.fQty},
  230. f_volumnD = f_volumnD + #{map.warehousebillsitems.fVolumn},
  231. f_netweightD = f_netweightD + #{map.warehousebillsitems.fNetweight},
  232. f_grossweightD = f_grossweightD + #{map.warehousebillsitems.fGrossweight},
  233. f_qtyblc = f_qtyblc + #{map.warehousebillsitems.fQty}
  234. </if>
  235. /*判断是否撤销入库*/
  236. <if test="map.billType == 'SJRKRevoke'">
  237. f_qtyD = f_qtyD - #{map.warehousebillsitems.fQty},
  238. f_volumnD = f_volumnD - #{map.warehousebillsitems.fVolumn},
  239. f_netweightD = f_netweightD - #{map.warehousebillsitems.fNetweight},
  240. f_grossweightD = f_grossweightD - #{map.warehousebillsitems.fGrossweight},
  241. f_qtyblc = f_qtyblc - #{map.warehousebillsitems.fQty}
  242. </if>
  243. /*判断是否出库*/
  244. <if test="map.billType == 'SJCK'">
  245. f_qtyC = f_qtyC + #{map.warehousebillsitems.fQty},
  246. f_volumnC = f_volumnC + #{map.warehousebillsitems.fVolumn},
  247. f_netweightC = f_netweightC + #{map.warehousebillsitems.fNetweight},
  248. f_grossweightC = f_grossweightC + #{map.warehousebillsitems.fGrossweight},
  249. f_qtyblc = f_qtyblc - #{map.warehousebillsitems.fQty}
  250. </if>
  251. /*判断是否撤销出库*/
  252. <if test="map.billType == 'SJCKRevoke'">
  253. f_qtyC = f_qtyC - #{map.warehousebillsitems.fQty},
  254. f_volumnC = f_volumnC - #{map.warehousebillsitems.fVolumn},
  255. f_netweightC = f_netweightC - #{map.warehousebillsitems.fNetweight},
  256. f_grossweightC = f_grossweightC - #{map.warehousebillsitems.fGrossweight},
  257. f_qtyblc = f_qtyblc + #{map.warehousebillsitems.fQty}
  258. </if>
  259. -- update_by = NOW()
  260. </trim>
  261. where f_id = #{map.whgenlegId}
  262. </update>
  263. <delete id="deleteTWhgenlegById" parameterType="Long">
  264. delete from t_whgenleg where f_id = #{fId}
  265. </delete>
  266. <delete id="deleteTWhgenlegByIds" parameterType="String">
  267. delete from t_whgenleg where f_id in
  268. <foreach item="fAccyear" collection="array" open="(" separator="," close=")">
  269. #{fId}
  270. </foreach>
  271. </delete>
  272. <select id="selectGoodsList" resultType="Map">
  273. SELECT
  274. t.f_goodsid AS fGoodsid,
  275. g.f_name AS fName
  276. FROM
  277. t_goods g
  278. RIGHT JOIN (
  279. SELECT
  280. f_goodsid AS f_goodsid
  281. FROM
  282. t_whgenleg
  283. GROUP BY
  284. f_goodsid
  285. ) t ON g.f_id = t.f_goodsid
  286. </select>
  287. <select id="selectGoodsListWhouse" resultType="Map">
  288. SELECT
  289. t.f_goodsid AS fGoodsid,
  290. g.f_name AS fName,
  291. w.f_name AS fWarehouseName,
  292. w.f_totalgross AS fTotalgross,
  293. t.f_grossweightblc AS fGrossweightD
  294. FROM
  295. t_goods g
  296. RIGHT JOIN (
  297. SELECT
  298. f_goodsid AS f_goodsid,
  299. f_warehouseid AS f_warehouseid,
  300. sum( f_grossweightblc ) AS f_grossweightblc
  301. FROM
  302. t_whgenleg
  303. GROUP BY
  304. f_goodsid,
  305. f_warehouseid
  306. ORDER BY
  307. sum( f_grossweightblc ) DESC
  308. ) t ON g.f_id = t.f_goodsid
  309. LEFT JOIN t_warehouse w ON w.f_id = t.f_warehouseid
  310. <where>
  311. <if test="fId != null ">and w.f_id = #{fId}</if>
  312. </where>
  313. </select>
  314. <select id="selectWareHouseList" resultType="Map">
  315. SELECT
  316. t.f_warehouseid AS fWarehouseid,
  317. w.f_name AS fName,
  318. t.f_grossweightblc AS fGrossweightD,
  319. w.f_totalgross AS fTotalgross
  320. FROM
  321. t_warehouse w
  322. RIGHT JOIN (
  323. SELECT
  324. f_warehouseid AS f_warehouseid,
  325. sum( f_grossweightblc ) AS f_grossweightblc
  326. FROM
  327. t_whgenleg
  328. GROUP BY
  329. f_warehouseid
  330. ORDER BY
  331. sum( f_grossweightblc ) DESC
  332. ) t ON w.f_id = t.f_warehouseid
  333. </select>
  334. <select id="selectWareHouseListWhouse" resultType="Map">
  335. SELECT
  336. t.f_warehouseid AS fWarehouseid,
  337. w.f_name AS fName,
  338. t.f_grossweightblc AS fGrossweightD,
  339. w.f_totalgross AS fTotalgross
  340. FROM
  341. t_warehouse w
  342. RIGHT JOIN (
  343. SELECT
  344. f_warehouseid AS f_warehouseid,
  345. sum( f_grossweightblc ) AS f_grossweightblc
  346. FROM
  347. t_whgenleg
  348. GROUP BY
  349. f_warehouseid
  350. ORDER BY
  351. sum( f_grossweightblc ) DESC
  352. ) t ON w.f_id = t.f_warehouseid
  353. <where>
  354. <if test="fId != null ">and w.f_id = #{fId}</if>
  355. </where>
  356. </select>
  357. <select id="selectCorpsList" resultType="Map">
  358. SELECT
  359. t.f_corpid AS fCorpid,
  360. c.f_name AS fName
  361. FROM
  362. t_corps c
  363. RIGHT JOIN (
  364. SELECT
  365. f_corpid AS f_corpid
  366. FROM
  367. t_whgenleg
  368. GROUP BY
  369. f_corpid
  370. ) t ON c.f_id = t.f_corpid
  371. </select>
  372. <select id="selectCorpsListWhouse" resultType="Map">
  373. SELECT
  374. t.f_corpid AS fCorpid,
  375. g.f_name AS fName,
  376. w.f_name AS fWarehouseName,
  377. w.f_totalgross AS fTotalgross,
  378. t.f_grossweightblc AS fGrossweightD
  379. FROM
  380. t_corps g
  381. RIGHT JOIN (
  382. SELECT
  383. f_corpid AS f_corpid,
  384. f_warehouseid AS f_warehouseid,
  385. sum( f_grossweightblc ) AS f_grossweightblc
  386. FROM
  387. t_whgenleg
  388. GROUP BY
  389. f_corpid,
  390. f_warehouseid
  391. ORDER BY
  392. sum( f_grossweightblc ) DESC
  393. ) t ON g.f_id = t.f_corpid
  394. LEFT JOIN t_warehouse w ON w.f_id = t.f_warehouseid
  395. <where>
  396. <if test="fId != null ">and w.f_id = #{fId}</if>
  397. </where>
  398. </select>
  399. <select id="selectDateFQtyblcListList" resultType="Map">
  400. SELECT
  401. t.f_originalbilldate AS fOriginalbilldate,
  402. sum(t.f_qtyblc) AS fQtyblc
  403. FROM
  404. t_whgenleg t
  405. WHERE
  406. t.f_originalbilldate &gt; #{map.frontday}
  407. AND t.f_originalbilldate &lt; #{map.nowadays}
  408. GROUP BY
  409. t.f_originalbilldate
  410. ORDER BY
  411. t.f_originalbilldate
  412. </select>
  413. <select id="selectStorageFeeItemList" parameterType="com.ruoyi.warehouseBusiness.domain.TWarehouseBills" resultType="Map">
  414. SELECT
  415. wh.f_id AS fId,
  416. wh.f_originalbillno AS fBillno,
  417. wh.f_goodsid AS fGoodsid,
  418. wh.f_originalbilldate AS fBsdate,
  419. wh.f_billingway AS fBillingway,
  420. wh.f_mblno AS fMblno,
  421. wh.f_chargedate AS fChargedate,
  422. wh.f_originalbilldate AS fOriginalbilldate,
  423. wh.f_marks AS fMarks,
  424. wh.f_volumnblc AS fVolumn,
  425. wh.f_qtyblc AS fQty,
  426. wh.f_grossweightblc AS fGrossweight,
  427. wh.f_netweightblc AS fNetweight,
  428. "KCZZ" AS fBilltype,
  429. goods.f_typeid AS fTypeid,
  430. goods.f_name AS fGoodsids
  431. FROM
  432. t_whgenleg wh
  433. LEFT JOIN t_goods goods ON goods.f_id = wh.f_goodsid
  434. LEFT JOIN t_warehouse ware ON ware.f_id = wh.f_warehouseid
  435. <where>
  436. wh.f_corpid = #{warehouse.fCorpid}
  437. and ware.f_charg = 1
  438. and wh.f_chargedate &lt; #{warehouse.fBillingDeadline}
  439. <if test="warehouse.fGoodsid != null">and wh.f_goodsid = #{warehouse.fGoodsid}</if>
  440. <if test="warehouse.fMblno != null">and wh.f_mblno = #{warehouse.fMblno}</if>
  441. </where>
  442. </select>
  443. <select id="selectInventoryList" parameterType="TWhgenleg" resultType="Map">
  444. select
  445. DISTINCT
  446. leg.f_id AS fId,
  447. leg.f_corpid AS fCorpIds,
  448. corp.f_name AS fCorpid,
  449. ware.f_warehouse_information AS fWarehouseids,
  450. area.f_name AS fWarehouseLocationids,
  451. leg.f_originalbillno AS fOriginalbillno,
  452. leg.f_warehouse_locationid AS fWarehouseLocationid,
  453. dict1.dict_label AS fTrademodeid,
  454. goods.f_name AS fGoodsids,
  455. leg.f_trademodeid AS fTrademodeids,
  456. goods.f_packagespecs AS fPackagespecs,
  457. leg.f_goodsid AS fGoodsid,
  458. leg.f_volumnD AS fVolumnD,
  459. leg.f_qtyD AS fQtyD,
  460. leg.f_mblno AS fMblno,
  461. leg.f_grossweightD AS fGrossweightD,
  462. leg.f_netweightD AS fNetweightD,
  463. leg.f_volumnC AS fVolumnC,
  464. leg.f_volumnblc AS fVolumnblc,
  465. leg.f_qtyC AS fQtyC,
  466. leg.f_business_type AS fBusinessType,
  467. leg.f_grossweightC AS fGrossweightC,
  468. leg.f_netweightC AS fNetweightC,
  469. leg.f_qtyblc AS fQtyblc,
  470. leg.f_billingway AS fBillingway,
  471. leg.f_chargedate AS fChargedate,
  472. leg.f_grossweightblc AS fGrossweightblc,
  473. leg.f_netweightblc AS fNetweightblc,
  474. dict.dict_label AS fBusinessTypes,
  475. leg.f_marks AS fMarks,
  476. DATE_FORMAT( leg.create_time, '%Y-%m-%d' ) AS createTime,
  477. DATE_FORMAT( leg.f_originalbilldate, '%Y-%m-%d' ) AS fOriginalbilldate,
  478. leg.f_cntrno AS fCntrno
  479. FROM
  480. t_whgenleg leg
  481. left join sys_user u on leg.create_by = u.user_name
  482. left join sys_dept d on u.dept_id = d.dept_id
  483. LEFT JOIN t_corps corp ON corp.f_id = leg.f_corpid
  484. LEFT JOIN t_goods goods ON goods.f_id = leg.f_goodsid
  485. LEFT JOIN t_warehouse ware ON ware.f_id = leg.f_warehouse_locationid
  486. LEFT JOIN sys_dict_data dict ON dict.dict_value = leg.f_business_type
  487. LEFT JOIN t_warehouse_area area ON area.f_id = leg.f_warehouse_locationid
  488. LEFT JOIN sys_dict_data dict1 ON dict1.dict_value = leg.f_trademodeid
  489. <where>
  490. dict.status = '0'
  491. AND dict1.status = '0'
  492. AND dict.dict_type = 'storage_type'
  493. AND dict1.dict_type = 'data_trademodes'
  494. <if test="fOriginalbillno != null and fOriginalbillno != ''">and leg.f_originalbillno = #{fOriginalbillno}</if>
  495. <if test="fPreqty != null ">and leg.f_preqty = #{fPreqty}</if>
  496. <if test="fCorpid != null ">and leg.f_corpid = #{fCorpid}</if>
  497. <if test="fMblno != null ">and leg.f_mblno LIKE concat('%', #{fMblno}, '%') </if>
  498. <if test='orgStorageDate != null and orgStorageDate[0] != null and orgStorageDate[0]!= ""'>
  499. and leg.f_originalbilldate &gt;= #{orgStorageDate[0]}
  500. </if>
  501. <if test='orgStorageDate != null and orgStorageDate[1] != null and orgStorageDate[1]!= ""'>
  502. and leg.f_originalbilldate &lt;= #{orgStorageDate[1]}
  503. </if>
  504. <if test="fPregrossweight != null ">and leg.f_pregrossweight = #{fPregrossweight}</if>
  505. <if test="fPrenetweight != null ">and leg.f_prenetweight = #{fPrenetweight}</if>
  506. <if test="fQtyd != null ">and leg.f_qtyD = #{fQtyd}</if>
  507. <if test="fTrademodeid != null ">and leg.f_trademodeid = #{fTrademodeid}</if>
  508. <if test="fGoodsid != null ">and leg.f_goodsid = #{fGoodsid}</if>
  509. <if test="fVolumnd != null ">and leg.f_volumnD = #{fVolumnd}</if>
  510. <if test="fGrossweightd != null ">and leg.f_grossweightD = #{fGrossweightd}</if>
  511. <if test="fNetweightd != null ">and leg.f_netweightD = #{fNetweightd}</if>
  512. <if test="fVolumnc != null ">and leg.f_volumnC = #{fVolumnc}</if>
  513. <if test="fQtyc != null ">and leg.f_qtyC = #{fQtyc}</if>
  514. <if test="fOriginalbilldate != null ">and leg.f_originalbilldate = #{fOriginalbilldate}</if>
  515. <if test="fMarks != null and fMarks != ''">and leg.f_marks = #{fMarks}</if>
  516. <if test="fQtyblc != null ">and leg.f_qtyblc = #{fQtyblc}</if>
  517. <if test="fGrossweightc != null ">and leg.f_grossweightC = #{fGrossweightc}</if>
  518. <if test="fNetweightc != null ">and leg.f_netweightC = #{fNetweightc}</if>
  519. <if test="fGrossweightblc != null ">and leg.f_grossweightblc = #{fGrossweightblc}</if>
  520. <if test="fNetweightblc != null ">and leg.f_netweightblc = #{fNetweightblc}</if>
  521. <if test="fCntrno != null and fCntrno != ''">and leg.f_cntrno = #{fCntrno}</if>
  522. <if test="fStatus != null and fStatus != ''">and leg.f_status = #{fStatus}</if>
  523. <if test="fWarehouseid != null ">and leg.f_warehouseid = #{fWarehouseid} </if>
  524. <if test="fLocation != null and fLocation ==1 ">
  525. and leg.f_warehouse_locationid = #{fWarehouseLocationid}
  526. </if>
  527. <if test="fLocation != null and fLocation ==0 ">
  528. and ware.ancestors LIKE concat('%', #{fWarehouseLocationid}, '%')
  529. </if>
  530. </where>
  531. ${params.dataScope}
  532. </select>
  533. <select id="selectWhgenlegList" resultType="java.util.Map">
  534. select
  535. DISTINCT
  536. leg.f_id AS fId,
  537. corp.f_name AS fCorpid,
  538. DATE_FORMAT( leg.f_originalbilldate, '%Y-%m-%d' ) AS fOriginalbilldate,
  539. ware.f_warehouse_information AS fWarehouseids,
  540. leg.f_mblno AS fMblno,
  541. goods.f_name AS fGoodsids,
  542. dict.dict_label AS fBusinessTypes,
  543. leg.f_marks AS fMarks,
  544. leg.f_qtyblc AS fQtyblc,
  545. leg.f_grossweightblc AS fGrossweightblc,
  546. leg.f_netweightblc AS fNetweightblc
  547. FROM
  548. t_whgenleg leg
  549. LEFT JOIN t_corps corp ON corp.f_id = leg.f_corpid
  550. LEFT JOIN t_goods goods ON goods.f_id = leg.f_goodsid
  551. LEFT JOIN t_warehouse ware ON ware.f_id = leg.f_warehouse_locationid
  552. LEFT JOIN sys_dict_data dict ON dict.dict_value = leg.f_business_type
  553. LEFT JOIN t_warehouse_area area ON area.f_id = leg.f_warehouse_locationid
  554. <where>
  555. dict.status = '0'
  556. AND dict.dict_type = 'storage_type'
  557. <if test="fOriginalbillno != null and fOriginalbillno != ''">and leg.f_originalbillno = #{fOriginalbillno}</if>
  558. <if test="fPreqty != null ">and leg.f_preqty = #{fPreqty}</if>
  559. <if test="fCorpid != null ">and leg.f_corpid = #{fCorpid}</if>
  560. <if test="fMblno != null ">and leg.f_mblno LIKE concat('%', #{fMblno}, '%') </if>
  561. <if test='timeStartBsdate != null and timeStartBsdate!= ""'>
  562. and leg.f_originalbilldate &gt;= #{timeStartBsdate}
  563. </if>
  564. <if test='timeEndBsdate != null timeEndBsdate!= ""'>
  565. and leg.f_originalbilldate &lt;= #{timeEndBsdate}
  566. </if>
  567. <if test="fPregrossweight != null ">and leg.f_pregrossweight = #{fPregrossweight}</if>
  568. <if test="fPrenetweight != null ">and leg.f_prenetweight = #{fPrenetweight}</if>
  569. <if test="fQtyd != null ">and leg.f_qtyD = #{fQtyd}</if>
  570. <if test="fTrademodeid != null ">and leg.f_trademodeid = #{fTrademodeid}</if>
  571. <if test="fGoodsid != null ">and leg.f_goodsid = #{fGoodsid}</if>
  572. <if test="fVolumnd != null ">and leg.f_volumnD = #{fVolumnd}</if>
  573. <if test="fGrossweightd != null ">and leg.f_grossweightD = #{fGrossweightd}</if>
  574. <if test="fNetweightd != null ">and leg.f_netweightD = #{fNetweightd}</if>
  575. <if test="fVolumnc != null ">and leg.f_volumnC = #{fVolumnc}</if>
  576. <if test="fQtyc != null ">and leg.f_qtyC = #{fQtyc}</if>
  577. <if test="fOriginalbilldate != null ">and leg.f_originalbilldate = #{fOriginalbilldate}</if>
  578. <if test="fMarks != null and fMarks != ''">and leg.f_marks = #{fMarks}</if>
  579. <if test="fQtyblc != null ">and leg.f_qtyblc = #{fQtyblc}</if>
  580. <if test="fGrossweightc != null ">and leg.f_grossweightC = #{fGrossweightc}</if>
  581. <if test="fNetweightc != null ">and leg.f_netweightC = #{fNetweightc}</if>
  582. <if test="fGrossweightblc != null ">and leg.f_grossweightblc = #{fGrossweightblc}</if>
  583. <if test="fNetweightblc != null ">and leg.f_netweightblc = #{fNetweightblc}</if>
  584. <if test="fCntrno != null and fCntrno != ''">and leg.f_cntrno = #{fCntrno}</if>
  585. <if test="fStatus != null and fStatus != ''">and leg.f_status = #{fStatus}</if>
  586. <if test="fWarehouseid != null ">and leg.f_warehouseid = #{fWarehouseid} </if>
  587. <if test="fLocation != null and fLocation ==1 ">
  588. and leg.f_warehouse_locationid = #{fWarehouseLocationid}
  589. </if>
  590. <if test="fLocation != null and fLocation ==0 ">
  591. and ware.ancestors LIKE concat('%', #{fWarehouseLocationid}, '%')
  592. </if>
  593. </where>
  594. </select>
  595. </mapper>