sinake
10 天以前 4865dc7156334faf8f4c1ee8011bffb03a28bcc5
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<?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.VExpertfeeExpertMapper">
 
    <resultMap type="com.ruoyi.project.domain.VExpertfeeExpert" id="VExpertfeeExpertResult">
        <result property="fundTaxId" column="fund_tax_id"/>
        <result property="beneficiarytype" column="BeneficiaryType"/>
        <result property="belong" column="Belong"/>
        <result property="beneficiaryname" column="BeneficiaryName"/>
        <result property="idcardno" column="IDCardNo"/>
        <result property="depositbank" column="DepositBank"/>
        <result property="bankcardno" column="BankCardNo"/>
        <result property="pretaxamount" column="PretaxAmount"/>
        <result property="taxamount" column="TaxAmount"/>
        <result property="taxedamount" column="TaxedAmount"/>
        <result property="donorname" column="DonorName"/>
        <result property="unitname" column="UnitName"/>
    </resultMap>
 
    <sql id="selectVExpertfeeExpertVo">
        select fund_tax_id,
               BeneficiaryType,
               Belong,
               BeneficiaryName,
               IDCardNo,
               DepositBank,
               BankCardNo,
               PretaxAmount,
               TaxAmount,
               TaxedAmount,
               DonorName,
               UnitName
        from v_expertfee_expert
    </sql>
 
    <select id="selectVExpertfeeExpertList" parameterType="com.ruoyi.project.domain.VExpertfeeExpert"
            resultMap="VExpertfeeExpertResult">
        <include refid="selectVExpertfeeExpertVo"/>
        <where>
            <if test="fundTaxId != null ">and fund_tax_id = #{fundTaxId}</if>
            <if test="beneficiarytype != null ">and BeneficiaryType = #{beneficiarytype}</if>
            <if test="belong != null ">and Belong = #{belong}</if>
            <if test="beneficiaryname != null  and beneficiaryname != ''">and BeneficiaryName like concat('%',
                #{beneficiaryname}, '%')
            </if>
            <if test="idcardno != null  and idcardno != ''">and IDCardNo = #{idcardno}</if>
            <if test="depositbank != null  and depositbank != ''">and DepositBank = #{depositbank}</if>
            <if test="bankcardno != null  and bankcardno != ''">and BankCardNo = #{bankcardno}</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="donorname != null  and donorname != ''">and DonorName like concat('%', #{donorname}, '%')</if>
            <if test="unitname != null  and unitname != ''">and UnitName like concat('%', #{unitname}, '%')</if>
        </where>
    </select>
 
    <select id="selectVExpertfeeExpertListByFaxId" parameterType="Integer" resultMap="VExpertfeeExpertResult">
        SELECT beneficiarytype,
               beneficiaryname,
               idcardno,
               depositbank,
               bankcardno,
               pretaxamount,
               taxamount,
               taxedamount,
               donorname,
               unitname
        FROM v_expertfee_expert
        where fund_tax_id = #{taxId}
        UNION
        SELECT null              as beneficiarytype,
               "合计"              as beneficiaryname,
               null              as idcardno,
               null              as depositbank,
               null              as bankcardno,
               SUM(pretaxamount) as pretaxamount,
               SUM(taxamount)    as taxamount,
               SUM(taxedamount)  as taxedamount,
               null              as donorname,
               null              as unitname
        FROM v_expertfee_expert
        where fund_tax_id = #{taxId}
    </select>
 
</mapper>