liusheng
2024-03-19 ded03f0315e02c13f17b8bf7777c89a5cc73130e
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
64
65
66
67
68
69
70
71
<?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.VExpertfeeTotalMapper">
 
    <resultMap type="com.ruoyi.project.domain.VExpertfeeTotal" id="VExpertfeeTotalResult">
        <result property="fundTaxId" column="fund_tax_id"/>
        <result property="deptmentno" column="DeptmentNo"/>
        <result property="deptmentname" column="DeptmentName"/>
        <result property="donormedicalcost" column="DonorMedicalCost"/>
        <result property="donorbodycost" column="DonorBodyCost"/>
        <result property="organgaincost" column="OrganGainCost"/>
        <result property="donorcost" column="DonorCost"/>
        <result property="organmedicalcost" column="OrganMedicalCost"/>
    </resultMap>
 
    <sql id="selectVExpertfeeTotalVo">
        select fund_tax_id,
               DeptmentName,
               DonorMedicalCost,
               DonorBodyCost,
               OrganGainCost,
               DonorCost,
               OrganMedicalCost
        from v_expertfee_total
    </sql>
 
    <select id="selectVExpertfeeTotalList" parameterType="com.ruoyi.project.domain.VExpertfeeTotal"
            resultMap="VExpertfeeTotalResult">
        <include refid="selectVExpertfeeTotalVo"/>
        <where>
            <if test="fundTaxId != null ">and fund_tax_id = #{fundTaxId}</if>
            <if test="deptmentname != null  and deptmentname != ''">and DeptmentName like concat('%', #{deptmentname},
                '%')
            </if>
            <if test="infoid != null ">and InfoID = #{infoid}</if>
            <if test="donorname != null  and donorname != ''">and DonorName like concat('%', #{donorname}, '%')</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>
        </where>
    </select>
 
    <select id="selectVExpertfeeTotalListByTaxId" parameterType="Integer"
            resultMap="VExpertfeeTotalResult">
        SELECT fund_tax_id,
               DeptmentNo,
               DeptmentName,
               DonorMedicalCost,
               DonorBodyCost,
               OrganGainCost,
               OrganMedicalCost,
               DonorCost
        FROM v_expertfee_total
        where fund_tax_id = #{taxId}
        UNION
        SELECT null                  as fund_tax_id,
               null                  as DeptmentNo,
               '合计'                  as DeptmentName,
               SUM(donormedicalcost) as DonorMedicalCost,
               SUM(donorbodycost)    as DonorBodyCost,
               SUM(organgaincost)    as OrganGainCost,
               SUM(organmedicalcost) as OrganMedicalCost,
               SUM(DonorCost)        as DonorCost
        FROM v_expertfee_total
        where fund_tax_id = #{taxId}
    </select>
 
</mapper>