liusheng
2023-08-09 2c16ba7f4cdfedf4ec05395e20caf9c87f2b5101
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
<?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.ServiceFunddetailMapper">
 
    <resultMap type="com.ruoyi.project.domain.ServiceFunddetail" id="ServiceFunddetailResult">
        <result property="id" column="ID"/>
        <result property="fundid" column="fundID"/>
        <result property="beneficiaryname" column="BeneficiaryName"/>
        <result property="beneficiaryno" column="BeneficiaryNo"/>
        <result property="unitname" column="UnitName"/>
        <result property="unitno" column="UnitNo"/>
        <result property="unituserno" column="UnitUserNo"/>
        <result property="title" column="Title"/>
        <result property="idcardtype" column="IDCardType"/>
        <result property="idcardno" column="IDCardNo"/>
        <result property="sex" column="Sex"/>
        <result property="familyrelations" column="FamilyRelations"/>
        <result property="phone" column="Phone"/>
        <result property="depositbank" column="DepositBank"/>
        <result property="bankcardno" column="BankCardNo"/>
        <result property="branchbankname" column="BranchBankName"/>
        <result property="annexbankcard" column="AnnexBankCard"/>
        <result property="annexregistform" column="AnnexRegistForm"/>
        <result property="applytype" column="ApplyType"/>
        <result property="applytypename" column="ApplyTypeName"/>
        <result property="itemid" column="ItemID"/>
        <result property="itemname" column="ItemName"/>
        <result property="itemtype" column="ItemType"/>
        <result property="amount" column="Amount"/>
        <result property="prepaidamount" column="PrepaidAmount"/>
        <result property="taxamount" column="TaxAmount"/>
        <result property="invoicecount" column="InvoiceCount"/>
        <result property="taxedamount" column="TaxedAmount"/>
        <result property="attachcount" column="AttachCount"/>
        <result property="remark" column="Remark"/>
        <result property="recordstatus" column="RecordStatus"/>
        <result property="price" column="Price"/>
        <result property="quantity" column="Quantity"/>
        <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="uploadflag" column="uploadflag"/>
        <result property="uploadtime" column="uploadtime"/>
        <result property="infoid" column="InfoId"/>
        <result property="donorno" column="DonorNo"/>
        <result property="donorname" column="DonorName"/>
        <result property="servicesscope" column="SERVICESSCOPE"/>
        <result property="servicesscopename" column="SERVICESSCOPENAME"/>
        <result property="servicetype" column="SERVICETYPE"/>
        <result property="servicetypename" column="SERVICETYPENAME"/>
        <result property="orderno" column="OrderNo"/>
        <result property="itemcode" column="ItemCode"/>
        <result property="subjecttype" column="subjecttype"/>
        <result property="subjecttypename" column="subjecttypename"/>
        <result property="AnnexFiles" column="AnnexFiles"/>
    </resultMap>
 
    <sql id="selectServiceFunddetailVo">
        select ID,
               fundID,
               InfoId,
               DonorNo,
               DonorName,
               BeneficiaryName,
               BeneficiaryNo,
               UnitName,
               UnitNo,
               UnitUserNo,
               Title,
               OrderNo,
               ItemCode,
               IDCardType,
               IDCardNo,
               Sex,
               FamilyRelations,
               Phone,
               DepositBank,
               BankCardNo,
               BranchBankName,
               AnnexBankCard,
               AnnexRegistForm,
               ApplyType,
               ApplyTypeName,
               ItemID,
               ItemName,
               ItemType,
               Amount,
               PrepaidAmount,
               TaxAmount,
               InvoiceCount,
               TaxedAmount,
               AttachCount,
               Quantity,
               Price,
               Remark,
               RecordStatus,
               del_flag,
               create_by,
               create_time,
               update_by,
               update_time,
               uploadflag,
               uploadtime,
               SERVICESSCOPE,
               SERVICESSCOPENAME,
               SERVICETYPE,
               SERVICETYPENAME,
               subjecttype,
               subjecttypename,
               AnnexFiles
        from service_funddetail
    </sql>
 
    <select id="selectServiceFunddetailList" parameterType="com.ruoyi.project.domain.ServiceFunddetail"
            resultMap="ServiceFunddetailResult">
        <include refid="selectServiceFunddetailVo"/>
        <where>
            del_flag = '0'
            <if test="beneficiaryname != null  and beneficiaryname != ''">and BeneficiaryName like concat('%',
                #{beneficiaryname}, '%')
            </if>
            <if test="unitname != null  and unitname != ''">and UnitName like concat('%', #{unitname}, '%')</if>
            <if test="applytype != null  and applytype != ''">and ApplyType = #{applytype}</if>
            <if test="itemname != null  and itemname != ''">and ItemName like concat('%', #{itemname}, '%')</if>
            <if test="itemtype != null  and itemtype != ''">and ItemType = #{itemtype}</if>
            <if test="recordstatus != null  and recordstatus != ''">and RecordStatus = #{recordstatus}</if>
            <if test="createBy != null  and createBy != ''">and create_by = #{createBy}</if>
            <if test="createTime != null ">and create_time = #{createTime}</if>
            <if test="uploadflag != null  and uploadflag != ''">and uploadflag = #{uploadflag}</if>
            <if test="uploadtime != null ">and uploadtime = #{uploadtime}</if>
            <if test="fundid != null and fundid != '' ">and fundID = #{fundid}</if>
 
        </where>
    </select>
    <select id="selectFundDetailListById" resultType="com.ruoyi.project.domain.ServiceFunddetail">
        <include refid="selectServiceFunddetailVo"/>
        where fundID = #{id} and del_flag = '0'
        order by OrderNo
    </select>
 
    <select id="getAllDetailsByFDIDLW" resultType="com.ruoyi.project.domain.ServiceFunddetail">
        <include refid="selectServiceFunddetailVo"/>
        where fundID = #{id} and ItemType = "10"
    </select>
    <select id="getAllDetailsByFDIDSH" resultType="com.ruoyi.project.domain.ServiceFunddetail">
        <include refid="selectServiceFunddetailVo"/>
        where fundID = #{id} and ItemType = "14"
    </select>
    <select id="getAllDetailsByFDIDSS" resultType="com.ruoyi.project.domain.ServiceFunddetail">
        <include refid="selectServiceFunddetailVo"/>
        where fundID = #{id} and ItemType = "16"
    </select>
    <select id="getAllDetailsByFDIDYX" resultType="com.ruoyi.project.domain.ServiceFunddetail">
        <include refid="selectServiceFunddetailVo"/>
        where fundID = #{id} and ItemType = "15"
    </select>
    <select id="getAllDetailsByFDIDHZ" resultType="com.ruoyi.project.domain.ServiceFunddetail">
        <include refid="selectServiceFunddetailVo"/>
        where fundID = #{id} and del_flag = 0 order by OrderNo
    </select>
    <select id="getAllDetailsByFDIDLWF" resultType="com.ruoyi.project.domain.ServiceFunddetail">
        <include refid="selectServiceFunddetailVo"/>
        where fundID = #{id} and ItemType = "12"
    </select>
    <select id="countItem" resultType="java.lang.Integer">
        select count(*)
        from service_funddetail
        where ItemID = #{itemid}
          and fundID = #{fundid}
          and del_flag = '0'
    </select>
 
    <select id="getDataBybeneficiaryNo" parameterType="com.ruoyi.project.domain.FunddetailReqVo"
            resultMap="ServiceFunddetailResult">
        select a.ID,
        a.fundID,
        a.InfoId,
        a.DonorNo,
        a.DonorName,
        a.BeneficiaryName,
        a.BeneficiaryNo,
        a.UnitName,
        a.UnitNo,
        a.UnitUserNo,
        a.Title,
        a.OrderNo,
        a.ItemCode,
        a.IDCardType,
        a.IDCardNo,
        a.Sex,
        a.FamilyRelations,
        a.Phone,
        a.DepositBank,
        a.BankCardNo,
        a.BranchBankName,
        a.AnnexBankCard,
        a.AnnexRegistForm,
        a.ApplyType,
        a.ApplyTypeName,
        a.ItemID,
        a.ItemName,
        a.ItemType,
        a.Amount,
        a.PrepaidAmount,
        a.TaxAmount,
        a.InvoiceCount,
        a.TaxedAmount,
        a.AttachCount,
        a.Quantity,
        a.Price,
        a.Remark,
        a.RecordStatus,
        a.del_flag,
        a.create_by,
        a.create_time,
        a.update_by,
        a.update_time,
        a.uploadflag,
        a.uploadtime,
        a.SERVICESSCOPE,
        a.SERVICESSCOPENAME,
        a.SERVICETYPE,
        a.SERVICETYPENAME,
        a.subjecttype,
        a.subjecttypename
        from service_funddetail a,
        service_fund b
        where a.del_flag = '0'
        and a.fundID = b.id
        <if test="beneficiaryNo != null  and beneficiaryNo != '' ">and a.beneficiaryNo = #{beneficiaryNo}</if>
        and b.create_time >= #{starttime}
        and b.create_time &lt;= #{endtime}
 
    </select>
 
    <select id="getTaxBeforeByBeneFiciaryNo" parameterType="com.ruoyi.project.domain.vo.TaxMoneyVO"
            resultMap="ServiceFunddetailResult">
        <include refid="selectServiceFunddetailVo"/>
        where create_time like concat(#{startTime}, '%') and beneficiaryNo=#{beneficiaryNo}
 
    </select>
 
</mapper>