sinake
13 小时以前 f16ee221c1384160c96a5907791d07e4f6126c4c
ruoyi-project/src/main/resources/mapper/project/ServiceDonatebaseinfoMapper.xml
@@ -478,4 +478,34 @@
        <if test="pageNum != null and pageSize != null">limit #{pageNum},#{pageSize}</if>
    </select>
    <select id="totalConfirmationBaseInfo" resultType="Map">
        SELECT  recordstate AS recordState, count(recordstate) AS stateCount
        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 like concat('%', #{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>
        GROUP BY recordstate
    </select>
</mapper>