TWarehousebillsitemsMapper.xml 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687
  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. w.f_storekeeper fStorekeeper,
  160. item.f_qty AS fQty,
  161. item.f_volumn AS fVolumn,
  162. item.f_driver_name AS fDriverName,
  163. item.f_driver_tel AS fDriverTel,
  164. item.f_driver_id_car AS fDriverIdCar,
  165. item.f_serial_number AS fSerialNumber,
  166. item.f_marks AS fMarks,
  167. item.f_grossweight AS fGrossweight,
  168. item.f_is_inventory AS fIsInventory,
  169. item.f_business_type AS fBusinessType,
  170. item.f_netweight AS fNetweight,
  171. item.f_cntrno AS fCntrno,
  172. item.f_truckno AS fTruckno,
  173. item.f_billstatus AS fBillstatus,
  174. item.remark,
  175. b.f_name AS fLabours,
  176. item.f_labour AS fLabour,
  177. f.f_name AS fFleets,
  178. item.f_fleet AS fFleet,
  179. item.f_stevedore AS fStevedore,
  180. item.f_forkliftman AS fForkliftman,
  181. item.f_localcntrno AS fLocalcntrno,
  182. l.dict_label AS fLntypes,
  183. item.f_lntype AS fLntype,
  184. item.f_sealno AS fSealno,
  185. item.f_warehouse_information AS fWarehouseInformation,
  186. item.f_orgwarehouse_information AS fOrgwarehouseInformation
  187. FROM
  188. t_warehousebills w
  189. LEFT JOIN t_warehousebillsitems item ON item.f_pid = w.f_id
  190. LEFT JOIN t_goods goods ON goods.f_id = item.f_goodsid
  191. LEFT JOIN t_warehouse_area area ON area.f_id = item.f_warehouselocid
  192. LEFT JOIN t_warehouse ware ON ware.f_id = area.f_warehouseid
  193. LEFT JOIN t_corps b ON b.f_id = item.f_labour
  194. LEFT JOIN t_corps f ON f.f_id = item.f_fleet
  195. LEFT JOIN sys_dict_data l ON l.dict_value = item.f_lntype
  196. AND l.dict_type = 'ln_way'
  197. WHERE
  198. item.f_pid = #{fPid}
  199. </select>
  200. <select id="selectTWarehousebillsitemsById" parameterType="Long" resultMap="TWarehousebillsitemsResult">
  201. <include refid="selectTWarehousebillsitemsVo"/>
  202. where f_id = #{fId}
  203. </select>
  204. <insert id="insertTWarehousebillsitems" parameterType="TWarehousebillsitems" useGeneratedKeys="true" keyProperty="fId">
  205. insert into t_warehousebillsitems
  206. <trim prefix="(" suffix=")" suffixOverrides=",">
  207. <if test="fPid != null">f_pid,</if>
  208. <if test="fSrcid != null">f_srcid,</if>
  209. <if test="fLineno != null">f_lineno,</if>
  210. <if test="fBillno != null">f_billno,</if>
  211. <if test="fGoodsid != null">f_goodsid,</if>
  212. <if test="fMblno != null">f_mblno,</if>
  213. <if test="fOriginalbillno != null">f_originalbillno,</if>
  214. <if test="fTransferWarehouselocid != null">f_transfer_warehouselocid,</if>
  215. <if test="fWarehouselocid != null">f_warehouselocid,</if>
  216. <if test="fOriginalbilldate != null">f_originalbilldate,</if>
  217. <if test="fBsdate != null">f_bsdate,</if>
  218. <if test="fBillingway != null">f_billingway,</if>
  219. <if test="fChargedate != null">f_chargedate,</if>
  220. <if test="fBoxno != null">f_boxno,</if>
  221. <if test="fGoodsval != null">f_goodsval,</if>
  222. <if test="fCntqty != null">f_cntqty,</if>
  223. <if test="fPackagespecs != null">f_packagespecs,</if>
  224. <if test="fCntrtype != null">f_cntrtype,</if>
  225. <if test="fPlanvolumn != null">f_planvolumn,</if>
  226. <if test="fPlanqty != null">f_planqty,</if>
  227. <if test="fPlangrossweight != null">f_plangrossweight,</if>
  228. <if test="fPlannetweight != null">f_plannetweight,</if>
  229. <if test="fVolumn != null">f_volumn,</if>
  230. <if test="fQty != null">f_qty,</if>
  231. <if test="fGrossweight != null">f_grossweight,</if>
  232. <if test="fNetweight != null">f_netweight,</if>
  233. <if test="fCntrno != null">f_cntrno,</if>
  234. <if test="fTruckno != null">f_truckno,</if>
  235. <if test="fMarks != null">f_marks,</if>
  236. <if test="fBillstatus != null">f_billstatus,</if>
  237. <if test="delFlag != null">del_flag,</if>
  238. <if test="createBy != null">create_by,</if>
  239. <if test="createTime != null">create_time,</if>
  240. <if test="updateBy != null">update_by,</if>
  241. <if test="updateTime != null">update_time,</if>
  242. <if test="remark != null">remark,</if>
  243. <if test="fInventoryDays != null">f_inventory_days,</if>
  244. <if test="fStorageFeeDeadline != null">f_storage_fee_deadline,</if>
  245. <if test="fAmt != null">f_amt,</if>
  246. <if test="fBillingDays != null">f_billing_days,</if>
  247. <if test="fDriverName != null">f_driver_name,</if>
  248. <if test="fDriverTel != null">f_driver_tel,</if>
  249. <if test="fDriverIdCar != null">f_driver_id_car,</if>
  250. <if test="fSerialNumber != null">f_serial_number,</if>
  251. <if test="fIsPass != null">f_is_pass,</if>
  252. <if test="fBilltype != null">f_billtype,</if>
  253. <if test="fBillingQty != null">f_billing_qty,</if>
  254. <if test="fBillingDeadline != null">f_billing_deadline,</if>
  255. <if test="fBusinessType != null">f_business_type,</if>
  256. <if test="fIsInventory != null">f_is_inventory,</if>
  257. <if test="fWarehouseInformation != null">f_warehouse_information,</if>
  258. <if test="fOrgwarehouseInformation != null">f_orgwarehouse_information,</if>
  259. <if test="fLabour != null">f_labour,</if>
  260. <if test="fFleet != null">f_fleet,</if>
  261. <if test="fStevedore != null">f_stevedore,</if>
  262. <if test="fLntype != null">f_lntype,</if>
  263. <if test="fForkliftman != null">f_forkliftman,</if>
  264. <if test="fLocalcntrno != null">f_localcntrno,</if>
  265. <if test="fSealno != null">f_sealno,</if>
  266. </trim>
  267. <trim prefix="values (" suffix=")" suffixOverrides=",">
  268. <if test="fPid != null">#{fPid},</if>
  269. <if test="fSrcid != null">#{fSrcid},</if>
  270. <if test="fLineno != null">#{fLineno},</if>
  271. <if test="fBillno != null">#{fBillno},</if>
  272. <if test="fGoodsid != null">#{fGoodsid},</if>
  273. <if test="fMblno != null">#{fMblno},</if>
  274. <if test="fOriginalbillno != null">#{fOriginalbillno},</if>
  275. <if test="fTransferWarehouselocid != null">#{fTransferWarehouselocid},</if>
  276. <if test="fWarehouselocid != null">#{fWarehouselocid},</if>
  277. <if test="fOriginalbilldate != null">#{fOriginalbilldate},</if>
  278. <if test="fBsdate != null">#{fBsdate},</if>
  279. <if test="fBillingway != null">#{fBillingway},</if>
  280. <if test="fChargedate != null">#{fChargedate},</if>
  281. <if test="fBoxno != null">#{fBoxno},</if>
  282. <if test="fGoodsval != null">#{fGoodsval},</if>
  283. <if test="fCntqty != null">#{fCntqty},</if>
  284. <if test="fPackagespecs != null">#{fPackagespecs},</if>
  285. <if test="fCntrtype != null">#{fCntrtype},</if>
  286. <if test="fPlanvolumn != null">#{fPlanvolumn},</if>
  287. <if test="fPlanqty != null">#{fPlanqty},</if>
  288. <if test="fPlangrossweight != null">#{fPlangrossweight},</if>
  289. <if test="fPlannetweight != null">#{fPlannetweight},</if>
  290. <if test="fVolumn != null">#{fVolumn},</if>
  291. <if test="fQty != null">#{fQty},</if>
  292. <if test="fGrossweight != null">#{fGrossweight},</if>
  293. <if test="fNetweight != null">#{fNetweight},</if>
  294. <if test="fCntrno != null">#{fCntrno},</if>
  295. <if test="fTruckno != null">#{fTruckno},</if>
  296. <if test="fMarks != null">#{fMarks},</if>
  297. <if test="fBillstatus != null">#{fBillstatus},</if>
  298. <if test="delFlag != null">#{delFlag},</if>
  299. <if test="createBy != null">#{createBy},</if>
  300. <if test="createTime != null">#{createTime},</if>
  301. <if test="updateBy != null">#{updateBy},</if>
  302. <if test="updateTime != null">#{updateTime},</if>
  303. <if test="remark != null">#{remark},</if>
  304. <if test="fInventoryDays != null">#{fInventoryDays},</if>
  305. <if test="fStorageFeeDeadline != null">#{fStorageFeeDeadline},</if>
  306. <if test="fAmt != null">#{fAmt},</if>
  307. <if test="fBillingDays != null">#{fBillingDays},</if>
  308. <if test="fDriverName != null">#{fDriverName},</if>
  309. <if test="fDriverTel != null">#{fDriverTel},</if>
  310. <if test="fDriverIdCar != null">#{fDriverIdCar},</if>
  311. <if test="fSerialNumber != null">#{fSerialNumber},</if>
  312. <if test="fIsPass != null">#{fIsPass},</if>
  313. <if test="fBilltype != null">#{fBilltype},</if>
  314. <if test="fBillingQty != null">#{fBillingQty},</if>
  315. <if test="fBillingDeadline != null">#{fBillingDeadline},</if>
  316. <if test="fBusinessType != null">#{fBusinessType},</if>
  317. <if test="fIsInventory != null">#{fIsInventory},</if>
  318. <if test="fWarehouseInformation != null">#{fWarehouseInformation},</if>
  319. <if test="fOrgwarehouseInformation != null">#{fOrgwarehouseInformation},</if>
  320. <if test="fLabour != null">#{fLabour},</if>
  321. <if test="fFleet != null">#{fFleet},</if>
  322. <if test="fStevedore != null">#{fStevedore},</if>
  323. <if test="fLntype != null">#{fLntype},</if>
  324. <if test="fForkliftman != null">#{fForkliftman},</if>
  325. <if test="fLocalcntrno != null">#{fLocalcntrno},</if>
  326. <if test="fSealno != null">#{fSealno},</if>
  327. </trim>
  328. </insert>
  329. <update id="updateTWarehousebillsitems" parameterType="TWarehousebillsitems">
  330. update t_warehousebillsitems
  331. <trim prefix="SET" suffixOverrides=",">
  332. <if test="fPid != null">f_pid = #{fPid},</if>
  333. <if test="fSrcid != null">f_srcid = #{fSrcid},</if>
  334. <if test="fLineno != null">f_lineno = #{fLineno},</if>
  335. <if test="fBillno != null">f_billno = #{fBillno},</if>
  336. <if test="fGoodsid != null">f_goodsid = #{fGoodsid},</if>
  337. <if test="fMblno != null">f_mblno = #{fMblno},</if>
  338. <if test="fOriginalbillno != null">f_originalbillno = #{fOriginalbillno},</if>
  339. <if test="fTransferWarehouselocid != null">f_transfer_warehouselocid = #{fTransferWarehouselocid},</if>
  340. <if test="fWarehouselocid != null">f_warehouselocid = #{fWarehouselocid},</if>
  341. <if test="fOriginalbilldate != null">f_originalbilldate = #{fOriginalbilldate},</if>
  342. <if test="fBsdate != null">f_bsdate = #{fBsdate},</if>
  343. <if test="fBillingway != null">f_billingway = #{fBillingway},</if>
  344. <if test="fChargedate != null">f_chargedate = #{fChargedate},</if>
  345. <if test="fBoxno != null">f_boxno = #{fBoxno},</if>
  346. <if test="fGoodsval != null">f_goodsval = #{fGoodsval},</if>
  347. <if test="fCntqty != null">f_cntqty = #{fCntqty},</if>
  348. <if test="fPackagespecs != null">f_packagespecs = #{fPackagespecs},</if>
  349. <if test="fCntrtype != null">f_cntrtype = #{fCntrtype},</if>
  350. <if test="fPlanvolumn != null">f_planvolumn = #{fPlanvolumn},</if>
  351. <if test="fPlanqty != null">f_planqty = #{fPlanqty},</if>
  352. <if test="fPlangrossweight != null">f_plangrossweight = #{fPlangrossweight},</if>
  353. <if test="fPlannetweight != null">f_plannetweight = #{fPlannetweight},</if>
  354. <if test="fVolumn != null">f_volumn = #{fVolumn},</if>
  355. <if test="fQty != null">f_qty = #{fQty},</if>
  356. <if test="fGrossweight != null">f_grossweight = #{fGrossweight},</if>
  357. <if test="fNetweight != null">f_netweight = #{fNetweight},</if>
  358. <if test="fCntrno != null">f_cntrno = #{fCntrno},</if>
  359. <if test="fTruckno != null">f_truckno = #{fTruckno},</if>
  360. <if test="fMarks != null">f_marks = #{fMarks},</if>
  361. <if test="fBillstatus != null and fBillstatus != ''">f_billstatus = #{fBillstatus},</if>
  362. <if test="delFlag != null">del_flag = #{delFlag},</if>
  363. <if test="createBy != null">create_by = #{createBy},</if>
  364. <if test="createTime != null">create_time = #{createTime},</if>
  365. <if test="updateBy != null">update_by = #{updateBy},</if>
  366. <if test="updateTime != null">update_time = #{updateTime},</if>
  367. <if test="remark != null">remark = #{remark},</if>
  368. <if test="fInventoryDays != null">f_inventory_days = #{fInventoryDays},</if>
  369. <if test="fStorageFeeDeadline != null">f_storage_fee_deadline = #{fStorageFeeDeadline},</if>
  370. <if test="fAmt != null">f_amt = #{fAmt},</if>
  371. <if test="fBillingDays != null">f_billing_days = #{fBillingDays},</if>
  372. <if test="fDriverName != null">f_driver_name = #{fDriverName},</if>
  373. <if test="fDriverTel != null">f_driver_tel = #{fDriverTel},</if>
  374. <if test="fDriverIdCar != null">f_driver_id_car = #{fDriverIdCar},</if>
  375. <if test="fSerialNumber != null">f_serial_number = #{fSerialNumber},</if>
  376. <if test="fIsPass != null">f_is_pass = #{fIsPass},</if>
  377. <if test="fBilltype != null">f_billtype = #{fBilltype},</if>
  378. <if test="fBillingQty != null">f_billing_qty = #{fBillingQty},</if>
  379. <if test="fBillingDeadline != null">f_billing_deadline = #{fBillingDeadline},</if>
  380. <if test="fBusinessType != null">f_business_type = #{fBusinessType},</if>
  381. <if test="fIsInventory != null">f_is_inventory = #{fIsInventory},</if>
  382. <if test="fWarehouseInformation != null">f_warehouse_information = #{fWarehouseInformation},</if>
  383. <if test="fOrgwarehouseInformation != null">f_orgwarehouse_information = #{fOrgwarehouseInformation},</if>
  384. <if test="fLabour != null">f_labour = #{fLabour},</if>
  385. <if test="fFleet != null">f_fleet = #{fFleet},</if>
  386. <if test="fStevedore != null">f_stevedore = #{fStevedore},</if>
  387. <if test="fLntype != null">f_lntype = #{fLntype},</if>
  388. <if test="fForkliftman != null">f_forkliftman = #{fForkliftman},</if>
  389. <if test="fLocalcntrno != null">f_localcntrno = #{fLocalcntrno},</if>
  390. <if test="fSealno != null">f_sealno = #{fSealno},</if>
  391. </trim>
  392. where f_id = #{fId}
  393. </update>
  394. <update id="agreementApprovalRejected" parameterType="TWarehousebillsitems">
  395. UPDATE
  396. t_warehousebillsitems
  397. SET f_storage_fee_deadline = null, f_chargedate = #{fChargedate}
  398. WHERE
  399. f_id = #{fId}
  400. </update>
  401. <delete id="deleteTWarehousebillsitemsById" parameterType="Long">
  402. delete from t_warehousebillsitems where f_id = #{fId}
  403. </delete>
  404. <delete id="deleteTWarehousebillsitemsByIds" parameterType="String">
  405. delete from t_warehousebillsitems where f_id in
  406. <foreach item="fId" collection="array" open="(" separator="," close=")">
  407. #{fId}
  408. </foreach>
  409. </delete>
  410. <delete id="deleteByFPid" parameterType="Long">
  411. delete from t_warehousebillsitems where f_pid = #{fId}
  412. </delete>
  413. <select id="selectStorageFeeItemList" parameterType="com.ruoyi.warehouseBusiness.domain.TWarehouseBills"
  414. resultType="Map">
  415. SELECT
  416. item.f_id AS fId,
  417. item.f_billno AS fBillno,
  418. item.f_goodsid AS fGoodsid,
  419. item.f_bsdate AS fBsdate,
  420. item.f_billingway AS fBillingway,
  421. item.f_chargedate AS fChargedate,
  422. item.f_originalbilldate AS fOriginalbilldate,
  423. item.f_mblno AS fMblno,
  424. item.f_volumn AS fVolumn,
  425. item.f_marks AS fMarks,
  426. item.f_billing_days AS fBillingDays,
  427. item.f_is_inventory AS fIsInventory,
  428. item.f_qty AS fQty,
  429. item.f_orgwarehouse_information AS fOrgwarehouseInformation,
  430. item.f_grossweight AS fGrossweight,
  431. item.f_netweight AS fNetweight,
  432. item.f_billtype AS fBilltype,
  433. goods.f_typeid AS fTypeid,
  434. goods.f_name AS fGoodsids
  435. FROM
  436. t_warehousebills ware
  437. LEFT JOIN t_warehousebillsitems item ON item.f_pid = ware.f_id
  438. LEFT JOIN t_goods goods ON goods.f_id = item.f_goodsid
  439. LEFT JOIN t_warehouse wa ON wa.f_id = ware.f_warehouseid
  440. <where>
  441. ware.f_corpid = #{warehouse.fCorpid}
  442. and ware.f_billtype in ("HQZY", "SJCK")
  443. and wa.f_charg = 1
  444. and item.f_billstatus = 40
  445. and item.f_storage_fee_deadline IS NULL
  446. and item.f_chargedate &lt; #{warehouse.fBillingDeadline}
  447. <if test="warehouse.fGoodsid != null">and item.f_goodsid = #{warehouse.fGoodsid}</if>
  448. <if test="warehouse.fMblno != null">and ware.f_mblno = #{warehouse.fMblno}</if>
  449. </where>
  450. </select>
  451. <select id="warehousebillsitemsWarehouselocidSize" resultType="java.lang.Integer">
  452. SELECT
  453. COUNT( 1 )
  454. FROM
  455. t_warehousebillsitems
  456. WHERE
  457. f_warehouselocid = #{fWarehouselocid}
  458. </select>
  459. <select id="inStock" resultType="java.lang.Integer">
  460. SELECT
  461. COUNT(f_id)
  462. FROM
  463. t_warehousebillsitems
  464. WHERE
  465. f_billtype = 'SJRK'
  466. AND
  467. f_billstatus in (20,30)
  468. </select>
  469. <select id="outStock" resultType="java.lang.Integer">
  470. SELECT
  471. COUNT(f_id)
  472. FROM
  473. t_warehousebillsitems
  474. WHERE
  475. f_billtype = 'SJCK'
  476. AND
  477. f_billstatus in (20,30)
  478. </select>
  479. <select id="monthInStock" resultType="java.lang.Integer">
  480. SELECT
  481. COUNT(f_id)
  482. FROM
  483. t_warehousebillsitems
  484. WHERE
  485. f_billtype = 'SJRK'
  486. AND
  487. f_billstatus =40
  488. AND
  489. f_bsdate &gt;= #{timeInterval[0]}
  490. AND
  491. f_bsdate &lt;= #{timeInterval[1]}
  492. </select>
  493. <select id="monthOutStock" resultType="java.lang.Integer">
  494. SELECT
  495. COUNT(f_id)
  496. FROM
  497. t_warehousebillsitems
  498. WHERE
  499. f_billtype = 'SJCK'
  500. AND
  501. f_billstatus =40
  502. AND
  503. f_bsdate &gt;= #{timeInterval[0]}
  504. AND
  505. f_bsdate &lt;= #{timeInterval[1]}
  506. </select>
  507. <select id="selectWarehouseBusinesInList" resultType="java.util.Map">
  508. SELECT
  509. items.f_id AS fId,
  510. items.f_pid AS fPid,
  511. c.f_name AS fName,
  512. items.f_mblno AS fMblno,
  513. items.f_bsdate AS fBsdate,
  514. items.f_is_pass AS fIsPass,
  515. CASE
  516. WHEN items.f_billstatus = 20 THEN
  517. '待入库'
  518. WHEN items.f_billstatus = 30 THEN
  519. '入库中'
  520. END AS fBillstatus,
  521. g.f_name AS fGoodsid,
  522. items.f_driver_tel AS fDriverTel,
  523. dict.dict_label AS fBusinessType,
  524. items.f_marks AS fMarks,
  525. items.f_warehouse_information AS fWarehouseInformation,
  526. items.f_qty AS fQty,
  527. items.f_grossweight AS fGrossweight,
  528. items.f_netweight AS fNetweight
  529. FROM
  530. t_warehousebillsitems items
  531. LEFT JOIN t_warehousebills t ON items.f_pid = t.f_id
  532. LEFT JOIN t_corps c ON t.f_corpid = c.f_id
  533. LEFT JOIN t_goods g ON items.f_goodsid = g.f_id
  534. LEFT JOIN sys_dict_data dict ON dict.dict_type = 'storage_type'
  535. AND dict.dict_value = items.f_business_type
  536. WHERE
  537. items.f_billtype = 'SJRK'
  538. AND items.f_billstatus IN ( 20, 30 )
  539. <if test="timeStartBsdate != null">AND items.f_bsdate &gt;= #{timeStartBsdate}</if>
  540. <if test="timeEndBsdate != null">AND items.f_bsdate &lt;= #{timeEndBsdate}</if>
  541. <if test="fBillstatus != null">AND items.f_billstatus = #{fBillstatus}</if>
  542. <if test="fMblno != null and fMblno != '' ">AND items.f_mblno like concat('%',#{fMblno},'%') </if>
  543. </select>
  544. <select id="selectWarehouseBusinesOutList" resultType="java.util.Map">
  545. SELECT
  546. items.f_id AS fId,
  547. items.f_pid AS fPid,
  548. c.f_name AS fName,
  549. items.f_mblno AS fMblno,
  550. items.f_bsdate AS fBsdate,
  551. items.f_is_pass AS fIsPass,
  552. CASE
  553. WHEN items.f_billstatus = 20 THEN
  554. '待出库'
  555. WHEN items.f_billstatus = 30 THEN
  556. '出库中'
  557. END AS fBillstatus,
  558. g.f_name AS fGoodsid,
  559. items.f_driver_tel AS fDriverTel,
  560. dict.dict_label AS fBusinessType ,
  561. items.f_marks AS fMarks,
  562. items.f_warehouse_information AS fWarehouseInformation,
  563. items.f_qty AS fQty,
  564. items.f_grossweight AS fGrossweight,
  565. items.f_netweight AS fNetweight
  566. FROM
  567. t_warehousebillsitems items
  568. LEFT JOIN t_warehousebills t ON items.f_pid = t.f_id
  569. LEFT JOIN t_corps c ON t.f_corpid = c.f_id
  570. LEFT JOIN t_goods g ON items.f_goodsid = g.f_id
  571. LEFT JOIN sys_dict_data dict ON dict.dict_type = 'storage_type'
  572. AND dict.dict_value = items.f_business_type
  573. WHERE
  574. items.f_billtype = 'SJCK'
  575. AND items.f_billstatus IN ( 20, 30 )
  576. <if test="timeStartBsdate != null">AND items.f_bsdate &gt;= #{timeStartBsdate}</if>
  577. <if test="timeEndBsdate != null">AND items.f_bsdate &lt;= #{timeEndBsdate}</if>
  578. <if test="fBillstatus != null">AND items.f_billstatus = #{fBillstatus}</if>
  579. <if test="fMblno != null and fMblno != '' ">AND items.f_mblno like concat('%',#{fMblno},'%') </if>
  580. order by items.f_bsdate desc
  581. </select>
  582. <select id="selectWarehouseItemsByPId" parameterType="long" resultType="Map">
  583. SELECT
  584. t.f_id fId,
  585. t.f_pid fPid,
  586. t.f_bsdate bsdate,
  587. corp.f_name corpName,
  588. t.f_mblno fMblno,
  589. stor.dict_label businessType,
  590. t.f_marks marks,
  591. t.f_labour labour,
  592. g.f_name goodsName,
  593. fleet.f_name fleetName,
  594. t.f_warehouse_information warehouseInformation,
  595. t.f_warehouselocid fWarehouselocid,
  596. t.f_truckno truckno,
  597. cntr.f_name cntrtypes,
  598. t.f_cntrtype cntrtype,
  599. t.f_cntqty cntqty,
  600. t.f_cntrno cntrno,
  601. t.f_qty fQty,
  602. t.f_truckno fTruckno,
  603. t.f_driver_name fDriverName,
  604. t.f_originalbilldate fOriginalbilldate,
  605. t.f_grossweight fGrossweight,
  606. t.f_netweight fNetweight,
  607. t.f_driver_tel fDriverTel,
  608. t.f_stevedore fStevedore,
  609. CASE
  610. WHEN t.f_billstatus = '10' THEN '计划'
  611. WHEN t.f_billstatus = '20' 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. WHEN t.f_billstatus = '30' THEN
  614. 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', '转移中', '无')))))
  615. WHEN t.f_billstatus = '40' THEN
  616. 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', '已转移', '无')))))
  617. END billstatus,
  618. t.remark
  619. FROM
  620. t_warehousebills w
  621. LEFT JOIN t_warehousebillsitems t ON w.f_id = t.f_pid
  622. LEFT JOIN sys_dict_data stor ON stor.dict_value = t.f_business_type
  623. AND stor.dict_type = 'storage_type'
  624. LEFT JOIN t_goods g ON g.f_id = t.f_goodsid
  625. LEFT JOIN t_corps fleet ON fleet.f_id = t.f_fleet
  626. LEFT JOIN t_corps corp ON corp.f_id = w.f_corpid
  627. LEFT JOIN t_cntr cntr ON cntr.f_id = t.f_cntrtype
  628. where
  629. t.f_id = #{fId}
  630. </select>
  631. <select id="selectItemFStatusByFPid" resultType="java.lang.Integer">
  632. SELECT
  633. IFNULL( COUNT( w.f_id ), 0 )
  634. FROM
  635. t_warehousebills w
  636. LEFT JOIN t_warehousebillsitems i ON i.f_pid = w.f_id
  637. WHERE
  638. w.f_id = #{fId}
  639. AND i.f_billstatus = 40
  640. </select>
  641. <select id="selectItemQtyByFPid" resultType="com.ruoyi.warehouseBusiness.domain.TWarehousebillsitems">
  642. SELECT
  643. IFNULL( SUM( f_qty ), 0 ) fQty,
  644. IFNULL( SUM( f_grossweight ), 0 ) fGrossweight,
  645. IFNULL( SUM( f_netweight ), 0 ) fNetweight
  646. FROM
  647. t_warehousebillsitems
  648. WHERE
  649. f_pid = #{fPid}
  650. AND f_billstatus = 40
  651. </select>
  652. <select id="selecMinBsDateByFPid" resultType="java.util.Date">
  653. SELECT
  654. MIN( f_bsdate )
  655. FROM
  656. t_warehousebillsitems
  657. WHERE
  658. f_pid = #{fId}
  659. </select>
  660. <update id="warehouseItemFollowUpdate" parameterType="Long">
  661. update
  662. t_warehousebillsitems
  663. SET f_billstatus = IF
  664. ( f_billtype = 'SJCK' || f_billtype = 'SJRK', 40, #{fettle} )
  665. where
  666. f_pid = #{fPid}
  667. </update>
  668. </mapper>