|  |  | 
 |  |  | <?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"> | 
 |  |  |         PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | 
 |  |  |         "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | 
 |  |  | <mapper namespace="com.ruoyi.project.mapper.ServiceFundMapper"> | 
 |  |  |      | 
 |  |  |     <resultMap type="ServiceFund" id="ServiceFundResult"> | 
 |  |  |         <result property="id"    column="ID"    /> | 
 |  |  |         <result property="infoid"    column="InfoID"    /> | 
 |  |  |         <result property="donorno"    column="DonorNo"    /> | 
 |  |  |         <result property="donorname"    column="DonorName"    /> | 
 |  |  |         <result property="del_flag"    column="del_flag"    /> | 
 |  |  |         <result property="createBy"    column="create_by"    /> | 
 |  |  |         <result property="createTime"    column="create_time"    /> | 
 |  |  |         <result property="updateBy"    column="update_by"    /> | 
 |  |  |         <result property="updateTime"    column="update_time"    /> | 
 |  |  |         <result property="userno"    column="UserNo"    /> | 
 |  |  |         <result property="username"    column="UserName"    /> | 
 |  |  |         <result property="unitname"    column="UnitName"    /> | 
 |  |  |         <result property="unitno"    column="UnitNo"    /> | 
 |  |  |         <result property="unituserno"    column="UnitUserNo"    /> | 
 |  |  |         <result property="phone"    column="Phone"    /> | 
 |  |  |         <result property="annexbankcard"    column="AnnexBankCard"    /> | 
 |  |  |         <result property="annexregistform"    column="AnnexRegistForm"    /> | 
 |  |  |         <result property="amountrequested"    column="AmountRequested"    /> | 
 |  |  |         <result property="applytype"    column="ApplyType"    /> | 
 |  |  |         <result property="prepaidamount"    column="PrepaidAmount"    /> | 
 |  |  |         <result property="invoicecount"    column="InvoiceCount"    /> | 
 |  |  |         <result property="attachcount"    column="AttachCount"    /> | 
 |  |  |         <result property="managerno"    column="ManagerNo"    /> | 
 |  |  |         <result property="managername"    column="ManagerName"    /> | 
 |  |  |         <result property="deptmentno"    column="DeptmentNo"    /> | 
 |  |  |         <result property="deptmentname"    column="DeptmentName"    /> | 
 |  |  |         <result property="opochecker"    column="OPOchecker"    /> | 
 |  |  |         <result property="finvicepresident"    column="FinVicePresident"    /> | 
 |  |  |         <result property="busvicepresident"    column="BusVicePresident"    /> | 
 |  |  |         <result property="officedirector"    column="OfficeDirector"    /> | 
 |  |  |         <result property="financedirector"    column="FinanceDirector"    /> | 
 |  |  |         <result property="totalcost"    column="TotalCost"    /> | 
 |  |  |         <result property="procurementcost"    column="ProcurementCost"    /> | 
 |  |  |         <result property="expertcost"    column="ExpertCost"    /> | 
 |  |  |         <result property="ethicscost"    column="EthicsCost"    /> | 
 |  |  |         <result property="medicalcost"    column="MedicalCost"    /> | 
 |  |  |         <result property="familycost"    column="FamilyCost"    /> | 
 |  |  |         <result property="aftercarecost"    column="AftercareCost"    /> | 
 |  |  |         <result property="remark"    column="Remark"    /> | 
 |  |  |         <result property="recordstatus"    column="RecordStatus"    /> | 
 |  |  |         <result property="uploadflag"    column="uploadflag"    /> | 
 |  |  |         <result property="uploadtime"    column="uploadtime"    /> | 
 |  |  |         <result property="flowlevel"    column="FlowLevel"    /> | 
 |  |  |         <result property="pretaxcost"    column="PretaxCost"    /> | 
 |  |  |         <result property="taxedcost"    column="TaxedCost"    /> | 
 |  |  |  | 
 |  |  |     <resultMap type="com.ruoyi.project.domain.ServiceFund" id="ServiceFundResult"> | 
 |  |  |         <result property="id" column="ID"/> | 
 |  |  |         <result property="infoid" column="InfoID"/> | 
 |  |  |         <result property="donorno" column="DonorNo"/> | 
 |  |  |         <result property="donorname" column="DonorName"/> | 
 |  |  |         <result property="del_flag" column="del_flag"/> | 
 |  |  |         <result property="createBy" column="create_by"/> | 
 |  |  |         <result property="createTime" column="create_time"/> | 
 |  |  |         <result property="updateBy" column="update_by"/> | 
 |  |  |         <result property="updateTime" column="update_time"/> | 
 |  |  |         <result property="userno" column="UserNo"/> | 
 |  |  |         <result property="username" column="UserName"/> | 
 |  |  |         <result property="unitname" column="UnitName"/> | 
 |  |  |         <result property="unitno" column="UnitNo"/> | 
 |  |  |         <result property="unituserno" column="UnitUserNo"/> | 
 |  |  |         <result property="phone" column="Phone"/> | 
 |  |  |         <result property="annexbankcard" column="AnnexBankCard"/> | 
 |  |  |         <result property="annexregistform" column="AnnexRegistForm"/> | 
 |  |  |         <result property="amountrequested" column="AmountRequested"/> | 
 |  |  |         <result property="applytype" column="ApplyType"/> | 
 |  |  |         <result property="prepaidamount" column="PrepaidAmount"/> | 
 |  |  |         <result property="invoicecount" column="InvoiceCount"/> | 
 |  |  |         <result property="attachcount" column="AttachCount"/> | 
 |  |  |         <result property="managerno" column="ManagerNo"/> | 
 |  |  |         <result property="managername" column="ManagerName"/> | 
 |  |  |         <result property="deptmentno" column="DeptmentNo"/> | 
 |  |  |         <result property="deptmentname" column="DeptmentName"/> | 
 |  |  |         <result property="opochecker" column="OPOchecker"/> | 
 |  |  |         <result property="finvicepresident" column="FinVicePresident"/> | 
 |  |  |         <result property="financechecher" column="FinanceChecher"/> | 
 |  |  |         <result property="president" column="president"/> | 
 |  |  |         <result property="busvicepresident" column="BusVicePresident"/> | 
 |  |  |         <result property="officedirector" column="OfficeDirector"/> | 
 |  |  |         <result property="financedirector" column="FinanceDirector"/> | 
 |  |  |         <result property="totalcost" column="TotalCost"/> | 
 |  |  |         <result property="procurementcost" column="ProcurementCost"/> | 
 |  |  |         <result property="expertcost" column="ExpertCost"/> | 
 |  |  |         <result property="ethicscost" column="EthicsCost"/> | 
 |  |  |         <result property="medicalcost" column="MedicalCost"/> | 
 |  |  |         <result property="familycost" column="FamilyCost"/> | 
 |  |  |         <result property="aftercarecost" column="AftercareCost"/> | 
 |  |  |         <result property="remark" column="Remark"/> | 
 |  |  |         <result property="recordstatus" column="RecordStatus"/> | 
 |  |  |         <result property="uploadflag" column="uploadflag"/> | 
 |  |  |         <result property="uploadtime" column="uploadtime"/> | 
 |  |  |         <result property="flowlevel" column="FlowLevel"/> | 
 |  |  |         <result property="pretaxcost" column="PretaxCost"/> | 
 |  |  |         <result property="taxedcost" column="TaxedCost"/> | 
 |  |  |         <result property="backflowlevel" column="backFlowLevel"/> | 
 |  |  |         <result property="zffs" column="zffs"/> | 
 |  |  |         <result property="riqi" column="riqi"/> | 
 |  |  |         <result property="bh" column="bh"/> | 
 |  |  |         <result property="checkstatus" column="checkstatus"/> | 
 |  |  |         <result property="performancetype" column="performancetype"/> | 
 |  |  |         <result property="istax" column="istax"/> | 
 |  |  |         <result property="fundtaxtime" column="fundtaxtime"/> | 
 |  |  |         <result property="applyTime" column="apply_time"/> | 
 |  |  |         <result property="applyTime" column="apply_time"/> | 
 |  |  |         <result property="uploadStates" column="upload_states"/> | 
 |  |  |         <result property="notes" column="notes"/> | 
 |  |  |         <result property="jxrq" column="jxrq"/> | 
 |  |  |         <result property="fundTaxId" column="fund_tax_id"/> | 
 |  |  |         <result property="taxcost" column="TaxCost"/> | 
 |  |  |         <result property="summaryId" column="summary_id"/> | 
 |  |  |     </resultMap> | 
 |  |  |  | 
 |  |  |     <sql id="selectServiceFundVo"> | 
 |  |  |         select ID, InfoID, DonorNo, DonorName, del_flag, create_by, create_time, update_by, update_time, UserNo, UserName, UnitName, UnitNo, UnitUserNo, PretaxCost, TaxedCost, Phone, AnnexBankCard, AnnexRegistForm, AmountRequested, ApplyType, PrepaidAmount, InvoiceCount, AttachCount, ManagerNo, ManagerName, DeptmentNo, DeptmentName, OPOchecker, FinVicePresident, BusVicePresident, OfficeDirector, FinanceDirector, FinanceChecher, TotalCost, ProcurementCost, ExpertCost, EthicsCost, MedicalCost, FamilyCost, AftercareCost, Remark, RecordStatus, uploadflag, uploadtime,FlowLevel from service_fund | 
 |  |  |         select ID, | 
 |  |  |                InfoID, | 
 |  |  |                DonorNo, | 
 |  |  |                summary_id, | 
 |  |  |                DonorName, | 
 |  |  |                del_flag, | 
 |  |  |                create_by, | 
 |  |  |                create_time, | 
 |  |  |                update_by, | 
 |  |  |                update_time, | 
 |  |  |                UserNo, | 
 |  |  |                UserName, | 
 |  |  |                UnitName, | 
 |  |  |                UnitNo, | 
 |  |  |                UnitUserNo, | 
 |  |  |                PretaxCost, | 
 |  |  |                TaxedCost, | 
 |  |  |                Phone, | 
 |  |  |                AnnexBankCard, | 
 |  |  |                AnnexRegistForm, | 
 |  |  |                AmountRequested, | 
 |  |  |                ApplyType, | 
 |  |  |                PrepaidAmount, | 
 |  |  |                InvoiceCount, | 
 |  |  |                AttachCount, | 
 |  |  |                ManagerNo, | 
 |  |  |                ManagerName, | 
 |  |  |                DeptmentNo, | 
 |  |  |                DeptmentName, | 
 |  |  |                OPOchecker, | 
 |  |  |                FinVicePresident, | 
 |  |  |                president, | 
 |  |  |                BusVicePresident, | 
 |  |  |                OfficeDirector, | 
 |  |  |                FinanceDirector, | 
 |  |  |                FinanceChecher, | 
 |  |  |                TotalCost, | 
 |  |  |                ProcurementCost, | 
 |  |  |                ExpertCost, | 
 |  |  |                EthicsCost, | 
 |  |  |                MedicalCost, | 
 |  |  |                FamilyCost, | 
 |  |  |                AftercareCost, | 
 |  |  |                Remark, | 
 |  |  |                RecordStatus, | 
 |  |  |                uploadflag, | 
 |  |  |                uploadtime, | 
 |  |  |                backflowlevel, | 
 |  |  |                FlowLevel, | 
 |  |  |                zffs, | 
 |  |  |                riqi, | 
 |  |  |                bh, | 
 |  |  |                checkstatus, | 
 |  |  |                performancetype, | 
 |  |  |                istax, | 
 |  |  |                apply_time, | 
 |  |  |                fundtaxtime, | 
 |  |  |                upload_states, | 
 |  |  |                jxrq, | 
 |  |  |                notes, | 
 |  |  |                TaxCost, | 
 |  |  |                fund_tax_id | 
 |  |  |         from service_fund | 
 |  |  |     </sql> | 
 |  |  |  | 
 |  |  |     <select id="selectServiceFundList" parameterType="ServiceFund" resultMap="ServiceFundResult"> | 
 |  |  |     <select id="selectServiceFundList" parameterType="com.ruoyi.project.domain.ServiceFund" | 
 |  |  |             resultMap="ServiceFundResult"> | 
 |  |  |         <include refid="selectServiceFundVo"/> | 
 |  |  |  | 
 |  |  |         where del_flag = '0' | 
 |  |  |             <if test="donorno != null  and donorno != ''"> and DonorNo = #{donorno}</if> | 
 |  |  |             <if test="userno != null  and userno != ''"> and UserNo = #{userno}</if> | 
 |  |  |             <if test="username != null  and username != ''"> and UserName like concat('%', #{username}, '%')</if> | 
 |  |  |             <if test="applytype != null  and applytype != ''"> and ApplyType = #{applytype}</if> | 
 |  |  |             <if test="deptmentname != null  and deptmentname != ''"> and DeptmentName like concat('%', #{deptmentname}, '%')</if> | 
 |  |  |             <if test="recordstatus != null"> and RecordStatus = #{recordstatus}</if> | 
 |  |  |             <if test="uploadflag != null  and uploadflag != ''"> and uploadflag = #{uploadflag}</if> | 
 |  |  |             <if test="uploadtime != null "> and uploadtime = #{uploadtime}</if> | 
 |  |  |             <if test="createBy != null  and createBy != '' "> and create_by = #{createBy}</if> | 
 |  |  |             <if test="infoid != null "> and InfoID = #{infoid}</if> | 
 |  |  |             <if test="donorno != null   and donorno != '' "> and DonorNo = #{donorno}</if> | 
 |  |  |         <if test="donorno != null  and donorno != ''">and DonorNo = #{donorno}</if> | 
 |  |  |         <if test="fundTaxId != null ">and fund_tax_id = #{fundTaxId}</if> | 
 |  |  |         <if test="userno != null  and userno != ''">and UserNo = #{userno}</if> | 
 |  |  |         <if test="username != null  and username != ''">and UserName like concat('%', #{username}, '%')</if> | 
 |  |  |         <if test="applytype != null  and applytype != ''">and ApplyType = #{applytype}</if> | 
 |  |  |         <if test="deptmentname != null  and deptmentname != ''">and DeptmentName like concat('%', #{deptmentname}, | 
 |  |  |             '%') | 
 |  |  |         </if> | 
 |  |  |         <if test="recordstatus != null">and RecordStatus = #{recordstatus}</if> | 
 |  |  |         <if test="uploadflag != null  and uploadflag != ''">and uploadflag = #{uploadflag}</if> | 
 |  |  |         <if test="uploadtime != null ">and uploadtime = #{uploadtime}</if> | 
 |  |  |         <if test="createBy != null  and createBy != '' ">and create_by = #{createBy}</if> | 
 |  |  |         <if test="infoid != null ">and InfoID = #{infoid}</if> | 
 |  |  |         <if test="donorno != null   and donorno != '' ">and DonorNo = #{donorno}</if> | 
 |  |  |         <if test="jxrq != null ">and jxrq = #{jxrq}</if> | 
 |  |  |         order by apply_time desc | 
 |  |  |     </select> | 
 |  |  |  | 
 |  |  |     <select id="getInfoByInfoId" resultType="com.ruoyi.project.domain.ServiceFund"> | 
 |  |  | 
 |  |  |     </select> | 
 |  |  |  | 
 |  |  |     <select id="getFundId" resultType="java.lang.Long"> | 
 |  |  |         select max(ID) from service_fund | 
 |  |  |         select max(ID) | 
 |  |  |         from service_fund | 
 |  |  |         where infoid = #{infoid} | 
 |  |  |     </select> | 
 |  |  |     <select id="selectVOList" resultType="com.ruoyi.project.domain.vo.FundVO"> | 
 |  |  |         SELECT | 
 |  |  |         `service_fund`.`ID` AS `id`, | 
 |  |  |         `service_fund`.`InfoID` AS `infoid`, | 
 |  |  |         `service_fund`.`summary_id` AS `summaryId`, | 
 |  |  |         `service_fund`.`DonorNo` AS `donorno`, | 
 |  |  |         `service_fund`.`DonorName` AS `donorname`, | 
 |  |  |         `service_fund`.`UserNo` AS `userno`, | 
 |  |  | 
 |  |  |         `service_fund`.`uploadtime` AS `uploadtime`, | 
 |  |  |         `service_fund`.`PretaxCost` AS `pretaxcost`, | 
 |  |  |         `service_fund`.`TaxedCost` AS `taxedcost`, | 
 |  |  |         `service_fund`.`jxrq` AS `jxrq`, | 
 |  |  |         `service_fund`.`fund_tax_id` AS `fundTaxId`, | 
 |  |  |         `service_funddetail`.`ID` AS `fdid`, | 
 |  |  |         `service_funddetail`.`fundID` AS `fundid`, | 
 |  |  |         `service_funddetail`.`BeneficiaryName` AS `beneficiaryname`, | 
 |  |  | 
 |  |  |         `service_fund`.`ID` = `service_funddetail`.`fundID` | 
 |  |  |         ))) | 
 |  |  |         <where> | 
 |  |  |             <if test="donorno != null  and donorno != ''"> and `service_fund`.`DonorNo` = #{donorno}</if> | 
 |  |  |             <if test="userno != null  and userno != ''"> and `service_fund`.`UserNo` = #{userno}</if> | 
 |  |  |             <if test="username != null  and username != ''"> and `service_fund`.`UserName` = #{username}</if> | 
 |  |  |             <if test="unitname != null  and unitname != ''"> and `service_fund`.`UnitName` = #{unitname}</if> | 
 |  |  |             <if test="create_by != null  and create_by != ''"> and `service_fund`.`create_by` = #{create_by}</if> | 
 |  |  |             <if test="create_time != null  and create_time != ''"> and `service_fund`.`create_time` = #{create_time}</if> | 
 |  |  |             <if test="donorno != null  and donorno != ''">and `service_fund`.`DonorNo` = #{donorno}</if> | 
 |  |  |             <if test="userno != null  and userno != ''">and `service_fund`.`UserNo` = #{userno}</if> | 
 |  |  |             <if test="username != null  and username != ''">and `service_fund`.`UserName` = #{username}</if> | 
 |  |  |             <if test="unitname != null  and unitname != ''">and `service_fund`.`UnitName` = #{unitname}</if> | 
 |  |  |             <if test="create_by != null  and create_by != ''">and `service_fund`.`create_by` = #{create_by}</if> | 
 |  |  |             <if test="create_time != null  and create_time != ''">and `service_fund`.`create_time` = #{create_time}</if> | 
 |  |  |  | 
 |  |  |         </where> | 
 |  |  |  | 
 |  |  |     </select> | 
 |  |  |  | 
 |  |  |     <select id="getListBypower" statementType="CALLABLE" resultType="com.ruoyi.project.domain.vo.SpFinancialExpensesFundOut"> | 
 |  |  |         call SP_FINANCIAL_EXPENSES(#{PAUSERNO,mode=IN,jdbcType=VARCHAR},#{PAFUNDTYPE,mode=IN,jdbcType=INTEGER},#{PAAPPLICANT,mode=IN,jdbcType=VARCHAR},#{PAAPPLICATIONBEGTIME,mode=IN,jdbcType=VARCHAR},#{PAAPPLICATIONENDTIME,mode=IN,jdbcType=VARCHAR},#{PADEPARTMENT,mode=IN,jdbcType=VARCHAR},#{CHECKFLAG,mode=IN,jdbcType=INTEGER},#{APPLYTYPE,mode=IN,jdbcType=INTEGER}) | 
 |  |  |     <select id="getListBypower" statementType="CALLABLE" | 
 |  |  |             resultType="com.ruoyi.project.domain.vo.SpFinancialExpensesFundOut"> | 
 |  |  |         call SP_FINANCIAL_EXPENSES(#{PAUSERNO,mode=IN,jdbcType=VARCHAR},#{PAFUNDTYPE,mode=IN,jdbcType=INTEGER},#{PAAPPLICANT,mode=IN,jdbcType=VARCHAR},#{PAAPPLICATIONBEGTIME,mode=IN,jdbcType=VARCHAR},#{PAAPPLICATIONENDTIME,mode=IN,jdbcType=VARCHAR},#{PADEPARTMENT,mode=IN,jdbcType=VARCHAR},#{CHECKFLAG,mode=IN,jdbcType=INTEGER},#{APPLYTYPE,mode=IN,jdbcType=INTEGER},#{CHECKSTATUS,mode=IN,jdbcType=INTEGER},#{donorname,mode=IN,jdbcType=VARCHAR}) | 
 |  |  |     </select> | 
 |  |  |  | 
 |  |  |     <select id="getExpertfeeList" statementType="CALLABLE" | 
 |  |  |             resultType="com.ruoyi.project.domain.vo.SpFinancialExpensesFundOut"> | 
 |  |  |         call SP_SELECT_EXPERTFEE(#{PAAPPLYTYPE,mode=IN,jdbcType=INTEGER},#{PFUNDTAXID,mode=IN,jdbcType=INTEGER},#{DONORNAME,mode=IN,jdbcType=VARCHAR},#{PADEPARTID,mode=IN,jdbcType=INTEGER},#{PAUSERNAME,mode=IN,jdbcType=VARCHAR}) | 
 |  |  |     </select> | 
 |  |  |  | 
 |  |  | </mapper> | 
 |  |  |     <update id="updateFundTaxIdById"> | 
 |  |  |         update service_fund | 
 |  |  |         <set> | 
 |  |  |             fund_tax_id = #{fundTaxId}, | 
 |  |  |             fundtaxtime = null | 
 |  |  |         </set> | 
 |  |  |         where id = #{id} | 
 |  |  |     </update> | 
 |  |  |     <update id="updateFundIsTexById"> | 
 |  |  |         update service_fund | 
 |  |  |         <set> | 
 |  |  |             istax = #{isTax}, | 
 |  |  |             fundtaxtime = null | 
 |  |  |         </set> | 
 |  |  |         where id = #{id} | 
 |  |  |     </update> | 
 |  |  | </mapper> |