<?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.ruoyi.project.mapper.VExpertfeeDonorMapper"> 
 | 
  
 | 
    <resultMap type="com.ruoyi.project.domain.VExpertfeeDonor" id="VExpertfeeDonorResult"> 
 | 
        <result property="fundTaxId"    column="fund_tax_id"    /> 
 | 
        <result property="infoid"    column="InfoID"    /> 
 | 
        <result property="donorname"    column="DonorName"    /> 
 | 
        <result property="pretaxamount"    column="PretaxAmount"    /> 
 | 
        <result property="taxamount"    column="TaxAmount"    /> 
 | 
        <result property="taxedamount"    column="TaxedAmount"    /> 
 | 
        <result property="donormedicalcost"    column="DonorMedicalCost"    /> 
 | 
        <result property="donorbodycost"    column="DonorBodyCost"    /> 
 | 
        <result property="organgaincost"    column="OrganGainCost"    /> 
 | 
        <result property="organmedicalcost"    column="OrganMedicalCost"    /> 
 | 
        <result property="donorcost"    column="DonorCost"    /> 
 | 
    </resultMap> 
 | 
  
 | 
    <sql id="selectVExpertfeeDonorVo"> 
 | 
        select fund_tax_id, InfoID, DonorName, PretaxAmount, TaxAmount, TaxedAmount, DonorMedicalCost, DonorBodyCost, OrganGainCost, OrganMedicalCost, DonorCost from v_expertfee_donor 
 | 
    </sql> 
 | 
  
 | 
    <select id="selectVExpertfeeDonorList" parameterType="com.ruoyi.project.domain.VExpertfeeDonor" resultMap="VExpertfeeDonorResult"> 
 | 
        <include refid="selectVExpertfeeDonorVo"/> 
 | 
        <where> 
 | 
            <if test="fundTaxId != null "> and fund_tax_id = #{fundTaxId}</if> 
 | 
            <if test="infoid != null "> and InfoID = #{infoid}</if> 
 | 
            <if test="donorname != null  and donorname != ''"> and DonorName like concat('%', #{donorname}, '%')</if> 
 | 
            <if test="pretaxamount != null "> and PretaxAmount = #{pretaxamount}</if> 
 | 
            <if test="taxamount != null "> and TaxAmount = #{taxamount}</if> 
 | 
            <if test="taxedamount != null "> and TaxedAmount = #{taxedamount}</if> 
 | 
            <if test="donormedicalcost != null "> and DonorMedicalCost = #{donormedicalcost}</if> 
 | 
            <if test="donorbodycost != null "> and DonorBodyCost = #{donorbodycost}</if> 
 | 
            <if test="organgaincost != null "> and OrganGainCost = #{organgaincost}</if> 
 | 
            <if test="organmedicalcost != null "> and OrganMedicalCost = #{organmedicalcost}</if> 
 | 
            <if test="donorcost != null "> and DonorCost = #{donorcost}</if> 
 | 
        </where> 
 | 
    </select> 
 | 
  
 | 
    <select id="selectVExpertfeeDonorList2" parameterType="com.ruoyi.project.domain.VExpertfeeDonor" resultMap="VExpertfeeDonorResult"> 
 | 
        select  DonorName, PretaxAmount, TaxAmount, TaxedAmount, DonorMedicalCost, DonorBodyCost, OrganGainCost, OrganMedicalCost, DonorCost from v_expertfee_donor 
 | 
        where fund_tax_id = #{taxId} 
 | 
        UNION 
 | 
        SELECT 
 | 
               '合计'                  as DonorName, 
 | 
               SUM(PretaxAmount) as PretaxAmount, 
 | 
               SUM(TaxAmount)    as TaxAmount, 
 | 
               SUM(TaxedAmount)    as TaxedAmount, 
 | 
               SUM(DonorMedicalCost) as DonorMedicalCost, 
 | 
               SUM(DonorBodyCost)        as DonorBodyCost, 
 | 
               SUM(OrganGainCost)        as OrganGainCost, 
 | 
               SUM(OrganMedicalCost)        as OrganMedicalCost, 
 | 
               SUM(DonorCost)        as DonorCost 
 | 
        FROM v_expertfee_donor 
 | 
        where fund_tax_id = #{taxId} 
 | 
    </select> 
 | 
  
 | 
  
 | 
  
 | 
</mapper> 
 |