liusheng
10 天以前 d88fffd5d757a23f302011ced88dea92e1ce31e9
ruoyi-project/src/main/resources/mapper/project/ServiceDonatebaseinfoMapper.xml
@@ -91,6 +91,11 @@
        <result property="gcsScore" column="gcs_score"/>
        <result property="coordinatorNo" column="coordinator_no"/>
        <result property="coordinatorName" column="coordinator_name"/>
        <result property="terminationResult" column="termination_result"/>
        <result property="reportHospital" column="report_hospital"/>
        <result property="currentHospital" column="current_hospital"/>
        <result property="terminationType" column="termination_type"/>
        <result property="extracontent" column="extracontent"/>
    </resultMap>
    <sql id="selectServiceDonatebaseinfoVo">
@@ -410,4 +415,67 @@
          AND d.OrganGetTime &lt;= #{endtime}
    </select>
    <select id="donateBaseInfoProgressList" resultType="com.ruoyi.project.domain.dto.DonatebaseinfoProgressDTO">
        SELECT sd.treatmenthospitalname AS treatmenthospitalname,
        sd.treatmenthospitalno AS treatmenthospitalno,
        sd.DonorNo AS donorno,
        sd.id AS id,
        sd.InpatientNo AS inpatientNo,
        sd.case_no AS caseNo,
        sd.NAME AS NAME,
        sd.RecordState AS recordstate,
        sd.termination_case AS terminationCase,
        sd.termination_type AS terminationType,
        sd.termination_result AS terminationResult,
        sd.workflow AS workflow,
        sd.Infectious AS infectious,
        sd.Infectious_other AS infectiousOther,
        sd.Sex AS sex,
        sd.Age AS age,
        sd.BloodType AS bloodtype,
        sd.idcardno AS idcardno,
        sd.ReportTime AS reportTime,
        sd.coordinator_no AS coordinatorNo,
        sd.coordinator_name AS coordinatorName,
        sd.diagnosisname AS diagnosisname,
        sd.extracontent AS extracontent,
        sm.assess_state AS assessState,-- 评估状态
        sm.assess_time AS assessTime,-- 评估时间
        sr.SignDate AS signDate,-- 亲属确认时间
        se.expert_conclusion AS expertConclusion,-- 伦理审查专家结论
        se.expert_time AS expertTime,-- 伦理审查专家结论时间
        (SELECT COUNT(*) FROM service_donateorgan sdo WHERE sdo.InfoID = sd.ID) AS organCount,-- 器官分配数量
        sdw.OperationBegTime AS operationBegTime,-- 获取见证时间
        sdt.CompleteTime AS completeTime -- 完成登记时间
        FROM service_donatebaseinfo sd
        LEFT JOIN service_medicalevaluation sm ON sd.ID = sm.InfoID
        AND sm.del_flag = 0 -- 捐献评估
        LEFT JOIN service_relativesconfirmation sr ON sd.ID = sr.InfoID
        AND sr.del_flag = 0-- 捐献确认
        LEFT JOIN service_ethicalreviewinitiate se ON sd.ID = se.InfoID
        AND se.del_flag = 0-- 伦理审查
        LEFT JOIN service_donationwitness sdw ON sd.ID = sdw.InfoID
        AND sdw.del_flag = 0-- 获取见证
        LEFT JOIN service_donatecompletioninfo sdt ON sd.ID = sdt.InfoID
        AND sdt.del_flag = 0 -- 完成登记
        <where>sd.del_flag = 0
            <if test="terminationCase != null ">AND sd.termination_case = #{terminationCase}</if>
            <if test="treatmentHospitalName != null ">AND sd.TreatmentHospitalName = #{treatmentHospitalName}</if>
            <if test="name != null ">AND sd.Name = #{name}</if>
            <if test="inpatientNo != null ">AND sd.InpatientNo = #{inpatientNo}</if>
            <if test="startAge != null">AND sd.age &gt;= #{startAge}</if>
            <if test="endAge !=null">AND sd.age &lt;= #{endAge}
            </if>
            <if test="idcardno != null  and idcardno != ''">and IDCardNo = #{idcardno}</if>
            <if test="recordstate != null and recordstate != ''">and sd.RecordState = #{recordstate}</if>
            <if test="workflow != null">and sd.workflow = #{workflow}</if>
            <if test="diagnosisName != null">and sd.DiagnosisName like concat('%', #{diagnosisName}, '%')</if>
        </where>
        ORDER BY sd.ReportTime DESC
        <if test="pageNum != null and pageSize != null">limit #{pageNum},#{pageSize}</if>
    </select>
</mapper>