TWarehousebillsitemsMapper.xml 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652
  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.warehouseBusiness.mapper.TWarehousebillsitemsMapper">
  6. <resultMap type="TWarehousebillsitems" id="TWarehousebillsitemsResult">
  7. <result property="fId" column="f_id"/>
  8. <result property="fPid" column="f_pid"/>
  9. <result property="fSrcid" column="f_srcid"/>
  10. <result property="fLineno" column="f_lineno"/>
  11. <result property="fBillno" column="f_billno"/>
  12. <result property="fGoodsid" column="f_goodsid"/>
  13. <result property="fMblno" column="f_mblno"/>
  14. <result property="fOriginalbillno" column="f_originalbillno"/>
  15. <result property="fTransferWarehouselocid" column="f_transfer_warehouselocid"/>
  16. <result property="fWarehouselocid" column="f_warehouselocid"/>
  17. <result property="fOriginalbilldate" column="f_originalbilldate"/>
  18. <result property="fBsdate" column="f_bsdate"/>
  19. <result property="fBillingway" column="f_billingway"/>
  20. <result property="fChargedate" column="f_chargedate"/>
  21. <result property="fBoxno" column="f_boxno"/>
  22. <result property="fGoodsval" column="f_goodsval"/>
  23. <result property="fCntqty" column="f_cntqty"/>
  24. <result property="fPackagespecs" column="f_packagespecs"/>
  25. <result property="fCntrtype" column="f_cntrtype"/>
  26. <result property="fPlanvolumn" column="f_planvolumn"/>
  27. <result property="fPlanqty" column="f_planqty"/>
  28. <result property="fPlangrossweight" column="f_plangrossweight"/>
  29. <result property="fPlannetweight" column="f_plannetweight"/>
  30. <result property="fVolumn" column="f_volumn"/>
  31. <result property="fQty" column="f_qty"/>
  32. <result property="fGrossweight" column="f_grossweight"/>
  33. <result property="fNetweight" column="f_netweight"/>
  34. <result property="fCntrno" column="f_cntrno"/>
  35. <result property="fTruckno" column="f_truckno"/>
  36. <result property="fMarks" column="f_marks"/>
  37. <result property="fBillstatus" column="f_billstatus"/>
  38. <result property="delFlag" column="del_flag"/>
  39. <result property="createBy" column="create_by"/>
  40. <result property="createTime" column="create_time"/>
  41. <result property="updateBy" column="update_by"/>
  42. <result property="updateTime" column="update_time"/>
  43. <result property="remark" column="remark"/>
  44. <result property="fInventoryDays" column="f_inventory_days"/>
  45. <result property="fStorageFeeDeadline" column="f_storage_fee_deadline"/>
  46. <result property="fAmt" column="f_amt"/>
  47. <result property="fBillingDays" column="f_billing_days"/>
  48. <result property="fDriverName" column="f_driver_name"/>
  49. <result property="fDriverTel" column="f_driver_tel"/>
  50. <result property="fDriverIdCar" column="f_driver_id_car"/>
  51. <result property="fSerialNumber" column="f_serial_number"/>
  52. <result property="fIsPass" column="f_is_pass"/>
  53. <result property="fBilltype" column="f_billtype"/>
  54. <result property="fBillingQty" column="f_billing_qty"/>
  55. <result property="fBillingDeadline" column="f_billing_deadline"/>
  56. <result property="fBusinessType" column="f_business_type"/>
  57. <result property="fIsInventory" column="f_is_inventory"/>
  58. <result property="fWarehouseInformation" column="f_warehouse_information"/>
  59. <result property="fOrgwarehouseInformation" column="f_orgwarehouse_information"/>
  60. <result property="fLabour" column="f_labour"/>
  61. <result property="fFleet" column="f_fleet"/>
  62. <result property="fStevedore" column="f_stevedore"/>
  63. <result property="fLntype" column="f_lntype"/>
  64. <result property="fForkliftman" column="f_forkliftman"/>
  65. <result property="fLocalcntrno" column="f_localcntrno"/>
  66. <result property="fSealno" column="f_sealno"/>
  67. </resultMap>
  68. <sql id="selectTWarehousebillsitemsVo">
  69. select f_id, f_pid, f_srcid, f_lineno, f_billno, f_goodsid, f_mblno, f_originalbillno, f_transfer_warehouselocid, f_warehouselocid,
  70. f_originalbilldate, f_bsdate, f_billingway, f_chargedate, f_boxno, f_goodsval, f_cntqty, f_packagespecs, f_cntrtype, f_planvolumn,
  71. f_planqty, f_plangrossweight, f_plannetweight, f_volumn, f_qty, f_grossweight, f_netweight, f_cntrno, f_truckno, f_marks, f_billstatus,
  72. del_flag, create_by, create_time, update_by, update_time, remark, f_inventory_days, f_storage_fee_deadline, f_amt, f_billing_days,
  73. f_driver_name, f_driver_tel, f_driver_id_car, f_serial_number, f_is_pass, f_billtype, f_billing_qty, f_billing_deadline, f_business_type,
  74. f_is_inventory, f_warehouse_information, f_orgwarehouse_information, f_labour, f_fleet, f_stevedore, f_lntype, f_forkliftman,
  75. f_localcntrno, f_sealno from t_warehousebillsitems
  76. </sql>
  77. <select id="selectTWarehousebillsitemsList" parameterType="TWarehousebillsitems"
  78. resultMap="TWarehousebillsitemsResult">
  79. <include refid="selectTWarehousebillsitemsVo"/>
  80. <where>
  81. <if test="fPid != null ">and f_pid = #{fPid}</if>
  82. <if test="fLineno != null ">and f_lineno = #{fLineno}</if>
  83. <if test="fGoodsid != null ">and f_goodsid = #{fGoodsid}</if>
  84. <if test="fMblno != null and fMblno != ''">and f_mblno = #{fMblno}</if>
  85. <if test="fBillno != null and fBillno != ''">and f_billno = #{fBillno}</if>
  86. <if test="fWarehouselocid != null ">and f_warehouselocid = #{fWarehouselocid}</if>
  87. <if test="fBsdate != null ">and f_bsdate = #{fBsdate}</if>
  88. <if test="fLabour != null ">and f_labour = #{fLabour}</if>
  89. <if test="fLabour != null ">and f_labour = #{fLabour}</if>
  90. <if test="fFleet != null ">and f_fleet = #{fFleet}</if>
  91. <if test="fOriginalbillno != null and fOriginalbillno != ''">and f_originalbillno = #{fOriginalbillno}</if>
  92. <if test="fBoxno != null and fBoxno != ''">and f_boxno = #{fBoxno}</if>
  93. <if test="fOriginalbilldate != null ">and f_originalbilldate = #{fOriginalbilldate}</if>
  94. <if test="fStorageFeeDeadline != null "> and f_storage_fee_deadline = #{fStorageFeeDeadline}</if>
  95. <if test="fTransferWarehouselocid != null "> and f_transfer_warehouselocid = #{fTransferWarehouselocid}</if>
  96. <if test="fCntqty != null ">and f_cntqty = #{fCntqty}</if>
  97. <if test="fGoodsval != null ">and f_goodsval = #{fGoodsval}</if>
  98. <if test="fCntrtype != null and fCntrtype != ''">and f_cntrtype = #{fCntrtype}</if>
  99. <if test="fPlanqty != null ">and f_planqty = #{fPlanqty}</if>
  100. <if test="fPlanvolumn != null ">and f_planvolumn = #{fPlanvolumn}</if>
  101. <if test="fChargedate != null ">and f_chargedate = #{fChargedate}</if>
  102. <if test="fIsInventory != null ">and f_is_inventory = #{fIsInventory}</if>
  103. <if test="fPackagespecs != null ">and f_packagespecs = #{fPackagespecs}</if>
  104. <if test="fBusinessType != null "> and f_business_type = #{fBusinessType}</if>
  105. <if test="fWarehouseInformation != null "> and f_warehouse_information = #{fWarehouseInformation}</if>
  106. <if test="fOrgwarehouseInformation != null "> and f_orgwarehouse_information = #{fOrgwarehouseInformation}</if>
  107. <if test="fPlangrossweight != null ">and f_plangrossweight = #{fPlangrossweight}</if>
  108. <if test="fPlannetweight != null ">and f_plannetweight = #{fPlannetweight}</if>
  109. <if test="fQty != null ">and f_qty = #{fQty}</if>
  110. <if test="fVolumn != null ">and f_volumn = #{fVolumn}</if>
  111. <if test="fGrossweight != null ">and f_grossweight = #{fGrossweight}</if>
  112. <if test="fNetweight != null ">and f_netweight = #{fNetweight}</if>
  113. <if test="fCntrno != null and fCntrno != ''">and f_cntrno = #{fCntrno}</if>
  114. <if test="fTruckno != null and fTruckno != ''">and f_truckno = #{fTruckno}</if>
  115. <if test="fBillstatus != null and fBillstatus != ''">and f_billstatus = #{fBillstatus}</if>
  116. <if test="fMarks != null and fMarks != ''">and f_marks = #{fMarks}</if>
  117. <if test="fInventoryDays != null ">and f_inventory_days = #{fInventoryDays}</if>
  118. <if test="fAmt != null ">and f_amt = #{fAmt}</if>
  119. <if test="fBillingDays != null ">and f_billing_days = #{fBillingDays}</if>
  120. <if test="fDriverName != null and fDriverName != ''">and f_driver_name like concat('%',
  121. #{fDriverName},'%')
  122. </if>
  123. <if test="fDriverTel != null and fDriverTel != ''">and f_driver_tel = #{fDriverTel}</if>
  124. <if test="fDriverIdCar != null and fDriverIdCar != ''">and f_driver_id_car = #{fDriverIdCar}</if>
  125. <if test="fSerialNumber != null and fSerialNumber != ''">and f_serial_number = #{fSerialNumber}</if>
  126. <if test="fIsPass != null and fIsPass != ''">and f_is_pass = #{fIsPass}</if>
  127. </where>
  128. </select>
  129. <select id="selectGoodsTransferitemsList" parameterType="TWarehousebillsitems" resultType="Map">
  130. select DISTINCT
  131. item.f_id AS fId,
  132. item.f_pid AS fPid,
  133. item.f_srcid AS fSrcid,
  134. item.f_lineno AS fLineno,
  135. item.f_billno AS fBillno,
  136. item.f_goodsid AS fGoodsid,
  137. goods.f_name AS fGoodsids,
  138. goods.if_cntrno AS ifCntrno,
  139. item.f_warehouselocid AS fWarehouselocid,
  140. area.f_name AS fWarehouselocids,
  141. ware.f_name AS fWarehouseids,
  142. item.f_is_pass AS fIsPass,
  143. item.f_originalbillno AS fOriginalbillno,
  144. item.f_mblno AS fMblno,
  145. item.f_bsdate AS fBsdate,
  146. item.f_boxno AS fBoxno,
  147. item.f_cntqty AS fCntqty,
  148. item.f_goodsval AS fGoodsval,
  149. item.f_cntrtype AS fCntrtype,
  150. item.f_planqty AS fPlanqty,
  151. item.f_planvolumn AS fPlanvolumn,
  152. item.f_billingway AS fBillingway,
  153. item.f_chargedate AS fChargedate,
  154. item.f_packagespecs AS fPackagespecs,
  155. item.f_plangrossweight AS fPlangrossweight,
  156. item.f_originalbilldate AS fOriginalbilldate,
  157. item.f_plannetweight AS fPlannetweight,
  158. item.f_transfer_warehouselocid AS fTransferWarehouselocid,
  159. item.f_qty AS fQty,
  160. item.f_volumn AS fVolumn,
  161. item.f_driver_name AS fDriverName,
  162. item.f_driver_tel AS fDriverTel,
  163. item.f_driver_id_car AS fDriverIdCar,
  164. item.f_serial_number AS fSerialNumber,
  165. item.f_marks AS fMarks,
  166. item.f_grossweight AS fGrossweight,
  167. item.f_is_inventory AS fIsInventory,
  168. item.f_business_type AS fBusinessType,
  169. item.f_netweight AS fNetweight,
  170. item.f_cntrno AS fCntrno,
  171. item.f_truckno AS fTruckno,
  172. item.f_billstatus AS fBillstatus,
  173. item.remark,
  174. b.f_name AS fLabours,
  175. item.f_labour AS fLabour,
  176. f.f_name AS fFleets,
  177. item.f_fleet AS fFleet,
  178. item.f_stevedore AS fStevedore,
  179. item.f_forkliftman AS fForkliftman,
  180. item.f_localcntrno AS fLocalcntrno,
  181. l.dict_label AS lntypes,
  182. item.f_lntype AS lntype,
  183. item.f_sealno AS fSealno,
  184. item.f_warehouse_information AS fWarehouseInformation,
  185. item.f_orgwarehouse_information AS fOrgwarehouseInformation
  186. FROM
  187. t_warehousebillsitems item
  188. LEFT JOIN t_goods goods ON goods.f_id = item.f_goodsid
  189. LEFT JOIN t_warehouse_area area ON area.f_id = item.f_warehouselocid
  190. LEFT JOIN t_warehouse ware ON ware.f_id = area.f_warehouseid
  191. LEFT JOIN t_corps b ON b.f_id = item.f_labour
  192. LEFT JOIN t_corps f ON f.f_id = item.f_fleet
  193. LEFT JOIN sys_dict_data l ON l.dict_value = item.f_lntype
  194. AND l.dict_type = 'ln_way'
  195. WHERE
  196. item.f_pid = #{fPid}
  197. </select>
  198. <select id="selectTWarehousebillsitemsById" parameterType="Long" resultMap="TWarehousebillsitemsResult">
  199. <include refid="selectTWarehousebillsitemsVo"/>
  200. where f_id = #{fId}
  201. </select>
  202. <insert id="insertTWarehousebillsitems" parameterType="TWarehousebillsitems" useGeneratedKeys="true" keyProperty="fId">
  203. insert into t_warehousebillsitems
  204. <trim prefix="(" suffix=")" suffixOverrides=",">
  205. <if test="fPid != null">f_pid,</if>
  206. <if test="fSrcid != null">f_srcid,</if>
  207. <if test="fLineno != null">f_lineno,</if>
  208. <if test="fBillno != null">f_billno,</if>
  209. <if test="fGoodsid != null">f_goodsid,</if>
  210. <if test="fMblno != null">f_mblno,</if>
  211. <if test="fOriginalbillno != null">f_originalbillno,</if>
  212. <if test="fTransferWarehouselocid != null">f_transfer_warehouselocid,</if>
  213. <if test="fWarehouselocid != null">f_warehouselocid,</if>
  214. <if test="fOriginalbilldate != null">f_originalbilldate,</if>
  215. <if test="fBsdate != null">f_bsdate,</if>
  216. <if test="fBillingway != null">f_billingway,</if>
  217. <if test="fChargedate != null">f_chargedate,</if>
  218. <if test="fBoxno != null">f_boxno,</if>
  219. <if test="fGoodsval != null">f_goodsval,</if>
  220. <if test="fCntqty != null">f_cntqty,</if>
  221. <if test="fPackagespecs != null">f_packagespecs,</if>
  222. <if test="fCntrtype != null">f_cntrtype,</if>
  223. <if test="fPlanvolumn != null">f_planvolumn,</if>
  224. <if test="fPlanqty != null">f_planqty,</if>
  225. <if test="fPlangrossweight != null">f_plangrossweight,</if>
  226. <if test="fPlannetweight != null">f_plannetweight,</if>
  227. <if test="fVolumn != null">f_volumn,</if>
  228. <if test="fQty != null">f_qty,</if>
  229. <if test="fGrossweight != null">f_grossweight,</if>
  230. <if test="fNetweight != null">f_netweight,</if>
  231. <if test="fCntrno != null">f_cntrno,</if>
  232. <if test="fTruckno != null">f_truckno,</if>
  233. <if test="fMarks != null">f_marks,</if>
  234. <if test="fBillstatus != null">f_billstatus,</if>
  235. <if test="delFlag != null">del_flag,</if>
  236. <if test="createBy != null">create_by,</if>
  237. <if test="createTime != null">create_time,</if>
  238. <if test="updateBy != null">update_by,</if>
  239. <if test="updateTime != null">update_time,</if>
  240. <if test="remark != null">remark,</if>
  241. <if test="fInventoryDays != null">f_inventory_days,</if>
  242. <if test="fStorageFeeDeadline != null">f_storage_fee_deadline,</if>
  243. <if test="fAmt != null">f_amt,</if>
  244. <if test="fBillingDays != null">f_billing_days,</if>
  245. <if test="fDriverName != null">f_driver_name,</if>
  246. <if test="fDriverTel != null">f_driver_tel,</if>
  247. <if test="fDriverIdCar != null">f_driver_id_car,</if>
  248. <if test="fSerialNumber != null">f_serial_number,</if>
  249. <if test="fIsPass != null">f_is_pass,</if>
  250. <if test="fBilltype != null">f_billtype,</if>
  251. <if test="fBillingQty != null">f_billing_qty,</if>
  252. <if test="fBillingDeadline != null">f_billing_deadline,</if>
  253. <if test="fBusinessType != null">f_business_type,</if>
  254. <if test="fIsInventory != null">f_is_inventory,</if>
  255. <if test="fWarehouseInformation != null">f_warehouse_information,</if>
  256. <if test="fOrgwarehouseInformation != null">f_orgwarehouse_information,</if>
  257. <if test="fLabour != null">f_labour,</if>
  258. <if test="fFleet != null">f_fleet,</if>
  259. <if test="fStevedore != null">f_stevedore,</if>
  260. <if test="fLntype != null">f_lntype,</if>
  261. <if test="fForkliftman != null">f_forkliftman,</if>
  262. <if test="fLocalcntrno != null">f_localcntrno,</if>
  263. <if test="fSealno != null">f_sealno,</if>
  264. </trim>
  265. <trim prefix="values (" suffix=")" suffixOverrides=",">
  266. <if test="fPid != null">#{fPid},</if>
  267. <if test="fSrcid != null">#{fSrcid},</if>
  268. <if test="fLineno != null">#{fLineno},</if>
  269. <if test="fBillno != null">#{fBillno},</if>
  270. <if test="fGoodsid != null">#{fGoodsid},</if>
  271. <if test="fMblno != null">#{fMblno},</if>
  272. <if test="fOriginalbillno != null">#{fOriginalbillno},</if>
  273. <if test="fTransferWarehouselocid != null">#{fTransferWarehouselocid},</if>
  274. <if test="fWarehouselocid != null">#{fWarehouselocid},</if>
  275. <if test="fOriginalbilldate != null">#{fOriginalbilldate},</if>
  276. <if test="fBsdate != null">#{fBsdate},</if>
  277. <if test="fBillingway != null">#{fBillingway},</if>
  278. <if test="fChargedate != null">#{fChargedate},</if>
  279. <if test="fBoxno != null">#{fBoxno},</if>
  280. <if test="fGoodsval != null">#{fGoodsval},</if>
  281. <if test="fCntqty != null">#{fCntqty},</if>
  282. <if test="fPackagespecs != null">#{fPackagespecs},</if>
  283. <if test="fCntrtype != null">#{fCntrtype},</if>
  284. <if test="fPlanvolumn != null">#{fPlanvolumn},</if>
  285. <if test="fPlanqty != null">#{fPlanqty},</if>
  286. <if test="fPlangrossweight != null">#{fPlangrossweight},</if>
  287. <if test="fPlannetweight != null">#{fPlannetweight},</if>
  288. <if test="fVolumn != null">#{fVolumn},</if>
  289. <if test="fQty != null">#{fQty},</if>
  290. <if test="fGrossweight != null">#{fGrossweight},</if>
  291. <if test="fNetweight != null">#{fNetweight},</if>
  292. <if test="fCntrno != null">#{fCntrno},</if>
  293. <if test="fTruckno != null">#{fTruckno},</if>
  294. <if test="fMarks != null">#{fMarks},</if>
  295. <if test="fBillstatus != null">#{fBillstatus},</if>
  296. <if test="delFlag != null">#{delFlag},</if>
  297. <if test="createBy != null">#{createBy},</if>
  298. <if test="createTime != null">#{createTime},</if>
  299. <if test="updateBy != null">#{updateBy},</if>
  300. <if test="updateTime != null">#{updateTime},</if>
  301. <if test="remark != null">#{remark},</if>
  302. <if test="fInventoryDays != null">#{fInventoryDays},</if>
  303. <if test="fStorageFeeDeadline != null">#{fStorageFeeDeadline},</if>
  304. <if test="fAmt != null">#{fAmt},</if>
  305. <if test="fBillingDays != null">#{fBillingDays},</if>
  306. <if test="fDriverName != null">#{fDriverName},</if>
  307. <if test="fDriverTel != null">#{fDriverTel},</if>
  308. <if test="fDriverIdCar != null">#{fDriverIdCar},</if>
  309. <if test="fSerialNumber != null">#{fSerialNumber},</if>
  310. <if test="fIsPass != null">#{fIsPass},</if>
  311. <if test="fBilltype != null">#{fBilltype},</if>
  312. <if test="fBillingQty != null">#{fBillingQty},</if>
  313. <if test="fBillingDeadline != null">#{fBillingDeadline},</if>
  314. <if test="fBusinessType != null">#{fBusinessType},</if>
  315. <if test="fIsInventory != null">#{fIsInventory},</if>
  316. <if test="fWarehouseInformation != null">#{fWarehouseInformation},</if>
  317. <if test="fOrgwarehouseInformation != null">#{fOrgwarehouseInformation},</if>
  318. <if test="fLabour != null">#{fLabour},</if>
  319. <if test="fFleet != null">#{fFleet},</if>
  320. <if test="fStevedore != null">#{fStevedore},</if>
  321. <if test="fLntype != null">#{fLntype},</if>
  322. <if test="fForkliftman != null">#{fForkliftman},</if>
  323. <if test="fLocalcntrno != null">#{fLocalcntrno},</if>
  324. <if test="fSealno != null">#{fSealno},</if>
  325. </trim>
  326. </insert>
  327. <update id="updateTWarehousebillsitems" parameterType="TWarehousebillsitems">
  328. update t_warehousebillsitems
  329. <trim prefix="SET" suffixOverrides=",">
  330. <if test="fPid != null">f_pid = #{fPid},</if>
  331. <if test="fSrcid != null">f_srcid = #{fSrcid},</if>
  332. <if test="fLineno != null">f_lineno = #{fLineno},</if>
  333. <if test="fBillno != null">f_billno = #{fBillno},</if>
  334. <if test="fGoodsid != null">f_goodsid = #{fGoodsid},</if>
  335. <if test="fMblno != null">f_mblno = #{fMblno},</if>
  336. <if test="fOriginalbillno != null">f_originalbillno = #{fOriginalbillno},</if>
  337. <if test="fTransferWarehouselocid != null">f_transfer_warehouselocid = #{fTransferWarehouselocid},</if>
  338. <if test="fWarehouselocid != null">f_warehouselocid = #{fWarehouselocid},</if>
  339. <if test="fOriginalbilldate != null">f_originalbilldate = #{fOriginalbilldate},</if>
  340. <if test="fBsdate != null">f_bsdate = #{fBsdate},</if>
  341. <if test="fBillingway != null">f_billingway = #{fBillingway},</if>
  342. <if test="fChargedate != null">f_chargedate = #{fChargedate},</if>
  343. <if test="fBoxno != null">f_boxno = #{fBoxno},</if>
  344. <if test="fGoodsval != null">f_goodsval = #{fGoodsval},</if>
  345. <if test="fCntqty != null">f_cntqty = #{fCntqty},</if>
  346. <if test="fPackagespecs != null">f_packagespecs = #{fPackagespecs},</if>
  347. <if test="fCntrtype != null">f_cntrtype = #{fCntrtype},</if>
  348. <if test="fPlanvolumn != null">f_planvolumn = #{fPlanvolumn},</if>
  349. <if test="fPlanqty != null">f_planqty = #{fPlanqty},</if>
  350. <if test="fPlangrossweight != null">f_plangrossweight = #{fPlangrossweight},</if>
  351. <if test="fPlannetweight != null">f_plannetweight = #{fPlannetweight},</if>
  352. <if test="fVolumn != null">f_volumn = #{fVolumn},</if>
  353. <if test="fQty != null">f_qty = #{fQty},</if>
  354. <if test="fGrossweight != null">f_grossweight = #{fGrossweight},</if>
  355. <if test="fNetweight != null">f_netweight = #{fNetweight},</if>
  356. <if test="fCntrno != null">f_cntrno = #{fCntrno},</if>
  357. <if test="fTruckno != null">f_truckno = #{fTruckno},</if>
  358. <if test="fMarks != null">f_marks = #{fMarks},</if>
  359. <if test="fBillstatus != null and fBillstatus != ''">f_billstatus = #{fBillstatus},</if>
  360. <if test="delFlag != null">del_flag = #{delFlag},</if>
  361. <if test="createBy != null">create_by = #{createBy},</if>
  362. <if test="createTime != null">create_time = #{createTime},</if>
  363. <if test="updateBy != null">update_by = #{updateBy},</if>
  364. <if test="updateTime != null">update_time = #{updateTime},</if>
  365. <if test="remark != null">remark = #{remark},</if>
  366. <if test="fInventoryDays != null">f_inventory_days = #{fInventoryDays},</if>
  367. <if test="fStorageFeeDeadline != null">f_storage_fee_deadline = #{fStorageFeeDeadline},</if>
  368. <if test="fAmt != null">f_amt = #{fAmt},</if>
  369. <if test="fBillingDays != null">f_billing_days = #{fBillingDays},</if>
  370. <if test="fDriverName != null">f_driver_name = #{fDriverName},</if>
  371. <if test="fDriverTel != null">f_driver_tel = #{fDriverTel},</if>
  372. <if test="fDriverIdCar != null">f_driver_id_car = #{fDriverIdCar},</if>
  373. <if test="fSerialNumber != null">f_serial_number = #{fSerialNumber},</if>
  374. <if test="fIsPass != null">f_is_pass = #{fIsPass},</if>
  375. <if test="fBilltype != null">f_billtype = #{fBilltype},</if>
  376. <if test="fBillingQty != null">f_billing_qty = #{fBillingQty},</if>
  377. <if test="fBillingDeadline != null">f_billing_deadline = #{fBillingDeadline},</if>
  378. <if test="fBusinessType != null">f_business_type = #{fBusinessType},</if>
  379. <if test="fIsInventory != null">f_is_inventory = #{fIsInventory},</if>
  380. <if test="fWarehouseInformation != null">f_warehouse_information = #{fWarehouseInformation},</if>
  381. <if test="fOrgwarehouseInformation != null">f_orgwarehouse_information = #{fOrgwarehouseInformation},</if>
  382. <if test="fLabour != null">f_labour = #{fLabour},</if>
  383. <if test="fFleet != null">f_fleet = #{fFleet},</if>
  384. <if test="fStevedore != null">f_stevedore = #{fStevedore},</if>
  385. <if test="fLntype != null">f_lntype = #{fLntype},</if>
  386. <if test="fForkliftman != null">f_forkliftman = #{fForkliftman},</if>
  387. <if test="fLocalcntrno != null">f_localcntrno = #{fLocalcntrno},</if>
  388. <if test="fSealno != null">f_sealno = #{fSealno},</if>
  389. </trim>
  390. where f_id = #{fId}
  391. </update>
  392. <update id="agreementApprovalRejected" parameterType="TWarehousebillsitems">
  393. UPDATE
  394. t_warehousebillsitems
  395. SET f_storage_fee_deadline = null, f_chargedate = #{fChargedate}
  396. WHERE
  397. f_id = #{fId}
  398. </update>
  399. <delete id="deleteTWarehousebillsitemsById" parameterType="Long">
  400. delete from t_warehousebillsitems where f_id = #{fId}
  401. </delete>
  402. <delete id="deleteTWarehousebillsitemsByIds" parameterType="String">
  403. delete from t_warehousebillsitems where f_id in
  404. <foreach item="fId" collection="array" open="(" separator="," close=")">
  405. #{fId}
  406. </foreach>
  407. </delete>
  408. <delete id="deleteByFPid" parameterType="Long">
  409. delete from t_warehousebillsitems where f_pid = #{fId}
  410. </delete>
  411. <select id="selectStorageFeeItemList" parameterType="com.ruoyi.warehouseBusiness.domain.TWarehouseBills"
  412. resultType="Map">
  413. SELECT
  414. item.f_id AS fId,
  415. item.f_billno AS fBillno,
  416. item.f_goodsid AS fGoodsid,
  417. item.f_bsdate AS fBsdate,
  418. item.f_billingway AS fBillingway,
  419. item.f_chargedate AS fChargedate,
  420. item.f_originalbilldate AS fOriginalbilldate,
  421. item.f_mblno AS fMblno,
  422. item.f_volumn AS fVolumn,
  423. item.f_marks AS fMarks,
  424. item.f_billing_days AS fBillingDays,
  425. item.f_is_inventory AS fIsInventory,
  426. item.f_qty AS fQty,
  427. item.f_orgwarehouse_information AS fOrgwarehouseInformation,
  428. item.f_grossweight AS fGrossweight,
  429. item.f_netweight AS fNetweight,
  430. item.f_billtype AS fBilltype,
  431. goods.f_typeid AS fTypeid,
  432. goods.f_name AS fGoodsids
  433. FROM
  434. t_warehousebills ware
  435. LEFT JOIN t_warehousebillsitems item ON item.f_pid = ware.f_id
  436. LEFT JOIN t_goods goods ON goods.f_id = item.f_goodsid
  437. LEFT JOIN t_warehouse wa ON wa.f_id = ware.f_warehouseid
  438. <where>
  439. ware.f_corpid = #{warehouse.fCorpid}
  440. and ware.f_billtype in ("HQZY", "SJCK")
  441. and wa.f_charg = 1
  442. and item.f_billstatus = 40
  443. and item.f_storage_fee_deadline IS NULL
  444. and item.f_chargedate &lt; #{warehouse.fBillingDeadline}
  445. <if test="warehouse.fGoodsid != null">and item.f_goodsid = #{warehouse.fGoodsid}</if>
  446. <if test="warehouse.fMblno != null">and ware.f_mblno = #{warehouse.fMblno}</if>
  447. </where>
  448. </select>
  449. <select id="warehousebillsitemsWarehouselocidSize" resultType="java.lang.Integer">
  450. SELECT
  451. COUNT( 1 )
  452. FROM
  453. t_warehousebillsitems
  454. WHERE
  455. f_warehouselocid = #{fWarehouselocid}
  456. </select>
  457. <select id="inStock" resultType="java.lang.Integer">
  458. SELECT
  459. COUNT(f_id)
  460. FROM
  461. t_warehousebillsitems
  462. WHERE
  463. f_billtype = 'SJRK'
  464. AND
  465. f_billstatus in (20,30)
  466. </select>
  467. <select id="outStock" resultType="java.lang.Integer">
  468. SELECT
  469. COUNT(f_id)
  470. FROM
  471. t_warehousebillsitems
  472. WHERE
  473. f_billtype = 'SJCK'
  474. AND
  475. f_billstatus in (20,30)
  476. </select>
  477. <select id="monthInStock" resultType="java.lang.Integer">
  478. SELECT
  479. COUNT(f_id)
  480. FROM
  481. t_warehousebillsitems
  482. WHERE
  483. f_billtype = 'SJRK'
  484. AND
  485. f_billstatus =40
  486. AND
  487. f_bsdate &gt;= #{timeInterval[0]}
  488. AND
  489. f_bsdate &lt;= #{timeInterval[1]}
  490. </select>
  491. <select id="monthOutStock" resultType="java.lang.Integer">
  492. SELECT
  493. COUNT(f_id)
  494. FROM
  495. t_warehousebillsitems
  496. WHERE
  497. f_billtype = 'SJCK'
  498. AND
  499. f_billstatus =40
  500. AND
  501. f_bsdate &gt;= #{timeInterval[0]}
  502. AND
  503. f_bsdate &lt;= #{timeInterval[1]}
  504. </select>
  505. <select id="selectWarehouseBusinesInList" resultType="java.util.Map">
  506. SELECT
  507. items.f_id AS fId,
  508. items.f_pid AS fPid,
  509. c.f_name AS fName,
  510. items.f_mblno AS fMblno,
  511. items.f_bsdate AS fBsdate,
  512. items.f_is_pass AS fIsPass,
  513. CASE
  514. WHEN items.f_billstatus = 20 THEN
  515. '待入库'
  516. WHEN items.f_billstatus = 30 THEN
  517. '入库中'
  518. END AS fBillstatus,
  519. g.f_name AS fGoodsid,
  520. items.f_driver_tel AS fDriverTel,
  521. dict.dict_label AS fBusinessType ,
  522. items.f_marks AS fMarks,
  523. items.f_warehouse_information AS fWarehouseInformation,
  524. items.f_qty AS fQty,
  525. items.f_grossweight AS fGrossweight,
  526. items.f_netweight AS fNetweight
  527. FROM
  528. t_warehousebillsitems items
  529. LEFT JOIN t_warehousebills t ON items.f_pid = t.f_id
  530. LEFT JOIN t_corps c ON t.f_corpid = c.f_id
  531. LEFT JOIN t_goods g ON items.f_goodsid = g.f_id
  532. LEFT JOIN sys_dict_data dict ON dict.dict_type = 'storage_type'
  533. AND dict.dict_value = items.f_business_type
  534. WHERE
  535. items.f_billtype = 'SJRK'
  536. AND items.f_billstatus IN ( 20, 30 )
  537. <if test="timeStartBsdate != null">AND items.f_bsdate &gt;= #{timeStartBsdate}</if>
  538. <if test="timeEndBsdate != null">AND items.f_bsdate &lt;= #{timeEndBsdate}</if>
  539. <if test="fBillstatus != null">AND items.f_billstatus = #{fBillstatus}</if>
  540. <if test="fMblno != null and fMblno != '' ">AND items.f_mblno like concat('%',#{fMblno},'%') </if>
  541. </select>
  542. <select id="selectWarehouseBusinesOutList" resultType="java.util.Map">
  543. SELECT
  544. items.f_id AS fId,
  545. items.f_pid AS fPid,
  546. c.f_name AS fName,
  547. items.f_mblno AS fMblno,
  548. items.f_bsdate AS fBsdate,
  549. items.f_is_pass AS fIsPass,
  550. CASE
  551. WHEN items.f_billstatus = 20 THEN
  552. '待出库'
  553. WHEN items.f_billstatus = 30 THEN
  554. '出库中'
  555. END AS fBillstatus,
  556. g.f_name AS fGoodsid,
  557. items.f_driver_tel AS fDriverTel,
  558. dict.dict_label AS fBusinessType ,
  559. items.f_marks AS fMarks,
  560. items.f_warehouse_information AS fWarehouseInformation,
  561. items.f_qty AS fQty,
  562. items.f_grossweight AS fGrossweight,
  563. items.f_netweight AS fNetweight
  564. FROM
  565. t_warehousebillsitems items
  566. LEFT JOIN t_warehousebills t ON items.f_pid = t.f_id
  567. LEFT JOIN t_corps c ON t.f_corpid = c.f_id
  568. LEFT JOIN t_goods g ON items.f_goodsid = g.f_id
  569. LEFT JOIN sys_dict_data dict ON dict.dict_type = 'storage_type'
  570. AND dict.dict_value = items.f_business_type
  571. WHERE
  572. items.f_billtype = 'SJCK'
  573. AND items.f_billstatus IN ( 20, 30 )
  574. <if test="timeStartBsdate != null">AND items.f_bsdate &gt;= #{timeStartBsdate}</if>
  575. <if test="timeEndBsdate != null">AND items.f_bsdate &lt;= #{timeEndBsdate}</if>
  576. <if test="fBillstatus != null">AND items.f_billstatus = #{fBillstatus}</if>
  577. <if test="fMblno != null and fMblno != '' ">AND items.f_mblno like concat('%',#{fMblno},'%') </if>
  578. order by items.f_bsdate desc
  579. </select>
  580. <select id="selectWarehouseItemsByPId" parameterType="long" resultType="Map">
  581. SELECT
  582. t.f_id fId,
  583. t.f_pid fPid,
  584. t.f_bsdate bsdate,
  585. corp.f_name corpName,
  586. t.f_mblno fMblno,
  587. stor.dict_label businessType,
  588. t.f_marks marks,
  589. t.f_labour labour,
  590. g.f_name goodsName,
  591. fleet.f_name fleetName,
  592. t.f_warehouse_information warehouseInformation,
  593. t.f_warehouselocid fWarehouselocid,
  594. t.f_truckno truckno,
  595. cntr.f_name cntrtypes,
  596. t.f_cntrtype cntrtype,
  597. t.f_cntqty cntqty,
  598. t.f_cntrno cntrno,
  599. t.f_qty fQty,
  600. t.f_originalbilldate fOriginalbilldate,
  601. t.f_grossweight fGrossweight,
  602. t.f_netweight fNetweight,
  603. t.f_driver_tel fDriverTel,
  604. t.f_stevedore fStevedore,
  605. CASE
  606. WHEN t.f_billstatus = '10' THEN '计划'
  607. WHEN t.f_billstatus = '20' THEN
  608. IF(w.f_billtype = 'SJRK', '待入库', IF(w.f_billtype = 'SJCK','待出库', IF(w.f_billtype = 'CKDB', '待调拨',IF(w.f_billtype = 'HWTG', '待通关', IF(w.f_billtype = 'HQZY', '待转移', '无')))))
  609. WHEN t.f_billstatus = '30' THEN
  610. IF(w.f_billtype = 'SJRK', '入库中', IF(w.f_billtype = 'SJCK','出库中', IF(w.f_billtype = 'CKDB', '调拨中',IF(w.f_billtype = 'HWTG', '通关中', IF(w.f_billtype = 'HQZY', '转移中', '无')))))
  611. WHEN t.f_billstatus = '40' THEN
  612. IF(w.f_billtype = 'SJRK', '已入库', IF(w.f_billtype = 'SJCK','已出库', IF(w.f_billtype = 'CKDB', '已调拨',IF(w.f_billtype = 'HWTG', '已通关', IF(w.f_billtype = 'HQZY', '已转移', '无')))))
  613. END billstatus,
  614. t.remark
  615. FROM
  616. t_warehousebills w
  617. LEFT JOIN t_warehousebillsitems t ON w.f_id = t.f_pid
  618. LEFT JOIN sys_dict_data stor ON stor.dict_value = t.f_business_type
  619. AND stor.dict_type = 'storage_type'
  620. LEFT JOIN t_goods g ON g.f_id = t.f_goodsid
  621. LEFT JOIN t_corps fleet ON fleet.f_id = t.f_fleet
  622. LEFT JOIN t_corps corp ON corp.f_id = w.f_corpid
  623. LEFT JOIN t_cntr cntr ON cntr.f_id = t.f_cntrtype
  624. where
  625. t.f_id = #{fId}
  626. </select>
  627. <update id="warehouseItemFollowUpdate" parameterType="Long">
  628. update
  629. t_warehousebillsitems
  630. SET f_billstatus = IF
  631. ( f_billtype = 'SJCK' || f_billtype = 'SJRK', 40, #{fettle} )
  632. where
  633. f_pid = #{fPid}
  634. </update>
  635. </mapper>