|
@@ -17,49 +17,21 @@ public interface BasSelectOverviewDao extends BaseMapper<CaseFrontsheetSurgery>
|
|
|
"bah=rtrim(a.inpatient_no), " +
|
|
|
"times=rtrim(a.admiss_times), " +
|
|
|
"name=rtrim(a.name), " +
|
|
|
- "a.sex, " +
|
|
|
- "deptName=(select rtrim(name) from zd_unit_code with(nolock) where code=a.dis_dept), " +
|
|
|
+ "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), " +
|
|
|
"b.late_flag, " +
|
|
|
"lateCount=(select count(*) from batj_ba2 with(nolock) where late_flag=1 and zyys=b.zyys), " +
|
|
|
"lateDays=datediff(day, a.dis_date, b.sign_date), " +
|
|
|
- "disDate=convert(varchar(10), a.dis_date, 21) " +
|
|
|
- "from zy_inactpatient a with(nolock), batj_ba2 b with(nolock), yz_inact_order c with(nolock) " +
|
|
|
- "where " +
|
|
|
- "a.inpatient_no=#{bah} and " +
|
|
|
- "a.inpatient_no=b.zyh and " +
|
|
|
- "a.admiss_times=b.zycs and " +
|
|
|
- "a.inpatient_no=c.inpatient_no and " +
|
|
|
- "a.admiss_times=c.admiss_times and " +
|
|
|
- "c.start_time>=#{start} and " +
|
|
|
- "c.start_time<=#{end} and " +
|
|
|
- "c.order_code in ('06026','06053','06027', '05973') and " +
|
|
|
- "isnull(a.file_status, 0)=#{fileStatus} " +
|
|
|
- "union " +
|
|
|
- "select " +
|
|
|
- "signDate=(convert(varchar(10), b.sign_date, 21)), " +
|
|
|
- "bedNo=rtrim(a.bed_no), " +
|
|
|
- "bah=rtrim(a.inpatient_no), " +
|
|
|
- "times=rtrim(a.admiss_times), " +
|
|
|
- "name=rtrim(a.name), " +
|
|
|
- "a.sex, " +
|
|
|
- "deptName=(select rtrim(name) from zd_unit_code with(nolock) where code=a.dis_dept), " +
|
|
|
- "doctorName=(select rtrim(name) from a_employee_mi with(nolock) where code=b.zyys), " +
|
|
|
- "b.late_flag, " +
|
|
|
- "lateCount=(select count(*) from batj_ba2 with(nolock) where late_flag=1 and zyys=b.zyys), " +
|
|
|
- "lateDays=datediff(day, a.dis_date, b.sign_date), " +
|
|
|
- "disDate=convert(varchar(10), c.start_time, 21) " +
|
|
|
- "from zy_inactpatient a with(nolock), batj_ba2 b with(nolock), yz_act_order c with(nolock) " +
|
|
|
+ "a.dis_date " +
|
|
|
+ "from zy_inactpatient a with(nolock), batj_ba2 b with(nolock) " +
|
|
|
"where " +
|
|
|
"a.inpatient_no=#{bah} and " +
|
|
|
"a.inpatient_no=b.zyh and " +
|
|
|
"a.admiss_times=b.zycs and " +
|
|
|
- "a.inpatient_no=c.inpatient_no and " +
|
|
|
- "a.admiss_times=c.admiss_times and " +
|
|
|
- "c.start_time>=#{start} and " +
|
|
|
- "c.start_time<=#{end} and " +
|
|
|
- "c.order_code in ('06026','06053','06027', '05973') and " +
|
|
|
- "isnull(a.file_status, 0)=#{fileStatus} ")
|
|
|
+ "a.dis_date>=#{start} and " +
|
|
|
+ "a.dis_date<=#{end} and " +
|
|
|
+ "isnull(a.file_status, 0)=#{fileStatus} order by a.zk_ward,b.zyys")
|
|
|
List<SheetOverview> selectPatientsForBasByBah(GetOutSheet param);
|
|
|
|
|
|
@Select("select " +
|
|
@@ -68,49 +40,21 @@ public interface BasSelectOverviewDao extends BaseMapper<CaseFrontsheetSurgery>
|
|
|
"bah=rtrim(a.inpatient_no), " +
|
|
|
"times=rtrim(a.admiss_times), " +
|
|
|
"name=rtrim(a.name), " +
|
|
|
- "a.sex, " +
|
|
|
- "deptName=(select rtrim(name) from zd_unit_code with(nolock) where code=a.dis_dept), " +
|
|
|
+ "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), " +
|
|
|
"b.late_flag, " +
|
|
|
"lateCount=(select count(*) from batj_ba2 with(nolock) where late_flag=1 and zyys=b.zyys), " +
|
|
|
"lateDays=datediff(day, a.dis_date, b.sign_date), " +
|
|
|
- "disDate=convert(varchar(10), a.dis_date, 21) " +
|
|
|
- "from zy_inactpatient a with(nolock), batj_ba2 b with(nolock), yz_inact_order c with(nolock) " +
|
|
|
- "where " +
|
|
|
- "a.inpatient_no=#{bah} and " +
|
|
|
- "a.inpatient_no=b.zyh and " +
|
|
|
- "a.admiss_times=b.zycs and " +
|
|
|
- "a.inpatient_no=c.inpatient_no and " +
|
|
|
- "a.admiss_times=c.admiss_times and " +
|
|
|
- "c.start_time>=#{start} and " +
|
|
|
- "c.start_time<=#{end} and " +
|
|
|
- "c.order_code in ('06026','06053','06027', '05973') and " +
|
|
|
- "isnull(a.file_status, 0)>=1 " +
|
|
|
- "union " +
|
|
|
- "select " +
|
|
|
- "signDate=(convert(varchar(10), b.sign_date, 21)), " +
|
|
|
- "bedNo=rtrim(a.bed_no), " +
|
|
|
- "bah=rtrim(a.inpatient_no), " +
|
|
|
- "times=rtrim(a.admiss_times), " +
|
|
|
- "name=rtrim(a.name), " +
|
|
|
- "a.sex, " +
|
|
|
- "deptName=(select rtrim(name) from zd_unit_code with(nolock) where code=a.dis_dept), " +
|
|
|
- "doctorName=(select rtrim(name) from a_employee_mi with(nolock) where code=b.zyys), " +
|
|
|
- "b.late_flag, " +
|
|
|
- "lateCount=(select count(*) from batj_ba2 with(nolock) where late_flag=1 and zyys=b.zyys), " +
|
|
|
- "lateDays=datediff(day, a.dis_date, b.sign_date), " +
|
|
|
- "disDate=convert(varchar(10), c.start_time, 21) " +
|
|
|
- "from zy_inactpatient a with(nolock), batj_ba2 b with(nolock), yz_act_order c with(nolock) " +
|
|
|
+ "a.dis_date " +
|
|
|
+ "from zy_inactpatient a with(nolock), batj_ba2 b with(nolock) " +
|
|
|
"where " +
|
|
|
"a.inpatient_no=#{bah} and " +
|
|
|
"a.inpatient_no=b.zyh and " +
|
|
|
"a.admiss_times=b.zycs and " +
|
|
|
- "a.inpatient_no=c.inpatient_no and " +
|
|
|
- "a.admiss_times=c.admiss_times and " +
|
|
|
- "c.start_time>=#{start} and " +
|
|
|
- "c.start_time<=#{end} and " +
|
|
|
- "c.order_code in ('06026','06053','06027', '05973') and " +
|
|
|
- "isnull(a.file_status, 0)>=1 ")
|
|
|
+ "a.dis_date>=#{start} and " +
|
|
|
+ "a.dis_date<=#{end} and " +
|
|
|
+ "isnull(a.file_status, 0)>=1 order by a.zk_ward,b.zyys")
|
|
|
List<SheetOverview> selectPatientsForBasByBah2(GetOutSheet param);
|
|
|
|
|
|
@Select("select " +
|
|
@@ -119,13 +63,13 @@ public interface BasSelectOverviewDao extends BaseMapper<CaseFrontsheetSurgery>
|
|
|
"bah=rtrim(a.inpatient_no), " +
|
|
|
"times=rtrim(a.admiss_times), " +
|
|
|
"name=rtrim(a.name), " +
|
|
|
- "a.sex, " +
|
|
|
- "deptName=(select rtrim(name) from zd_unit_code with(nolock) where code=a.dis_dept), " +
|
|
|
+ "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), " +
|
|
|
"b.late_flag, " +
|
|
|
"lateCount=(select count(*) from batj_ba2 with(nolock) where late_flag=1 and zyys=b.zyys), " +
|
|
|
"lateDays=datediff(day, a.dis_date, b.sign_date), " +
|
|
|
- "disDate=convert(varchar(10), a.dis_date, 21) " +
|
|
|
+ "a.dis_date " +
|
|
|
"from zy_inactpatient a with(nolock), batj_ba2 b with(nolock) " +
|
|
|
"where " +
|
|
|
"a.inpatient_no not like 'S%' and " +
|
|
@@ -136,7 +80,7 @@ public interface BasSelectOverviewDao extends BaseMapper<CaseFrontsheetSurgery>
|
|
|
"a.dis_date<=#{end} and " +
|
|
|
"a.zk_ward = #{ward} and " +
|
|
|
"isnull(a.file_status, 0)=#{fileStatus} and " +
|
|
|
- "charindex('$',a.inpatient_no)=0 ")
|
|
|
+ "charindex('$',a.inpatient_no)=0 order by a.zk_ward,b.zyys")
|
|
|
List<SheetOverview> selectPatientsForBasByWard(GetOutSheet param);
|
|
|
|
|
|
@Select("select " +
|
|
@@ -145,13 +89,13 @@ public interface BasSelectOverviewDao extends BaseMapper<CaseFrontsheetSurgery>
|
|
|
"bah=rtrim(a.inpatient_no), " +
|
|
|
"times=rtrim(a.admiss_times), " +
|
|
|
"name=rtrim(a.name), " +
|
|
|
- "a.sex, " +
|
|
|
- "deptName=(select rtrim(name) from zd_unit_code with(nolock) where code=a.dis_dept), " +
|
|
|
+ "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), " +
|
|
|
"b.late_flag, " +
|
|
|
"lateCount=(select count(*) from batj_ba2 with(nolock) where late_flag=1 and zyys=b.zyys), " +
|
|
|
"lateDays=datediff(day, a.dis_date, b.sign_date), " +
|
|
|
- "disDate=convert(varchar(10), a.dis_date, 21) " +
|
|
|
+ "a.dis_date " +
|
|
|
"from zy_inactpatient a with(nolock), batj_ba2 b with(nolock) " +
|
|
|
"where " +
|
|
|
"a.inpatient_no not like 'S%' and " +
|
|
@@ -162,7 +106,7 @@ public interface BasSelectOverviewDao extends BaseMapper<CaseFrontsheetSurgery>
|
|
|
"a.dis_date<=#{end} and " +
|
|
|
"a.zk_ward = #{ward} and " +
|
|
|
"isnull(a.file_status, 0)>=1 and " +
|
|
|
- "charindex('$',a.inpatient_no)=0 ")
|
|
|
+ "charindex('$',a.inpatient_no)=0 order by a.zk_ward,b.zyys")
|
|
|
List<SheetOverview> selectPatientsForBasByWard2(GetOutSheet param);
|
|
|
|
|
|
@Select("select " +
|
|
@@ -171,13 +115,13 @@ public interface BasSelectOverviewDao extends BaseMapper<CaseFrontsheetSurgery>
|
|
|
"bah=rtrim(a.inpatient_no), " +
|
|
|
"times=rtrim(a.admiss_times), " +
|
|
|
"name=rtrim(a.name), " +
|
|
|
- "a.sex, " +
|
|
|
- "deptName=(select rtrim(name) from zd_unit_code with(nolock) where code=a.dis_dept), " +
|
|
|
+ "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), " +
|
|
|
"b.late_flag, " +
|
|
|
"lateCount=(select count(*) from batj_ba2 with(nolock) where late_flag=1 and zyys=b.zyys), " +
|
|
|
"lateDays=datediff(day, a.dis_date, b.sign_date), " +
|
|
|
- "disDate=convert(varchar(10), a.dis_date, 21) " +
|
|
|
+ "a.dis_date " +
|
|
|
"from zy_inactpatient a with(nolock), batj_ba2 b with(nolock) " +
|
|
|
"where " +
|
|
|
"a.inpatient_no not like 'S%' and " +
|
|
@@ -187,7 +131,7 @@ public interface BasSelectOverviewDao extends BaseMapper<CaseFrontsheetSurgery>
|
|
|
"a.dis_date>=#{start} and " +
|
|
|
"a.dis_date<=#{end} and " +
|
|
|
"isnull(a.file_status, 0)=#{fileStatus} and " +
|
|
|
- "charindex('$',a.inpatient_no)=0 ")
|
|
|
+ "charindex('$',a.inpatient_no)=0 order by a.zk_ward,b.zyys")
|
|
|
List<SheetOverview> selectPatientsForBasByFileStatus(GetOutSheet param);
|
|
|
|
|
|
@Select("select " +
|
|
@@ -196,13 +140,13 @@ public interface BasSelectOverviewDao extends BaseMapper<CaseFrontsheetSurgery>
|
|
|
"bah=rtrim(a.inpatient_no), " +
|
|
|
"times=rtrim(a.admiss_times), " +
|
|
|
"name=rtrim(a.name), " +
|
|
|
- "a.sex, " +
|
|
|
- "deptName=(select rtrim(name) from zd_unit_code with(nolock) where code=a.dis_dept), " +
|
|
|
+ "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), " +
|
|
|
"b.late_flag, " +
|
|
|
"lateCount=(select count(*) from batj_ba2 with(nolock) where late_flag=1 and zyys=b.zyys), " +
|
|
|
"lateDays=datediff(day, a.dis_date, b.sign_date), " +
|
|
|
- "disDate=convert(varchar(10), a.dis_date, 21) " +
|
|
|
+ "a.dis_date " +
|
|
|
"from zy_inactpatient a with(nolock), batj_ba2 b with(nolock) " +
|
|
|
"where " +
|
|
|
"a.inpatient_no not like 'S%' and " +
|
|
@@ -212,6 +156,6 @@ public interface BasSelectOverviewDao extends BaseMapper<CaseFrontsheetSurgery>
|
|
|
"a.dis_date>=#{start} and " +
|
|
|
"a.dis_date<=#{end} and " +
|
|
|
"isnull(a.file_status, 0)>=1 and " +
|
|
|
- "charindex('$',a.inpatient_no)=0 ")
|
|
|
+ "charindex('$',a.inpatient_no)=0 order by a.zk_ward,b.zyys")
|
|
|
List<SheetOverview> selectPatientsForBasByFileStatus2(GetOutSheet param);
|
|
|
}
|