|
|
@@ -8,6 +8,7 @@ import org.apache.ibatis.annotations.Update;
|
|
|
import thyyxxk.webserver.entity.casefrontsheet.CaseFrontsheetSurgery;
|
|
|
import thyyxxk.webserver.entity.casefrontsheet.request.DismissedSheetInquiry;
|
|
|
import thyyxxk.webserver.entity.casefrontsheet.request.SheetOverview;
|
|
|
+import thyyxxk.webserver.entity.casefrontsheet.request.casefrontsheet.response.BaOpLog;
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
@@ -23,7 +24,9 @@ public interface BasSelectOverviewDao extends BaseMapper<CaseFrontsheetSurgery>
|
|
|
"a.sex,a.admiss_date, " +
|
|
|
"deptName=(select rtrim(name) from zd_unit_code with(nolock) where code=a.zk_ward), " +
|
|
|
"doctorName=(select rtrim(name) from a_employee_mi with(nolock) where code=b.zyys), " +
|
|
|
- "a.dis_date " +
|
|
|
+ "a.dis_date, " +
|
|
|
+ "unarcheivTimes=(select count(1) from ba_op_log d where " +
|
|
|
+ "d.inpatient_no=a.inpatient_no and d.admiss_times=a.admiss_times and d.op_type=3) " +
|
|
|
"from zy_inactpatient a with(nolock), batj_ba2 b with(nolock) " +
|
|
|
"where " +
|
|
|
"a.inpatient_no not like 'S%' and " +
|
|
|
@@ -41,7 +44,9 @@ public interface BasSelectOverviewDao extends BaseMapper<CaseFrontsheetSurgery>
|
|
|
"admiss_times as times,admiss_date,sex,zy_dismiss_way, " +
|
|
|
"dismiss_dept as deptName,admiss_doctor_name as doctorName,late_flag, " +
|
|
|
"lateDays=datediff(day, dismiss_date, sign_date), " +
|
|
|
- "dismiss_date as disDate from t_case_frontsheet_main with(nolock) " +
|
|
|
+ "unarcheivTimes=(select count(1) from ba_op_log d where " +
|
|
|
+ "d.inpatient_no=a.bah and d.admiss_times=a.admiss_times and d.op_type=3), " +
|
|
|
+ "dismiss_date as disDate from t_case_frontsheet_main a with(nolock) " +
|
|
|
"where bah=#{bah} and file_status=#{fileStatus} and dismiss_date>=#{start} and " +
|
|
|
"dismiss_date<=#{end} order by admiss_dept,admiss_doctor")
|
|
|
List<SheetOverview> selectPatientsFromSignedBase(DismissedSheetInquiry param);
|
|
|
@@ -56,6 +61,8 @@ public interface BasSelectOverviewDao extends BaseMapper<CaseFrontsheetSurgery>
|
|
|
"deptName=(select rtrim(name) from zd_unit_code with(nolock) where code=a.zk_ward), " +
|
|
|
"doctorName=(select rtrim(name) from a_employee_mi with(nolock) where code=b.zyys), " +
|
|
|
"lateCount=(select count(1) from t_case_frontsheet_main with(nolock) where late_flag=1 and admiss_doctor=b.zyys), " +
|
|
|
+ "unarcheivTimes=(select count(1) from ba_op_log d " +
|
|
|
+ "where d.inpatient_no=a.inpatient_no and d.admiss_times=a.admiss_times and d.op_type=3), " +
|
|
|
"a.dis_date " +
|
|
|
"from zy_inactpatient a with(nolock), batj_ba2 b with(nolock) " +
|
|
|
"where " +
|
|
|
@@ -73,7 +80,9 @@ public interface BasSelectOverviewDao extends BaseMapper<CaseFrontsheetSurgery>
|
|
|
@Select("select sign_date,file_status,bah,admiss_times as times,zy_dismiss_way, " +
|
|
|
"name,sex,admiss_date,dismiss_dept as deptName,admiss_doctor_name as doctorName, " +
|
|
|
"late_flag,lateDays=datediff(day,dismiss_date,sign_date), " +
|
|
|
- "dismiss_date as disDate from t_case_frontsheet_main with(nolock) " +
|
|
|
+ "unarcheivTimes=(select count(1) from ba_op_log d " +
|
|
|
+ "where d.inpatient_no=a.bah and d.admiss_times=a.admiss_times and d.op_type=3), " +
|
|
|
+ "dismiss_date as disDate from t_case_frontsheet_main a with(nolock) " +
|
|
|
"where dismiss_date>=#{start} and dismiss_date<=#{end} and file_status=#{fileStatus} " +
|
|
|
"and dismiss_dept_code=#{ward} order by dismiss_dept, admiss_doctor")
|
|
|
List<SheetOverview> selectPatientsForBasByWard2(DismissedSheetInquiry param);
|
|
|
@@ -87,7 +96,9 @@ public interface BasSelectOverviewDao extends BaseMapper<CaseFrontsheetSurgery>
|
|
|
"a.sex,a.admiss_date, " +
|
|
|
"deptName=(select rtrim(name) from zd_unit_code with(nolock) where code=a.zk_ward), " +
|
|
|
"doctorName=(select rtrim(name) from a_employee_mi with(nolock) where code=b.zyys), " +
|
|
|
- "a.dis_date " +
|
|
|
+ "a.dis_date, " +
|
|
|
+ "unarcheivTimes=(select count(1) from ba_op_log d " +
|
|
|
+ "where d.inpatient_no=a.inpatient_no and d.admiss_times=a.admiss_times and d.op_type=3) " +
|
|
|
"from zy_inactpatient a with(nolock), batj_ba2 b with(nolock) " +
|
|
|
"where " +
|
|
|
"a.inpatient_no not like 'S%' and " +
|
|
|
@@ -104,8 +115,8 @@ public interface BasSelectOverviewDao extends BaseMapper<CaseFrontsheetSurgery>
|
|
|
@Select("select sign_date,file_status,bah,admiss_times as times,zy_dismiss_way," +
|
|
|
"name,sex,admiss_date,dismiss_dept as deptName,admiss_doctor_name as doctorName," +
|
|
|
"late_flag,lateDays=datediff(day, dismiss_date, sign_date),dismiss_date as disDate, " +
|
|
|
- "beenUnArchived=(select count(1) from ba_op_log d where d.op_type=3 and " +
|
|
|
- "d.inpatient_no=a.bah and d.admiss_times=a.admiss_times) " +
|
|
|
+ "unarcheivTimes=(select count(1) from ba_op_log d " +
|
|
|
+ "where d.inpatient_no=a.bah and d.admiss_times=a.admiss_times and d.op_type=3) " +
|
|
|
"from t_case_frontsheet_main a with(nolock) " +
|
|
|
"where dismiss_date>=#{start} and dismiss_date<=#{end} and " +
|
|
|
"file_status=#{fileStatus} order by trans_dept,admiss_doctor")
|
|
|
@@ -114,4 +125,12 @@ public interface BasSelectOverviewDao extends BaseMapper<CaseFrontsheetSurgery>
|
|
|
@Update("update zy_actpatient set file_status=#{status} where inpatient_no=#{bah} and admiss_times=#{times};" +
|
|
|
"update zy_inactpatient set file_status=#{status} where inpatient_no=#{bah} and admiss_times=#{times};")
|
|
|
void updateActFileStatus(@Param("bah") String bah, @Param("times") int times, @Param("status") int status);
|
|
|
+
|
|
|
+ @Select("select op_type,op_id,op_time, " +
|
|
|
+ "opTypeName=case when op_type=1 then '保存' when op_type=2 then '签收' " +
|
|
|
+ "when op_type=3 then '解除签收' else '打印' end, " +
|
|
|
+ "opName=(select rtrim(d.name) from a_employee_mi d where d.code=op_id) " +
|
|
|
+ "from ba_op_log where inpatient_no=#{bah} and admiss_times=#{times} " +
|
|
|
+ "order by op_time desc")
|
|
|
+ List<BaOpLog> getBaOpLogs(String bah, Integer times);
|
|
|
}
|