123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.fuzamei.mapperInterface.CapitalTransferMapper"><!-- 找接口 -->
- <!--查询资金划转表 列表 省分行托管中心指令业务岗 -->
- <select id="selectCapitalTransferTable" parameterType="java.util.Map" resultType="com.fuzamei.entity.CapitalTransfer">
- select z.fund_id,
- y.person_name,
- z.fund_name,
- y.account_balance,
- z.sum_of_money,
- f.attachment_name,
- f.url,
- y.drawing_account,
- z.apply_time,
- z.handle_time,
- s.status_name
- from
- capital_transfer z left join t_user y
- on z. custodian=y.user_id
- left join attachment f
- on z.basis_of_payment=f.attachment_id
- left join status s on z.status_id=s.status_id
- <where>
- <if test="fund_name!='' and fund_name!= null">
- fund_name=#{fund_name}
- </if>
- <if test="status_name!='' and status_name!=null">
- and status_name=#{status_name}
- </if>
- <if test="startTime!=null and endTime!=null">
- and apply_time between #{startTime} and #{endTime}
- </if>
- </where>
- order by apply_time desc
- limit #{startPage},#{rowNum}
- </select>
- <!--查询资金划转表 返回查询总条数 --><!--带条件分页待做修改 -->
- <select id="selectCapitalTransferPage" resultType="int">
- select count(*) from capital_transfer
- <where>
- <!-- <include refid="query_accountopen_where"></include> -->
- <if test="fund_name != null and fund_name!=''">
- fund_name=#{fund_name}
- </if>
- <if test="status_name != null and status_name''">
- and status_name=#{status_name}
- </if>
- <if test="startTime!=null and endTime!=null">
- and apply_time between #{startTime} and #{endTime}
- </if>
-
- </where>
- </select>
- <!--动态sql 上面引用 -->
-
-
-
-
- <!--************************************************************************************************ -->
- <!--查看 资金划转详情 根据前端给我返回的id 在把那一条数据查出来-->
- <select id="selectChaKanZiJinHuaZhuan" parameterType="java.util.Map" resultType="com.fuzamei.entity.CapitalTransfer">
- select y.person_name,
- sj.fund_name,
- y.account_balance,
- sj.sum_of_money,
- f.attachment_name,
- f.url,
- y.drawing_account,
- sj.apply_time
- 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
- <where>
- <if test="fund_id!='' and fund_id!=null">
- fund_id=#{fund_id}
- </if>
- </where>
- </select>
- <!--************************************************************************************************************* -->
- <!-- 点击查看 (划转资金审核记录表) 框框详情记录 -->
- <select id="selectCapitalTransferRecord" parameterType="java.util.Map" resultType="com.fuzamei.entity.CapitalTransferCheck">
- select sj.fund_id,
- sj.check_department,
- sj.check_person,
- sj.check_opinion,
- sj.check_time,
- sj.check_result ,
- s. status_name as relation
- from (
- select sj.fund_id,
- sj.check_department,
- sj.check_person,
- sj.check_opinion,
- sj.check_time,
- s.status_name as check_result,
- sj.relation
- from
- capital_transfer_check sj
- left join status s on sj.check_result =s.status_id )sj
- left join status s on s.status_id=sj.relation
- <where>
- <if test="fund_id!='' and fund_id!=null">
- fund_id=#{fund_id}
- </if>
- </where>
- </select>
- <!-- 管理人 发起 划转资金 插入到划转资金表*******************************///暂没用////////////////////////////////////////////////////// -->
- <insert id="insertCapitalTransfer">
- insert into
- capital_transfer(fund_id,
- custodian,
- fund_name,
- sum_of_money,
- basis_of_payment,
- apply_time,
- handle_time,
- status_id)
- values(#{fund_id},
- #{custodian},
- #{fund_name},
- #{sum_of_money},
- #{basis_of_payment},
- #{apply_time},
- #{handle_time},
- #{status_id})
- </insert>
-
- <!--****************************************************************************************************************************** -->
- <!-- 将划转资金 上传 附件信息插入附件表中 -->
- <insert id="insertAttachmentInfo">
- insert into
- attachment(attachment_id,
- attachment_name,
- url,
- upload_person_id,
- create_time)
- values(#{attachment_id},
- #{attachment_name},
- #{url},
- #{upload_person_id},
- #{create_time})
- </insert>
- <!--****************************************************************************************** -->
- <!-- 当划转资金时 往操作记录表中插入一条数据 -->
- <insert id="insertOperationHistory">
- insert into
- operation_history(operator_type_id,
- operator_account,
- operator_role,
- operator_person,
- operator_time,
- hash)
- values(#{operator_type_id},
- #{operator_account},
- #{operator_role},
- #{operator_person},
- #{operator_time},
- #{hash})
- </insert>
- <!--******************************************************************************************************* -->
- <!-- 查询划转资金表 几级审核 审核意见 --><!-- 要排除状态13 状态为:指令业务岗审核不通过。 指令业务岗审核不通过就到不了核算业务岗这里审核 -->
- <select id="selectCheckOpinion" parameterType="java.util.Map" resultType="com.fuzamei.entity.CapitalTransfer">
- select
- y.person_name,
- z.fund_name,
- y.account_balance,
- z.sum_of_money,
- f.attachment_name,
- f.url,
- y.drawing_account,
- z.apply_time
- from
- capital_transfer z left join t_user y
- on z. custodian=y.user_id
- left join attachment f on z.basis_of_payment=f.attachment_id
- left join status s on s.status_id=z.status_id
- <where>
- z.status_id not in (13)
- <if test="fund_id != null and fund_id != ''">
- and fund_id=#{fund_id}
- </if>
- </where>
- </select>
- <!--************************************************************************************************* -->
- <!--将审核意见插入到(划转资金审核表)里 -->
- <insert id="insertCheckTransfer">
- insert into capital_transfer_check(fund_id,
- check_department,
- check_person,
- check_opinion,
- check_time,
- check_result,
- relation)
- values(#{fund_id},
- #{check_department},
- #{check_person},
- #{check_opinion},
- #{check_time},
- #{check_result},
- #{relation})
- </insert>
- <!--审核意见 查询审核记录表 -->
- <select id="">
- select s.fund_id,
- s.check_department,
- s.check_person,
- s.check_opinion,
- s.check_time,
- y.status_name
- from capital_transfer_check s
- left join status y on s.check_result=y.status_id
-
- </select>
- <!-- 将划转审核结果意见在插入划转资金表的同时,也将审核结果更新到划转资金表中去,根据基金id ->fund_id定位到指定的业务 -->
- <update id="updatecapitaltransferStatus" parameterType="java.util.Map">
- update
- capital_transfer
- set
- status_id=#{status_id}
- where
- fund_id=#{fund_id}
- </update>
-
-
-
- </mapper>
|