Explorar el Código

挂号统计优化

hurugang hace 5 años
padre
commit
f4800869b4

+ 4 - 4
src/main/java/cn/hnthyy/thmz/mapper/his/ChargeFeeVoMapper.java

@@ -833,10 +833,10 @@ public interface ChargeFeeVoMapper {
             "<when test='orderByDcountDate!=null'>" +
             "           closing_date = b.closing_date," +
             "</when>" +
-            "           pt_count =count((case when  b.cancel_mark = '0' then b.patient_id else null end)), " +
-            "           th_count =count(case when b.cancel_mark='1' then b.patient_id else null end),            " +
-            "           pt_amount =sum((case  when b.cancel_mark = '0' then  b.req_fee + b.clinic_fee + b.oth_fee + isnull(b.bl_fee,0) + isnull(b.ck_fee,0) else 0 end))," +
-            "           th_amount =sum(case when b.cancel_mark='1' then b.req_fee + b.clinic_fee + b.oth_fee + isnull(b.bl_fee,0) + isnull(b.ck_fee,0) else 0 end)," +
+            "           pt_count =count((case when  b.cancel_mark = '0' or (b.cancel_mark = '1' and times <![CDATA[>]]> 0 ) then b.patient_id else null end)), " +
+            "           th_count =count(case when b.cancel_mark='1' and times <![CDATA[<]]> 0 then b.patient_id else null end),            " +
+            "           pt_amount =sum((case  when b.cancel_mark = '0' or ( b.cancel_mark = '1' and times <![CDATA[>]]> 0)  then  b.req_fee + b.clinic_fee + b.oth_fee + isnull(b.bl_fee,0) + isnull(b.ck_fee,0) else 0 end))," +
+            "           th_amount =sum(case when b.cancel_mark='1' and times <![CDATA[<]]> 0  then b.req_fee + b.clinic_fee + b.oth_fee + isnull(b.bl_fee,0) + isnull(b.ck_fee,0) else 0 end)," +
             "           total_amount=sum((case  when b.cancel_mark in ('0','1') then  b.req_fee + b.clinic_fee + b.oth_fee + isnull(b.bl_fee,0) + isnull(b.ck_fee,0) else 0 end)) " +
             "    FROM ${tableName}   b " +
             "   WHERE " +