AccountMaintenance.xml 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  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.fuzamei.mapperInterface.AccountMaintenanceMapper">
  4. <!--查询账户开立信息维护 列表-->
  5. <select id="selectAccountMaintenanceInfo" parameterType="java.util.Map" resultType="com.fuzamei.entity.AccountOpeningRecord">
  6. select DISTINCT
  7. customer_id,
  8. customer_name,
  9. bank_account,
  10. f.attachment_name as basic_data_id,
  11. f.url as basicUrl,
  12. f1.attachment_name as letter_of_commitment_id,
  13. f1.url as letterUrl,
  14. f2.attachment_name as application_id,
  15. f2.url as applicationUrl,
  16. update_time,
  17. s.status_name
  18. from
  19. account_opening_record a
  20. LEFT JOIN attachment f
  21. on a.basic_data_id=f.attachment_id
  22. LEFT JOIN attachment f1
  23. on a.letter_of_commitment_id = f1.attachment_id
  24. LEFT JOIN attachment f2
  25. on a.application_id= f2.attachment_id
  26. LEFT JOIN status s
  27. on a.status_id = s.status_id
  28. <where>
  29. <if test="customer_name!='' and customer_name!=null ">
  30. customer_name=#{customer_name}
  31. </if>
  32. <if test="bank_account!='' and bank_account!=null">
  33. and bank_account=#{bank_account}
  34. </if>
  35. <if test="startTime!=null and endTime!=null">
  36. and a.update_time between #{startTime} and #{endTime}
  37. </if>
  38. </where>
  39. order by update_time desc
  40. limit #{startPage},#{rowNum}
  41. </select>
  42. <!--查询账户维护开立信息总页数 返回一个int类型 待条件查询出来的也要分页-->
  43. <select id="selectCountAccountMaintenancePage" resultType="int">
  44. select count(*) from account_opening_record
  45. <where>
  46. <if test="customer_name!='' and customer_name!=null ">
  47. customer_name=#{customer_name}
  48. </if>
  49. <if test="bank_account!='' and bank_account!=null">
  50. and bank_account=#{bank_account}
  51. </if>
  52. <if test="startTime!=null and endTime!=null">
  53. and update_time between #{startTime} and #{endTime}
  54. </if>
  55. </where>
  56. </select>
  57. <!-- 添加上传账户维护信息表 添加到账户维护开立表 -->
  58. <insert id="insertIntoAccountMaintenanceInfo" parameterType="java.util.Map">
  59. insert into account_opening_record(
  60. customer_id,
  61. customer_name,
  62. bank_account,
  63. basic_data_id,
  64. letter_of_commitment_id,
  65. application_id,
  66. update_time,
  67. status_id,
  68. hash)
  69. values(
  70. #{customer_id},
  71. #{customer_name},
  72. #{bank_account},
  73. #{basicAttachment_id},
  74. #{letterAttachment_id},
  75. #{applicationAttachment_id},
  76. #{update_time},
  77. #{status_id},
  78. #{hash})
  79. </insert>
  80. <!-- 上传其他凭证,承诺书,开户申请书 经办支行添加创建账号和客户名称 上传到附件表-->
  81. <insert id="insertAccountMaintenanceInfoFuJianBiao" parameterType="java.util.Map">
  82. <!-- 插入到附件表-->
  83. insert into attachment (
  84. attachment_id,
  85. attachment_name,
  86. url,
  87. upload_person_id,
  88. create_time)
  89. values(
  90. #{attachment_id},
  91. #{attachment_name},
  92. #{url},
  93. #{upload_person_id},
  94. #{create_time} )
  95. </insert>
  96. <!-- 当经办支行进行账户开立维护上传的时候往(操作记录表)中插入一条数据 可公用-->
  97. <insert id="insertAccountMaintenanceInfoOperationHistory">
  98. insert into
  99. operation_history(operator_type_id,
  100. operator_account,
  101. operator_role,
  102. operator_person,
  103. operator_time,
  104. hash)
  105. values(#{operatorTypeId},
  106. #{operatorAccount},
  107. #{operatorRole},
  108. #{operatorPerson},
  109. #{operatorTime},
  110. #{hash})
  111. </insert>
  112. <!-- 账户开立查看详情下载页面 -->
  113. <select id="selectAccountMaintenanceNoPage" parameterType="java.util.Map" resultType="com.fuzamei.entity.AccountOpeningRecord">
  114. select DISTINCT
  115. customer_id,
  116. customer_name,
  117. bank_account,
  118. f.attachment_name as basic_data_id,
  119. f.url as basicUrl,
  120. f1.attachment_name as letter_of_commitment_id,
  121. f1.url as letterUrl ,
  122. f2.attachment_name as application_id,
  123. f2.url as applicationUrl,
  124. update_time
  125. from
  126. account_opening_record a
  127. left join attachment f
  128. on a.basic_data_id=f.attachment_id
  129. left join attachment f1
  130. on a.letter_of_commitment_id = f1.attachment_id
  131. left join attachment f2
  132. on a.application_id= f2.attachment_id
  133. where customer_id=#{customer_id}
  134. </select>
  135. </mapper>