liusheng
2023-06-14 d6f2f458d9c8156981880c987d861423ce9af146
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
<?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.ServiceEthicalreviewopinionsMapper">
    
    <resultMap type="ServiceEthicalreviewopinions" id="ServiceEthicalreviewopinionsResult">
        <result property="id"    column="ID"    />
        <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="infoid"    column="InfoID"    />
        <result property="donorno"    column="DonorNo"    />
        <result property="expertopinion"    column="ExpertOpinion"    />
        <result property="expertconclusion"    column="ExpertConclusion"    />
        <result property="expertname"    column="ExpertName"    />
        <result property="conclusiontime"    column="ConclusionTime"    />
        <result property="conclusionannex"    column="ConclusionAnnex"    />
        <result property="conclusionorder"    column="ConclusionOrder"    />
    </resultMap>
 
    <sql id="selectServiceEthicalreviewopinionsVo">
        select ID, del_flag, create_by, create_time, update_by, update_time, InfoID, DonorNo, ExpertOpinion, ExpertConclusion, ExpertName, ConclusionTime, ConclusionAnnex, ConclusionOrder from service_ethicalreviewopinions
    </sql>
 
    <select id="selectServiceEthicalreviewopinionsList" parameterType="ServiceEthicalreviewopinions" resultMap="ServiceEthicalreviewopinionsResult">
        <include refid="selectServiceEthicalreviewopinionsVo"/>
        <where>
            <if test="infoid != null "> and InfoID = #{infoid}</if>
            <if test="donorno != null  and donorno != ''"> and DonorNo = #{donorno}</if>
            <if test="expertopinion != null  and expertopinion != ''"> and ExpertOpinion = #{expertopinion}</if>
            <if test="expertconclusion != null "> and ExpertConclusion = #{expertconclusion}</if>
            <if test="expertname != null  and expertname != ''"> and ExpertName like concat('%', #{expertname}, '%')</if>
            <if test="conclusiontime != null "> and ConclusionTime = #{conclusiontime}</if>
            <if test="conclusionannex != null  and conclusionannex != ''"> and ConclusionAnnex = #{conclusionannex}</if>
            <if test="conclusionorder != null "> and ConclusionOrder = #{conclusionorder}</if>
        </where>
    </select>
    <select id="selectVOList" resultType="com.ruoyi.project.domain.vo.EthicalReviewVO">
        SELECT
        `service_donatebaseinfo`.`ID` AS `ID`,
        `service_donatebaseinfo`.`Name` AS `Name`,
        `service_donatebaseinfo`.`Sex` AS `Sex`,
        `service_donatebaseinfo`.`IDCardNo` AS `IDCardNo`,
        `service_donatebaseinfo`.`Age` AS `Age`,
        `service_donatebaseinfo`.`Birthday` AS `Birthday`,
        `service_donatebaseinfo`.`Nationality` AS `Nationality`,
        `service_donatebaseinfo`.`Nation` AS `Nation`,
        `service_donatebaseinfo`.`RegisterAddress` AS `RegisterAddress`,
        `service_donatebaseinfo`.`RegisterProvince` AS `RegisterProvince`,
        `service_donatebaseinfo`.`RegisterProvinceName` AS `RegisterProvinceName`,
        `service_donatebaseinfo`.`RegisterCity` AS `RegisterCity`,
        `service_donatebaseinfo`.`RegisterCityName` AS `RegisterCityName`,
        `service_donatebaseinfo`.`RegisterTown` AS `RegisterTown`,
        `service_donatebaseinfo`.`RegisterTownName` AS `RegisterTownName`,
        `service_donatebaseinfo`.`RegisterCommunity` AS `RegisterCommunity`,
        `service_donatebaseinfo`.`RegisterCommunityName` AS `RegisterCommunityName`,
        `service_donatebaseinfo`.`RegisterCountyCode` AS `RegisterCountyCode`,
        `service_donatebaseinfo`.`RegisterCountyName` AS `RegisterCountyName`,
        `service_donatebaseinfo`.`RecordState` AS `RecordState`,
        `service_donatebaseinfo`.`TreatmentHospitalNo` AS `TreatmentHospitalNo`,
        `service_donatebaseinfo`.`TreatmentHospitalName` AS `TreatmentHospitalName`,
        `service_donatebaseinfo`.`TreatmentDeptName` AS `TreatmentDeptName`,
        `service_donatebaseinfo`.`DiagnosisNo` AS `DiagnosisNo`,
        `service_donatebaseinfo`.`DiagnosisName` AS `DiagnosisName`,
        `service_donatebaseinfo`.`DonorNo` AS `DonorNo`,
        `service_donatebaseinfo`.`ReporterNo` AS `ReporterNo`,
        `service_donatebaseinfo`.`ReporterName` AS `ReporterName`,
        `service_donatebaseinfo`.`ReporterPhone` AS `ReporterPhone`,
        `service_donatebaseinfo`.`ReportTime` AS `ReportTime`,
        `service_donatebaseinfo`.`BloodType` AS `BloodType`,
        `service_donatebaseinfo`.`RhYin` AS `RhYin`,
        `service_donatebaseinfo`.`InpatientNo` AS `InpatientNo`,
        `service_donatebaseinfo`.`IllnessOverview` AS `IllnessOverview`,
        `service_donatebaseinfo`.`DiseaseType` AS `DiseaseType`,
        `service_donatebaseinfo`.`PatientState` AS `PatientState`,
        `service_donatebaseinfo`.`create_by` AS `basecreateby`,
        `service_donateflowchart`.`ID` AS `fcID`,
        `service_donateflowchart`.`InfoID` AS `InfoID`,
        `service_donateflowchart`.`DonorNo` AS `fcDonorNo`,
        `service_donateflowchart`.`del_flag` AS `delFlag`,
        `service_donateflowchart`.`create_by` AS `createBy`,
        `service_donateflowchart`.`create_time` AS `createTime`,
        `service_donateflowchart`.`update_by` AS `updateBy`,
        `service_donateflowchart`.`update_time` AS `updateTime`,
        `service_donateflowchart`.`FlowName` AS `FlowName`,
        `service_donateflowchart`.`FlowAnnex` AS `FlowAnnex`,
        `service_donateflowchart`.`FlowContent` AS `FlowContent`,
        `service_donateflowchart`.`FlowConclusion` AS `FlowConclusion`
        FROM
 
        `service_donatebaseinfo`
        LEFT JOIN `service_donateflowchart` ON
        `service_donatebaseinfo`.`ID` = `service_donateflowchart`.`InfoID`
        AND  `service_donateflowchart`.`FlowName` = '伦理审查'
        LEFT JOIN `base_organization` ON
        `base_organization`.`OrganizationID` = `service_donatebaseinfo`.`TreatmentHospitalNo`
        <where>
            <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_donateflowchart`.create_time >= #{starttime} </if>
            <if test="endtime != null ">  and `service_donateflowchart`.create_time &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="fcid != null ">  and `service_donateflowchart`.`ID` = #{fcid}</if>
        </where>
 
        order by  `service_donateflowchart`.`create_time` desc
 
    </select>
    <select id="countNumber" resultType="java.lang.Integer">
        select count(*) from service_donateflowchart where `service_donateflowchart`.`FlowName` = '伦理审查'
        and create_time >= #{starttime} and create_time &lt;= #{endtime}
    </select>
 
</mapper>