yxh
8 天以前 edbfa6b1a3a45e79cb17b06f3798535c3b1ba395
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?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, InfoID, PretaxAmount, TaxAmount, TaxedAmount, DonorMedicalCost, DonorBodyCost, OrganGainCost, OrganMedicalCost, DonorCost from v_expertfee_donor
        where fund_tax_id = #{taxId}
        UNION
        SELECT
               '合计'                  as DonorName,
               null                    as InfoID,
               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>