Browse Source

优化对账

lighter 2 năm trước cách đây
mục cha
commit
a6833bd9bb

+ 5 - 3
src/main/java/thyyxxk/webserver/dao/his/medicalinsurance/SiManageDao.java

@@ -61,9 +61,11 @@ public interface SiManageDao {
                                                           @Param("start") String start,
                                                           @Param("end") String end);
 
-    @Select("select visitId=rtrim(inpatient_no)+'_'+cast(admiss_times as varchar)+'_'+cast(ledger_sn as varchar), " +
-            "total_charge as medfee_sumamt,acct_pay,fund_pay_sumamt,hosp_part_amt from zy_ledger_file where " +
-            "account_date>=#{start} and account_date<=#{end} and responce_type in ('ad','ae','af','ag','ah','ak') and ledger_sn>0")
+    @Select("select visitId=rtrim(a.inpatient_no)+'_'+cast(a.admiss_times as varchar)+'_'+cast(a.ledger_sn as varchar), " +
+            "a.total_charge as medfee_sumamt,acct_pay,fund_pay_sumamt,hosp_part_amt from zy_ledger_file a, " +
+            "zy_receipt b where b.date_2>=#{start} and b.date_2<=#{end} and a.responce_type in ('ad','ae','af','ag','ah','ak') " +
+            "and a.ledger_sn>0 and a.inpatient_no=b.inpatient_no and a.admiss_times=b.admiss_times " +
+            "and a.ledger_sn=b.ledger_sn and receipt_sn=1")
     List<InstSetlLdgChkBrf> selectHisZyBrfsForHisCheck(@Param("start") String start,
                                                        @Param("end") String end);