TWarehousebillsitemsMapper.xml 39 KB

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