123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389 |
- <?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>
- <!-- ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||/////////////////////////////-->
- <!--查询资金划转表 列表 指令业务岗审核通过后 核算业务岗 才能看见之前的记录 状态不在12和13 -->
- <select id="selectCapitalTransferTable2" 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>
- z.status_id not in(12,13)
- <if test="fund_name!='' and fund_name!= null">
- and 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>
- <!--/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
- <!--查询资金划转表 列表 指令业务岗和核算业务岗审核通过后 核算主管岗 才能看见之前的记录 状态不在12和13和14和15 -->
- <select id="selectCapitalTransferTable3" 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>
- z.status_id not in(12,13,14,15)
- <if test="fund_name!='' and fund_name!= null">
- and 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" parameterType="java.util.Map">
- <!-- SELECT count(*) from capital_transfer z left join status s on z.status_id = s.status_id -->
- select count(*) from capital_transfer z
- <where>
- <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>
- <!-- ////////////////////////////////////////////////////////////////////////////////////////////////// -->
- <!--查询资金划转表 返回查询总条数 指令业务岗审核通过后核算业务岗才能看见之前审核的列表信息 -->
- <select id="selectCapitalTransferPage2" resultType="int" parameterType="java.util.Map">
- <!-- SELECT count(*) from capital_transfer z left join status s on z.status_id = s.status_id -->
- select count(*) from capital_transfer z
- <where>
- z.status_id not in(12,13)
- <if test="fund_name != null and fund_name!=''">
- and 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>
- <!--///////////////////////////////////////////////////////////////// -->
- <!--查询资金划转表 返回查询总条数 指令业务岗和核算业务岗审核通过后核算主管岗才能看见之前的2级审核的列表的信息 -->
- <select id="selectCapitalTransferPage3" resultType="int" parameterType="java.util.Map">
- <!-- SELECT count(*) from capital_transfer z left join status s on z.status_id = s.status_id -->
- select count(*) from capital_transfer z
- <where>
- z.status_id not in(12,13,14,15)
- <if test="fund_name!= null and fund_name!=''">
- and 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>
-
- <!--************************************************************************************************ -->
- <!--查看 资金划转详情 根据前端给我返回的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
- bc.fund_id,
- bc.check_department,
- bc.check_person,
- bc.check_opinion,
- bc.check_time,
- bc.check_result ,
- s.status_name as relation
- from
- (select
- bc.check_department,
- bc.check_person,
- bc.fund_id,
- bc.check_opinion,
- bc.check_time,
- s.status_name as check_result,
- bc.relation
- from
- capital_transfer_check bc
- left join
- status s
- on
- bc.check_result=s.status_id) bc
- left join
- status s
- on
- bc.relation=s.status_id
-
- where fund_id=#{fund_id}
- order by
- bc.check_time desc
-
- <where>
- <if test="fund_id!='' and fund_id!=null">
- fund_id=#{fund_id}
- </if>
- </where> -
- </select>
- <!--//////////////////// -->
- <!-- 根据资金划转id查询状态id值 -->
- <select id="getStatusIdByCapitalId" resultType="int">
- select status_id from capital_transfer where fund_id=#{fund_id}
- </select>
- <!--===========================================以下=================================================================================== -->
- <!-- 管理人 发起 划转资金 插入到划转资金表*******************************///暂没用////////////////////////////////////////////////////// -->
- <insert id="insertCapitalTransfer" parameterType="java.util.Map">
- 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" parameterType="java.util.Map">
- 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" parameterType="java.util.Map">
- 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 as check_result,
- zt.status_name as relation
- from
- capital_transfer_check s
- left join
- status y on s.check_result=y.status_id
- left join
- status zt on s.relation=zt.status_id
-
-
- </select> -->
- <!-- 将划转审核结果意见在插入划转资金表的同时,也将审核结果更新到划转资金表中去,根据基金id ->fund_id定位到指定的业务 -->
- <update id="updateCapitaltransferStatus" parameterType="java.util.Map">
- update
- capital_transfer
- set
- status_id=#{statusId}
- where
- fund_id=#{fund_id}
- </update>
-
- <!--根据user_id 去修改账户余额 -->
- <update id="updateTUserAccountBalance"><!--用户表的账户余额 要减掉-->
- update t_user set account_balance=#{account_balance} where user_id=#{user_id}
- </update>
-
- <!--根据账户表的账户id来修改钱 -->
- <update id="updateAccountMoney"><!-- 账户表的账户 (钱)要加起来 -->
- update account set money=#{money} where account_id=#{account_id}
- </update>
-
- <!-- 查询 根据用户id查询出账户表id值--><!--暂没用 -->
- <!-- <select id="queryAccountIdByUserId" resultType="com.fuzamei.entity.UserAccount">
- select account_id from user_account where user_id=#{user_id}
- </select> -->
-
- <!--查询所有(账户名称) 返给前端 -->
- <select id="queryAccountWhereUserId" parameterType="int" resultType="com.fuzamei.entity.AccountInfo">
- select account_name from account_info WHERE account_id in
- (select account_id from user_account where user_id=#{user_id})
- </select>
-
-
-
- </mapper>
|