CapitalTransferMapper.xml 8.4 KB

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