|
@@ -17,32 +17,68 @@ public interface CaseFrontSheetAnalyzeDao {
|
|
|
List<TempDismissCount> selectDismissCount(@Param("start") String start,
|
|
|
@Param("end") String end);
|
|
|
|
|
|
- @Select("<script>" +
|
|
|
+ @Select("select a.bah as patNo,a.admiss_times as times, " +
|
|
|
+ "a.name as name,gender=(case when a.sex='1' then N'男' else N'女' end), " +
|
|
|
+ "a.age,a.admiss_date,a.dismiss_date as disDate, " +
|
|
|
+ "inHospDays=admiss_days,a.total_cost as total_charge, " +
|
|
|
+ "a.trans_dept as disDept,a.clinic_diag_str as admDiag, " +
|
|
|
+ "disDiag=(select t.name from t_case_frontsheet_disdiag t where t.bah=a.bah " +
|
|
|
+ "and t.times=a.admiss_times and t.no=1), " +
|
|
|
+ "blfx=a.case_classification,admiss_dept,a.trans_dept as zkWard, " +
|
|
|
+ "a.dept_leader_name as kzy,a.main_doctor_name as zzys, " +
|
|
|
+ "a.admiss_doctor_name as zyys,fdcrb=a.statutory_epidemic " +
|
|
|
+ "from t_case_frontsheet_main a where a.trans_dept_code like #{dept} and " +
|
|
|
+ "a.dismiss_date>=#{begntime} and a.dismiss_date<=#{endtime} " +
|
|
|
+ "order by a.trans_dept_code ")
|
|
|
+ List<DismissCount> selectDismissDetailCount(@Param("begntime") String begntime,
|
|
|
+ @Param("endtime") String endtime,
|
|
|
+ @Param("dept") String dept);
|
|
|
+
|
|
|
+
|
|
|
+ @Select("select rtrim(a.inpatient_no) as patNo,a.admiss_times as times, " +
|
|
|
+ "rtrim(a.name) as name,gender=(case when a.sex='1' then N'男' else N'女' end), " +
|
|
|
+ "age=datediff(year,b.birth_date,getdate()),a.admiss_date,d.start_time as dis_date, " +
|
|
|
+ "inHospDays=datediff(day, a.admiss_date, d.start_time),a.total_charge, " +
|
|
|
+ "rtrim(a.zk_ward) as disDept,rtrim(a.clinic_diag_str) as admDiag, " +
|
|
|
+ "disDiag=(select dis_diag_comment from ba_first_page1 t where t.inpatient_no=a.inpatient_no " +
|
|
|
+ "and t.admiss_times=a.admiss_times and t.dis_diag_no=1), " +
|
|
|
+ "blfx=isnull(c.blfx,''),rtrim(a.small_dept) as admissDept,rtrim(a.zk_ward) as zkWard, " +
|
|
|
+ "c.kzr,c.zzys,c.zyys,fdcrb=isnull(c.fdcrb,'') " +
|
|
|
+ "from zy_inactpatient a, a_patient_mi b, batj_ba2 c, " +
|
|
|
+ "(select inpatient_no,admiss_times,start_time from yz_act_order " +
|
|
|
+ "where start_time>=#{begntime} and start_time<=#{endtime} " +
|
|
|
+ "and order_code='05973' and exec_unit like #{dept} " +
|
|
|
+ "union " +
|
|
|
+ "select inpatient_no,admiss_times,start_time from yz_inact_order " +
|
|
|
+ "where start_time>=#{begntime} and start_time<=#{endtime} " +
|
|
|
+ "and order_code='05973' and exec_unit like #{dept}) d " +
|
|
|
+ "where a.inpatient_no=b.inpatient_no and a.inpatient_no=c.zyh and " +
|
|
|
+ " a.inpatient_no=d.inpatient_no and a.admiss_times=c.zycs and " +
|
|
|
+ " a.admiss_times=d.admiss_times " +
|
|
|
+ "union " +
|
|
|
"select rtrim(a.inpatient_no) as patNo,a.admiss_times as times, " +
|
|
|
- "rtrim(a.name) as name,gender=(case when a.sex='1' then '男' else '女' end), " +
|
|
|
- "age=datediff(year,b.birth_date,getdate()),a.admiss_date,a.dis_date, " +
|
|
|
- "inHospDays=datediff(day, a.admiss_date, a.dis_date),a.total_charge, " +
|
|
|
+ "rtrim(a.name) as name,gender=(case when a.sex='1' then N'男' else N'女' end), " +
|
|
|
+ "age=datediff(year,b.birth_date,getdate()),a.admiss_date,d.start_time as dis_date, " +
|
|
|
+ "inHospDays=datediff(day, a.admiss_date, d.start_time),a.total_charge, " +
|
|
|
"rtrim(a.zk_ward) as disDept,rtrim(a.clinic_diag_str) as admDiag, " +
|
|
|
"disDiag=(select dis_diag_comment from ba_first_page1 t where t.inpatient_no=a.inpatient_no " +
|
|
|
"and t.admiss_times=a.admiss_times and t.dis_diag_no=1), " +
|
|
|
"blfx=isnull(c.blfx,''),rtrim(a.small_dept) as admissDept,rtrim(a.zk_ward) as zkWard, " +
|
|
|
- "c.kzr,c.zzys,c.zyys,fdcrb=isnull(c.fdcrb,'')," +
|
|
|
- "deadOrder=(select count(1) from yz_inact_order t where t.inpatient_no=a.inpatient_no and " +
|
|
|
- "t.admiss_times=a.admiss_times and t.order_code='05973') " +
|
|
|
- "from zy_inactpatient a, a_patient_mi b, batj_ba2 c where " +
|
|
|
- "a.inpatient_no not like 'S%' and " +
|
|
|
- "a.inpatient_no not like 'JT%' and " +
|
|
|
- "<if test=\" dept!=null and dept!='' \">" +
|
|
|
- "a.zk_ward=#{dept} and " +
|
|
|
- "</if>" +
|
|
|
- "charindex('$',a.inpatient_no)=0 and " +
|
|
|
- "a.dis_date>=#{begntime} and a.dis_date<=#{endtime} and " +
|
|
|
- "a.inpatient_no=b.inpatient_no and a.inpatient_no=c.zyh and a.admiss_times=c.zycs " +
|
|
|
- "order by a.zk_ward " +
|
|
|
- "</script>")
|
|
|
- List<DismissCount> selectDismissDetailCount(@Param("begntime") String begntime,
|
|
|
- @Param("endtime") String endtime,
|
|
|
- @Param("dept") String dept);
|
|
|
+ "c.kzr,c.zzys,c.zyys,fdcrb=isnull(c.fdcrb,'') " +
|
|
|
+ "from zy_actpatient a, a_patient_mi b, batj_ba2 c, " +
|
|
|
+ "(select inpatient_no,admiss_times,start_time from yz_act_order " +
|
|
|
+ "where start_time>=#{begntime} and start_time<=#{endtime} " +
|
|
|
+ "and order_code='05973' and exec_unit like #{dept} union " +
|
|
|
+ "select inpatient_no,admiss_times,start_time from yz_inact_order " +
|
|
|
+ "where start_time>=#{begntime} and start_time<=#{endtime} " +
|
|
|
+ "and order_code='05973' and exec_unit like #{dept}) d " +
|
|
|
+ "where a.inpatient_no=b.inpatient_no and a.inpatient_no=c.zyh and " +
|
|
|
+ " a.inpatient_no=d.inpatient_no and a.admiss_times=c.zycs and " +
|
|
|
+ " a.admiss_times=d.admiss_times ")
|
|
|
+ List<DismissCount> selectDeathCount(@Param("begntime") String begntime,
|
|
|
+ @Param("endtime") String endtime,
|
|
|
+ @Param("dept") String dept);
|
|
|
+
|
|
|
|
|
|
@Select("select diag_conform2,diag_conform3,diag_conform4,rescue_times,rescue_success_times, " +
|
|
|
"quality_control_level,admiss_days,${deptIdentity}_code as deptCode,${deptIdentity} as deptName " +
|