瀏覽代碼

退号数调整

hurugang 5 年之前
父節點
當前提交
ac78d2a6fd
共有 1 個文件被更改,包括 18 次插入18 次删除
  1. 18 18
      src/main/java/cn/hnthyy/thmz/mapper/his/ChargeFeeVoMapper.java

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

@@ -621,57 +621,57 @@ public interface ChargeFeeVoMapper {
             "SELECT " +
                     " count ( case when times  <![CDATA[>]]> 0 and (paymode ='1' or paymode is null) then 1 else null end ) xjhs," +
                     " sum ( case when times  <![CDATA[>]]> 0 and (paymode ='1' or paymode is null) then req_fee + oth_fee + clinic_fee + isnull ( brochure_fee , 0 ) + isnull ( bl_fee , 0 ) + isnull ( ck_fee , 0 ) else 0 end ) xjsk, " +
-                    " count ( case when  times  <![CDATA[<]]> 0 and (paymode ='1' or paymode is null) then 1 else null end ) - count ( case when times  <![CDATA[<]]> 0 and (paymode ='1' or paymode is null) then 1 else null end )xjthhs," +
+                    " count ( case when  times  <![CDATA[<]]> 0 and (paymode ='1' or paymode is null) then 1 else null end ) xjthhs," +
                     " ABS( sum ( case when times  <![CDATA[<]]> 0 and (paymode ='1' or paymode is null) then req_fee + oth_fee + clinic_fee + isnull ( brochure_fee , 0 ) + isnull ( bl_fee , 0 ) + isnull ( ck_fee , 0 ) else 0 end )) xjth, " +
-                    " count ( case when times  <![CDATA[>]]> 0 and (paymode ='1' or paymode is null) then 1 else null end ) xjsshs," +
+                    " count ( case when times  <![CDATA[>]]> 0 and (paymode ='1' or paymode is null) then 1 else null end ) - count ( case when times  <![CDATA[<]]> 0 and (paymode ='1' or paymode is null) then 1 else null end ) xjsshs," +
                     " sum ( case when paymode ='1' or paymode is null then req_fee + oth_fee + clinic_fee + isnull ( brochure_fee , 0 ) + isnull ( bl_fee , 0 ) + isnull ( ck_fee , 0 ) else 0 end ) xjss, " +
                     " count ( case when times  <![CDATA[>]]> 0 and paymode ='3' then 1 else null end ) yhkhs," +
                     " sum ( case when times  <![CDATA[>]]> 0 and paymode ='3'  then req_fee + oth_fee + clinic_fee + isnull ( brochure_fee , 0 ) + isnull ( bl_fee , 0 ) + isnull ( ck_fee , 0 ) else 0 end ) yhksk, " +
-                    " count ( case when  times  <![CDATA[<]]> 0 and paymode ='3' then 1 else null end ) - count ( case when times  <![CDATA[<]]> 0 and paymode ='3'  then 1 else null end ) yhkthhs," +
+                    " count ( case when  times  <![CDATA[<]]> 0 and paymode ='3' then 1 else null end )  yhkthhs," +
                     " ABS(sum ( case when times  <![CDATA[<]]> 0 and paymode ='3' then req_fee + oth_fee + clinic_fee + isnull ( brochure_fee , 0 ) + isnull ( bl_fee , 0 ) + isnull ( ck_fee , 0 ) else 0 end )) yhkth, " +
-                    " count ( case when times  <![CDATA[>]]> 0 and paymode ='3'  then 1 else null end ) yhksshs," +
+                    " count ( case when times  <![CDATA[>]]> 0 and paymode ='3'  then 1 else null end ) - count ( case when times  <![CDATA[<]]> 0 and paymode ='3'  then 1 else null end ) yhksshs," +
                     " sum ( case when paymode ='3'  then req_fee + oth_fee + clinic_fee + isnull ( brochure_fee , 0 ) + isnull ( bl_fee , 0 ) + isnull ( ck_fee , 0 ) else 0 end ) yhkss," +
                     " count ( case when times  <![CDATA[>]]> 0 and paymode ='6' then 1 else null end ) ybkhs," +
                     " sum ( case when times  <![CDATA[>]]> 0 and paymode ='6'  then req_fee + oth_fee + clinic_fee + isnull ( brochure_fee , 0 ) + isnull ( bl_fee , 0 ) + isnull ( ck_fee , 0 ) else 0 end ) ybksk, " +
-                    " count ( case when times  <![CDATA[<]]> 0 and paymode ='6' then 1 else null end ) - count ( case when times  <![CDATA[<]]> 0 and paymode ='6'  then 1 else null end ) ybkthhs," +
+                    " count ( case when times  <![CDATA[<]]> 0 and paymode ='6' then 1 else null end ) ybkthhs," +
                     " ABS(sum ( case when times  <![CDATA[<]]> 0 and paymode ='6' then req_fee + oth_fee + clinic_fee + isnull ( brochure_fee , 0 ) + isnull ( bl_fee , 0 ) + isnull ( ck_fee , 0 ) else 0 end )) ybkth, " +
-                    " count ( case when times  <![CDATA[>]]> 0 and paymode ='6'  then 1 else null end ) ybksshs," +
+                    " count ( case when times  <![CDATA[>]]> 0 and paymode ='6'  then 1 else null end ) - count ( case when times  <![CDATA[<]]> 0 and paymode ='6'  then 1 else null end ) ybksshs," +
                     " sum ( case when paymode ='6'  then req_fee + oth_fee + clinic_fee + isnull ( brochure_fee , 0 ) + isnull ( bl_fee , 0 ) + isnull ( ck_fee , 0 ) else 0 end ) ybkss," +
                     " count ( case when times  <![CDATA[>]]> 0 and paymode ='F' then 1 else null end ) zfbhs," +
                     " sum ( case when times  <![CDATA[>]]> 0 and paymode ='F'  then req_fee + oth_fee + clinic_fee + isnull ( brochure_fee , 0 ) + isnull ( bl_fee , 0 ) + isnull ( ck_fee , 0 ) else 0 end ) zfbsk, " +
-                    " count ( case when times  <![CDATA[<]]> 0 and paymode ='F' then 1 else null end ) - count ( case when  times  <![CDATA[<]]> 0 and paymode ='F'  then 1 else null end ) zfbthhs," +
+                    " count ( case when times  <![CDATA[<]]> 0 and paymode ='F' then 1 else null end )  zfbthhs," +
                     " ABS(sum ( case when times  <![CDATA[<]]> 0 and paymode ='F' then req_fee + oth_fee + clinic_fee + isnull ( brochure_fee , 0 ) + isnull ( bl_fee , 0 ) + isnull ( ck_fee , 0 ) else 0 end )) zfbth, " +
-                    " count ( case when times  <![CDATA[>]]> 0 and paymode ='F'  then 1 else null end ) zfbsshs," +
+                    " count ( case when times  <![CDATA[>]]> 0 and paymode ='F'  then 1 else null end ) - count ( case when  times  <![CDATA[<]]> 0 and paymode ='F'  then 1 else null end ) zfbsshs," +
                     " sum ( case when paymode ='F'  then req_fee + oth_fee + clinic_fee + isnull ( brochure_fee , 0 ) + isnull ( bl_fee , 0 ) + isnull ( ck_fee , 0 ) else 0 end ) zfbss," +
                     " count ( case when times  <![CDATA[>]]> 0 and paymode ='E' then 1 else null end )  wxhs," +
                     " sum ( case when times  <![CDATA[>]]> 0 and paymode ='E'  then req_fee + oth_fee + clinic_fee + isnull ( brochure_fee , 0 ) + isnull ( bl_fee , 0 ) + isnull ( ck_fee , 0 ) else 0 end ) wxsk, " +
-                    " count ( case when times  <![CDATA[<]]> 0 and paymode ='E' then 1 else null end ) - count ( case when  times  <![CDATA[<]]> 0 and paymode ='E'  then 1 else null end ) wxthhs," +
+                    " count ( case when times  <![CDATA[<]]> 0 and paymode ='E' then 1 else null end ) wxthhs," +
                     " ABS(sum ( case when times  <![CDATA[<]]> 0 and paymode ='E' then req_fee + oth_fee + clinic_fee + isnull ( brochure_fee , 0 ) + isnull ( bl_fee , 0 ) + isnull ( ck_fee , 0 ) else 0 end )) wxth, " +
                     " count ( case when times  <![CDATA[>]]> 0 and paymode ='E'  then 1 else null end ) wxsshs," +
                     " sum ( case when paymode ='E'  then req_fee + oth_fee + clinic_fee + isnull ( brochure_fee , 0 ) + isnull ( bl_fee , 0 ) + isnull ( ck_fee , 0 ) else 0 end ) wxss," +
-                    " count ( case when times  <![CDATA[>]]> 0 and paymode ='Y' then 1 else null end )  byjzhs," +
+                    " count ( case when times  <![CDATA[>]]> 0 and paymode ='Y' then 1 else null end ) - count ( case when  times  <![CDATA[<]]> 0 and paymode ='E'  then 1 else null end ) byjzhs," +
                     " sum ( case when times  <![CDATA[>]]> 0 and paymode ='Y'  then req_fee + oth_fee + clinic_fee + isnull ( brochure_fee , 0 ) + isnull ( bl_fee , 0 ) + isnull ( ck_fee , 0 ) else 0 end ) byjzsk, " +
-                    " count ( case when times  <![CDATA[<]]> 0 and paymode ='Y' then 1 else null end ) - count ( case when times  <![CDATA[<]]> 0 and paymode ='Y'  then 1 else null end ) byjzthhs," +
+                    " count ( case when times  <![CDATA[<]]> 0 and paymode ='Y' then 1 else null end ) byjzthhs," +
                     " ABS(sum ( case when times  <![CDATA[<]]> 0 and paymode ='Y' then req_fee + oth_fee + clinic_fee + isnull ( brochure_fee , 0 ) + isnull ( bl_fee , 0 ) + isnull ( ck_fee , 0 ) else 0 end )) byjzth, " +
-                    " count ( case when times  <![CDATA[>]]> 0 and paymode ='Y'  then 1 else null end ) byjzsshs," +
+                    " count ( case when times  <![CDATA[>]]> 0 and paymode ='Y'  then 1 else null end ) - count ( case when times  <![CDATA[<]]> 0 and paymode ='Y'  then 1 else null end ) byjzsshs," +
                     " sum ( case when paymode ='Y'  then req_fee + oth_fee + clinic_fee + isnull ( brochure_fee , 0 ) + isnull ( bl_fee , 0 ) + isnull ( ck_fee , 0 ) else 0 end ) byjzss," +
                     " count ( case when times  <![CDATA[>]]> 0 and (paymode <![CDATA[<>]]> 'hospital_z' or paymode is null) then 1 else null end ) hjhs," +
                     " sum ( case when times  <![CDATA[>]]> 0 and (paymode <![CDATA[<>]]> 'hospital_z' or paymode is null) then req_fee + oth_fee + clinic_fee + isnull ( brochure_fee , 0 ) + isnull ( bl_fee , 0 ) + isnull ( ck_fee , 0 ) else 0 end ) hjsk, " +
-                    " count ( case when (paymode <![CDATA[<>]]> 'hospital_z' or paymode is null)  and times  <![CDATA[<]]> 0 then 1 else null end ) -count ( case when  (paymode <![CDATA[<>]]> 'hospital_z' or paymode is null)  and times  <![CDATA[<]]> 0 then 1 else null end ) hjthhs," +
+                    " count ( case when (paymode <![CDATA[<>]]> 'hospital_z' or paymode is null)  and times  <![CDATA[<]]> 0 then 1 else null end ) hjthhs," +
                     " ABS(sum ( case when (paymode <![CDATA[<>]]> 'hospital_z' or paymode is null) and times  <![CDATA[<]]> 0 then req_fee + oth_fee + clinic_fee + isnull ( brochure_fee , 0 ) + isnull ( bl_fee , 0 ) + isnull ( ck_fee , 0 ) else 0 end )) hjth, " +
-                    " count ( case when times  <![CDATA[>]]> 0 and (paymode <![CDATA[<>]]> 'hospital_z' or paymode is null) then 1 else null end ) hjsshs," +
+                    " count ( case when times  <![CDATA[>]]> 0 and (paymode <![CDATA[<>]]> 'hospital_z' or paymode is null) then 1 else null end ) -count ( case when  (paymode <![CDATA[<>]]> 'hospital_z' or paymode is null)  and times  <![CDATA[<]]> 0 then 1 else null end ) hjsshs," +
                     " sum ( case when paymode <![CDATA[<>]]> 'hospital_z' or paymode is null then req_fee + oth_fee + clinic_fee + isnull ( brochure_fee , 0 ) + isnull ( bl_fee , 0 ) + isnull ( ck_fee , 0 ) else 0 end ) hjss," +
                     " count ( case when times  <![CDATA[>]]> 0 and paymode ='WX' then 1 else null end ) wxzzhs," +
                     " sum ( case when times  <![CDATA[>]]> 0 and paymode ='WX'  then req_fee + oth_fee + clinic_fee + isnull ( brochure_fee , 0 ) + isnull ( bl_fee , 0 ) + isnull ( ck_fee , 0 ) else 0 end )  wxzzsk, " +
-                    " count ( case when op_id='99999' and  times  <![CDATA[<]]> 0 and paymode ='WX' then 1 else null end ) - count ( case when  op_id='99999' and times  <![CDATA[<]]> 0 and paymode ='WX' then 1 else null end ) wxzzthhs," +
+                    " count ( case when op_id='99999' and  times  <![CDATA[<]]> 0 and paymode ='WX' then 1 else null end ) wxzzthhs," +
                     " ABS( sum ( case when op_id='99999' and   times  <![CDATA[<]]> 0 and paymode ='WX'  then req_fee + oth_fee + clinic_fee + isnull ( brochure_fee , 0 ) + isnull ( bl_fee , 0 ) + isnull ( ck_fee , 0 ) else 0 end )) wxzzth, " +
-                    " count ( case when times  <![CDATA[>]]> 0 and paymode ='WX' then 1 else null end ) wxzzsshs," +
+                    " count ( case when times  <![CDATA[>]]> 0 and paymode ='WX' then 1 else null end )  - count ( case when  op_id='99999' and times  <![CDATA[<]]> 0 and paymode ='WX' then 1 else null end ) wxzzsshs," +
                     " sum ( case when op_id='99999' and paymode ='WX' then req_fee + oth_fee + clinic_fee + isnull ( brochure_fee , 0 ) + isnull ( bl_fee , 0 ) + isnull ( ck_fee , 0 ) else 0 end ) wxzzss, " +
                     " count ( case when times  <![CDATA[>]]> 0 and paymode ='ZFB' then 1 else null end ) zfbzzhs," +
                     " sum ( case when times  <![CDATA[>]]> 0 and paymode ='ZFB'  then req_fee + oth_fee + clinic_fee + isnull ( brochure_fee , 0 ) + isnull ( bl_fee , 0 ) + isnull ( ck_fee , 0 ) else 0 end )  zfbzzsk, " +
-                    " count ( case when op_id='99999' and    times  <![CDATA[<]]> 0 and paymode ='ZFB' then 1 else null end ) - count ( case when op_id='99999' and times  <![CDATA[<]]> 0 and paymode ='ZFB' then 1 else null end ) zfbzzthhs," +
+                    " count ( case when op_id='99999' and    times  <![CDATA[<]]> 0 and paymode ='ZFB' then 1 else null end ) zfbzzthhs," +
                     " ABS( sum ( case when  op_id='99999' and   times  <![CDATA[<]]> 0 and paymode ='ZFB'  then req_fee + oth_fee + clinic_fee + isnull ( brochure_fee , 0 ) + isnull ( bl_fee , 0 ) + isnull ( ck_fee , 0 ) else 0 end )) zfbzzth, " +
-                    " count ( case when times  <![CDATA[>]]> 0 and paymode ='ZFB' then 1 else null end ) zfbzzsshs," +
+                    " count ( case when times  <![CDATA[>]]> 0 and paymode ='ZFB' then 1 else null end )  - count ( case when op_id='99999' and times  <![CDATA[<]]> 0 and paymode ='ZFB' then 1 else null end ) zfbzzsshs," +
                     " sum ( case when op_id='99999' and paymode ='ZFB' then req_fee + oth_fee + clinic_fee + isnull ( brochure_fee , 0 ) + isnull ( bl_fee , 0 ) + isnull ( ck_fee , 0 ) else 0 end ) zfbzzss, " +
                     " sum ( case when isnull ( paymode , '1' ) = 'Y' then req_fee + oth_fee + clinic_fee + isnull ( brochure_fee , 0 ) + isnull ( bl_fee , 0 ) + isnull ( ck_fee , 0 ) else 0 end ) ghjejz," +
                     " sum ( case when isnull ( paymode , '1' ) <![CDATA[<>]]> 'Y' then req_fee + oth_fee + clinic_fee + isnull ( brochure_fee , 0 ) + isnull ( bl_fee , 0 ) + isnull ( ck_fee , 0 ) else 0 end ) ghjebhjz," +