AccountOpenMapper.xml 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  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.AccountOpenMapper">
  4. <!--查询账户开立 返回总页数-->
  5. <select id="serchCountPage" resultType="int">
  6. select count(*) from account_opening_record
  7. </select>
  8. <!--查询提示函 返回总页数 -->
  9. <select id="serchCountPage2" resultType="int">
  10. select count(*) from prompt_letter
  11. </select>
  12. <!-- 账户开立带分页,没用左链接-->
  13. <!-- <select id="queryAllAccountOpening" resultType="com.fuzamei.entity.AccountOpeningRecord">
  14. select
  15. customer_id,
  16. customer_name,
  17. bank_account,
  18. attachment_name as basic_data_id,
  19. attachment_name as letter_of_commitment_id,
  20. attachment_name as application_id,
  21. update_time,s.status_name
  22. from
  23. account_opening_record a, attachment f,status s
  24. <where>
  25. a.basic_data_id=f.attachment_id
  26. and
  27. a.letter_of_commitment_id = f.attachment_id
  28. and
  29. a.application_id= f.attachment_id
  30. and
  31. s.status_id=a.status_id
  32. <if test="customer_name!='' and customer_name!=null ">
  33. and customer_name=#{customer_name}
  34. </if>
  35. <if test="bank_account!='' and bank_account!=null">
  36. and bank_account=#{bank_account}
  37. </if>
  38. <if test="startTime!='' and endTime != ''">
  39. and a.update_time between #{startTime} and #{endTime}
  40. </if>
  41. </where>
  42. order by update_time desc
  43. limit #{startPage},#{rowNum}
  44. </select> -->
  45. <!-- ************************************************************************************************** -->
  46. <!--提示函 管理人接收的 列表 -->
  47. <!-- select t.prompt_letter_id,f.attachment_name, t.receive_time ,f.url from prompt_letter t left join attachment f on t.prompt_letter_id=f.attachment_id order by receive_time desc -->
  48. <select id="selectPromptLetter" parameterType="java.util.Map" resultType="com.fuzamei.entity.PromptLetter">
  49. select t.prompt_letter_id,
  50. f.attachment_name,
  51. f.url,
  52. t.receive_time
  53. from prompt_letter t left join attachment f on t.prompt_letter_id=f.attachment_id
  54. <where>
  55. receive_time between #{startTime} and #{endTime}
  56. </where>
  57. order by receive_time desc limit #{startPage},#{rowNum}
  58. </select>
  59. <!--********************************************************************************************* -->
  60. <!-- <insert id="insertTiShiHanOrUserOrOtherTable" parameterType="java.util.Map">
  61. </insert> -->
  62. <!--提示函上传 插入数据到提示函表 -->
  63. <!-- *********************************************************************************************** -->
  64. <insert id="insertIntoPromptLetterTable" parameterType="java.util.Map">
  65. insert into
  66. prompt_letter(prompt_letter_id,
  67. prompt_letter_name,
  68. send_person,
  69. receive_person,
  70. send_time,
  71. receive_time,
  72. hash)
  73. values(
  74. #{prompt_letter_id},
  75. #{prompt_letter_name},
  76. #{send_person},
  77. #{receive_person},
  78. #{send_time},
  79. #{receive_time},
  80. #{hash}
  81. )
  82. </insert>
  83. <!-- 提示函上传 往附件表也插入数据信息 -->
  84. <insert id="insertIntoAttachmentTable">
  85. insert into
  86. attachment(attachment_id,
  87. attachment_name,
  88. url,
  89. upload_person_id,
  90. create_time)
  91. values(#{attachmentId},
  92. #{attachmentName},
  93. #{url},
  94. #{upload_person_id},
  95. #{create_time})
  96. </insert>
  97. <!-- 当经办支行进行账户开立上传的时候往(操作记录表)中插入一条数据 公用-->
  98. <insert id="insertOperationHistory">
  99. insert into
  100. operation_history(operator_type_id,
  101. operator_account,
  102. operator_role,
  103. operator_person,
  104. operator_time,
  105. hash)
  106. values(#{operatorTypeId},
  107. #{operatorAccount},
  108. #{operatorRole},
  109. #{operatorPerson},
  110. #{operatorTime},
  111. #{hash})
  112. </insert>
  113. <!--********************************************************************************************** -->
  114. <!--发送记录查询风险提示函 ,省分行托管中心风管岗 发送时间列biao-->
  115. <select id="selectTishihan" parameterType="java.util.Map" resultType="com.fuzamei.entity.PromptLetter">
  116. select t.prompt_letter_id , y.person_name , f.attachment_name, t.send_time
  117. from prompt_letter t left join attachment f on t.prompt_letter_id=f.attachment_id left join t_user y on t.send_person=f.attachment_id
  118. <where>
  119. <if test="startTime!='' and endTime != ''">
  120. t.send_time between #{startTime} and #{endTime}
  121. </if>
  122. </where>
  123. order by send_time desc
  124. limit #{startPage},#{rowNum}
  125. </select>
  126. <!--*********************************************************************************************** -->
  127. <!-- 真伪查询 上传服务器 往 附件表记录插入-->
  128. <insert id="insertTrueFalseSelect" parameterType="java.util.Map">
  129. insert into attachment (
  130. attachment_id,
  131. attachment_name,
  132. url,
  133. upload_person_id,
  134. create_time)
  135. values(
  136. #{attachment_id},
  137. #{attachment_name},
  138. #{url},
  139. #{upload_person_id},
  140. #{create_time} );
  141. </insert>
  142. <!--************************************************************************************************************** -->
  143. <!-- 上传客户资料,承诺书,开户申请书 经办支行创建添加账号和客户名称 useGeneratedKeys="true" 返回主键 闲着没有用 -->
  144. <insert id="insertAccountUploadFile" parameterType="java.util.Map">
  145. <!-- 插入到开户记录表 -->
  146. insert into account_opening_record(
  147. customer_id,
  148. customer_name,
  149. bank_account,
  150. basic_data_id,
  151. letter_of_commitment_id,
  152. application_id,
  153. update_time,
  154. status_id,
  155. hash)
  156. values(
  157. #{customer_id},
  158. #{customer_name},
  159. #{bank_account},
  160. #{basicAttachment_id},
  161. #{letterAttachment_id},
  162. #{applicationAttachment_id},
  163. #{update_time},
  164. #{status_id},
  165. #{hash}
  166. )
  167. </insert>
  168. <!-- 上传客户资料,承诺书,开户申请书 经办支行添加创建账号和客户名称 上传到附件表-->
  169. <insert id="insertAccountUploadFileFuJianBiao" parameterType="java.util.Map">
  170. <!-- 插入到附件表-->
  171. insert into attachment (
  172. attachment_id,
  173. attachment_name,
  174. url,
  175. upload_person_id,
  176. create_time)
  177. values(
  178. #{attachment_id},
  179. #{attachment_name},
  180. #{url},
  181. #{upload_person_id},
  182. #{create_time} )
  183. </insert>
  184. <!-- *******************代替上面的账户开立,用左链接************************************************* -->
  185. <select id="queryAllAccountOpening" resultType="com.fuzamei.entity.AccountOpeningRecord">
  186. select
  187. customer_id,
  188. customer_name,
  189. bank_account,
  190. f.attachment_name as basic_data_id,
  191. f1.attachment_name as letter_of_commitment_id,
  192. f2.attachment_name as application_id,
  193. update_time,s.status_name
  194. from
  195. account_opening_record a
  196. LEFT JOIN attachment f
  197. on a.basic_data_id=f.attachment_id
  198. LEFT JOIN attachment f1
  199. on a.letter_of_commitment_id = f1.attachment_id
  200. LEFT JOIN attachment f2
  201. on a.application_id= f2.attachment_id
  202. LEFT JOIN status s
  203. on a.status_id = s.status_id
  204. <where>
  205. <if test="customer_name!='' and customer_name!=null ">
  206. customer_name=#{customer_name}
  207. </if>
  208. <if test="bank_account!='' and bank_account!=null">
  209. and bank_account=#{bank_account}
  210. </if>
  211. <if test="startTime!='' and endTime != ''">
  212. and a.update_time between #{startTime} and #{endTime}
  213. </if>
  214. </where>
  215. order by update_time desc
  216. limit #{startPage},#{rowNum}
  217. </select>
  218. <!--账户开立 通过点击查看 供应下载页面 -->
  219. <select id="selectAccountopenNoPage" parameterType="java.util.Map" resultType="com.fuzamei.entity.AccountOpeningRecord">
  220. select
  221. customer_id,
  222. customer_name,
  223. bank_account,
  224. f.attachment_name as basic_data_id,
  225. f1.attachment_name as letter_of_commitment_id,
  226. f2.attachment_name as application_id,
  227. update_time,
  228. f.url
  229. from
  230. account_opening_record a
  231. left join attachment f
  232. on a.basic_data_id=f.attachment_id
  233. left join attachment f1
  234. on a.letter_of_commitment_id = f1.attachment_id
  235. left join attachment f2
  236. on a.application_id= f2.attachment_id
  237. where customer_id=#{customer_id}
  238. </select>
  239. </mapper>