|
|
@@ -1,7 +1,13 @@
|
|
|
package org.thyy.scheduled.dao;
|
|
|
|
|
|
import org.apache.ibatis.annotations.Mapper;
|
|
|
+import org.apache.ibatis.annotations.Param;
|
|
|
+import org.apache.ibatis.annotations.Select;
|
|
|
import org.apache.ibatis.annotations.Update;
|
|
|
+import org.thyy.scheduled.entity.mainbusiness.Inpatient;
|
|
|
+
|
|
|
+import java.util.Date;
|
|
|
+import java.util.List;
|
|
|
|
|
|
@Mapper
|
|
|
public interface MainBusinessDo {
|
|
|
@@ -10,4 +16,75 @@ public interface MainBusinessDo {
|
|
|
|
|
|
@Update("update mzfz_zd_dept_room set patient_num=0 where patient_num!=0")
|
|
|
void resetPatientNum();
|
|
|
+
|
|
|
+
|
|
|
+ @Select("select rtrim(inpatient_no) inpatient_no,admiss_times,admiss_date, " +
|
|
|
+ "ledgerSn=(select max(ledger_sn) from zy_ledger_file b where " +
|
|
|
+ "a.inpatient_no=b.inpatient_no and a.admiss_times=b.admiss_times) " +
|
|
|
+ "from zy_actpatient a ")
|
|
|
+ List<Inpatient> getInpatients();
|
|
|
+
|
|
|
+ @Update("update zy_detail_charge set charge_date=#{newDate} where inpatient_no=#{zyh} " +
|
|
|
+ "and admiss_times=#{times} and CONVERT(varchar(20), charge_date, 20) <= #{admdate}")
|
|
|
+ void correctFeeChargeTimeBeforeAdmiss(@Param("zyh") String zyh,
|
|
|
+ @Param("times") int times,
|
|
|
+ @Param("admdate") Date admdate,
|
|
|
+ @Param("newDate") Date newDate);
|
|
|
+
|
|
|
+
|
|
|
+ @Select("select start_time from yz_act_order where inpatient_no=#{patNo} and admiss_times=#{times} " +
|
|
|
+ "and status_flag > '1' and isnull(group_no, '00')='00' and order_code in ('06026','06053','05973')")
|
|
|
+ Date selectActOrderDisDate(@Param("patNo") String patNo, @Param("times") Integer times);
|
|
|
+
|
|
|
+ @Update("update zy_detail_charge set charge_date=#{disdate} where inpatient_no=#{zyh} " +
|
|
|
+ "and admiss_times=#{times} and charge_date>#{disdate}")
|
|
|
+ void correctFeeChargeTimeAfterDismiss(@Param("zyh") String zyh,
|
|
|
+ @Param("times") int times,
|
|
|
+ @Param("disdate") Date disdate);
|
|
|
+
|
|
|
+ @Update("update zy_ledger_file set deposit=(select isnull(sum(depo_amount),0) from zy_deposit_file f with(nolock) " +
|
|
|
+ "where f.inpatient_no=#{zyh} and f.admiss_times=#{times} and f.ledger_sn=#{ledger} and f.status in ('1','2') ) " +
|
|
|
+ "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);
|
|
|
+
|
|
|
+ @Update("execute zy_receive_drug #{zyh},#{times},#{zyh},#{infant} ")
|
|
|
+ void zyReceiveDrug(@Param("zyh") String zyh,
|
|
|
+ @Param("times") int times,
|
|
|
+ @Param("infant") int infant);
|
|
|
+
|
|
|
+ @Update("execute zy_receive_one #{zyh},#{times},#{zyh},#{infant} ")
|
|
|
+ void zyReceiveOne(@Param("zyh") String zyh,
|
|
|
+ @Param("times") int times,
|
|
|
+ @Param("infant") int infant);
|
|
|
+
|
|
|
+ @Update("execute dbo.zy_cngl_fyjs_list_yz #{zyh},#{times} ")
|
|
|
+ void zyCnglFyjsListYz(@Param("zyh") String zyh,
|
|
|
+ @Param("times") int times);
|
|
|
+
|
|
|
+ @Update("update zy_detail_charge set charge_status='2' where " +
|
|
|
+ "inpatient_no=#{zyh} and admiss_times=#{times} and ledger_sn=#{ledger} ")
|
|
|
+ void updateZyDetailCharge(@Param("zyh") String zyh,
|
|
|
+ @Param("times") int times,
|
|
|
+ @Param("ledger") int ledger);
|
|
|
+
|
|
|
+ @Update("execute zy_calc_detail_again_new #{zyh},#{times},#{ledger},1,1")
|
|
|
+ void zyCalcDetailAgainNew(@Param("zyh") String zyh,
|
|
|
+ @Param("times") int times,
|
|
|
+ @Param("ledger") int ledger);
|
|
|
+
|
|
|
+ @Update("update zy_ledger_file set balance=(deposit+isnull(charge_yb,0)-total_charge) where " +
|
|
|
+ "inpatient_no=#{zyh} and admiss_times=#{times} and ledger_sn=#{ledger}")
|
|
|
+ void updateBalance(@Param("zyh") String zyh,
|
|
|
+ @Param("times") int times,
|
|
|
+ @Param("ledger") int ledger);
|
|
|
+
|
|
|
+ @Select("select balance from zy_ledger_file where inpatient_no=#{zyh} and admiss_times=#{times} and ledger_sn=#{ledger}")
|
|
|
+ String selectLedgerBalance(@Param("zyh") String zyh,
|
|
|
+ @Param("times") int times,
|
|
|
+ @Param("ledger") int ledger);
|
|
|
+
|
|
|
+ @Update("update zy_actpatient set balance=#{balance} where inpatient_no=#{zyh}")
|
|
|
+ void updateZyActPatientBalance(@Param("zyh") String zyh, @Param("balance") String balance);
|
|
|
}
|