CapitalTransferMapper.xml 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  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.CapitalTransferMapper"><!-- 找接口 -->
  4. <!--查询资金划转表 列表 省分行托管中心指令业务岗 -->
  5. <select id="selectCapitalTransferTable" parameterType="java.util.Map" resultType="com.fuzamei.entity.CapitalTransfer">
  6. select z.fund_id,
  7. y.person_name,
  8. z.fund_name,
  9. y.account_balance,
  10. z.sum_of_money,
  11. f.attachment_name,
  12. f.url,
  13. y.drawing_account,
  14. z.apply_time,
  15. z.handle_time,
  16. s.status_name
  17. from
  18. capital_transfer z left join t_user y
  19. on z. custodian=y.user_id
  20. left join attachment f
  21. on z.basis_of_payment=f.attachment_id
  22. left join status s on z.status_id=s.status_id
  23. <where>
  24. <if test="fund_name!='' and fund_name!= null">
  25. fund_name=#{fund_name}
  26. </if>
  27. <if test="status_name!='' and status_name!=null">
  28. and status_name=#{status_name}
  29. </if>
  30. <if test="startTime!=null and endTime!=null">
  31. and apply_time between #{startTime} and #{endTime}
  32. </if>
  33. </where>
  34. order by apply_time desc
  35. limit #{startPage},#{rowNum}
  36. </select>
  37. <!--查询资金划转表 返回查询总条数 --><!--带条件分页待做修改 -->
  38. <select id="selectCapitalTransferPage" resultType="int">
  39. select count(*) from capital_transfer
  40. <where>
  41. <!-- <include refid="query_accountopen_where"></include> -->
  42. <if test="fund_name != null and fund_name!=''">
  43. fund_name=#{fund_name}
  44. </if>
  45. <if test="status_name != null and status_name''">
  46. and status_name=#{status_name}
  47. </if>
  48. <if test="startTime!=null and endTime!=null">
  49. and apply_time between #{startTime} and #{endTime}
  50. </if>
  51. </where>
  52. </select>
  53. <!--动态sql 上面引用 -->
  54. <!--************************************************************************************************ -->
  55. <!--查看 资金划转详情 根据前端给我返回的id 在把那一条数据查出来-->
  56. <select id="selectChaKanZiJinHuaZhuan" parameterType="java.util.Map" resultType="com.fuzamei.entity.CapitalTransfer">
  57. select y.person_name,
  58. sj.fund_name,
  59. y.account_balance,
  60. sj.sum_of_money,
  61. f.attachment_name,
  62. f.url,
  63. y.drawing_account,
  64. sj.apply_time
  65. from capital_transfer sj left join t_user y on sj.custodian= y.user_id left join attachment f on sj.basis_of_payment=f.attachment_id
  66. <where>
  67. <if test="fund_id!='' and fund_id!=null">
  68. fund_id=#{fund_id}
  69. </if>
  70. </where>
  71. </select>
  72. <!--************************************************************************************************************* -->
  73. <!-- 点击查看 (划转资金审核记录表) 框框详情记录 -->
  74. <select id="selectCapitalTransferRecord" parameterType="java.util.Map" resultType="com.fuzamei.entity.CapitalTransferCheck">
  75. select sj.fund_id,
  76. sj.check_department,
  77. sj.check_person,
  78. sj.check_opinion,
  79. sj.check_time,
  80. sj.check_result ,
  81. s. status_name as relation
  82. from (
  83. select sj.fund_id,
  84. sj.check_department,
  85. sj.check_person,
  86. sj.check_opinion,
  87. sj.check_time,
  88. s.status_name as check_result,
  89. sj.relation
  90. from
  91. capital_transfer_check sj
  92. left join status s on sj.check_result =s.status_id )sj
  93. left join status s on s.status_id=sj.relation
  94. <where>
  95. <if test="fund_id!='' and fund_id!=null">
  96. fund_id=#{fund_id}
  97. </if>
  98. </where>
  99. </select>
  100. <!-- 管理人 发起 划转资金 插入到划转资金表*******************************///暂没用////////////////////////////////////////////////////// -->
  101. <insert id="insertCapitalTransfer">
  102. insert into
  103. capital_transfer(fund_id,
  104. custodian,
  105. fund_name,
  106. sum_of_money,
  107. basis_of_payment,
  108. apply_time,
  109. handle_time,
  110. status_id)
  111. values(#{fund_id},
  112. #{custodian},
  113. #{fund_name},
  114. #{sum_of_money},
  115. #{basis_of_payment},
  116. #{apply_time},
  117. #{handle_time},
  118. #{status_id})
  119. </insert>
  120. <!--****************************************************************************************************************************** -->
  121. <!-- 将划转资金 上传 附件信息插入附件表中 -->
  122. <insert id="insertAttachmentInfo">
  123. insert into
  124. attachment(attachment_id,
  125. attachment_name,
  126. url,
  127. upload_person_id,
  128. create_time)
  129. values(#{attachment_id},
  130. #{attachment_name},
  131. #{url},
  132. #{upload_person_id},
  133. #{create_time})
  134. </insert>
  135. <!--****************************************************************************************** -->
  136. <!-- 当划转资金时 往操作记录表中插入一条数据 -->
  137. <insert id="insertOperationHistory">
  138. insert into
  139. operation_history(operator_type_id,
  140. operator_account,
  141. operator_role,
  142. operator_person,
  143. operator_time,
  144. hash)
  145. values(#{operator_type_id},
  146. #{operator_account},
  147. #{operator_role},
  148. #{operator_person},
  149. #{operator_time},
  150. #{hash})
  151. </insert>
  152. <!--******************************************************************************************************* -->
  153. <!-- 查询划转资金表 几级审核 审核意见 --><!-- 要排除状态13 状态为:指令业务岗审核不通过。 指令业务岗审核不通过就到不了核算业务岗这里审核 -->
  154. <select id="selectCheckOpinion" parameterType="java.util.Map" resultType="com.fuzamei.entity.CapitalTransfer">
  155. select
  156. y.person_name,
  157. z.fund_name,
  158. y.account_balance,
  159. z.sum_of_money,
  160. f.attachment_name,
  161. f.url,
  162. y.drawing_account,
  163. z.apply_time
  164. from
  165. capital_transfer z left join t_user y
  166. on z. custodian=y.user_id
  167. left join attachment f on z.basis_of_payment=f.attachment_id
  168. left join status s on s.status_id=z.status_id
  169. <where>
  170. z.status_id not in (13)
  171. <if test="fund_id != null and fund_id != ''">
  172. and fund_id=#{fund_id}
  173. </if>
  174. </where>
  175. </select>
  176. <!--************************************************************************************************* -->
  177. <!--将审核意见插入到(划转资金审核表)里 -->
  178. <insert id="insertCheckTransfer">
  179. insert into capital_transfer_check(fund_id,
  180. check_department,
  181. check_person,
  182. check_opinion,
  183. check_time,
  184. check_result,
  185. relation)
  186. values(#{fund_id},
  187. #{check_department},
  188. #{check_person},
  189. #{check_opinion},
  190. #{check_time},
  191. #{check_result},
  192. #{relation})
  193. </insert>
  194. <!--审核意见 查询审核记录表 -->
  195. <select id="">
  196. select s.fund_id,
  197. s.check_department,
  198. s.check_person,
  199. s.check_opinion,
  200. s.check_time,
  201. y.status_name
  202. from capital_transfer_check s
  203. left join status y on s.check_result=y.status_id
  204. </select>
  205. <!-- 将划转审核结果意见在插入划转资金表的同时,也将审核结果更新到划转资金表中去,根据基金id ->fund_id定位到指定的业务 -->
  206. <update id="updatecapitaltransferStatus" parameterType="java.util.Map">
  207. update
  208. capital_transfer
  209. set
  210. status_id=#{status_id}
  211. where
  212. fund_id=#{fund_id}
  213. </update>
  214. </mapper>