|
@@ -0,0 +1,657 @@
|
|
|
+package thyyxxk.webserver.dao_his.casefrontsheet;
|
|
|
+
|
|
|
+import org.apache.ibatis.annotations.Mapper;
|
|
|
+import org.apache.ibatis.annotations.Select;
|
|
|
+import thyyxxk.webserver.pojo.casefrontsheet.GetOutSheetParam;
|
|
|
+import thyyxxk.webserver.pojo.casefrontsheet.SheetOverview;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+@Mapper
|
|
|
+public interface BasSelectOverviewDao {
|
|
|
+ @Select("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 where code=a.dis_dept), " +
|
|
|
+ "doctorName=(select rtrim(name) from a_employee_mi where code=b.zyys), " +
|
|
|
+ "b.late_flag, " +
|
|
|
+ "lateCount=(select count(*) from batj_ba2 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, batj_ba2 b, yz_inact_order c " +
|
|
|
+ "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 where code=a.dis_dept), " +
|
|
|
+ "doctorName=(select rtrim(name) from a_employee_mi where code=b.zyys), " +
|
|
|
+ "b.late_flag, " +
|
|
|
+ "lateCount=(select count(*) from batj_ba2 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_actpatient a, batj_ba2 b, yz_act_order c " +
|
|
|
+ "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 where code=a.dis_dept), " +
|
|
|
+ "doctorName=(select rtrim(name) from a_employee_mi where code=b.zyys), " +
|
|
|
+ "b.late_flag, " +
|
|
|
+ "lateCount=(select count(*) from batj_ba2 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_actpatient a, batj_ba2 b, yz_inact_order c " +
|
|
|
+ "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 where code=a.dis_dept), " +
|
|
|
+ "doctorName=(select rtrim(name) from a_employee_mi where code=b.zyys), " +
|
|
|
+ "b.late_flag, " +
|
|
|
+ "lateCount=(select count(*) from batj_ba2 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, batj_ba2 b, yz_act_order c " +
|
|
|
+ "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} ")
|
|
|
+ List<SheetOverview> selectPatientsForBasByBah(GetOutSheetParam param);
|
|
|
+
|
|
|
+ @Select("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 where code=a.dis_dept), " +
|
|
|
+ "doctorName=(select rtrim(name) from a_employee_mi where code=b.zyys), " +
|
|
|
+ "b.late_flag, " +
|
|
|
+ "lateCount=(select count(*) from batj_ba2 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, batj_ba2 b, yz_inact_order c " +
|
|
|
+ "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 where code=a.dis_dept), " +
|
|
|
+ "doctorName=(select rtrim(name) from a_employee_mi where code=b.zyys), " +
|
|
|
+ "b.late_flag, " +
|
|
|
+ "lateCount=(select count(*) from batj_ba2 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_actpatient a, batj_ba2 b, yz_act_order c " +
|
|
|
+ "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 where code=a.dis_dept), " +
|
|
|
+ "doctorName=(select rtrim(name) from a_employee_mi where code=b.zyys), " +
|
|
|
+ "b.late_flag, " +
|
|
|
+ "lateCount=(select count(*) from batj_ba2 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_actpatient a, batj_ba2 b, yz_inact_order c " +
|
|
|
+ "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 where code=a.dis_dept), " +
|
|
|
+ "doctorName=(select rtrim(name) from a_employee_mi where code=b.zyys), " +
|
|
|
+ "b.late_flag, " +
|
|
|
+ "lateCount=(select count(*) from batj_ba2 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, batj_ba2 b, yz_act_order c " +
|
|
|
+ "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 ")
|
|
|
+ List<SheetOverview> selectPatientsForBasByBah2(GetOutSheetParam param);
|
|
|
+
|
|
|
+ @Select("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 where code=a.dis_dept), " +
|
|
|
+ "doctorName=(select rtrim(name) from a_employee_mi where code=b.zyys), " +
|
|
|
+ "b.late_flag, " +
|
|
|
+ "lateCount=(select count(*) from batj_ba2 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, batj_ba2 b, yz_inact_order c " +
|
|
|
+ "where " +
|
|
|
+ "a.inpatient_no not like 'S%' and " +
|
|
|
+ "a.inpatient_no not like 'JT%' 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 " +
|
|
|
+ "c.exec_unit = #{ward} and " +
|
|
|
+ "isnull(a.file_status, 0)=#{fileStatus} and " +
|
|
|
+ "charindex('$',a.inpatient_no)=0 " +
|
|
|
+ "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 where code=a.dis_dept), " +
|
|
|
+ "doctorName=(select rtrim(name) from a_employee_mi where code=b.zyys), " +
|
|
|
+ "b.late_flag, " +
|
|
|
+ "lateCount=(select count(*) from batj_ba2 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_actpatient a, batj_ba2 b, yz_act_order c " +
|
|
|
+ "where " +
|
|
|
+ "a.inpatient_no not like 'S%' and " +
|
|
|
+ "a.inpatient_no not like 'JT%' 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 " +
|
|
|
+ "c.exec_unit = #{ward} and " +
|
|
|
+ "isnull(a.file_status, 0)=#{fileStatus} and " +
|
|
|
+ "charindex('$',a.inpatient_no)=0 " +
|
|
|
+ "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 where code=a.dis_dept), " +
|
|
|
+ "doctorName=(select rtrim(name) from a_employee_mi where code=b.zyys), " +
|
|
|
+ "b.late_flag, " +
|
|
|
+ "lateCount=(select count(*) from batj_ba2 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_actpatient a, batj_ba2 b, yz_inact_order c " +
|
|
|
+ "where " +
|
|
|
+ "a.inpatient_no not like 'S%' and " +
|
|
|
+ "a.inpatient_no not like 'JT%' 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 " +
|
|
|
+ "c.exec_unit = #{ward} and " +
|
|
|
+ "isnull(a.file_status, 0)=#{fileStatus} and " +
|
|
|
+ "charindex('$',a.inpatient_no)=0 " +
|
|
|
+ "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 where code=a.dis_dept), " +
|
|
|
+ "doctorName=(select rtrim(name) from a_employee_mi where code=b.zyys), " +
|
|
|
+ "b.late_flag, " +
|
|
|
+ "lateCount=(select count(*) from batj_ba2 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, batj_ba2 b, yz_act_order c " +
|
|
|
+ "where " +
|
|
|
+ "a.inpatient_no not like 'S%' and " +
|
|
|
+ "a.inpatient_no not like 'JT%' 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 " +
|
|
|
+ "c.exec_unit = #{ward} and " +
|
|
|
+ "isnull(a.file_status, 0)=#{fileStatus} and " +
|
|
|
+ "charindex('$',a.inpatient_no)=0 ")
|
|
|
+ List<SheetOverview> selectPatientsForBasByWard(GetOutSheetParam param);
|
|
|
+
|
|
|
+ @Select("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 where code=a.dis_dept), " +
|
|
|
+ "doctorName=(select rtrim(name) from a_employee_mi where code=b.zyys), " +
|
|
|
+ "b.late_flag, " +
|
|
|
+ "lateCount=(select count(*) from batj_ba2 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, batj_ba2 b, yz_inact_order c " +
|
|
|
+ "where " +
|
|
|
+ "a.inpatient_no not like 'S%' and " +
|
|
|
+ "a.inpatient_no not like 'JT%' 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 " +
|
|
|
+ "c.exec_unit = #{ward} and " +
|
|
|
+ "isnull(a.file_status, 0)>=1 and " +
|
|
|
+ "charindex('$',a.inpatient_no)=0 " +
|
|
|
+ "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 where code=a.dis_dept), " +
|
|
|
+ "doctorName=(select rtrim(name) from a_employee_mi where code=b.zyys), " +
|
|
|
+ "b.late_flag, " +
|
|
|
+ "lateCount=(select count(*) from batj_ba2 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_actpatient a, batj_ba2 b, yz_act_order c " +
|
|
|
+ "where " +
|
|
|
+ "a.inpatient_no not like 'S%' and " +
|
|
|
+ "a.inpatient_no not like 'JT%' 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 " +
|
|
|
+ "c.exec_unit = #{ward} and " +
|
|
|
+ "isnull(a.file_status, 0)>=1 and " +
|
|
|
+ "charindex('$',a.inpatient_no)=0 " +
|
|
|
+ "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 where code=a.dis_dept), " +
|
|
|
+ "doctorName=(select rtrim(name) from a_employee_mi where code=b.zyys), " +
|
|
|
+ "b.late_flag, " +
|
|
|
+ "lateCount=(select count(*) from batj_ba2 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_actpatient a, batj_ba2 b, yz_inact_order c " +
|
|
|
+ "where " +
|
|
|
+ "a.inpatient_no not like 'S%' and " +
|
|
|
+ "a.inpatient_no not like 'JT%' 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 " +
|
|
|
+ "c.exec_unit = #{ward} and " +
|
|
|
+ "isnull(a.file_status, 0)>=1 and " +
|
|
|
+ "charindex('$',a.inpatient_no)=0 " +
|
|
|
+ "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 where code=a.dis_dept), " +
|
|
|
+ "doctorName=(select rtrim(name) from a_employee_mi where code=b.zyys), " +
|
|
|
+ "b.late_flag, " +
|
|
|
+ "lateCount=(select count(*) from batj_ba2 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, batj_ba2 b, yz_act_order c " +
|
|
|
+ "where " +
|
|
|
+ "a.inpatient_no not like 'S%' and " +
|
|
|
+ "a.inpatient_no not like 'JT%' 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 " +
|
|
|
+ "c.exec_unit = #{ward} and " +
|
|
|
+ "isnull(a.file_status, 0)>=1 and " +
|
|
|
+ "charindex('$',a.inpatient_no)=0 ")
|
|
|
+ List<SheetOverview> selectPatientsForBasByWard2(GetOutSheetParam param);
|
|
|
+
|
|
|
+ @Select("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 where code=a.dis_dept), " +
|
|
|
+ "doctorName=(select rtrim(name) from a_employee_mi where code=b.zyys), " +
|
|
|
+ "b.late_flag, " +
|
|
|
+ "lateCount=(select count(*) from batj_ba2 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, batj_ba2 b, yz_inact_order c " +
|
|
|
+ "where " +
|
|
|
+ "a.inpatient_no not like 'S%' and " +
|
|
|
+ "a.inpatient_no not like 'JT%' 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} and " +
|
|
|
+ "charindex('$',a.inpatient_no)=0 " +
|
|
|
+ "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 where code=a.dis_dept), " +
|
|
|
+ "doctorName=(select rtrim(name) from a_employee_mi where code=b.zyys), " +
|
|
|
+ "b.late_flag, " +
|
|
|
+ "lateCount=(select count(*) from batj_ba2 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_actpatient a, batj_ba2 b, yz_act_order c " +
|
|
|
+ "where " +
|
|
|
+ "a.inpatient_no not like 'S%' and " +
|
|
|
+ "a.inpatient_no not like 'JT%' 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} and " +
|
|
|
+ "charindex('$',a.inpatient_no)=0 " +
|
|
|
+ "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 where code=a.dis_dept), " +
|
|
|
+ "doctorName=(select rtrim(name) from a_employee_mi where code=b.zyys), " +
|
|
|
+ "b.late_flag, " +
|
|
|
+ "lateCount=(select count(*) from batj_ba2 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_actpatient a, batj_ba2 b, yz_inact_order c " +
|
|
|
+ "where " +
|
|
|
+ "a.inpatient_no not like 'S%' and " +
|
|
|
+ "a.inpatient_no not like 'JT%' 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} and " +
|
|
|
+ "charindex('$',a.inpatient_no)=0 " +
|
|
|
+ "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 where code=a.dis_dept), " +
|
|
|
+ "doctorName=(select rtrim(name) from a_employee_mi where code=b.zyys), " +
|
|
|
+ "b.late_flag, " +
|
|
|
+ "lateCount=(select count(*) from batj_ba2 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, batj_ba2 b, yz_act_order c " +
|
|
|
+ "where " +
|
|
|
+ "a.inpatient_no not like 'S%' and " +
|
|
|
+ "a.inpatient_no not like 'JT%' 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} and " +
|
|
|
+ "charindex('$',a.inpatient_no)=0 ")
|
|
|
+ List<SheetOverview> selectPatientsForBasByFileStatus(GetOutSheetParam param);
|
|
|
+
|
|
|
+ @Select("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 where code=a.dis_dept), " +
|
|
|
+ "doctorName=(select rtrim(name) from a_employee_mi where code=b.zyys), " +
|
|
|
+ "b.late_flag, " +
|
|
|
+ "lateCount=(select count(*) from batj_ba2 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, batj_ba2 b, yz_inact_order c " +
|
|
|
+ "where " +
|
|
|
+ "a.inpatient_no not like 'S%' and " +
|
|
|
+ "a.inpatient_no not like 'JT%' 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 and " +
|
|
|
+ "charindex('$',a.inpatient_no)=0 " +
|
|
|
+ "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 where code=a.dis_dept), " +
|
|
|
+ "doctorName=(select rtrim(name) from a_employee_mi where code=b.zyys), " +
|
|
|
+ "b.late_flag, " +
|
|
|
+ "lateCount=(select count(*) from batj_ba2 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_actpatient a, batj_ba2 b, yz_act_order c " +
|
|
|
+ "where " +
|
|
|
+ "a.inpatient_no not like 'S%' and " +
|
|
|
+ "a.inpatient_no not like 'JT%' 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 and " +
|
|
|
+ "charindex('$',a.inpatient_no)=0 " +
|
|
|
+ "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 where code=a.dis_dept), " +
|
|
|
+ "doctorName=(select rtrim(name) from a_employee_mi where code=b.zyys), " +
|
|
|
+ "b.late_flag, " +
|
|
|
+ "lateCount=(select count(*) from batj_ba2 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_actpatient a, batj_ba2 b, yz_inact_order c " +
|
|
|
+ "where " +
|
|
|
+ "a.inpatient_no not like 'S%' and " +
|
|
|
+ "a.inpatient_no not like 'JT%' 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 and " +
|
|
|
+ "charindex('$',a.inpatient_no)=0 " +
|
|
|
+ "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 where code=a.dis_dept), " +
|
|
|
+ "doctorName=(select rtrim(name) from a_employee_mi where code=b.zyys), " +
|
|
|
+ "b.late_flag, " +
|
|
|
+ "lateCount=(select count(*) from batj_ba2 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, batj_ba2 b, yz_act_order c " +
|
|
|
+ "where " +
|
|
|
+ "a.inpatient_no not like 'S%' and " +
|
|
|
+ "a.inpatient_no not like 'JT%' 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 and " +
|
|
|
+ "charindex('$',a.inpatient_no)=0 ")
|
|
|
+ List<SheetOverview> selectPatientsForBasByFileStatus2(GetOutSheetParam param);
|
|
|
+}
|