TWhgenlegMapper.xml 26 KB

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