TWarehousebillsitemsMapper.xml 46 KB

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