From 1b8f305c2764e382f5d72bd0f7b65826ee2b3ebe Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期二, 26 三月 2024 14:17:35 +0800
Subject: [PATCH] 代码提交

---
 ruoyi-project/src/main/resources/mapper/project/ServiceDonationwitnessMapper.xml |    2 
 ruoyi-project/src/main/resources/mapper/project/ServiceDonatebaseinfoMapper.xml  |    4 
 ruoyi-project/src/main/resources/mapper/project/ServiceDonateorganMapper.xml     |  158 ++++++++++++++++++++++++++++++++++++++--------------
 3 files changed, 119 insertions(+), 45 deletions(-)

diff --git a/ruoyi-project/src/main/resources/mapper/project/ServiceDonatebaseinfoMapper.xml b/ruoyi-project/src/main/resources/mapper/project/ServiceDonatebaseinfoMapper.xml
index 83a05fc..4f0776f 100644
--- a/ruoyi-project/src/main/resources/mapper/project/ServiceDonatebaseinfoMapper.xml
+++ b/ruoyi-project/src/main/resources/mapper/project/ServiceDonatebaseinfoMapper.xml
@@ -241,8 +241,8 @@
         inner join base_organization o on b.TreatmentHospitalNo = o.OrganizationID
         <where>
             AND b.del_flag=0
-            <if test="starttime != null ">and b.ReportTime >= #{starttime}</if>
-            <if test="endtime != null ">and b.ReportTime &lt;= #{endtime}</if>
+            <if test="starttime != null ">and b.donatetime >= #{starttime}</if>
+            <if test="endtime != null ">and b.donatetime &lt;= #{endtime}</if>
             <if test="city != null and city != ''">and o.City = #{city}</if>
             <if test="reporterno != null and reporterno != ''">and b.ReporterNo = #{reporterno}</if>
         </where>
diff --git a/ruoyi-project/src/main/resources/mapper/project/ServiceDonateorganMapper.xml b/ruoyi-project/src/main/resources/mapper/project/ServiceDonateorganMapper.xml
index 142d674..898ff17 100644
--- a/ruoyi-project/src/main/resources/mapper/project/ServiceDonateorganMapper.xml
+++ b/ruoyi-project/src/main/resources/mapper/project/ServiceDonateorganMapper.xml
@@ -215,25 +215,54 @@
         <if test="reporterno != null and reporterno != ''">and b.ReporterNo = #{reporterno}</if>
     </select>
     <select id="getAllFinishedOrgansThisYear" resultType="java.lang.Integer">
-        select count(*) from service_donateorgan d
+        <!--        select count(*) from service_donateorgan d-->
 
+        <!--        inner join service_donatebaseinfo b on b.id = d.InfoID-->
+        <!--        inner join base_organization o on b.TreatmentHospitalNo = o.OrganizationID-->
+        <!--        where OrganState = "6" AND d.del_flag=0 AND d.OrganGetTime IS NOT NULL AND d.OrganNo != 'C00'-->
+        <!--        AND d.OrganNo != 'C69L'-->
+        <!--        AND d.OrganNo != 'C69R'-->
+        <!--        <if test="starttime != null">and d.OrganGetTime >= #{starttime}</if>-->
+        <!--        <if test="endtime != null ">and d.OrganGetTime &lt;= #{endtime}</if>-->
+        <!--        <if test="city != null and city != ''">and o.City = #{city}</if>-->
+        <!--        <if test="reporterno != null and reporterno != ''">and b.ReporterNo = #{reporterno}</if>-->
+        select count(*) from service_donatecomporgan d
         inner join service_donatebaseinfo b on b.id = d.InfoID
         inner join base_organization o on b.TreatmentHospitalNo = o.OrganizationID
-        where OrganState = "6" AND d.del_flag=0 AND d.OrganGetTime IS NOT NULL AND d.OrganNo != 'C00'
+        where b.del_flag=0
+        AND d.transplantstate = "1"
+        AND d.del_flag=0
+        AND d.TransplantTime IS NOT NULL
+        AND d.OrganNo != 'C00'
         AND d.OrganNo != 'C69L'
         AND d.OrganNo != 'C69R'
-        <if test="starttime != null">and d.OrganGetTime >= #{starttime}</if>
-        <if test="endtime != null ">and d.OrganGetTime &lt;= #{endtime}</if>
+        <if test="starttime != null">and d.TransplantTime >= #{starttime}</if>
+        <if test="endtime != null ">and d.TransplantTime &lt;= #{endtime}</if>
         <if test="city != null and city != ''">and o.City = #{city}</if>
         <if test="reporterno != null and reporterno != ''">and b.ReporterNo = #{reporterno}</if>
     </select>
     <select id="getOrganNumberThisYear" resultType="java.lang.Integer">
-        select count(*) from service_donateorgan d
+        <!--select count(*) from service_donateorgan d-->
 
+        <!--inner join service_donatebaseinfo b on b.id = d.InfoID-->
+        <!--inner join base_organization o on b.TreatmentHospitalNo = o.OrganizationID-->
+
+        <!--where d.OrganGetTime IS NOT NULL AND d.OrganNo != 'C00'-->
+        <!--AND d.OrganNo != 'C69L'-->
+        <!--AND d.OrganNo != 'C69R'-->
+        <!--AND d.del_flag=0-->
+        <!--<if test="starttime != null ">and d.OrganGetTime >= #{starttime}</if>-->
+        <!--<if test="endtime != null ">and d.OrganGetTime &lt;= #{endtime}</if>-->
+        <!--<if test="city != null and city != ''">and o.City = #{city}</if>-->
+        <!--<if test="reporterno != null and reporterno != ''">and b.ReporterNo = #{reporterno}</if>-->
+
+        select count(*) from service_donationwitnessorgan d
         inner join service_donatebaseinfo b on b.id = d.InfoID
         inner join base_organization o on b.TreatmentHospitalNo = o.OrganizationID
-
-        where d.OrganGetTime IS NOT NULL AND d.OrganNo != 'C00'
+        where b.del_flag=0
+        AND d.OrganGetTime IS NOT NULL
+        AND d.OrganState=1
+        AND d.OrganNo != 'C00'
         AND d.OrganNo != 'C69L'
         AND d.OrganNo != 'C69R'
         AND d.del_flag=0
@@ -512,7 +541,7 @@
         where d.OrganNo = #{organno}
         -- and (OrganState = "3" or OrganState = "4" or OrganState = "5" or OrganState = "6")
         and d.del_flag=0
---         and d.OrganGetTime IS NOT NULL
+        -- and d.OrganGetTime IS NOT NULL
         <if test="starttime != null ">and d.OrganGetTime >= #{starttime}</if>
         <if test="endtime != null ">and d.OrganGetTime &lt;= #{endtime}</if>
         <if test="city != null and city != ''">and o.City = #{city}</if>
@@ -529,45 +558,88 @@
         and OrganGetTime >= #{starttime} and OrganGetTime &lt;= #{endtime}
     </select>
 
-    <select id="countList" parameterType="com.ruoyi.project.domain.ServiceOrganallocation" resultMap="ServiceDonateorganResult">
+    <select id="countList" parameterType="com.ruoyi.project.domain.ServiceOrganallocation"
+            resultMap="ServiceDonateorganResult">
         select service_donateorgan.* from service_donateorgan
         LEFT JOIN service_donatebaseinfo on service_donateorgan.InfoID=service_donatebaseinfo.ID
         LEFT JOIN base_organization on base_organization.OrganizationID = service_donatebaseinfo.TreatmentHospitalNo
         <where>
-            <if test="id != null "> and service_donateorgan.ID = #{id}</if>
-            <if test="organnumber != null  and organnumber != ''"> and service_donateorgan.OrganNumber = #{organnumber}</if>
-            <if test="applicantuserid != null  and applicantuserid != ''"> and service_donateorgan.ApplicantUserID = #{applicantuserid}</if>
-            <if test="applicantusername != null  and applicantusername != ''"> and service_donateorgan.ApplicantUserName like concat('%', #{applicantusername}, '%')</if>
-            <if test="applicanttime != null "> and service_donateorgan.ApplicantTime = #{applicanttime}</if>
-            <if test="checkuserid != null  and checkuserid != ''"> and service_donateorgan.CheckUserID = #{checkuserid}</if>
-            <if test="checkusername != null  and checkusername != ''"> and service_donateorgan.CheckUserName like concat('%', #{checkusername}, '%')</if>
-            <if test="checktime != null "> and service_donateorgan.CheckTime = #{checktime}</if>
-            <if test="checksuggestion != null  and checksuggestion != ''"> and service_donateorgan.CheckSuggestion = #{checksuggestion}</if>
-            <if test="allocationstatus != null "> and service_donateorgan.AllocationStatus = #{allocationstatus}</if>
-            <if test="name != null  and name != ''"> and service_donateorgan.Name like concat('%', #{name}, '%')</if>
-            <if test="sex != null "> and service_donateorgan.Sex = #{sex}</if>
-            <if test="idcardtype != null "> and service_donateorgan.IDCardType = #{idcardtype}</if>
-            <if test="idcardno != null  and idcardno != ''"> and service_donateorgan.IDCardNo = #{idcardno}</if>
-            <if test="age != null "> and service_donateorgan.Age = #{age}</if>
-            <if test="ageunit != null  and ageunit != ''"> and service_donateorgan.AgeUnit = #{ageunit}</if>
-            <if test="birthday != null  and birthday != ''"> and service_donateorgan.Birthday = #{birthday}</if>
-            <if test="phone != null  and phone != ''"> and service_donateorgan.Phone = #{phone}</if>
-            <if test="residenceaddress != null  and residenceaddress != ''"> and service_donateorgan.ResidenceAddress = #{residenceaddress}</if>
-            <if test="residenceprovince != null  and residenceprovince != ''"> and service_donateorgan.ResidenceProvince = #{residenceprovince}</if>
-            <if test="residenceprovincename != null  and residenceprovincename != ''"> and service_donateorgan.ResidenceProvinceName like concat('%', #{residenceprovincename}, '%')</if>
-            <if test="residencecity != null  and residencecity != ''"> and service_donateorgan.ResidenceCity = #{residencecity}</if>
-            <if test="residencecityname != null  and residencecityname != ''"> and service_donateorgan.ResidenceCityName like concat('%', #{residencecityname}, '%')</if>
-            <if test="residencetown != null  and residencetown != ''"> and service_donateorgan.ResidenceTown = #{residencetown}</if>
-            <if test="residencetownname != null  and residencetownname != ''"> and service_donateorgan.ResidenceTownName like concat('%', #{residencetownname}, '%')</if>
-            <if test="residencecommunity != null  and residencecommunity != ''"> and service_donateorgan.ResidenceCommunity = #{residencecommunity}</if>
-            <if test="residencecommunityname != null  and residencecommunityname != ''"> and service_donateorgan.ResidenceCommunityName like concat('%', #{residencecommunityname}, '%')</if>
-            <if test="residencecountycode != null  and residencecountycode != ''"> and service_donateorgan.ResidenceCountyCode = #{residencecountycode}</if>
-            <if test="residencecountyname != null  and residencecountyname != ''"> and service_donateorgan.ResidenceCountyName like concat('%', #{residencecountyname}, '%')</if>
-            <if test="createBy != null  and createBy != ''"> and service_donateorgan.create_by = #{createBy}</if>
-            <if test="starttime != null "> and `service_donateorgan`.ApplicantTime >= #{starttime} </if>
-            <if test="endtime != null ">  and `service_donateorgan`.ApplicantTime &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="id != null ">and service_donateorgan.ID = #{id}</if>
+            <if test="organnumber != null  and organnumber != ''">and service_donateorgan.OrganNumber = #{organnumber}
+            </if>
+            <if test="applicantuserid != null  and applicantuserid != ''">and service_donateorgan.ApplicantUserID =
+                #{applicantuserid}
+            </if>
+            <if test="applicantusername != null  and applicantusername != ''">and service_donateorgan.ApplicantUserName
+                like
+                concat('%', #{applicantusername}, '%')
+            </if>
+            <if test="applicanttime != null ">and service_donateorgan.ApplicantTime = #{applicanttime}</if>
+            <if test="checkuserid != null  and checkuserid != ''">and service_donateorgan.CheckUserID = #{checkuserid}
+            </if>
+            <if test="checkusername != null  and checkusername != ''">and service_donateorgan.CheckUserName like
+                concat('%',
+                #{checkusername}, '%')
+            </if>
+            <if test="checktime != null ">and service_donateorgan.CheckTime = #{checktime}</if>
+            <if test="checksuggestion != null  and checksuggestion != ''">and service_donateorgan.CheckSuggestion =
+                #{checksuggestion}
+            </if>
+            <if test="allocationstatus != null ">and service_donateorgan.AllocationStatus = #{allocationstatus}</if>
+            <if test="name != null  and name != ''">and service_donateorgan.Name like concat('%', #{name}, '%')</if>
+            <if test="sex != null ">and service_donateorgan.Sex = #{sex}</if>
+            <if test="idcardtype != null ">and service_donateorgan.IDCardType = #{idcardtype}</if>
+            <if test="idcardno != null  and idcardno != ''">and service_donateorgan.IDCardNo = #{idcardno}</if>
+            <if test="age != null ">and service_donateorgan.Age = #{age}</if>
+            <if test="ageunit != null  and ageunit != ''">and service_donateorgan.AgeUnit = #{ageunit}</if>
+            <if test="birthday != null  and birthday != ''">and service_donateorgan.Birthday = #{birthday}</if>
+            <if test="phone != null  and phone != ''">and service_donateorgan.Phone = #{phone}</if>
+            <if test="residenceaddress != null  and residenceaddress != ''">and service_donateorgan.ResidenceAddress =
+                #{residenceaddress}
+            </if>
+            <if test="residenceprovince != null  and residenceprovince != ''">and service_donateorgan.ResidenceProvince
+                =
+                #{residenceprovince}
+            </if>
+            <if test="residenceprovincename != null  and residenceprovincename != ''">and
+                service_donateorgan.ResidenceProvinceName like concat('%', #{residenceprovincename}, '%')
+            </if>
+            <if test="residencecity != null  and residencecity != ''">and service_donateorgan.ResidenceCity =
+                #{residencecity}
+            </if>
+            <if test="residencecityname != null  and residencecityname != ''">and service_donateorgan.ResidenceCityName
+                like
+                concat('%', #{residencecityname}, '%')
+            </if>
+            <if test="residencetown != null  and residencetown != ''">and service_donateorgan.ResidenceTown =
+                #{residencetown}
+            </if>
+            <if test="residencetownname != null  and residencetownname != ''">and service_donateorgan.ResidenceTownName
+                like
+                concat('%', #{residencetownname}, '%')
+            </if>
+            <if test="residencecommunity != null  and residencecommunity != ''">and
+                service_donateorgan.ResidenceCommunity =
+                #{residencecommunity}
+            </if>
+            <if test="residencecommunityname != null  and residencecommunityname != ''">and
+                service_donateorgan.ResidenceCommunityName like concat('%', #{residencecommunityname}, '%')
+            </if>
+            <if test="residencecountycode != null  and residencecountycode != ''">and
+                service_donateorgan.ResidenceCountyCode =
+                #{residencecountycode}
+            </if>
+            <if test="residencecountyname != null  and residencecountyname != ''">and
+                service_donateorgan.ResidenceCountyName
+                like concat('%', #{residencecountyname}, '%')
+            </if>
+            <if test="createBy != null  and createBy != ''">and service_donateorgan.create_by = #{createBy}</if>
+            <if test="starttime != null ">and `service_donateorgan`.ApplicantTime >= #{starttime}</if>
+            <if test="endtime != null ">and `service_donateorgan`.ApplicantTime &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>
         </where>
 
         order by create_time desc
diff --git a/ruoyi-project/src/main/resources/mapper/project/ServiceDonationwitnessMapper.xml b/ruoyi-project/src/main/resources/mapper/project/ServiceDonationwitnessMapper.xml
index 2feaa6e..3c78bbc 100644
--- a/ruoyi-project/src/main/resources/mapper/project/ServiceDonationwitnessMapper.xml
+++ b/ruoyi-project/src/main/resources/mapper/project/ServiceDonationwitnessMapper.xml
@@ -249,6 +249,8 @@
         inner join service_donatebaseinfo b on w.InfoID = b.id
         inner join base_organization o on b.TreatmentHospitalNo = o.OrganizationID
         <where>
+            w.del_flag=0
+            and b.del_flag=0
             <if test="starttime != null ">and w.OperationBegTime >= #{starttime}</if>
             <if test="endtime != null ">and w.OperationBegTime &lt;= #{endtime}</if>
             <if test="city != null and city != ''">and o.City = #{city}</if>

--
Gitblit v1.9.3