TWarehousebillsfeesMapper.xml 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486
  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.TWarehousebillsfeesMapper">
  6. <resultMap type="TWarehousebillsfees" id="TWarehousebillsfeesResult">
  7. <result property="fId" column="f_id"/>
  8. <result property="fPid" column="f_pid"/>
  9. <result property="fLineno" column="f_lineno"/>
  10. <result property="fCorpid" column="f_corpid"/>
  11. <result property="fFeeid" column="f_feeid"/>
  12. <result property="fFeeunitid" column="f_feeUnitid"/>
  13. <result property="fQty" column="f_qty"/>
  14. <result property="fUnitprice" column="f_unitprice"/>
  15. <result property="fAmount" column="f_amount"/>
  16. <result property="fCurrency" column="f_currency"/>
  17. <result property="fExrate" column="f_exrate"/>
  18. <result property="fTaxrate" column="f_taxrate"/>
  19. <result property="fDc" column="f_dc"/>
  20. <result property="fBillstatus" column="f_billstatus"/>
  21. <result property="fReviewDate" column="f_review_date"/>
  22. <result property="fAccamount" column="f_accamount"/>
  23. <result property="fStatementNo" column="f_statement_no"/>
  24. <result property="fStlamount" column="f_stlamount"/>
  25. <result property="fInvnos" column="f_invnos"/>
  26. <result property="fAccamountDate" column="f_accamount_date"/>
  27. <result property="fInvamount" column="f_invamount"/>
  28. <result property="fStlamountNo" column="f_stlamount_no"/>
  29. <result property="fAskamount" column="f_askamount"/>
  30. <result property="fStatus" column="f_status"/>
  31. <result property="fStlamountDate" column="f_stlamount_date"/>
  32. <result property="delFlag" column="del_flag"/>
  33. <result property="createBy" column="create_by"/>
  34. <result property="createTime" column="create_time"/>
  35. <result property="updateBy" column="update_by"/>
  36. <result property="updateTime" column="update_time"/>
  37. <result property="remark" column="remark"/>
  38. <result property="srcId" column="src_id"/>
  39. <result property="srcBillNo" column="src_bill_no"/>
  40. <result property="fMblno" column="f_mblno"/>
  41. <result property="fProductName" column="f_product_name"/>
  42. <result property="fMarks" column="f_marks"/>
  43. <result property="fChargedate" column="f_chargedate"/>
  44. <result property="fBillingDeadline" column="f_billing_deadline"/>
  45. <result property="fInventoryDays" column="f_inventory_days"/>
  46. <result property="fAmt" column="f_amt"/>
  47. <result property="fBillingDays" column="f_billing_days"/>
  48. <result property="fBillingQty" column="f_billing_qty"/>
  49. <result property="fBilltype" column="f_billtype"/>
  50. <result property="fBillingway" column="f_billingway"/>
  51. <result property="fBsdate" column="f_bsdate"/>
  52. <result property="fOriginalbilldate" column="f_originalbilldate"/>
  53. <result property="fStltypeid" column="f_stltypeid"/>
  54. <result property="fBusinessType" column="f_business_type"/>
  55. <result property="fSrcTypeId" column="f_src_type_id"/>
  56. </resultMap>
  57. <sql id="selectTWarehousebillsfeesVo">
  58. select f_id,
  59. f_pid,
  60. f_lineno,
  61. f_corpid,
  62. f_feeid,
  63. f_feeUnitid,
  64. f_qty,
  65. f_unitprice,
  66. f_amount,
  67. f_currency,
  68. f_exrate,
  69. f_taxrate,
  70. f_dc,
  71. f_billstatus,
  72. f_review_date,
  73. f_statement_no,
  74. f_accamount,
  75. f_stlamount,
  76. f_accamount_date,
  77. f_invnos,
  78. f_invamount,
  79. f_stlamount_no,
  80. f_askamount,
  81. f_status,
  82. f_stlamount_date,
  83. del_flag,
  84. create_by,
  85. create_time,
  86. update_by,
  87. update_time,
  88. remark,
  89. src_id,
  90. src_bill_no,
  91. f_mblno,
  92. f_product_name,
  93. f_marks,
  94. f_chargedate,
  95. f_billing_deadline,
  96. f_inventory_days,
  97. f_amt,
  98. f_billing_days,
  99. f_billing_qty,
  100. f_billtype,
  101. f_billingway,
  102. f_bsdate,
  103. f_originalbilldate,
  104. f_stltypeid,
  105. f_business_type,
  106. f_src_type_id
  107. from t_warehousebillsfees
  108. </sql>
  109. <select id="selectTWarehousebillsfeesList" parameterType="TWarehousebillsfees"
  110. resultMap="TWarehousebillsfeesResult">
  111. <include refid="selectTWarehousebillsfeesVo"/>
  112. <where>
  113. <if test="fPid != null ">and f_pid = #{fPid}</if>
  114. <if test="fLineno != null ">and f_lineno = #{fLineno}</if>
  115. <if test="fCorpid != null ">and f_corpid = #{fCorpid}</if>
  116. <if test="fFeeid != null ">and f_feeid = #{fFeeid}</if>
  117. <if test="fFeeunitid != null ">and f_feeUnitid = #{fFeeunitid}</if>
  118. <if test="fQty != null ">and f_qty = #{fQty}</if>
  119. <if test="fUnitprice != null ">and f_unitprice = #{fUnitprice}</if>
  120. <if test="fAmount != null ">and f_amount = #{fAmount}</if>
  121. <if test="fCurrency != null and fCurrency != ''">and f_currency = #{fCurrency}</if>
  122. <if test="fExrate != null ">and f_exrate = #{fExrate}</if>
  123. <if test="fTaxrate != null ">and f_taxrate = #{fTaxrate}</if>
  124. <if test="fDc != null and fDc != ''">and f_dc = #{fDc}</if>
  125. <if test="fBillstatus != null and fBillstatus != ''">and f_billstatus = #{fBillstatus}</if>
  126. <if test="fReviewDate != null ">and f_review_date = #{fReviewDate}</if>
  127. <if test="fStatementNo != null and fStatementNo != ''">and f_statement_no = #{fStatementNo}</if>
  128. <if test="fAccamount != null ">and f_accamount = #{fAccamount}</if>
  129. <if test="fStlamount != null ">and f_stlamount = #{fStlamount}</if>
  130. <if test="fAccamountDate != null ">and f_accamount_date = #{fAccamountDate}</if>
  131. <if test="fInvnos != null and fInvnos != ''">and f_invnos = #{fInvnos}</if>
  132. <if test="fInvamount != null ">and f_invamount = #{fInvamount}</if>
  133. <if test="fStlamountNo != null and fStlamountNo != ''">and f_stlamount_no = #{fStlamountNo}</if>
  134. <if test="fAskamount != null ">and f_askamount = #{fAskamount}</if>
  135. <if test="fStatus != null and fStatus != ''">and f_status = #{fStatus}</if>
  136. <if test="fStlamountDate != null ">and f_stlamount_date = #{fStlamountDate}</if>
  137. <if test="srcId != null ">and src_id = #{srcId}</if>
  138. <if test="srcBillNo != null and srcBillNo != ''">and src_bill_no = #{srcBillNo}</if>
  139. <if test="fMblno != null and fMblno != ''">and f_mblno = #{fMblno}</if>
  140. <if test="fProductName != null and fProductName != ''">and f_product_name like concat('%', #{fProductName},
  141. '%')
  142. </if>
  143. <if test="fMarks != null and fMarks != ''">and f_marks = #{fMarks}</if>
  144. <if test="fChargedate != null ">and f_chargedate = #{fChargedate}</if>
  145. <if test="fBillingDeadline != null ">and f_billing_deadline = #{fBillingDeadline}</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="fBillingQty != null ">and f_billing_qty = #{fBillingQty}</if>
  150. <if test="fBilltype != null and fBilltype != ''">and f_billtype = #{fBilltype}</if>
  151. <if test="fBillingway != null ">and f_billingway = #{fBillingway}</if>
  152. <if test="fBsdate != null ">and f_bsdate = #{fBsdate}</if>
  153. <if test="fOriginalbilldate != null ">and f_originalbilldate = #{fOriginalbilldate}</if>
  154. <if test="fStltypeid != null">and f_stltypeid = #{fStltypeid},</if>
  155. <if test="fSrcTypeId != null">and f_src_type_id = #{fSrcTypeId},</if>
  156. </where>
  157. </select>
  158. <select id="selectTWarehousebillsfeesById" parameterType="Long" resultMap="TWarehousebillsfeesResult">
  159. <include refid="selectTWarehousebillsfeesVo"/>
  160. where f_id = #{fId}
  161. </select>
  162. <select id="selectTWarehousebillsfeesByPId" parameterType="Long" resultMap="TWarehousebillsfeesResult">
  163. select f_id, f_pid, f_billing_deadline
  164. where f_pid = #{fId}
  165. and f_billtype = 'SJCK'
  166. </select>
  167. <select id="selectWarehousebillsfeesByPId" parameterType="Long" resultMap="TWarehousebillsfeesResult">
  168. <include refid="selectTWarehousebillsfeesVo"/>
  169. where f_pid = #{fId}
  170. </select>
  171. <select id="selectReconciliation" resultType="java.lang.Integer">
  172. SELECT COUNT(d.f_id)
  173. FROM t_fee_do d
  174. LEFT JOIN t_fee f ON d.f_pid = f.f_id
  175. WHERE d.f_srcpid = #{fId}
  176. AND f.f_billtype = 'DZ'
  177. </select>
  178. <select id="selectCharge" resultType="java.lang.Integer">
  179. SELECT COUNT(d.f_id)
  180. FROM t_fee_do d
  181. LEFT JOIN t_fee f ON d.f_pid = f.f_id
  182. WHERE d.f_srcpid = #{fId}
  183. AND f.f_billtype = 'SF'
  184. </select>
  185. <select id="selectPay" resultType="java.lang.Integer">
  186. SELECT COUNT(d.f_id)
  187. FROM t_fee_do d
  188. LEFT JOIN t_fee f ON d.f_pid = f.f_id
  189. WHERE d.f_srcpid = #{fId}
  190. AND f.f_billtype = 'FF'
  191. </select>
  192. <insert id="insertTWarehousebillsfees" parameterType="TWarehousebillsfees" useGeneratedKeys="true"
  193. keyProperty="fId">
  194. insert into t_warehousebillsfees
  195. <trim prefix="(" suffix=")" suffixOverrides=",">
  196. <if test="fPid != null">f_pid,</if>
  197. <if test="fLineno != null">f_lineno,</if>
  198. <if test="fCorpid != null">f_corpid,</if>
  199. <if test="fFeeid != null">f_feeid,</if>
  200. <if test="fFeeunitid != null">f_feeUnitid,</if>
  201. <if test="fQty != null">f_qty,</if>
  202. <if test="fUnitprice != null">f_unitprice,</if>
  203. <if test="fAmount != null">f_amount,</if>
  204. <if test="fCurrency != null">f_currency,</if>
  205. <if test="fExrate != null">f_exrate,</if>
  206. <if test="fTaxrate != null">f_taxrate,</if>
  207. <if test="fDc != null">f_dc,</if>
  208. <if test="fBillstatus != null">f_billstatus,</if>
  209. <if test="fReviewDate != null">f_review_date,</if>
  210. <if test="fStatementNo != null">f_statement_no,</if>
  211. <if test="fAccamount != null">f_accamount,</if>
  212. <if test="fStlamount != null">f_stlamount,</if>
  213. <if test="fAccamountDate != null">f_accamount_date,</if>
  214. <if test="fInvnos != null">f_invnos,</if>
  215. <if test="fInvamount != null">f_invamount,</if>
  216. <if test="fStlamountNo != null">f_stlamount_no,</if>
  217. <if test="fAskamount != null">f_askamount,</if>
  218. <if test="fStatus != null">f_status,</if>
  219. <if test="fStlamountDate != null">f_stlamount_date,</if>
  220. <if test="delFlag != null">del_flag,</if>
  221. <if test="createBy != null">create_by,</if>
  222. <if test="createTime != null">create_time,</if>
  223. <if test="updateBy != null">update_by,</if>
  224. <if test="updateTime != null">update_time,</if>
  225. <if test="remark != null">remark,</if>
  226. <if test="srcId != null">src_id,</if>
  227. <if test="srcBillNo != null">src_bill_no,</if>
  228. <if test="fMblno != null">f_mblno,</if>
  229. <if test="fProductName != null">f_product_name,</if>
  230. <if test="fMarks != null">f_marks,</if>
  231. <if test="fChargedate != null">f_chargedate,</if>
  232. <if test="fBillingDeadline != null">f_billing_deadline,</if>
  233. <if test="fInventoryDays != null">f_inventory_days,</if>
  234. <if test="fAmt != null">f_amt,</if>
  235. <if test="fBillingDays != null">f_billing_days,</if>
  236. <if test="fBillingQty != null">f_billing_qty,</if>
  237. <if test="fBilltype != null">f_billtype,</if>
  238. <if test="fBillingway != null">f_billingway,</if>
  239. <if test="fBsdate != null">f_bsdate,</if>
  240. <if test="fOriginalbilldate != null">f_originalbilldate,</if>
  241. <if test="fStltypeid != null">f_stltypeid,</if>
  242. <if test="fBusinessType != null">f_business_type,</if>
  243. <if test="fSrcTypeId != null">f_src_type_id,</if>
  244. </trim>
  245. <trim prefix="values (" suffix=")" suffixOverrides=",">
  246. <if test="fPid != null">#{fPid},</if>
  247. <if test="fLineno != null">#{fLineno},</if>
  248. <if test="fCorpid != null">#{fCorpid},</if>
  249. <if test="fFeeid != null">#{fFeeid},</if>
  250. <if test="fFeeunitid != null">#{fFeeunitid},</if>
  251. <if test="fQty != null">#{fQty},</if>
  252. <if test="fUnitprice != null">#{fUnitprice},</if>
  253. <if test="fAmount != null">#{fAmount},</if>
  254. <if test="fCurrency != null">#{fCurrency},</if>
  255. <if test="fExrate != null">#{fExrate},</if>
  256. <if test="fTaxrate != null">#{fTaxrate},</if>
  257. <if test="fDc != null">#{fDc},</if>
  258. <if test="fBillstatus != null">#{fBillstatus},</if>
  259. <if test="fReviewDate != null">#{fReviewDate},</if>
  260. <if test="fStatementNo != null">#{fStatementNo},</if>
  261. <if test="fAccamount != null">#{fAccamount},</if>
  262. <if test="fStlamount != null">#{fStlamount},</if>
  263. <if test="fAccamountDate != null">#{fAccamountDate},</if>
  264. <if test="fInvnos != null">#{fInvnos},</if>
  265. <if test="fInvamount != null">#{fInvamount},</if>
  266. <if test="fStlamountNo != null">#{fStlamountNo},</if>
  267. <if test="fAskamount != null">#{fAskamount},</if>
  268. <if test="fStatus != null">#{fStatus},</if>
  269. <if test="fStlamountDate != null">#{fStlamountDate},</if>
  270. <if test="delFlag != null">#{delFlag},</if>
  271. <if test="createBy != null">#{createBy},</if>
  272. <if test="createTime != null">#{createTime},</if>
  273. <if test="updateBy != null">#{updateBy},</if>
  274. <if test="updateTime != null">#{updateTime},</if>
  275. <if test="remark != null">#{remark},</if>
  276. <if test="srcId != null">#{srcId},</if>
  277. <if test="srcBillNo != null">#{srcBillNo},</if>
  278. <if test="fMblno != null">#{fMblno},</if>
  279. <if test="fProductName != null">#{fProductName},</if>
  280. <if test="fMarks != null">#{fMarks},</if>
  281. <if test="fChargedate != null">#{fChargedate},</if>
  282. <if test="fBillingDeadline != null">#{fBillingDeadline},</if>
  283. <if test="fInventoryDays != null">#{fInventoryDays},</if>
  284. <if test="fAmt != null">#{fAmt},</if>
  285. <if test="fBillingDays != null">#{fBillingDays},</if>
  286. <if test="fBillingQty != null">#{fBillingQty},</if>
  287. <if test="fBilltype != null">#{fBilltype},</if>
  288. <if test="fBillingway != null">#{fBillingway},</if>
  289. <if test="fBsdate != null">#{fBsdate},</if>
  290. <if test="fOriginalbilldate != null">#{fOriginalbilldate},</if>
  291. <if test="fStltypeid != null">#{fStltypeid},</if>
  292. <if test="fBusinessType != null">#{fBusinessType},</if>
  293. <if test="fSrcTypeId != null">#{fSrcTypeId},</if>
  294. </trim>
  295. </insert>
  296. <update id="updateTWarehousebillsfees" parameterType="TWarehousebillsfees">
  297. update t_warehousebillsfees
  298. <trim prefix="SET" suffixOverrides=",">
  299. <if test="fPid != null">f_pid = #{fPid},</if>
  300. <if test="fLineno != null">f_lineno = #{fLineno},</if>
  301. <if test="fCorpid != null">f_corpid = #{fCorpid},</if>
  302. <if test="fFeeid != null">f_feeid = #{fFeeid},</if>
  303. <if test="fFeeunitid != null">f_feeUnitid = #{fFeeunitid},</if>
  304. <if test="fQty != null">f_qty = #{fQty},</if>
  305. <if test="fUnitprice != null">f_unitprice = #{fUnitprice},</if>
  306. <if test="fAmount != null">f_amount = #{fAmount},</if>
  307. <if test="fCurrency != null">f_currency = #{fCurrency},</if>
  308. <if test="fExrate != null">f_exrate = #{fExrate},</if>
  309. <if test="fTaxrate != null">f_taxrate = #{fTaxrate},</if>
  310. <if test="fDc != null">f_dc = #{fDc},</if>
  311. <if test="fBillstatus != null">f_billstatus = #{fBillstatus},</if>
  312. <if test="fReviewDate != null">f_review_date = #{fReviewDate},</if>
  313. <if test="fStatementNo != null">f_statement_no = #{fStatementNo},</if>
  314. <if test="fAccamount != null">f_accamount = #{fAccamount},</if>
  315. <if test="fStlamount != null">f_stlamount = #{fStlamount},</if>
  316. <if test="fAccamountDate != null">f_accamount_date = #{fAccamountDate},</if>
  317. <if test="fInvnos != null">f_invnos = #{fInvnos},</if>
  318. <if test="fInvamount != null">f_invamount = #{fInvamount},</if>
  319. <if test="fStlamountNo != null">f_stlamount_no = #{fStlamountNo},</if>
  320. <if test="fAskamount != null">f_askamount = #{fAskamount},</if>
  321. <if test="fStatus != null">f_status = #{fStatus},</if>
  322. <if test="fStlamountDate != null">f_stlamount_date = #{fStlamountDate},</if>
  323. <if test="delFlag != null">del_flag = #{delFlag},</if>
  324. <if test="createBy != null">create_by = #{createBy},</if>
  325. <if test="createTime != null">create_time = #{createTime},</if>
  326. <if test="updateBy != null">update_by = #{updateBy},</if>
  327. <if test="updateTime != null">update_time = #{updateTime},</if>
  328. <if test="remark != null">remark = #{remark},</if>
  329. <if test="srcId != null">src_id = #{srcId},</if>
  330. <if test="srcBillNo != null">src_bill_no = #{srcBillNo},</if>
  331. <if test="fMblno != null">f_mblno = #{fMblno},</if>
  332. <if test="fProductName != null">f_product_name = #{fProductName},</if>
  333. <if test="fMarks != null">f_marks = #{fMarks},</if>
  334. <if test="fChargedate != null">f_chargedate = #{fChargedate},</if>
  335. <if test="fBillingDeadline != null">f_billing_deadline = #{fBillingDeadline},</if>
  336. <if test="fInventoryDays != null">f_inventory_days = #{fInventoryDays},</if>
  337. <if test="fAmt != null">f_amt = #{fAmt},</if>
  338. <if test="fBillingDays != null">f_billing_days = #{fBillingDays},</if>
  339. <if test="fBillingQty != null">f_billing_qty = #{fBillingQty},</if>
  340. <if test="fBilltype != null">f_billtype = #{fBilltype},</if>
  341. <if test="fBillingway != null">f_billingway = #{fBillingway},</if>
  342. <if test="fBsdate != null">f_bsdate = #{fBsdate},</if>
  343. <if test="fOriginalbilldate != null">f_originalbilldate = #{fOriginalbilldate},</if>
  344. <if test="fStltypeid != null">f_stltypeid = #{fStltypeid},</if>
  345. <if test="fSrcTypeId != null">f_src_type_id = #{fSrcTypeId},</if>
  346. </trim>
  347. where f_id = #{fId}
  348. </update>
  349. <delete id="deleteTWarehousebillsfeesById" parameterType="Long">
  350. delete
  351. from t_warehousebillsfees
  352. where f_id = #{fId}
  353. </delete>
  354. <delete id="deleteByFPid" parameterType="Long">
  355. delete
  356. from t_warehousebillsfees
  357. where f_pid = #{fId}
  358. </delete>
  359. <delete id="deleteTWarehousebillsfeesByIds" parameterType="String">
  360. delete from t_warehousebillsfees where f_id in
  361. <foreach item="fId" collection="array" open="(" separator="," close=")">
  362. #{fId}
  363. </foreach>
  364. </delete>
  365. <update id="warehouseFeesFollowUpdate">
  366. update
  367. t_warehousebillsfees
  368. <trim prefix="SET" suffixOverrides=",">
  369. <if test="fettle != null">f_billstatus = #{fettle},</if>
  370. <if test="auditItem != null and fettle == 6">f_review_date = #{auditItem},</if>
  371. <if test="auditItem != null and fettle != 6">f_review_date = null,</if>
  372. </trim>
  373. where f_pid = #{fPid}
  374. </update>
  375. <update id="updateTWarehousebillsfee" parameterType="Map">
  376. update t_warehousebillsfees
  377. <trim prefix="SET" suffixOverrides=",">
  378. /*判断确认对账*/
  379. <if test="map.billType == 'DZ'">
  380. f_statement_no = #{map.tFee.fBillno},
  381. f_accamount = f_accamount + #{map.tFeeDo.fAmt},
  382. f_accamount_date = #{map.tFee.fAccbilldate}
  383. </if>
  384. /*判断撤销对账*/
  385. <if test="map.billType == 'DZRevoke'">
  386. f_statement_no = #{map.tFee.fBillno},
  387. f_accamount = f_accamount - #{map.tFeeDo.fAmt},
  388. f_accamount_date = #{map.tFee.fAccbilldate}
  389. </if>
  390. /*判断收付款*/
  391. <if test="map.billType == 'DC'">
  392. f_stlamount_no = #{map.tFee.fBillno},
  393. f_stlamount = f_stlamount + #{map.tFeeDo.fAmt},
  394. f_stlamount_date =#{map.tFee.fAccbilldate}
  395. </if>
  396. /*判断撤销收付款*/
  397. <if test="map.billType == 'DCRevoke'">
  398. f_stlamount_no = #{map.tFee.fBillno},
  399. f_stlamount = f_stlamount - #{map.tFeeDo.fAmt},
  400. f_stlamount_date =#{map.tFee.fAccbilldate}
  401. </if>
  402. </trim>
  403. where f_id = #{map.tFeeDo.fSrcid}
  404. </update>
  405. <select id="selectFeesByPId" parameterType="Long" resultMap="TWarehousebillsfeesResult">
  406. SELECT
  407. tw.f_id,
  408. tw.f_pid,
  409. tw.f_lineno,
  410. tw.f_corpid,
  411. tc.f_name corpName,
  412. tw.f_feeid,
  413. tf.f_name feeName,
  414. tw.f_feeUnitid,
  415. tw.f_qty,
  416. tw.f_unitprice,
  417. tw.f_amount,
  418. tw.f_currency,
  419. tw.f_exrate,
  420. tw.f_taxrate,
  421. tw.f_dc,
  422. tw.f_billstatus,
  423. tw.f_review_date,
  424. tw.f_statement_no,
  425. tw.f_accamount,
  426. tw.f_stlamount,
  427. tw.f_accamount_date,
  428. tw.f_invnos,
  429. tw.f_invamount,
  430. tw.f_stlamount_no,
  431. tw.f_askamount,
  432. tw.f_status,
  433. tw.f_stlamount_date,
  434. tw.del_flag,
  435. tw.create_by,
  436. tw.create_time,
  437. tw.update_by,
  438. tw.update_time,
  439. tw.remark,
  440. tw.src_id,
  441. tw.src_bill_no,
  442. tw.f_mblno,
  443. tw.f_product_name,
  444. tw.f_marks,
  445. tw.f_chargedate,
  446. tw.f_billing_deadline,
  447. tw.f_inventory_days,
  448. tw.f_amt,
  449. tw.f_billing_days,
  450. tw.f_billing_qty,
  451. tw.f_billtype,
  452. tw.f_billingway,
  453. tw.f_bsdate,
  454. tw.f_originalbilldate,
  455. tw.f_stltypeid,
  456. tw.f_business_type,
  457. tw.f_src_type_id
  458. FROM
  459. t_warehousebillsfees tw
  460. LEFT JOIN t_fees tf ON tw.f_feeid = tf.f_id
  461. LEFT JOIN t_corps tc ON tw.f_corpid = tc.f_id
  462. where tw.f_pid = #{fPid}
  463. and tw.f_billtype = 'KHDD'
  464. <if test="fDc != null and fDc != ''">and tw.f_dc = #{fDc}</if>
  465. </select>
  466. <delete id="deleteFessByFPid" parameterType="object">
  467. delete
  468. from t_warehousebillsfees
  469. where f_pid = #{fPid}
  470. <if test="fDc != null and fDc != ''">and f_dc = #{fDc}</if>
  471. </delete>
  472. </mapper>