|
@@ -0,0 +1,86 @@
|
|
|
+package thyyxxk.webserver.dao.his.inpatient.charge;
|
|
|
+
|
|
|
+import org.apache.ibatis.annotations.*;
|
|
|
+import thyyxxk.webserver.entity.inpatient.charge.forceinout.SimplePatient;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+@Mapper
|
|
|
+public interface ForceInAndOutDao {
|
|
|
+
|
|
|
+ @Select("select rtrim(inpatient_no) as patNo,admiss_times as times,rtrim(name) as name," +
|
|
|
+ "admiss_date as admDate,med_type,dis_date,rtrim(bed_status) as bedStatus," +
|
|
|
+ "rtrim(ward) as ward,rtrim(zk_ward) as dept,rtrim(bed_no) as bedNo " +
|
|
|
+ "from zy_inactpatient where inpatient_no=#{input} or name=#{input} " +
|
|
|
+ "order by inpatient_no,dis_date desc")
|
|
|
+ List<SimplePatient> getZyInactpatient(String input);
|
|
|
+
|
|
|
+ @Select("select rtrim(inpatient_no) as patNo,admiss_times as times,rtrim(name) as name," +
|
|
|
+ "admiss_date as admDate,med_type,dis_date,rtrim(bed_status) as bedStatus," +
|
|
|
+ "rtrim(ward) as ward,rtrim(zk_ward) as dept,rtrim(bed_no) as bedNo " +
|
|
|
+ "from zy_actpatient where inpatient_no=#{input} or name=#{input} ")
|
|
|
+ List<SimplePatient> getZyActpatient(String input);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 出院召回开始 <<<---
|
|
|
+ * 床位状态:1空闲,2占用
|
|
|
+ */
|
|
|
+ @Select("select count(1) from zy_bed_mi where dept_code=#{ward} " +
|
|
|
+ "and ward_code=#{ward} and bed_no=#{bedNo} and bed_status='1' ")
|
|
|
+ int certainBedFree(SimplePatient patient);
|
|
|
+
|
|
|
+ @Select("select max(rtrim(bed_no)) from zy_bed_mi where dept_code=#{ward} " +
|
|
|
+ "and ward_code=#{ward} and bed_status='1'")
|
|
|
+ String getMaxFreeBedNo(String ward);
|
|
|
+
|
|
|
+ @Update("update zy_inactpatient set bed_no=#{bedNo},dis_ward=null,dis_dept=null," +
|
|
|
+ "bed_status='9' where inpatient_no=#{patNo} and admiss_times=#{times}")
|
|
|
+ void changeBedNoAndBedStatus(SimplePatient patient);
|
|
|
+
|
|
|
+ @Insert("insert into zy_actpatient select * from zy_inactpatient " +
|
|
|
+ "where inpatient_no=#{patNo} and admiss_times=#{times} ")
|
|
|
+ void transferZyActpatient(SimplePatient patient);
|
|
|
+
|
|
|
+ @Insert("insert into zy_actpatient select * from zy_inactpatient " +
|
|
|
+ "where inpatient_no>=#{babyNoBegin} and inpatient_no<=#{babyNoEnd} and admiss_times=#{times}")
|
|
|
+ void transferZyActpatientBaby(SimplePatient patient);
|
|
|
+
|
|
|
+ @Update("update zy_bed_mi set bed_status='2',inpatient_no=#{patNo},admiss_times=#{times} " +
|
|
|
+ "where ward_code=#{ward} and dept_code=#{ward} and bed_no=#{bedNo}")
|
|
|
+ void lockZyBedMi(SimplePatient patient);
|
|
|
+
|
|
|
+ @Update("update zy_adt set dis_date=null,orig_ward=null,orig_dept=null,orig_bed=null " +
|
|
|
+ "where inpatient_no=#{patNo} and admiss_times=#{times} and trans_times=0")
|
|
|
+ void clearZyAdt(SimplePatient patient);
|
|
|
+
|
|
|
+ @Delete("delete from zy_inactpatient where inpatient_no=#{patNo} and admiss_times=#{times}")
|
|
|
+ void deleteZyInactpatient(SimplePatient patient);
|
|
|
+
|
|
|
+ @Delete("delete from zy_inactpatient where inpatient_no>=#{babyNoBegin} " +
|
|
|
+ "and inpatient_no<=#{babyNoEnd} and admiss_times=#{times}")
|
|
|
+ void deleteZyInactpatientBaby(SimplePatient patient);
|
|
|
+
|
|
|
+ @Insert("insert into yz_act_order select * from yz_inact_order " +
|
|
|
+ "where inpatient_no=#{patNo} and admiss_times=#{times}")
|
|
|
+ void transferYzActOrder(SimplePatient patient);
|
|
|
+
|
|
|
+ @Insert("insert into yz_act_order select *from yz_inact_order " +
|
|
|
+ "where inpatient_no=#{babyNoBegin} and inpatient_no<=#{babyNoEnd} and admiss_times=#{times}")
|
|
|
+ void transferYzActOrderBaby(SimplePatient patient);
|
|
|
+
|
|
|
+ @Delete("delete from yz_inact_order where inpatient_no=#{patNo} and admiss_times=#{times}")
|
|
|
+ void deleteYzActOrder(SimplePatient patient);
|
|
|
+
|
|
|
+ @Delete("delete from yz_inact_order where inpatient_no=#{babyNoBegin} " +
|
|
|
+ "and inpatient_no<=#{babyNoEnd} and admiss_times=#{times}")
|
|
|
+ void deleteYzActOrderBaby(SimplePatient patient);
|
|
|
+ /**
|
|
|
+ * 出院召回结束 --->>>
|
|
|
+ */
|
|
|
+
|
|
|
+ @Insert("insert into zy_work_log(inpatient_no,admiss_times,ledger_sn,op_id,op_date,log_type," +
|
|
|
+ "dept_code,ward_code,name) values " +
|
|
|
+ "(#{patNo},#{times},0,#{staffId},getdate(),#{staffOpType},#{zkWard},#{ward},#{staffName}) ")
|
|
|
+ void insertZyWorkLog(SimplePatient patient);
|
|
|
+
|
|
|
+}
|