liusheng
3 天以前 9ff5a9b1a3ce92b7bf4fcd3a8fdabbb1739cfe4b
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
<?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.ServiceDonatemaintenanceMapper">
 
    <resultMap type="com.ruoyi.project.domain.ServiceDonatemaintenance" id="ServiceDonatemaintenanceResult">
        <result property="id" column="ID"/>
        <result property="infoid" column="InfoID"/>
        <result property="caseNo" column="case_no"/>
        <result property="donorno" column="DonorNo"/>
        <result property="itemNo" column="item_no"/>
        <result property="itemName" column="item_name"/>
        <result property="itemTime" column="item_time"/>
        <result property="itemDesc" column="item_desc"/>
        <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"/>
    </resultMap>
 
    <sql id="selectServiceDonatemaintenanceVo">
        select ID,
               InfoID,
               case_no,
               DonorNo,
               item_no,
               item_name,
               item_time,
               item_desc,
               del_flag,
               create_by,
               create_time,
               update_by,
               update_time
        from service_donatemaintenance
    </sql>
 
    <select id="selectServiceDonatemaintenanceList" parameterType="com.ruoyi.project.domain.vo.MaintenanceBaseInfoVO"
            resultType="com.ruoyi.project.domain.dto.MaintenanceBaseInfoDTO">
        select
        sd.treatmenthospitalname AS treatmenthospitalname,
        sd.treatmenthospitalno AS treatmenthospitalno,
        sd.DonorNo AS donorno,
        sd.extracontent AS extracontent,
        sd.inpatientno AS inpatientno,
        sd.DonationCategory as donationcategory,
        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,
        sd.ReportTime AS reportTime,
        sd.RhYin AS rhYin,
        sd.IllnessOverview AS illnessOverview,
        sd.id AS infoid,
        sdm.id AS id,
        sdm.item_no as itemNo,
        sdm.item_name as itemName,
        sdm.item_time as itemTime,
        sdt.DeathTime as deathTime,
        sdm.item_desc as itemDesc
        FROM
        service_donatebaseinfo sd
        LEFT JOIN service_donatemaintenance sdm ON sd.ID = sdm.InfoID
        AND sd.del_flag = 0
        AND sdm.del_flag = 0
        and sdm.ID is not null
        left join service_deathinfo sdt on sd.ID = sdt.infoID and sdt.del_flag=0 and sdt.ID is not null
        <where>
            sd.termination_case = 0
            <if test="infoid != null ">and sd.ID = #{infoid}</if>
            <if test="inpatientno != null ">and sd.InpatientNo = #{inpatientno}</if>
            <if test="caseNo != null  and caseNo != ''">and case_no = #{caseNo}</if>
            <if test="reportTime != null ">and ReportTime = #{reportTime}</if>
            <if test="donorno != null  and donorno != ''">and DonorNo = #{donorno}</if>
            <if test="name != null  and name != ''">and name = #{name}</if>
            <if test="coordinatorName != null  and coordinatorName != ''">and coordinator_name = #{coordinatorName}</if>
            <if test="itemNo != null  and itemNo != ''">and item_no = #{itemNo}</if>
            <if test="itemName != null  and itemName != ''">and item_name like concat('%', #{itemName}, '%')</if>
            <if test="itemTime != null ">and item_time = #{itemTime}</if>
            <if test="itemDesc != null  and itemDesc != ''">and item_desc = #{itemDesc}</if>
        </where>
        <if test="pageNum != null and pageSize != null">limit #{pageNum},#{pageSize}</if>
    </select>
 
</mapper>