|
|
@@ -22,12 +22,16 @@ public interface AdjustBedDao {
|
|
|
" select user_code from dj_user_role where role_id in (4,12,18)" +
|
|
|
" ) ")
|
|
|
List<String> getAdmins(String ward);
|
|
|
+
|
|
|
@Update(" update mz_zy_req set bed_no = #{bedNo}, req_status =#{reqStatus},pre_bed_confirm_id=#{preBedConfirmId},pre_bed_confirm_date=#{preBedConfirmDate},pre_bed_confirm_remark=#{preBedConfirmRemark} where patient_id=#{patientId} and CONVERT(VARCHAR(30),visit_date,20) =#{visitDateStr} ")
|
|
|
void updateBedNo(MzZyReq mzZyReq);
|
|
|
+
|
|
|
@Select(" select top 1 1 from zy_bed_mi where bed_no = #{bedNo} and ward_code = #{wardCode} and bed_status ='1' ")
|
|
|
- Integer isIdleBedNo(@Param("bedNo") String bedNo,@Param("wardCode") String wardCode);
|
|
|
+ Integer isIdleBedNo(@Param("bedNo") String bedNo, @Param("wardCode") String wardCode);
|
|
|
+
|
|
|
@Select(" select bed_no from zy_bed_mi where bed_status ='1' and ward_code= #{ward} order by cast(bed_no as int) ")
|
|
|
List<String> selectIdleBedNoList(String ward);
|
|
|
+
|
|
|
@Select(" SELECT zy_bed_mi.room_no,\n" +
|
|
|
" zy_bed_mi.bed_no,\n" +
|
|
|
" inpatient_no=isnull(zy_actpatient.inpatient_no,zy_bed_mi.inpatient_no),\n" +
|
|
|
@@ -42,28 +46,39 @@ public interface AdjustBedDao {
|
|
|
" zy_actpatient.refer_physician,\n" +
|
|
|
" refer_physician_name =(select name from a_employee_mi where zy_actpatient.refer_physician= code),\n" +
|
|
|
" zy_actpatient.responce_type,\n" +
|
|
|
- " responce_type_name = (select name from zy_zd_responce_type where zy_actpatient.responce_type=code)\n" +
|
|
|
+ " responce_type_name = (select name from zy_zd_responce_type where zy_actpatient.responce_type=code)," +
|
|
|
+ " electronic_screen\n" +
|
|
|
" from zy_bed_mi left join zy_actpatient on zy_bed_mi.inpatient_no = zy_actpatient.inpatient_no\n" +
|
|
|
" where zy_bed_mi.ward_code = #{wardCode} order by cast(zy_bed_mi.bed_no as int) ")
|
|
|
List<ZyBedMi> selectZybedMi(ZyBedMi param);
|
|
|
+
|
|
|
@Select(" select top 1 * from mz_zy_req where patient_id=#{patientId} and CONVERT(VARCHAR(30),visit_date,20) =#{visitDateStr} ")
|
|
|
MzZyReq selectMzZyReq(MzZyReq mzZyReq);
|
|
|
+
|
|
|
@Select(" select top 1 1 from zy_actpatient where bed_no =#{bedNo} and dept =#{wardCode}")
|
|
|
Integer isExistPatient(ZyBedMi param);
|
|
|
+
|
|
|
@Update(" update zy_bed_mi set inpatient_no =#{inpatientNo} , admiss_times =#{admissTimes} , bed_status =#{bedStatus} where bed_no =#{bedNo} and dept_code =#{wardCode}")
|
|
|
void updatePatientByBed(ZyBedMi param);
|
|
|
+
|
|
|
@Select(" select top 1 req_status from mz_zy_req where patient_id=#{patientId} and CONVERT(VARCHAR(30),visit_date,20) =#{visitDateStr} ")
|
|
|
String selectReqStatus(MzZyReq req);
|
|
|
+
|
|
|
@Select(" select top 1 inpatient_no , admiss_times from zy_actpatient where bed_no =#{bedNo} and dept =#{wardCode} ")
|
|
|
ZyBedMi selectActInpatientByBed(ZyBedMi param);
|
|
|
+
|
|
|
@Update(" update zy_actpatient SET bed_no =#{bedNo} , bed_status =#{bedStatus} , ward =#{wardCode} WHERE ( inpatient_no =#{inpatientNo} or inpatient_no like ( #{inpatientNo} + '$%' ) ) AND admiss_times =#{admissTimes};")
|
|
|
void updateActpatientBed(ZyBedMi zyBedMi);
|
|
|
+
|
|
|
@Update(" update yz_yp_zy_order SET bed_no =#{bedNo} WHERE ( inpatient_no =#{inpatientNo} or inpatient_no =( #{inpatientNo} + '$1' ) or inpatient_no =( #{inpatientNo} + '$2' ) or inpatient_no =( #{inpatientNo} + '$3' ) or inpatient_no =( #{inpatientNo} + '$4' ) or inpatient_no =( #{inpatientNo} + '$5' ) or inpatient_no =( #{inpatientNo} + '$6' ) ) AND admiss_times =#{admissTimes}")
|
|
|
void updateYpZyOrder(ZyBedMi zyBedMi);
|
|
|
+
|
|
|
@Update(" update yz_act_occ SET bed_no =#{bedNo} WHERE ( inpatient_no =#{inpatientNo} or inpatient_no =( #{inpatientNo} + '$1' ) or inpatient_no =( #{inpatientNo} + '$2' ) or inpatient_no =( #{inpatientNo} + '$3' ) or inpatient_no =( #{inpatientNo} + '$4' ) or inpatient_no =( #{inpatientNo} + '$5' ) or inpatient_no =( #{inpatientNo} + '$6' ) ) AND admiss_times =#{admissTimes}")
|
|
|
void updateYzActOcc(ZyBedMi zyBedMi);
|
|
|
+
|
|
|
@Select(" select top 1 1 from mz_zy_req where req_ward=#{wardCode} and visit_date >=#{startVisitDate} and visit_date<=#{endVisitDate} and bed_no=#{bedNo}")
|
|
|
Integer queryIsPreBed(ZyBedMi param);
|
|
|
+
|
|
|
@Select(" select top 1 rtrim(name) name from mz_patient_mi where patient_id =#{patientId} ")
|
|
|
String selectPatientMi(@Param("patientId") String patientId);
|
|
|
|
|
|
@@ -83,6 +98,7 @@ public interface AdjustBedDao {
|
|
|
"deptName=(select d.name from zd_unit_code d where d.code=dept_code) " +
|
|
|
"from a_employee_mi where hsry_flag=1")
|
|
|
List<CodeName> getHsry();
|
|
|
+
|
|
|
@Select(" select rtrim(ward) ward from zy_actpatient where inpatient_no=#{inpatientNo} and admiss_times =#{admissTimes}")
|
|
|
- String selectWard(@Param("inpatientNo") String inpatientNo, @Param("admissTimes")Integer admissTimes);
|
|
|
+ String selectWard(@Param("inpatientNo") String inpatientNo, @Param("admissTimes") Integer admissTimes);
|
|
|
}
|