liusheng
9 天以前 d88fffd5d757a23f302011ced88dea92e1ce31e9
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
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
<?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.ServiceDonationwitnessMapper">
 
    <resultMap type="com.ruoyi.project.domain.ServiceDonationwitness" id="ServiceDonationwitnessResult">
        <result property="id" column="ID"/>
        <result property="infoid" column="InfoID"/>
        <result property="donorno" column="DonorNo"/>
        <result property="gainhospitalno" column="GainHospitalNo"/>
        <result property="gainhospitalname" column="GainHospitalName"/>
        <result property="deathtime" column="DeathTime"/>
        <result property="deathreason" column="DeathReason"/>
        <result property="deathjudgedocto" column="DeathJudgeDoctO"/>
        <result property="deathjudgedoctt" column="DeathJudgeDoctT"/>
        <result property="deathjudgeannex" column="DeathJudgeAnnex"/>
        <result property="operationbegtime" column="OperationBegTime"/>
        <result property="operationendtime" column="OperationEndTime"/>
        <result property="operationdoctor" column="OperationDoctor"/>
        <result property="isspendremember" column="IsSpendRemember"/>
        <result property="isrestoreremains" column="IsRestoreRemains"/>
        <result property="rememberannex" column="RememberAnnex"/>
        <result property="responsibleuserid" column="ResponsibleUserID"/>
        <result property="responsibleusername" column="ResponsibleUserName"/>
        <result property="coordinateduserido" column="CoordinatedUserIDO"/>
        <result property="coordinatedusernameo" column="CoordinatedUserNameO"/>
        <result property="coordinateduseridt" column="CoordinatedUserIDT"/>
        <result property="coordinatedusernamet" column="CoordinatedUserNameT"/>
        <result property="abdominalaortacannulatime" column="AbdominalAortaCannulaTime"/>
        <result property="abdominalaortaperfusiontime" column="AbdominalAortaPerfusionTime"/>
        <result property="portalveincannulatime" column="PortalVeinCannulaTime"/>
        <result property="portalveinperfusiontime" column="PortalVeinPerfusionTime"/>
        <result property="pulmonaryarterycannulatime" column="PulmonaryArteryCannulaTime"/>
        <result property="pulmonaryarteryperfusiontime" column="PulmonaryArteryPerfusionTime"/>
        <result property="aortacannulatime" column="AortaCannulaTime"/>
        <result property="aortaperfusiontime" column="AortaPerfusionTime"/>
        <result property="delFlag" 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="organdonation" column="OrganDonation"/>
        <result property="organdonationOther" column="OrganDonation_Other"/>
        <result property="donationcategory" column="DonationCategory"/>
        <result property="coordinatorInOperating" column="coordinator_in_operating"/>
        <result property="coordinatorOutOperating" column="coordinator_out_operating"/>
        <result property="coordinatorSign" column="coordinator_sign"/>
        <result property="coordinatorSignTime" column="coordinator_sign_time"/>
    </resultMap>
 
    <sql id="selectServiceDonationwitnessVo">
        select ID,
               InfoID,
               coordinator_in_operating,
               coordinator_out_operating,
               coordinator_sign,
               coordinator_sign_time,
               DonorNo,
               GainHospitalNo,
               GainHospitalName,
               DeathTime,
               DeathReason,
               DeathJudgeDoctO,
               DeathJudgeDoctT,
               DeathJudgeAnnex,
               OperationBegTime,
               OperationEndTime,
               OperationDoctor,
               IsSpendRemember,
               IsRestoreRemains,
               RememberAnnex,
               ResponsibleUserID,
               ResponsibleUserName,
               CoordinatedUserIDO,
               CoordinatedUserNameO,
               CoordinatedUserIDT,
               CoordinatedUserNameT,
               AbdominalAortaCannulaTime,
               AbdominalAortaPerfusionTime,
               PortalVeinCannulaTime,
               PortalVeinPerfusionTime,
               PulmonaryArteryCannulaTime,
               PulmonaryArteryPerfusionTime,
               AortaCannulaTime,
               AortaPerfusionTime,
               del_flag,
               create_by,
               create_time,
               update_by,
               update_time,
               OrganDonation,
               OrganDonation_Other,
               DonationCategory
        from service_donationwitness
    </sql>
 
    <select id="selectServiceDonationwitnessList" parameterType="com.ruoyi.project.domain.ServiceDonationwitness"
            resultMap="ServiceDonationwitnessResult">
        <include refid="selectServiceDonationwitnessVo"/>
        <where>
            <if test="donorno != null  and donorno != ''">and DonorNo = #{donorno}</if>
            <if test="gainhospitalname != null  and gainhospitalname != ''">and GainHospitalName like concat('%',
                #{gainhospitalname}, '%')
            </if>
            <if test="operationdoctor != null  and operationdoctor != ''">and OperationDoctor = #{operationdoctor}</if>
            <if test="infoid != null">and InfoID = #{infoid}</if>
        </where>
    </select>
 
    <select id="getDonationwitnessBaseInfo" parameterType="com.ruoyi.project.domain.vo.DonationwitnessBaseInfoVO" resultType="com.ruoyi.project.domain.dto.DonationwitnessBaseInfoDTO">
        select
        sd.treatmenthospitalname AS treatmenthospitalname,
        sd.treatmenthospitalno AS treatmenthospitalno,
        sd.DonationCategory as donationcategory,
        sd.DonorNo AS donorno,
        sd.case_no AS caseNo,
        sd.NAME AS name,
        sd.RecordState AS recordstate,
        sd.Sex AS sex,
        sd.Age AS age,
        sd.BloodType AS bloodtype,
        sd.idcardno AS idcardno,
        sd.diagnosisname AS diagnosisname,
        st.coordinator_in_operating as coordinatorInOperating,
        sd.id AS infoid,
        st.coordinator_out_operating as coordinatorOutOperating,
        st.coordinator_sign as coordinatorSign,
        st.coordinator_sign_time as coordinatorSignTime,
        st.DonorNo as donorno,
        st.GainHospitalNo as gainhospitalno,
        st.GainHospitalName as gainhospitalname,
        st.OperationBegTime as operationbegtime,
        st.OperationEndTime as operationendtime,
        st.OperationDoctor as operationdoctor,
        st.ResponsibleUserID as responsibleuserid,
        st.ResponsibleUserName as responsibleusername,
        st.CoordinatedUserIDO as coordinateduserido,
        st.CoordinatedUserNameO as coordinatedusernameo,
        st.CoordinatedUserIDT as coordinateduseridt,
        st.CoordinatedUserNameT as coordinatedusernamet,
        st.AbdominalAortaCannulaTime as abdominalaortacannulatime,
        st.AbdominalAortaPerfusionTime as abdominalaortaperfusiontime,
        st.PortalVeinCannulaTime as portalveincannulatime,
        st.PortalVeinPerfusionTime as portalveinperfusiontime,
        st.PulmonaryArteryCannulaTime as pulmonaryarterycannulatime,
        st.PulmonaryArteryPerfusionTime as pulmonaryarteryperfusiontime,
        st.AortaCannulaTime as aortacannulatime,
        st.AortaPerfusionTime as aortaperfusiontime,
        st.OrganDonation as organdonation,
        st.OrganDonation_Other as organdonationOther,
        st.DonationCategory as donationcategory
        FROM
        service_donatebaseinfo sd
        LEFT JOIN service_donationwitness st ON sd.ID = st.InfoID
        and st.ID is not null
        AND sd.del_flag = 0
        AND st.del_flag = 0
        <where>
            sd.termination_case = 0
 
            <if test="name != null  and name != ''">and sd.Name like concat('%', #{name}, '%')</if>
            <if test="inpatientno != null  and inpatientno != ''">and sd.inpatientno = #{inpatientno}</if>
            <if test="donorno != null  and donorno != ''">and st.DonorNo = #{donorno}</if>
            <if test="gainhospitalname != null  and gainhospitalname != ''">and  st.GainHospitalName like concat('%',
                #{gainhospitalname}, '%')
            </if>
            <if test="operationdoctor != null  and operationdoctor != ''">and  st.OperationDoctor = #{operationdoctor}</if>
            <if test="infoid != null">and  st.InfoID = #{infoid}</if>
        </where>
        <if test="pageNum != null and pageSize != null">limit #{pageNum},#{pageSize}</if>
    </select>
 
    <select id="selectVOList" resultType="com.ruoyi.project.domain.vo.DonationWitnessVO">
        SELECT
        `service_donatebaseinfo`.`ID` AS `ID`,
        `service_donatebaseinfo`.`DonorNo` AS `DonorNo`,
        `service_donatebaseinfo`.`DonationCategory` AS `DonationCategory`,
        `service_donatebaseinfo`.`Name` AS `Name`,
        `service_donatebaseinfo`.`Sex` AS `Sex`,
        `service_donatebaseinfo`.`IDCardType` AS `IDCardType`,
        `service_donatebaseinfo`.`IDCardNo` AS `IDCardNo`,
        `service_donatebaseinfo`.`Age` AS `Age`,
        `service_donatebaseinfo`.`Birthday` AS `Birthday`,
        `service_donatebaseinfo`.`TreatmentHospitalNo` AS `TreatmentHospitalNo`,
        `service_donatebaseinfo`.`TreatmentHospitalName` AS `TreatmentHospitalName`,
        `service_donatebaseinfo`.`TreatmentDeptName` AS `TreatmentDeptName`,
        `service_donatebaseinfo`.`RecordState` AS `RecordState`,
        `service_donatebaseinfo`.`ReporterNo` AS `ReporterNo`,
        `service_donatebaseinfo`.`ReporterName` AS `ReporterName`,
        `service_donatebaseinfo`.`ReporterPhone` AS `ReporterPhone`,
        `service_donatebaseinfo`.`ReportTime` AS `ReportTime`,
        `service_donatebaseinfo`.`create_by` AS `basecreateby`,
        `service_donatebaseinfo`.`workflow` AS `workflow`,
        `service_donatebaseinfo`.`termination_case` AS `terminationCase`,
        `service_donatebaseinfo`.`donatetime` AS `donatetime`,
        `service_donationwitness`.`ID` AS `dwID`,
        `service_donationwitness`.`InfoID` AS `InfoID`,
        `service_donationwitness`.`DonorNo` AS `dwDonorNo`,
        `service_donationwitness`.`GainHospitalNo` AS `GainHospitalNo`,
        `service_donationwitness`.`GainHospitalName` AS `GainHospitalName`,
        `service_donationwitness`.`DeathTime` AS `DeathTime`,
        `service_donationwitness`.`DeathReason` AS `DeathReason`,
        `service_donationwitness`.`DeathJudgeDoctO` AS `DeathJudgeDoctO`,
        `service_donationwitness`.`DeathJudgeDoctT` AS `DeathJudgeDoctT`,
        `service_donationwitness`.`DeathJudgeAnnex` AS `DeathJudgeAnnex`,
        `service_donationwitness`.`OperationBegTime` AS `OperationBegTime`,
        `service_donationwitness`.`OperationEndTime` AS `OperationEndTime`,
        `service_donationwitness`.`OperationDoctor` AS `OperationDoctor`,
        `service_donationwitness`.`IsSpendRemember` AS `IsSpendRemember`,
        `service_donationwitness`.`IsRestoreRemains` AS `IsRestoreRemains`,
        `service_donationwitness`.`RememberAnnex` AS `RememberAnnex`,
        `service_donationwitness`.`ResponsibleUserID` AS `ResponsibleUserID`,
        `service_donationwitness`.`ResponsibleUserName` AS `ResponsibleUserName`,
        `service_donationwitness`.`CoordinatedUserIDO` AS `CoordinatedUserIDO`,
        `service_donationwitness`.`CoordinatedUserNameO` AS `CoordinatedUserNameO`,
        `service_donationwitness`.`CoordinatedUserIDT` AS `CoordinatedUserIDT`,
        `service_donationwitness`.`CoordinatedUserNameT` AS `CoordinatedUserNameT`,
        `service_donationwitness`.`AbdominalAortaCannulaTime` AS `AbdominalAortaCannulaTime`,
        `service_donationwitness`.`AbdominalAortaPerfusionTime` AS `AbdominalAortaPerfusionTime`,
        `service_donationwitness`.`PortalVeinCannulaTime` AS `PortalVeinCannulaTime`,
        `service_donationwitness`.`PortalVeinPerfusionTime` AS `PortalVeinPerfusionTime`,
        `service_donationwitness`.`PulmonaryArteryPerfusionTime` AS `PulmonaryArteryPerfusionTime`,
        `service_donationwitness`.`PulmonaryArteryCannulaTime` AS `PulmonaryArteryCannulaTime`,
        `service_donationwitness`.`AortaCannulaTime` AS `AortaCannulaTime`,
        `service_donationwitness`.`AortaPerfusionTime` AS `AortaPerfusionTime`,
        `service_donationwitness`.`OrganDonation` AS `OrganDonation`,
        `service_donationwitness`.`OrganDonation_Other` AS `OrganDonation_Other`,
        `service_donationwitness`.`DonationCategory` AS `dwDonationCategory`,
        `service_donationwitness`.`del_flag` AS `delflag`,
        `service_donationwitness`.`create_by` AS `createby`,
        `service_donationwitness`.`create_time` AS `createtime`,
        `service_donationwitness`.`update_by` AS `updateby`,
        `service_donationwitness`.`update_time` AS `updatetime`,
        `service_donationwitness`.`coordinator_in_operating` AS `coordinatorInOperating`,
        `service_donationwitness`.`coordinator_out_operating` AS `coordinatorOutOperating`,
        `service_donationwitness`.`coordinator_sign` AS `coordinatorSign`,
        `service_donationwitness`.`coordinator_sign_time` AS `coordinatorSignTime`
        FROM
        `service_donatebaseinfo`
        LEFT JOIN `service_donationwitness` ON
        `service_donatebaseinfo`.`ID` = `service_donationwitness`.`InfoID`
        LEFT JOIN `base_organization` ON
        `base_organization`.`OrganizationID` = `service_donatebaseinfo`.`TreatmentHospitalNo`
        <where>
            service_donationwitness.del_flag=0
            and service_donatebaseinfo.del_flag=0
            <if test="donorno != null  and donorno != ''">and `service_donatebaseinfo`.`DonorNo` = #{donorno}</if>
            <if test="name != null  and name != ''">and `service_donatebaseinfo`.`Name` like concat('%', #{name}, '%')
            </if>
            <if test="idcardno != null  and idcardno != ''">and `service_donatebaseinfo`.`IDCardNo` = #{idcardno}</if>
            <if test="treatmenthospitalno != null  and treatmenthospitalno != ''">and
                `service_donatebaseinfo`.`TreatmentHospitalNo` = #{treatmenthospitalno}
            </if>
            <if test="recordstate != null  and recordstate != ''">and `service_donatebaseinfo`.`RecordState` =
                #{recordstate}
            </if>
            <if test="basecreateby != null  and basecreateby != ''">and `service_donatebaseinfo`.`create_by` =
                #{basecreateby}
            </if>
            <if test="starttime != null ">and `service_donationwitness`.OperationBegTime >= #{starttime}</if>
            <if test="endtime != null ">and `service_donationwitness`.OperationBegTime &lt;= #{endtime}</if>
            <if test="reporterno != null  and reporterno != ''">and `service_donatebaseinfo`.ReporterNo =
                #{reporterno}
            </if>
            <if test="city != null and city != ''">and `base_organization`.`City` = #{city}</if>
            <if test="workflow != null ">and `service_donatebaseinfo`.`workflow` = #{workflow}</if>
        </where>
 
        order by `service_donationwitness`.`create_time` desc
 
    </select>
 
    <select id="getDBDDonaterNumberThisYear" resultType="java.lang.Integer">
        select count(*) from service_donationwitness w
        inner join service_donatebaseinfo b on w.InfoID = b.id
        inner join base_organization o on b.TreatmentHospitalNo = o.OrganizationID
        where w.DonationCategory = "DBD"
        <if test="starttime != null ">and w.OperationBegTime >= #{starttime}</if>
        <if test="endtime != null ">and w.OperationBegTime &lt;= #{endtime}</if>
        <if test="city != null and city != ''">and o.City = #{city}</if>
        <if test="reporterno != null and reporterno != ''">and b.ReporterNo = #{reporterno}</if>
    </select>
    <select id="getDCDDonaterNumberThisYear" resultType="java.lang.Integer">
        select count(*) from service_donationwitness w
        inner join service_donatebaseinfo b on w.InfoID = b.id
        inner join base_organization o on b.TreatmentHospitalNo = o.OrganizationID
        where w.DonationCategory = "DCD"
        <if test="starttime != null ">and w.OperationBegTime >= #{starttime}</if>
        <if test="endtime != null ">and w.OperationBegTime &lt;= #{endtime}</if>
        <if test="city != null and city != ''">and o.City = #{city}</if>
        <if test="reporterno != null and reporterno != ''">and b.ReporterNo = #{reporterno}</if>
 
    </select>
    <select id="getDBCDDonaterNumberThisYear" resultType="java.lang.Integer">
        select count(*) from service_donationwitness w
        inner join service_donatebaseinfo b on w.InfoID = b.id
        inner join base_organization o on b.TreatmentHospitalNo = o.OrganizationID
        where w.DonationCategory = "DBCD"
        <if test="starttime != null ">and w.OperationBegTime >= #{starttime}</if>
        <if test="endtime != null ">and w.OperationBegTime &lt;= #{endtime}</if>
        <if test="city != null and city != ''">and o.City = #{city}</if>
        <if test="reporterno != null and reporterno != ''">and b.ReporterNo = #{reporterno}</if>
    </select>
    <select id="getDonationCategoryByInfoId" resultType="java.lang.String">
        select DonationCategory
        from service_donationwitness
        where InfoID = #{infoId}
          and del_flag = 0
    </select>
    <select id="countNumber" resultType="java.lang.Integer">
        select count(*)
        from service_donationwitness
        where OperationBegTime >= #{starttime}
          and OperationBegTime &lt;= #{endtime}
    </select>
    <select id="selectByInfoId" resultType="com.ruoyi.project.domain.ServiceDonationwitness">
        <include refid="selectServiceDonationwitnessVo"/>
        where InfoID = #{infoid} and del_flag!=1
    </select>
    <select id="getAllDonatePeople" resultType="com.ruoyi.project.domain.ServiceDonationwitness">
        <include refid="selectServiceDonationwitnessVo"/>
    </select>
    <select id="countThisYearByTime" resultType="java.lang.Integer">
        select count(*) from service_donationwitness w
        inner join service_donatebaseinfo b on w.InfoID = b.id
        inner join base_organization o on b.TreatmentHospitalNo = o.OrganizationID
        <where>
            w.del_flag=0
            and b.del_flag=0
            <if test="starttime != null ">and w.OperationBegTime >= #{starttime}</if>
            <if test="endtime != null ">and w.OperationBegTime &lt;= #{endtime}</if>
            <if test="city != null and city != ''">and o.City = #{city}</if>
            <if test="reporterno != null and reporterno != ''">and b.ReporterNo = #{reporterno}</if>
        </where>
    </select>
    <select id="getWitnessList" resultType="com.ruoyi.project.domain.ServiceDonationwitness">
        <include refid="selectServiceDonationwitnessVo"/>
    </select>
    <select id="getAllDonatePeopleByTime" resultType="com.ruoyi.project.domain.ServiceDonationwitness">
        <include refid="selectServiceDonationwitnessVo"/>
        where OperationEndTime >= #{starttime} and OperationEndTime &lt;= #{endtime}
    </select>
    <select id="selectByTime" resultType="com.ruoyi.project.domain.ServiceDonationwitness">
        <include refid="selectServiceDonationwitnessVo"/>
        where OperationBegTime >= #{starttime} and OperationBegTime &lt;= #{endtime}
    </select>
 
 
</mapper>