AccountRequestFundsDetailMapper.xml 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.fjhx.account.mapper.account.AccountRequestFundsDetailMapper">
  4. <select id="getPage" resultType="com.fjhx.account.entity.account.vo.AccountRequestFundsDetailVo">
  5. select arfd.id,
  6. arfd.account_request_funds_id,
  7. arfd.cost_type,
  8. arfd.amount,
  9. arfd.remarks,
  10. arfd.create_user,
  11. arfd.create_time,
  12. arfd.update_user,
  13. arfd.update_time
  14. from account_request_funds_detail arfd
  15. ${ew.customSqlSegment}
  16. </select>
  17. <select id="getListByContractId" resultType="com.fjhx.account.entity.account.vo.AccountRequestFundsDetailVo">
  18. SELECT t2.rate,
  19. t2.currency,
  20. t1.*
  21. FROM account_request_funds_detail t1
  22. LEFT JOIN account_request_funds t2 ON t1.account_request_funds_id = t2.id
  23. LEFT JOIN account_payment t3 ON t2.id = t3.business_id
  24. WHERE t1.contract_id = #{contractId}
  25. AND t3.`status` = 10
  26. </select>
  27. <select id="getListByContractIds" resultType="com.fjhx.account.entity.account.vo.AccountRequestFundsDetailVo">
  28. SELECT
  29. t2.rate,
  30. t2.currency,
  31. t1.*
  32. FROM
  33. account_request_funds_detail t1
  34. LEFT JOIN account_request_funds t2 ON t1.account_request_funds_id = t2.id
  35. LEFT JOIN account_payment t3 ON t2.id = t3.business_id
  36. <where>
  37. t3.`status` = 10
  38. <if test="contractIds neq null and contractIds.size() > 0">
  39. <foreach collection="contractIds" item="contractId" open="AND t1.contract_id IN (" separator=","
  40. close=")">
  41. #{contractId}
  42. </foreach>
  43. </if>
  44. </where>
  45. </select>
  46. <select id="listByAccountRequestFundsId"
  47. resultType="com.fjhx.account.entity.account.vo.AccountRequestFundsDetailVo">
  48. SELECT arfd.*,
  49. sc.`code` contractCode
  50. FROM account_request_funds_detail arfd
  51. LEFT JOIN bytesailing_jxst.sales_contract sc ON arfd.contract_id = sc.id
  52. WHERE arfd.account_request_funds_id = #{accountRequestFundsId}
  53. </select>
  54. <select id="getList" resultType="com.fjhx.account.entity.account.vo.AccountRequestFundsDetailVo">
  55. SELECT fd.*,
  56. sc.code contractCode
  57. FROM account_request_funds_detail fd
  58. LEFT JOIN bytesailing_jxst.sales_contract sc ON fd.contract_id = sc.id
  59. ${ew.customSqlSegment}
  60. </select>
  61. </mapper>