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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<?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.ServiceDonateorganBaseMapper">
 
    <resultMap type="com.ruoyi.project.domain.ServiceDonateorganBase" id="ServiceDonateorganBaseResult">
        <result property="id" column="ID"/>
        <result property="infoid" column="InfoID"/>
        <result property="allocationStatus" column="allocation_status"/>
        <result property="allocationTime" column="allocation_time"/>
        <result property="registrationCode" column="registration_code"/>
        <result property="registrationName" column="registration_name"/>
        <result property="registrationTime" column="registration_time"/>
        <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="estimatedtime" column="EstimatedTime"/>
    </resultMap>
 
    <sql id="selectServiceDonateorganBaseVo">
        select ID,
               InfoID,
               allocation_status,
               allocation_time,
               registration_code,
               registration_name,
               registration_time,
               del_flag,
               create_by,
               create_time,
               update_by,
               update_time,
               EstimatedTime
        from service_donateorgan_base
    </sql>
 
    <select id="selectServiceDonateorganBaseList" parameterType="com.ruoyi.project.domain.ServiceDonateorganBase"
            resultMap="ServiceDonateorganBaseResult">
        <include refid="selectServiceDonateorganBaseVo"/>
        <where>
            <if test="infoid != null ">and InfoID = #{infoid}</if>
            <if test="allocationStatus != null ">and allocation_status = #{allocationStatus}</if>
            <if test="allocationTime != null ">and allocation_time = #{allocationTime}</if>
            <if test="registrationCode != null  and registrationCode != ''">and registration_code =
                #{registrationCode}
            </if>
            <if test="registrationName != null  and registrationName != ''">and registration_name like concat('%',
                #{registrationName}, '%')
            </if>
            <if test="registrationTime != null ">and registration_time = #{registrationTime}</if>
            <if test="estimatedtime != null ">and EstimatedTime = #{estimatedtime}</if>
        </where>
    </select>
 
 
    <select id="getDonateorganBaseInfoList" resultType="com.ruoyi.project.domain.dto.DonateorganBaseInfoDTO">
        SELECT
        sd.treatmenthospitalname AS treatmenthospitalname,
        sd.treatmenthospitalno AS treatmenthospitalno,
        sd.DonorNo AS donorno,
        sd.DonationCategory as donationcategory,
        sd.case_no AS caseNo,
        sd.extracontent AS extracontent,
        sd.InpatientNo AS inpatientno,
        sd.Name AS NAME,
        sd.Sex AS sex,
        sd.Age AS age,
        sd.BloodType AS bloodtype,
        sd.idcardno AS idcardno,
        sd.diagnosisname AS diagnosisname,
        sd.id AS infoid,
        sdb.ID AS id,
        sdb.registration_name AS registrationName,
        sdb.registration_time AS registrationTime,
        sdb.registration_code AS registrationCode
        FROM
        service_donatebaseinfo sd
        LEFT JOIN service_donateorgan_base sdb ON sd.ID = sdb.InfoID and sd.del_flag = 0
        and sdb.del_flag = 0
        and sdb.ID is not null
        <where>
            sd.termination_case = 0
            <if test="donorno != null  and donorno != ''">and sd.DonorNo = #{donorno}</if>
            <if test="infoid != null ">and sd.ID = #{infoid}</if>
            <if test="inpatientno != null ">and sd.InpatientNo = #{inpatientno}</if>
            <if test="treatmenthospitalname != null  and treatmenthospitalname != ''">and sd.treatmenthospitalname like
                concat('%', #{treatmenthospitalname}, '%')
            </if>
            <if test="idcardno != null  and idcardno != ''">and sd.IDCardNo. = #{idcardno}</if>
            <if test="treatmenthospitalno != null  and treatmenthospitalno != ''">and sd.TreatmentHospitalNo =
                #{treatmenthospitalno}
            </if>
            <if test="recordstate != null  and recordstate != ''">and sd.RecordState = #{recordstate}
            </if>
            <if test="name != null  and name != ''">and sd.Name = #{name}
            </if>
            <if test="inpatientno != null  and inpatientno != ''">and sd.InpatientNo = #{inpatientno}
            </if>
            <if test="registrationName != null  and registrationName != ''">and sdb.registration_name =
                #{registrationName}
            </if>
            <if test="registrationTime != null and registrationTime != ''">
                and sdb.registration_time = #{registrationTime}
            </if>
            <if test="registrationCode != null and registrationCode != ''">
                and sdb.registration_code = #{registrationCode}
            </if>
        </where>
        <if test="pageNum != null and pageSize != null">limit #{pageNum},#{pageSize}</if>
    </select>
 
</mapper>