From ca29e025563fb430861d191d11dcd226b4e8e4d7 Mon Sep 17 00:00:00 2001
From: sinake <sinake1@qq.com>
Date: 星期一, 21 九月 2026 16:30:02 +0800
Subject: [PATCH] 捐献器官统计明细列表

---
 ruoyi-project/src/main/resources/mapper/project/ServiceDonatebaseinfoMapper.xml |   51 +++++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 41 insertions(+), 10 deletions(-)

diff --git a/ruoyi-project/src/main/resources/mapper/project/ServiceDonatebaseinfoMapper.xml b/ruoyi-project/src/main/resources/mapper/project/ServiceDonatebaseinfoMapper.xml
index bc0be20..a223c09 100644
--- a/ruoyi-project/src/main/resources/mapper/project/ServiceDonatebaseinfoMapper.xml
+++ b/ruoyi-project/src/main/resources/mapper/project/ServiceDonatebaseinfoMapper.xml
@@ -96,6 +96,7 @@
         <result property="currentHospital" column="current_hospital"/>
         <result property="terminationType" column="termination_type"/>
         <result property="extracontent" column="extracontent"/>
+        <result property="entryTime" column="entry_time"/>
     </resultMap>
 
     <sql id="selectServiceDonatebaseinfoVo">
@@ -259,7 +260,7 @@
     </select>
     <select id="getDonateBaseCountThisYear" resultType="java.lang.Integer">
         select count(*) from service_donatebaseinfo b
-        inner join base_organization o on b.TreatmentHospitalNo = o.OrganizationID
+        left join base_organization o on b.TreatmentHospitalNo = o.OrganizationID
         <where>
             AND b.del_flag=0
             <if test="starttime != null ">and b.donatetime >= #{starttime}</if>
@@ -299,7 +300,7 @@
     </select>
     <select id="getAllDonateBaseInfoByTime" resultType="com.ruoyi.project.domain.ServiceDonatebaseinfo">
         select * from service_donatebaseinfo b
-        inner join base_organization o on b.TreatmentHospitalNo = o.OrganizationID
+        left join base_organization o on b.TreatmentHospitalNo = o.OrganizationID
         <where>
             <if test="starttime != null ">and b.ReportTime >= #{starttime}</if>
             <if test="caseNo != null ">and b.case_no >= #{caseNo}</if>
@@ -349,21 +350,21 @@
     <select id="getDistrictDonate" resultType="java.lang.String">
         select o.city
         from service_donatebaseinfo b
-                 inner join base_organization o on o.organizationid = b.treatmenthospitalno
+                 left join base_organization o on o.organizationid = b.treatmenthospitalno
         where (b.RecordState = '0' or b.RecordState = '1' or b.RecordState = '2')
     </select>
     <select id="getDistrictComplete" resultType="java.lang.String">
         select o.city
         from service_donatebaseinfo b
                  inner join service_donatecompletioninfo d on d.infoid = b.id
-                 inner join base_organization o on o.organizationid = b.treatmenthospitalno
+                 left join base_organization o on o.organizationid = b.treatmenthospitalno
         where d.CompleteTime > 0
     </select>
     <select id="getDistrictOrgans" resultType="java.lang.String">
         select o.city
         from service_donatebaseinfo b
                  inner join service_donateorgan d on d.infoid = b.id
-                 inner join base_organization o on o.organizationid = b.treatmenthospitalno
+                 left join base_organization o on o.organizationid = b.treatmenthospitalno
         where d.OrganGetTime > 0
     </select>
     <select id="getDonateNameById" resultType="java.lang.String">
@@ -375,7 +376,7 @@
     <select id="getDistrictDonateByTime" resultType="java.lang.String">
         select o.city
         from service_donatebaseinfo b
-                 inner join base_organization o on o.organizationid = b.treatmenthospitalno
+                 left join base_organization o on o.organizationid = b.treatmenthospitalno
         where (b.RecordState = '0' or b.RecordState = '1' or b.RecordState = '2')
           and b.ReportTime >= #{starttime}
           and b.ReportTime &lt;= #{endtime}
@@ -384,7 +385,7 @@
         select o.city
         from service_donatebaseinfo b
                  inner join service_donatecompletioninfo d on d.infoid = b.id
-                 inner join base_organization o on o.organizationid = b.treatmenthospitalno
+                 left join base_organization o on o.organizationid = b.treatmenthospitalno
         where d.del_flag = 0
           and d.CompleteTime >= #{starttime}
           and d.CompleteTime &lt;= #{endtime}
@@ -393,7 +394,7 @@
     <select id="gettreatmenthospitalnoCompleteByTime" resultType="java.lang.String">
         select b.treatmenthospitalno from service_donatebaseinfo b
         inner join service_donatecompletioninfo d on d.infoid=b.id
-        inner join base_organization o on o.organizationid=b.treatmenthospitalno
+        left join base_organization o on o.organizationid=b.treatmenthospitalno
         <where>
             d.del_flag=0
             <if test="starttime != null ">and d.CompleteTime >= #{starttime}</if>
@@ -408,7 +409,7 @@
         select o.city
         from service_donatebaseinfo b
                  inner join service_donateorgan d on d.infoid = b.id
-                 inner join base_organization o on o.organizationid = b.treatmenthospitalno
+                 left join base_organization o on o.organizationid = b.treatmenthospitalno
         WHERE d.del_flag = 0
           AND d.OrganGetTime IS NOT NULL
           AND d.OrganGetTime >= #{starttime}
@@ -463,7 +464,7 @@
         <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="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}
@@ -478,4 +479,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>

--
Gitblit v1.9.3