From 64fe4241b5e764f91966878eff1720a3b14d6da8 Mon Sep 17 00:00:00 2001
From: sinake <sinake1@qq.com>
Date: 星期三, 25 十一月 2026 11:50:58 +0800
Subject: [PATCH] 打包文件

---
 ruoyi-project/src/main/resources/mapper/project/ServiceDonorchargeorganMapper.xml |   46 ++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 46 insertions(+), 0 deletions(-)

diff --git a/ruoyi-project/src/main/resources/mapper/project/ServiceDonorchargeorganMapper.xml b/ruoyi-project/src/main/resources/mapper/project/ServiceDonorchargeorganMapper.xml
index 0e0c1cf..7f1ace5 100644
--- a/ruoyi-project/src/main/resources/mapper/project/ServiceDonorchargeorganMapper.xml
+++ b/ruoyi-project/src/main/resources/mapper/project/ServiceDonorchargeorganMapper.xml
@@ -189,6 +189,52 @@
         order by b.donatetime
     </select>
 
+    <select id="organfeeSummary" parameterType="com.ruoyi.project.domain.ServiceDonorchargeorgan"
+            resultType="Map">
+        select sum(organcharge) organchargeTotal, sum(amount) amountTotal, sum(organcharge)- sum(amount) unreceivedTotal,count(*) rowCount
+        from service_donorchargeorgan o
+        <where>
+            and (o.del_flag = 0 or o.del_flag is null)
+            <if test="selectAll != true ">
+                and (o.paymentid IS NULL or o.paymentid=0 or organcharge-amount>0)
+                and (organ_charge_state =0 OR organ_charge_state IS null)
+            </if>
+            <if test="infoid != null ">and o.InfoID = #{infoid}</if>
+            <if test="receiveTime != null ">and o.receive_time = #{receiveTime}</if>
+            <if test="paymentno != null ">and o.paymentno = #{paymentno}</if>
+            <if test="donorchargeid != null ">and o.donorchargeID = #{donorchargeid}</if>
+            <if test="donorname != null  and donorname != ''">and o.donorname like concat('%', #{donorname}, '%')</if>
+            <if test="hospitalname != null  and hospitalname != ''">and o.HospitalName like concat('%', #{hospitalname},
+                '%')
+            </if>
+            <if test="hospitalno != null  and hospitalno != ''">and o.HospitalNo = #{hospitalno}</if>
+            <if test="hospitalnoIsNull == true">and (o.Hospitalname is null or o.Hospitalname = '')</if>
+            <if test="organno != null  and organno != ''">and o.OrganNo = #{organno}</if>
+            <if test="organname != null  and organname != ''">and o.OrganName like concat('%', #{organname}, '%')</if>
+            <if test="organState != null  and organState != ''">and o.organ_state = #{organState}</if>
+            <if test="payStatus != null  and payStatus != ''">
+                <choose>
+                    <when test="payStatus == '宸蹭粯'">
+                        and o.organcharge is not null and (o.organcharge - IFNULL(o.amount, 0)) = 0
+                    </when>
+                    <when test="payStatus == '鏈粯'">
+                        and o.organcharge is not null and (o.organcharge - IFNULL(o.amount, 0)) &lt;&gt; 0
+                    </when>
+                </choose>
+            </if>
+            <if test="organcharge != null ">and o.organcharge = #{organcharge}</if>
+            <if test="organtime != null ">and o.organtime = #{organtime}</if>
+            <if test="chargeoperator != null  and chargeoperator != ''">and o.chargeoperator = #{chargeoperator}</if>
+            <if test="amount != null ">and o.amount = #{amount}</if>
+            <if test="amounttime != null ">and o.amounttime = #{amounttime}</if>
+            <if test="amountoperator != null  and amountoperator != ''">and o.amountoperator = #{amountoperator}</if>
+            <if test="chargestate != null ">and o.chargestate = #{chargestate}</if>
+            <if test="organchargedesc != null  and organchargedesc != ''">and o.organchargedesc = #{organchargedesc}</if>
+            <if test="starttime != null ">and donationtime &gt;= #{starttime}</if>
+            <if test="endtime != null ">and donationtime &lt;= #{endtime}</if>
+        </where>
+    </select>
+
     <update id="removeByIds">
         update service_donorchargeorgan
         set del_flag = 1

--
Gitblit v1.9.3