TWarehousebillsitemsMapper.xml 32 KB

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