TWarehousebillsMapper.xml 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537
  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.TWarehouseBillsMapper">
  6. <resultMap type="TWarehousebills" id="TWarehousebillsResult">
  7. <result property="fId" column="f_id" />
  8. <result property="fBillno" column="f_billno" />
  9. <result property="fCustomsdeclartion" column="f_customsdeclartion" />
  10. <result property="fOriginalbillno" column="f_originalbillno" />
  11. <result property="fDeptid" column="f_deptid" />
  12. <result property="fBsdeptid" column="f_bsdeptid" />
  13. <result property="fContacts" column="f_contacts" />
  14. <result property="fTel" column="f_tel" />
  15. <result property="fCorpid" column="f_corpid" />
  16. <result property="fTocorpid" column="f_tocorpid" />
  17. <result property="fStltypeid" column="f_stltypeid" />
  18. <result property="fBscorpno" column="f_bscorpno" />
  19. <result property="fWarehouseid" column="f_warehouseid" />
  20. <result property="fStorekeeper" column="f_storekeeper" />
  21. <result property="fChargedate" column="f_chargedate" />
  22. <result property="fBsdate" column="f_bsdate" />
  23. <result property="fPlanqty" column="f_planqty" />
  24. <result property="fPlangrossweight" column="f_plangrossweight" />
  25. <result property="fPlannetweight" column="f_plannetweight" />
  26. <result property="fPlanvolumn" column="f_planvolumn" />
  27. <result property="fQty" column="f_qty" />
  28. <result property="fGrossweight" column="f_grossweight" />
  29. <result property="fNetweight" column="f_netweight" />
  30. <result property="fVolumn" column="f_volumn" />
  31. <result property="fTrademodeid" column="f_trademodeid" />
  32. <result property="fBillingway" column="f_billingway" />
  33. <result property="fSbu" column="f_sbu" />
  34. <result property="fFeetunit" column="f_feetunit" />
  35. <result property="fMblno" column="f_mblno" />
  36. <result property="fVslvoy" column="f_vslvoy" />
  37. <result property="fMarks" column="f_marks" />
  38. <result property="fEta" column="f_eta" />
  39. <result property="fCustomno" column="f_customno" />
  40. <result property="fIfweigh" column="f_ifweigh" />
  41. <result property="fIfpledge" column="f_ifpledge" />
  42. <result property="fIfdamage" column="f_ifdamage" />
  43. <result property="fBankcorpid" column="f_bankcorpid" />
  44. <result property="fBilltype" column="f_billtype" />
  45. <result property="fBillstatus" column="f_billstatus" />
  46. <result property="delFlag" column="del_flag" />
  47. <result property="createBy" column="create_by" />
  48. <result property="createTime" column="create_time" />
  49. <result property="fItemsStatus" column="f_items_status" />
  50. <result property="updateBy" column="update_by" />
  51. <result property="updateTime" column="update_time" />
  52. <result property="remark" column="remark" />
  53. <result property="fBillingDeadline" column="f_billing_deadline" />
  54. <result property="fProductName" column="f_product_name" />
  55. <result property="fReviewDate" column="f_review_date" />
  56. <result property="fTruckno" column="f_truckno" />
  57. <result property="fDriverName" column="f_driver_name" />
  58. <result property="fDriverTel" column="f_driver_tel" />
  59. <result property="fDriverIdCar" column="f_driver_id_car" />
  60. <result property="fBusinessType" column="f_business_type" />
  61. <result property="fLabour" column="f_labour" />
  62. <result property="fFleet" column="f_fleet" />
  63. <result property="fInwarehouseid" column="f_inwarehouseid" />
  64. </resultMap>
  65. <sql id="selectTWarehousebillsVo">
  66. select f_id, f_billno, f_customsdeclartion, f_originalbillno, f_deptid, f_bsdeptid,
  67. f_contacts, f_tel, f_corpid, f_tocorpid, f_stltypeid, f_bscorpno, f_warehouseid,
  68. f_storekeeper, f_chargedate, f_bsdate, f_planqty, f_plangrossweight, f_plannetweight,
  69. f_planvolumn, f_qty, f_grossweight, f_netweight, f_volumn, f_trademodeid, f_billingway,
  70. f_sbu, f_feetunit, f_mblno, f_vslvoy, f_inwarehouseid, f_marks, f_eta, f_customno, f_ifweigh, f_ifpledge,
  71. f_ifdamage, f_bankcorpid, f_billtype, f_billstatus, del_flag, create_by, create_time,
  72. f_items_status, update_by, update_time, remark, f_billing_deadline, f_product_name,
  73. f_review_date, f_truckno, f_driver_name, f_driver_tel, f_driver_id_car, f_business_type,f_labour,f_fleet from t_warehousebills
  74. </sql>
  75. <select id="selectTWarehousebillsList" parameterType="TWarehousebills" resultMap="TWarehousebillsResult">
  76. select
  77. ware.*
  78. from
  79. t_warehousebills ware
  80. left join sys_user u on ware.create_by = u.user_name
  81. left join sys_dept d on ware.f_bsdeptid = d.dept_id
  82. <where>
  83. <if test="fBillno != null and fBillno != ''">and f_billno = #{fBillno}</if>
  84. <if test="fCustomsdeclartion != null and fCustomsdeclartion != ''">and f_customsdeclartion =
  85. #{fCustomsdeclartion}
  86. </if>
  87. <if test="fOriginalbillno != null and fOriginalbillno != ''">and f_originalbillno = #{fOriginalbillno}</if>
  88. <if test="fDeptid != null ">and f_deptid = #{fDeptid}</if>
  89. <if test="fBsdeptid != null ">and f_bsdeptid = #{fBsdeptid}</if>
  90. <if test="fInwarehouseid != null ">and f_inwarehouseid = #{fInwarehouseid}</if>
  91. <if test="fContacts != null and fContacts != ''">and f_contacts = #{fContacts}</if>
  92. <if test="fTel != null and fTel != ''">and f_tel = #{fTel}</if>
  93. <if test="fCorpid != null ">and f_corpid = #{fCorpid}</if>
  94. <if test="fTocorpid != null ">and f_tocorpid = #{fTocorpid}</if>
  95. <if test="fChargedate != null ">and f_chargedate = #{fChargedate}</if>
  96. <if test='timeInterval != null and timeInterval[0] != null and timeInterval[0]!= ""'>
  97. and f_bsdate &gt;= #{timeInterval[0]}
  98. </if>
  99. <if test='timeInterval != null and timeInterval[1] != null and timeInterval[1]!= ""'>
  100. and f_bsdate &lt;= #{timeInterval[1]}
  101. </if>
  102. <if test="fStltypeid != null ">and f_stltypeid = #{fStltypeid}</if>
  103. <if test="fBscorpno != null and fBscorpno != ''">and f_bscorpno = #{fBscorpno}</if>
  104. <if test="fWarehouseid != null ">and f_warehouseid = #{fWarehouseid}</if>
  105. <if test="fStorekeeper != null and fStorekeeper != ''">and f_storekeeper = #{fStorekeeper}</if>
  106. <if test="fBsdate != null ">and f_bsdate = #{fBsdate}</if>
  107. <if test="fPlanqty != null ">and f_planqty = #{fPlanqty}</if>
  108. <if test="fProductName != null and fProductName != ''"> and f_product_name like concat('%', #{fProductName}, '%')</if>
  109. <if test="fPlangrossweight != null ">and f_plangrossweight = #{fPlangrossweight}</if>
  110. <if test="fPlannetweight != null ">and f_plannetweight = #{fPlannetweight}</if>
  111. <if test="fPlanvolumn != null ">and f_planvolumn = #{fPlanvolumn}</if>
  112. <if test="fQty != null ">and f_qty = #{fQty}</if>
  113. <if test="fMarks != null and fMarks != ''">and f_marks = #{fMarks}</if>
  114. <if test="fGrossweight != null ">and f_grossweight = #{fGrossweight}</if>
  115. <if test="fNetweight != null ">and f_netweight = #{fNetweight}</if>
  116. <if test="fVolumn != null ">and f_volumn = #{fVolumn}</if>
  117. <if test="fTrademodeid != null ">and f_trademodeid = #{fTrademodeid}</if>
  118. <if test="fBillingway != null ">and f_billingway = #{fBillingway}</if>
  119. <if test="fSbu != null ">and f_sbu = #{fSbu}</if>
  120. <if test="fFeetunit != null and fFeetunit != ''">and f_feetunit = #{fFeetunit}</if>
  121. <if test="fMblno != null and fMblno != ''">and f_mblno = #{fMblno}</if>
  122. <if test="fVslvoy != null and fVslvoy != ''">and f_vslvoy = #{fVslvoy}</if>
  123. <if test="fEta != null ">and f_eta = #{fEta}</if>
  124. <if test="fCustomno != null and fCustomno != ''">and f_customno = #{fCustomno}</if>
  125. <if test="fIfweigh != null and fIfweigh != ''">and f_ifweigh = #{fIfweigh}</if>
  126. <if test="fIfpledge != null and fIfpledge != ''">and f_ifpledge = #{fIfpledge}</if>
  127. <if test="fIfdamage != null and fIfdamage != ''">and f_ifdamage = #{fIfdamage}</if>
  128. <if test="fBankcorpid != null ">and f_bankcorpid = #{fBankcorpid}</if>
  129. <if test="fBillingDeadline != null "> and f_billing_deadline = #{fBillingDeadline}</if>
  130. <if test="fBilltype != null and fBilltype != ''">and f_billtype = #{fBilltype}</if>
  131. <if test="fBillstatus != null and fBillstatus != ''">and f_billstatus = #{fBillstatus}</if>
  132. </where>
  133. ${params.dataScope}
  134. </select>
  135. <select id="selectWarehouseBusinessList" parameterType="TWarehousebills" resultType="Map">
  136. SELECT
  137. DISTINCT
  138. bill.f_id AS fId,
  139. corp.f_name AS fCorpid,
  140. corpTo.f_name AS fTocorpid,
  141. bill.f_mblno AS fMblno,
  142. corpSub.f_name AS fSbu,
  143. bill.f_marks AS fMarks,
  144. bill.remark AS remark,
  145. bill.f_planqty AS fPlanqty,
  146. bill.f_plangrossweight AS fPlangrossweight,
  147. bill.f_plannetweight AS fPlannetweight,
  148. bill.f_planvolumn AS fPlanvolumn,
  149. bill.f_bsdate AS fBsdate,
  150. bill.f_trademodeid AS fTrademodeid,
  151. bill.f_truckno AS fTruckno,
  152. bill.f_driver_name AS fDriverName,
  153. bill.f_driver_tel AS fDriverTel,
  154. bill.f_driver_id_car AS fDriverIdCar,
  155. bill.f_business_type AS fBusinessType,
  156. ware.f_name AS fWarehouseid,
  157. bill.f_qty AS fQty,
  158. bill.f_netweight AS fNetweight,
  159. bill.create_time AS createTime,
  160. bill.f_inwarehouseid AS fInwarehouseid,
  161. bill.create_by AS createBy,
  162. bill.f_grossweight AS fGrossweight,
  163. bill.f_product_name AS fProductName,
  164. bill.f_billing_deadline AS fBillingDeadline,
  165. bill.f_billstatus AS fBillstatus,
  166. bill.f_items_status AS fItemsStatus,
  167. bill.f_billno AS fBillno
  168. FROM
  169. t_warehousebills bill
  170. left join sys_user u on bill.create_by = u.user_name
  171. left join sys_dept d on bill.f_bsdeptid = d.dept_id
  172. LEFT JOIN t_corps corp ON corp.f_id = bill.f_corpid
  173. LEFT JOIN t_corps corpTo ON corpTo.f_id = bill.f_tocorpid
  174. LEFT JOIN t_corps corpSub ON corpSub.f_id = bill.f_sbu
  175. LEFT JOIN t_warehouse ware ON ware.f_id = bill.f_warehouseid
  176. LEFT JOIN t_warehousebillsitems item ON item.f_pid = bill.f_id
  177. LEFT JOIN t_goods goods ON goods.f_id = item.f_goodsid
  178. <where>
  179. <if test="fBillno != null and fBillno != ''">and bill.f_billno like concat('%', #{fBillno}, '%')</if>
  180. <if test="fCustomsdeclartion != null and fCustomsdeclartion != ''">and bill.f_customsdeclartion =
  181. #{fCustomsdeclartion}
  182. </if>
  183. <if test="fOriginalbillno != null and fOriginalbillno != ''">and bill.f_originalbillno =
  184. #{fOriginalbillno}
  185. </if>
  186. <if test="fDeptid != null ">and bill.f_deptid = #{fDeptid}</if>
  187. <if test="fInwarehouseid != null ">and bill.f_inwarehouseid = #{fInwarehouseid}</if>
  188. <if test="fBsdeptid != null ">and bill.f_bsdeptid = #{fBsdeptid}</if>
  189. <if test="fChargedate != null ">and bill.f_chargedate = #{fChargedate}</if>
  190. <if test='timeInterval != null and timeInterval[0] != null and timeInterval[0]!= ""'>
  191. and bill.f_bsdate &gt;= #{timeInterval[0]}
  192. </if>
  193. <if test='timeInterval != null and timeInterval[1] != null and timeInterval[1]!= ""'>
  194. and bill.f_bsdate &lt;= #{timeInterval[1]}
  195. </if>
  196. <if test="fGoodsid != null and fGoodsid != ''">and item.f_goodsid = #{fGoodsid}</if>
  197. <if test="fContacts != null and fContacts != ''">and bill.f_contacts = #{fContacts}</if>
  198. <if test="fTel != null and fTel != ''">and bill.f_tel = #{fTel}</if>
  199. <if test="fCorpid != null ">and bill.f_corpid = #{fCorpid}</if>
  200. <if test="fBillingDeadline != null ">and bill.f_billing_deadline = #{fBillingDeadline}</if>
  201. <if test="fTocorpid != null ">and bill.f_tocorpid = #{fTocorpid}</if>
  202. <if test="fMarks != null and fMarks != ''">and bill.f_marks like concat('%', #{fMarks}, '%')</if>
  203. <if test="fStltypeid != null ">and bill.f_stltypeid = #{fStltypeid}</if>
  204. <if test="fReviewDate != null "> and f_review_date = #{fReviewDate}</if>
  205. <if test="fBscorpno != null and fBscorpno != ''">and bill.f_bscorpno = #{fBscorpno}</if>
  206. <if test="fWarehouseid != null ">and bill.f_warehouseid = #{fWarehouseid}</if>
  207. <if test="fStorekeeper != null and fStorekeeper != ''">and bill.f_storekeeper = #{fStorekeeper}</if>
  208. <if test="fBsdate != null ">and bill.f_bsdate = #{fBsdate}</if>
  209. <if test="fPlanqty != null ">and bill.f_planqty = #{fPlanqty}</if>
  210. <if test="fPlangrossweight != null ">and bill.f_plangrossweight = #{fPlangrossweight}</if>
  211. <if test="fPlannetweight != null ">and bill.f_plannetweight = #{fPlannetweight}</if>
  212. <if test="fPlanvolumn != null ">and bill.f_planvolumn = #{fPlanvolumn}</if>
  213. <if test="fQty != null ">and bill.f_qty = #{fQty}</if>
  214. <if test="fGrossweight != null ">and bill.f_grossweight = #{fGrossweight}</if>
  215. <if test="fNetweight != null ">and bill.f_netweight = #{fNetweight}</if>
  216. <if test="fVolumn != null ">and bill.f_volumn = #{fVolumn}</if>
  217. <if test="fTrademodeid != null ">and bill.f_trademodeid = #{fTrademodeid}</if>
  218. <if test="fBillingway != null ">and bill.f_billingway = #{fBillingway}</if>
  219. <if test="fSbu != null ">and bill.f_sbu = #{fSbu}</if>
  220. <if test="fFeetunit != null and fFeetunit != ''">and bill.f_feetunit = #{fFeetunit}</if>
  221. <if test="fMblno != null and fMblno != ''">and bill.f_mblno like concat('%', #{fMblno}, '%')</if>
  222. <if test="fVslvoy != null and fVslvoy != ''">and bill.f_vslvoy = #{fVslvoy}</if>
  223. <if test="fEta != null ">and bill.f_eta = #{fEta}</if>
  224. <if test="fCustomno != null and fCustomno != ''">and bill.f_customno = #{fCustomno}</if>
  225. <if test="fIfweigh != null and fIfweigh != ''">and bill.f_ifweigh = #{fIfweigh}</if>
  226. <if test="fIfpledge != null and fIfpledge != ''">and bill.f_ifpledge = #{fIfpledge}</if>
  227. <if test="fIfdamage != null and fIfdamage != ''">and bill.f_ifdamage = #{fIfdamage}</if>
  228. <if test="fBankcorpid != null ">and bill.f_bankcorpid = #{fBankcorpid}</if>
  229. <if test="fBilltype != null and fBilltype != ''">and bill.f_billtype = #{fBilltype}</if>
  230. <if test="fBillstatus != null and fBillstatus != ''">and bill.f_billstatus = #{fBillstatus}</if>
  231. <if test="createBy != null and createBy != ''">and bill.create_by = #{createBy}</if>
  232. </where>
  233. ${params.dataScope}
  234. </select>
  235. <select id="selectTWarehousebillsById" parameterType="Long" resultMap="TWarehousebillsResult">
  236. <include refid="selectTWarehousebillsVo"/>
  237. where f_id = #{fId}
  238. ORDER BY f_bsdate desc
  239. </select>
  240. <select id="selectTWarehousebillsItemsList"
  241. resultType="com.ruoyi.warehouseBusiness.domain.TWareHouseExcelItems">
  242. SELECT
  243. ( @ii := @ii + 1 ) AS fId,
  244. wi.src_bill_no AS fMblno,
  245. CASE
  246. wi.f_billtype
  247. WHEN 'SJRK' THEN
  248. '入库'
  249. WHEN 'SJCK' THEN
  250. '出库'
  251. WHEN 'KCZZ' THEN
  252. '库存总账'
  253. END AS fBilltype,
  254. wi.f_product_name AS fGoodsid,
  255. wi.f_marks AS fMarks,
  256. /*'' AS fBillingQty1,*/
  257. wi.f_billing_qty AS fBillingQty,
  258. /*'' AS fBillingQty2,*/
  259. wi.f_bsdate AS fBsdate,
  260. /*'' AS fBsdate1,*/
  261. wi.f_inventory_days AS fInventoryDays,
  262. wi.f_billing_days AS fBillingDays,
  263. wi.f_amt AS fAmt,
  264. /*'' AS fAmt1,*/
  265. wi.f_amt AS fAmt2
  266. FROM
  267. t_warehousebills w
  268. LEFT JOIN t_warehousebillsfees wi ON w.f_id = wi.f_pid
  269. ,(
  270. SELECT
  271. @ii := 0
  272. ) AS ii
  273. WHERE
  274. w.f_id = #{fId}
  275. </select>
  276. <select id="selectInventoryList" parameterType="TWarehousebills" resultType="java.util.Map">
  277. SELECT
  278. co.f_name AS fName,
  279. it.f_bsdate AS fBsdate,
  280. leg.f_mblno AS fMblno,
  281. it.f_business_type AS fBusinessType,
  282. dict.dict_label AS fBusinessTypes,
  283. it.f_marks AS fMarks ,
  284. go.f_name AS fGoodsName,
  285. area.f_name AS fWarehouseLocationids,
  286. leg.f_trademodeid AS fTrademodeid,
  287. it.f_qty AS fQty,
  288. it.f_grossweight AS fGrossweight,
  289. it.f_netweight AS fNetweight
  290. FROM
  291. t_warehousebills leg
  292. LEFT JOIN t_warehousebillsitems it ON leg.f_id = it.f_pid
  293. LEFT JOIN t_goods go ON it.f_goodsid = go.f_id
  294. LEFT JOIN t_corps co ON leg.f_corpid = co.f_id
  295. LEFT JOIN sys_dict_data dict ON dict.dict_value = it.f_business_type
  296. LEFT JOIN t_warehouse_area area ON area.f_id = it.f_warehouselocid
  297. <where>
  298. dict.status = '0'
  299. AND dict.dict_type = 'storage_type'
  300. AND leg.f_billtype in ('SJRk','SJCK')
  301. <if test="fBilltype != null">AND leg.f_billtype = #{fBilltype}</if>
  302. <if test="fWarehouseid != null ">and leg.f_warehouseid = #{fWarehouseid}</if>
  303. <if test="fWarehouseid != null ">and it.f_warehouselocid = #{fWarehouseid}</if>
  304. <if test="fGoodsid != null ">and it.f_goodsid = #{fGoodsid}</if>
  305. <if test="fTrademodeid != null ">and leg.f_trademodeid = #{fTrademodeid}</if>
  306. <if test="fCorpid != null ">and leg.f_corpid = #{fCorpid}</if>
  307. <if test="fMblno != null ">and leg.f_mblno = #{fMblno}</if>
  308. </where>
  309. </select>
  310. <insert id="insertTWarehousebills" parameterType="TWarehousebills" useGeneratedKeys="true" keyProperty="fId">
  311. insert into t_warehousebills
  312. <trim prefix="(" suffix=")" suffixOverrides=",">
  313. <if test="fBillno != null">f_billno,</if>
  314. <if test="fCustomsdeclartion != null">f_customsdeclartion,</if>
  315. <if test="fOriginalbillno != null">f_originalbillno,</if>
  316. <if test="fDeptid != null">f_deptid,</if>
  317. <if test="fBsdeptid != null">f_bsdeptid,</if>
  318. <if test="fContacts != null">f_contacts,</if>
  319. <if test="fTel != null">f_tel,</if>
  320. <if test="fCorpid != null">f_corpid,</if>
  321. <if test="fTocorpid != null">f_tocorpid,</if>
  322. <if test="fStltypeid != null">f_stltypeid,</if>
  323. <if test="fBscorpno != null and fBscorpno != ''">f_bscorpno,</if>
  324. <if test="fWarehouseid != null">f_warehouseid,</if>
  325. <if test="fStorekeeper != null">f_storekeeper,</if>
  326. <if test="fChargedate != null">f_chargedate,</if>
  327. <if test="fBsdate != null">f_bsdate,</if>
  328. <if test="fPlanqty != null">f_planqty,</if>
  329. <if test="fPlangrossweight != null">f_plangrossweight,</if>
  330. <if test="fPlannetweight != null">f_plannetweight,</if>
  331. <if test="fPlanvolumn != null">f_planvolumn,</if>
  332. <if test="fQty != null">f_qty,</if>
  333. <if test="fGrossweight != null">f_grossweight,</if>
  334. <if test="fNetweight != null">f_netweight,</if>
  335. <if test="fVolumn != null">f_volumn,</if>
  336. <if test="fTrademodeid != null">f_trademodeid,</if>
  337. <if test="fBillingway != null">f_billingway,</if>
  338. <if test="fSbu != null">f_sbu,</if>
  339. <if test="fFeetunit != null">f_feetunit,</if>
  340. <if test="fMblno != null">f_mblno,</if>
  341. <if test="fVslvoy != null">f_vslvoy,</if>
  342. <if test="fMarks != null and fMarks != ''">f_marks,</if>
  343. <if test="fEta != null">f_eta,</if>
  344. <if test="fCustomno != null">f_customno,</if>
  345. <if test="fIfweigh != null">f_ifweigh,</if>
  346. <if test="fIfpledge != null">f_ifpledge,</if>
  347. <if test="fIfdamage != null">f_ifdamage,</if>
  348. <if test="fBankcorpid != null">f_bankcorpid,</if>
  349. <if test="fBilltype != null">f_billtype,</if>
  350. <if test="fBillstatus != null">f_billstatus,</if>
  351. <if test="delFlag != null">del_flag,</if>
  352. <if test="createBy != null">create_by,</if>
  353. <if test="createTime != null">create_time,</if>
  354. <if test="fItemsStatus != null">f_items_status,</if>
  355. <if test="updateBy != null">update_by,</if>
  356. <if test="updateTime != null">update_time,</if>
  357. <if test="remark != null">remark,</if>
  358. <if test="fBillingDeadline != null">f_billing_deadline,</if>
  359. <if test="fProductName != null">f_product_name,</if>
  360. <if test="fReviewDate != null">f_review_date,</if>
  361. <if test="fTruckno != null">f_truckno,</if>
  362. <if test="fDriverName != null">f_driver_name,</if>
  363. <if test="fDriverTel != null">f_driver_tel,</if>
  364. <if test="fDriverIdCar != null">f_driver_id_car,</if>
  365. <if test="fBusinessType != null">f_business_type,</if>
  366. <if test="fLabour != null">f_labour,</if>
  367. <if test="fFleet != null">f_fleet,</if>
  368. <if test="fInwarehouseid != null">f_inwarehouseid,</if>
  369. </trim>
  370. <trim prefix="values (" suffix=")" suffixOverrides=",">
  371. <if test="fBillno != null">#{fBillno},</if>
  372. <if test="fCustomsdeclartion != null">#{fCustomsdeclartion},</if>
  373. <if test="fOriginalbillno != null">#{fOriginalbillno},</if>
  374. <if test="fDeptid != null">#{fDeptid},</if>
  375. <if test="fBsdeptid != null">#{fBsdeptid},</if>
  376. <if test="fContacts != null">#{fContacts},</if>
  377. <if test="fTel != null">#{fTel},</if>
  378. <if test="fCorpid != null">#{fCorpid},</if>
  379. <if test="fTocorpid != null">#{fTocorpid},</if>
  380. <if test="fStltypeid != null">#{fStltypeid},</if>
  381. <if test="fBscorpno != null and fBscorpno != ''">#{fBscorpno},</if>
  382. <if test="fWarehouseid != null">#{fWarehouseid},</if>
  383. <if test="fStorekeeper != null">#{fStorekeeper},</if>
  384. <if test="fChargedate != null">#{fChargedate},</if>
  385. <if test="fBsdate != null">#{fBsdate},</if>
  386. <if test="fPlanqty != null">#{fPlanqty},</if>
  387. <if test="fPlangrossweight != null">#{fPlangrossweight},</if>
  388. <if test="fPlannetweight != null">#{fPlannetweight},</if>
  389. <if test="fPlanvolumn != null">#{fPlanvolumn},</if>
  390. <if test="fQty != null">#{fQty},</if>
  391. <if test="fGrossweight != null">#{fGrossweight},</if>
  392. <if test="fNetweight != null">#{fNetweight},</if>
  393. <if test="fVolumn != null">#{fVolumn},</if>
  394. <if test="fTrademodeid != null">#{fTrademodeid},</if>
  395. <if test="fBillingway != null">#{fBillingway},</if>
  396. <if test="fSbu != null">#{fSbu},</if>
  397. <if test="fFeetunit != null">#{fFeetunit},</if>
  398. <if test="fMblno != null">#{fMblno},</if>
  399. <if test="fVslvoy != null">#{fVslvoy},</if>
  400. <if test="fMarks != null and fMarks != ''">#{fMarks},</if>
  401. <if test="fEta != null">#{fEta},</if>
  402. <if test="fCustomno != null">#{fCustomno},</if>
  403. <if test="fIfweigh != null">#{fIfweigh},</if>
  404. <if test="fIfpledge != null">#{fIfpledge},</if>
  405. <if test="fIfdamage != null">#{fIfdamage},</if>
  406. <if test="fBankcorpid != null">#{fBankcorpid},</if>
  407. <if test="fBilltype != null">#{fBilltype},</if>
  408. <if test="fBillstatus != null">#{fBillstatus},</if>
  409. <if test="delFlag != null">#{delFlag},</if>
  410. <if test="createBy != null">#{createBy},</if>
  411. <if test="createTime != null">#{createTime},</if>
  412. <if test="fItemsStatus != null">#{fItemsStatus},</if>
  413. <if test="updateBy != null">#{updateBy},</if>
  414. <if test="updateTime != null">#{updateTime},</if>
  415. <if test="remark != null">#{remark},</if>
  416. <if test="fBillingDeadline != null">#{fBillingDeadline},</if>
  417. <if test="fProductName != null">#{fProductName},</if>
  418. <if test="fReviewDate != null">#{fReviewDate},</if>
  419. <if test="fTruckno != null">#{fTruckno},</if>
  420. <if test="fDriverName != null">#{fDriverName},</if>
  421. <if test="fDriverTel != null">#{fDriverTel},</if>
  422. <if test="fDriverIdCar != null">#{fDriverIdCar},</if>
  423. <if test="fBusinessType != null">#{fBusinessType},</if>
  424. <if test="fLabour != null">#{fLabour},</if>
  425. <if test="fFleet != null">#{fFleet},</if>
  426. <if test="fInwarehouseid != null">#{fInwarehouseid},</if>
  427. </trim>
  428. </insert>
  429. <update id="updateTWarehousebills" parameterType="TWarehousebills">
  430. update t_warehousebills
  431. <trim prefix="SET" suffixOverrides=",">
  432. <if test="fBillno != null">f_billno = #{fBillno},</if>
  433. <if test="fCustomsdeclartion != null">f_customsdeclartion = #{fCustomsdeclartion},</if>
  434. <if test="fOriginalbillno != null">f_originalbillno = #{fOriginalbillno},</if>
  435. <if test="fDeptid != null">f_deptid = #{fDeptid},</if>
  436. <if test="fBsdeptid != null">f_bsdeptid = #{fBsdeptid},</if>
  437. <if test="fContacts != null">f_contacts = #{fContacts},</if>
  438. <if test="fTel != null">f_tel = #{fTel},</if>
  439. <if test="fCorpid != null">f_corpid = #{fCorpid},</if>
  440. <if test="fTocorpid != null">f_tocorpid = #{fTocorpid},</if>
  441. <if test="fStltypeid != null">f_stltypeid = #{fStltypeid},</if>
  442. <if test="fBscorpno != null and fBscorpno != ''">f_bscorpno = #{fBscorpno},</if>
  443. <if test="fWarehouseid != null">f_warehouseid = #{fWarehouseid},</if>
  444. <if test="fStorekeeper != null">f_storekeeper = #{fStorekeeper},</if>
  445. <if test="fChargedate != null">f_chargedate = #{fChargedate},</if>
  446. <if test="fBsdate != null">f_bsdate = #{fBsdate},</if>
  447. <if test="fPlanqty != null">f_planqty = #{fPlanqty},</if>
  448. <if test="fPlangrossweight != null">f_plangrossweight = #{fPlangrossweight},</if>
  449. <if test="fPlannetweight != null">f_plannetweight = #{fPlannetweight},</if>
  450. <if test="fPlanvolumn != null">f_planvolumn = #{fPlanvolumn},</if>
  451. <if test="fQty != null">f_qty = #{fQty},</if>
  452. <if test="fGrossweight != null">f_grossweight = #{fGrossweight},</if>
  453. <if test="fNetweight != null">f_netweight = #{fNetweight},</if>
  454. <if test="fVolumn != null">f_volumn = #{fVolumn},</if>
  455. <if test="fTrademodeid != null">f_trademodeid = #{fTrademodeid},</if>
  456. <if test="fBillingway != null">f_billingway = #{fBillingway},</if>
  457. <if test="fSbu != null">f_sbu = #{fSbu},</if>
  458. <if test="fFeetunit != null">f_feetunit = #{fFeetunit},</if>
  459. <if test="fMblno != null">f_mblno = #{fMblno},</if>
  460. <if test="fVslvoy != null">f_vslvoy = #{fVslvoy},</if>
  461. <if test="fMarks != null and fMarks != ''">f_marks = #{fMarks},</if>
  462. <if test="fEta != null">f_eta = #{fEta},</if>
  463. <if test="fCustomno != null">f_customno = #{fCustomno},</if>
  464. <if test="fIfweigh != null">f_ifweigh = #{fIfweigh},</if>
  465. <if test="fIfpledge != null">f_ifpledge = #{fIfpledge},</if>
  466. <if test="fIfdamage != null">f_ifdamage = #{fIfdamage},</if>
  467. <if test="fBankcorpid != null">f_bankcorpid = #{fBankcorpid},</if>
  468. <if test="fBilltype != null">f_billtype = #{fBilltype},</if>
  469. <if test="fBillstatus != null">f_billstatus = #{fBillstatus},</if>
  470. <if test="delFlag != null">del_flag = #{delFlag},</if>
  471. <if test="createBy != null">create_by = #{createBy},</if>
  472. <if test="createTime != null">create_time = #{createTime},</if>
  473. <if test="fItemsStatus != null">f_items_status = #{fItemsStatus},</if>
  474. <if test="updateBy != null">update_by = #{updateBy},</if>
  475. <if test="updateTime != null">update_time = #{updateTime},</if>
  476. <if test="remark != null">remark = #{remark},</if>
  477. <if test="fBillingDeadline != null">f_billing_deadline = #{fBillingDeadline},</if>
  478. <if test="fProductName != null">f_product_name = #{fProductName},</if>
  479. <if test="fReviewDate != null">f_review_date = #{fReviewDate},</if>
  480. <if test="fTruckno != null">f_truckno = #{fTruckno},</if>
  481. <if test="fDriverName != null">f_driver_name = #{fDriverName},</if>
  482. <if test="fDriverTel != null">f_driver_tel = #{fDriverTel},</if>
  483. <if test="fDriverIdCar != null">f_driver_id_car = #{fDriverIdCar},</if>
  484. <if test="fBusinessType != null">f_business_type = #{fBusinessType},</if>
  485. <if test="fReviewDate == null">f_review_date = null,</if>
  486. <if test="fLabour != null">f_labour = #{fLabour },</if>
  487. <if test="fFleet != null">f_fleet = #{fFleet},</if>
  488. <if test="fInwarehouseid != null">f_inwarehouseid = #{fInwarehouseid},</if>
  489. </trim>
  490. where f_id = #{fId}
  491. </update>
  492. <delete id="deleteTWarehousebillsById" parameterType="Long">
  493. delete from t_warehousebills where f_id = #{fId}
  494. </delete>
  495. <delete id="deleteTWarehousebillsByIds" parameterType="String">
  496. delete
  497. item.*,
  498. bill.*,
  499. fess.*,
  500. enclosure.*
  501. from
  502. t_warehousebills bill
  503. LEFT JOIN t_warehousebillsfees fess ON fess.f_pid = bill.f_id
  504. LEFT JOIN t_enclosure enclosure ON enclosure.f_pid = bill.f_id
  505. LEFT JOIN t_warehousebillsitems item ON item.f_pid = bill.f_id
  506. where
  507. bill.f_id in
  508. <foreach item="fId" collection="array" open="(" separator="," close=")">
  509. #{fId}
  510. </foreach>
  511. </delete>
  512. <update id="warehouseFollowUpdate">
  513. update
  514. t_warehousebills
  515. <trim prefix="SET" suffixOverrides=",">
  516. <if test="fettle != null">f_billstatus = #{fettle},</if>
  517. <if test="auditItem != null and fettle == 6">f_review_date = #{auditItem},</if>
  518. <if test="auditItem != null and fettle != 6">f_review_date = null,</if>
  519. </trim>
  520. where f_id = #{fPid}
  521. </update>
  522. </mapper>