From 0d45c29b4d4b043342f39a9a03fb0cc8162f4ef7 Mon Sep 17 00:00:00 2001
From: sinake <sinake1@qq.com>
Date: 星期二, 19 五月 2026 10:15:29 +0800
Subject: [PATCH] 新增InfoID获取伦理审查发起详细信息挡口,获取捐献工作流新增7个状态字段数据

---
 ruoyi-project/src/main/resources/mapper/project/ServiceEthicalreviewopinionsMapper.xml |   56 ++++++++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 44 insertions(+), 12 deletions(-)

diff --git a/ruoyi-project/src/main/resources/mapper/project/ServiceEthicalreviewopinionsMapper.xml b/ruoyi-project/src/main/resources/mapper/project/ServiceEthicalreviewopinionsMapper.xml
index f327e28..d838f25 100644
--- a/ruoyi-project/src/main/resources/mapper/project/ServiceEthicalreviewopinionsMapper.xml
+++ b/ruoyi-project/src/main/resources/mapper/project/ServiceEthicalreviewopinionsMapper.xml
@@ -135,28 +135,34 @@
         service_ethicalreviewopinions.dept_name as dept_name,
         service_ethicalreviewopinions.dept_code as dept_code,
         service_ethicalreviewopinions.organ_type as organ_type,
-        service_ethicalreviewopinions.ConclusionOrder as conclusionorder
-        FROM
-        service_donatebaseinfo
-        LEFT JOIN
-        service_ethicalreviewopinions
-        ON
-        service_donatebaseinfo.ID = service_ethicalreviewopinions.InfoID
+        service_ethicalreviewopinions.ConclusionOrder as conclusionorder,
+        service_ethicalreviewopinions.nitiate_id as nitiateId,
+        service_ethicalreviewopinions.expert_no as expertNo,
+        service_ethicalreviewopinions.start_time,
+        service_ethicalreviewopinions.end_time,
+        service_ethicalreviewopinions.expert_type,
+        c.file_patch,
+        service_ethicalreviewopinions.sigin as sigin
+        FROM   service_donatebaseinfo
+        LEFT JOIN  service_ethicalreviewopinions
+        ON service_donatebaseinfo.ID = service_ethicalreviewopinions.InfoID
         LEFT JOIN base_organization ON
         base_organization.OrganizationID = service_donatebaseinfo.TreatmentHospitalNo
-
+        left join service_ethicalreviewinitiate c on c.InfoID=service_donatebaseinfo.id
         <where>
             service_donatebaseinfo.del_flag=0
             and service_ethicalreviewopinions.del_flag=0
             <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 test="name != null  and name != ''">
+            and (`service_donatebaseinfo`.`Name` like concat('%', #{name}, '%')  or `service_donatebaseinfo`.`InpatientNo` like concat('%', #{name}, '%'))
             </if>
             <if test="idcardno != null  and idcardno != ''">and `service_donatebaseinfo`.`IDCardNo` = #{idcardno}</if>
+            <if test="inpatientno != null  and inpatientno != ''">and `service_donatebaseinfo`.`InpatientNo` = #{inpatientno}</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 test="recordstate != null  and recordstate != ''">
+                and `service_donatebaseinfo`.`RecordState` = #{recordstate}
             </if>
             <if test="caseNo != null  and caseNo != ''">and `service_donatebaseinfo`.`case_no` =
                 #{caseNo}
@@ -172,6 +178,14 @@
             <if test="city != null and city != ''">and `base_organization`.`City` = #{city}</if>
             <if test="fcid != null ">and `service_ethicalreviewopinions`.`ID` = #{fcid}</if>
             <if test="workflow != null ">and `service_donatebaseinfo`.`workflow` = #{workflow}</if>
+            <if test="nitiateId != null ">and `service_ethicalreviewopinions`.`nitiate_id` = #{nitiateId}</if>
+            <if test="expertNo != null ">and `service_ethicalreviewopinions`.`expert_no` = #{expertNo}</if>
+            <if test="receiveStatus != null  and receiveStatus != ''">
+                and `service_ethicalreviewopinions`.`receive_status` in(${receiveStatus})
+            </if>
+            <if test="expertname != null ">and `service_ethicalreviewopinions`.`expertname` = #{expertname}</if>
+            <if test="expertconclusion != null ">and `service_ethicalreviewopinions`.`expertconclusion` = #{expertconclusion}</if>
+
         </where>
 
         order by `service_ethicalreviewopinions`.`ConclusionTime` desc
@@ -196,10 +210,28 @@
 
         FROM service_ethicalreviewopinions
         <where>
-            <if test="DonorNo != null ">DonorNo = #{DonorNo}</if>
+            <if test="expertNo != null ">expert_no = #{expertNo}</if>
         </where>
 
         GROUP BY receive_status,ExpertOpinion,ConclusionAnnex
     </select>
 
+    <update id="updateTimeOut" >
+        UPDATE service_ethicalreviewopinions SET receive_status=0
+        WHERE end_time IS NOT NULL AND end_time &lt;= NOW()
+    </update>
+
+    <select id="stateTotal" resultType="com.ruoyi.project.domain.vo.EthicalreviewopinionsStateTotalVO">
+        SELECT COUNT(*) count,SUM(CASE WHEN receive_status = 5 THEN 1 ELSE 0 END) AS throughCount,
+        SUM(CASE WHEN receive_status =4  THEN 1 ELSE 0 END) AS rejectCount,
+        SUM(CASE WHEN receive_status =3  THEN 1 ELSE 0 END) AS waiveCount
+
+        FROM service_ethicalreviewopinions
+        <where>
+            <if test="expertNo != null ">expert_no = #{expertNo}</if>
+        </where>
+
+
+    </select>
+
 </mapper>

--
Gitblit v1.9.3