|
@@ -129,6 +129,13 @@ public interface DismissDao {
|
|
|
@Param("begntime") Date begntime,
|
|
|
@Param("endtime") Date endtime);
|
|
|
|
|
|
+ @Update("update zy_ledger_file set deposit=(select sum(depo_amount) from zy_deposit_file f with(nolock) " +
|
|
|
+ "where f.inpatient_no=#{zyh} and f.admiss_times=#{times} and f.ledger_sn=#{ledger}) " +
|
|
|
+ "where inpatient_no=#{zyh} and admiss_times=#{times} and ledger_sn=#{ledger}")
|
|
|
+ void recountDeposit(@Param("zyh") String zyh,
|
|
|
+ @Param("times") int times,
|
|
|
+ @Param("ledger") int ledger);
|
|
|
+
|
|
|
@Delete("delete zy_ledger_file_yb where inpatient_no=#{patNo} and admiss_times=#{times} and ledger_sn=#{ledgerSn}")
|
|
|
void deleteZyLedgerFileYb(@Param("patNo") String patNo,
|
|
|
@Param("times") Integer times, @Param("ledgerSn") int ledgerSn);
|
|
@@ -178,30 +185,33 @@ public interface DismissDao {
|
|
|
@Param("deptCode") String deptCode, @Param("codeRs") String codeRs,
|
|
|
@Param("dismissDate") Date dismissDate);
|
|
|
|
|
|
- @Update("update zy_ledger_file set account_date=#{dismissDate},settle_type='1',balance=0,last_balance=" +
|
|
|
- "isnull((CASE WHEN b.xjzf!=0.00 then b.xjzf when b.xjzf=0.00 then b.total_cost-b.charge_yb end),0)," +
|
|
|
- "settle=deposit-(isnull((CASE WHEN b.xjzf!=0.00 then b.xjzf when " +
|
|
|
- "b.xjzf=0.00 then b.total_cost-b.charge_yb end),0))-0.00,ward_code=#{wardCode}," +
|
|
|
- "dept_code=#{deptCode},op_id_code=#{codeRs},charge_yb=0 from zy_ledger_file," +
|
|
|
- "zy_ledger_file_yb b where zy_ledger_file.inpatient_no=#{patNo} and zy_ledger_file.admiss_times=#{times} " +
|
|
|
- "and zy_ledger_file.ledger_sn=#{ledgerSn} and zy_ledger_file.inpatient_no=b.inpatient_no and " +
|
|
|
- "zy_ledger_file.admiss_times=b.admiss_times and zy_ledger_file.ledger_sn=b.ledger_sn")
|
|
|
+ @Select("select case when isnull(xjzf,0)!=0 then xjzf else total_cost-tczf end from zy_ledger_file_yb " +
|
|
|
+ "where inpatient_no=#{patNo} and admiss_times=#{times} and ledger_sn=#{ledgerSn}")
|
|
|
+ String selectMedinsCashPay(@Param("patNo") String patNo,
|
|
|
+ @Param("times") Integer times,
|
|
|
+ @Param("ledgerSn") int ledgerSn);
|
|
|
+
|
|
|
+ @Update("update zy_ledger_file set account_date=#{dismissDate},settle_type='1',balance=0,last_balance=#{cash}, " +
|
|
|
+ "settle=(deposit-#{cash}),ward_code=#{wardCode},dept_code=#{deptCode},op_id_code=#{codeRs},charge_yb=0 " +
|
|
|
+ "where inpatient_no=#{patNo} and admiss_times=#{times} and ledger_sn=#{ledgerSn}")
|
|
|
int updateCostStatusWithoutInfant(@Param("patNo") String patNo, @Param("times") Integer times,
|
|
|
@Param("ledgerSn") int ledgerSn, @Param("wardCode") String wardCode,
|
|
|
@Param("deptCode") String deptCode, @Param("codeRs") String codeRs,
|
|
|
- @Param("dismissDate") Date dismissDate);
|
|
|
-
|
|
|
- @Update("update zy_ledger_file set account_date=#{dismissDate},settle_type='1',balance=0,last_balance=" +
|
|
|
- "(zy_ledger_file.total_charge-b.tczf),settle=deposit-(zy_ledger_file.total_charge-b.tczf)," +
|
|
|
- "ward_code=#{wardCode},dept_code=#{deptCode},op_id_code=#{codeRs}," +
|
|
|
- "charge_yb=0 from zy_ledger_file,zy_ledger_file_yb b where zy_ledger_file.inpatient_no=#{patNo} " +
|
|
|
- "and zy_ledger_file.admiss_times=#{times} and zy_ledger_file.ledger_sn=#{ledgerSn} and " +
|
|
|
- "zy_ledger_file.inpatient_no=b.inpatient_no and zy_ledger_file.admiss_times=b.admiss_times and " +
|
|
|
- "zy_ledger_file.ledger_sn=b.ledger_sn")
|
|
|
+ @Param("dismissDate") Date dismissDate, @Param("cash") String cash);
|
|
|
+
|
|
|
+ @Select("select tczf from zy_ledger_file_yb where inpatient_no=#{patNo} and admiss_times=#{times} and ledger_sn=#{ledgerSn}")
|
|
|
+ String selectMedinsFundPay(@Param("patNo") String patNo,
|
|
|
+ @Param("times") Integer times,
|
|
|
+ @Param("ledgerSn") int ledgerSn);
|
|
|
+
|
|
|
+ @Update("update zy_ledger_file set account_date=#{dismissDate},settle_type='1',balance=0, " +
|
|
|
+ "last_balance=(total_charge-#{fund}),settle=(deposit-total_charge+#{fund}), " +
|
|
|
+ "ward_code=#{wardCode},dept_code=#{deptCode},op_id_code=#{codeRs}, " +
|
|
|
+ "charge_yb=0 where inpatient_no=#{patNo} and admiss_times=#{times} and ledger_sn=#{ledgerSn}")
|
|
|
int updateCostStatusWithInfant(@Param("patNo") String patNo, @Param("times") Integer times,
|
|
|
@Param("ledgerSn") int ledgerSn, @Param("wardCode") String wardCode,
|
|
|
@Param("deptCode") String deptCode, @Param("codeRs") String codeRs,
|
|
|
- @Param("dismissDate") Date dismissDate);
|
|
|
+ @Param("dismissDate") Date dismissDate, @Param("fund") String fund);
|
|
|
|
|
|
@Update("update zy_detail_charge set charge_status=3 where charge_status=2 and " +
|
|
|
"inpatient_no=#{patNo} AND admiss_times=#{times} AND ledger_sn=#{ledgerSn}")
|