|
@@ -49,56 +49,6 @@ public interface BasSelectOverviewDao extends BaseMapper<CaseFrontsheetSurgery>
|
|
|
"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_actpatient a with(nolock), batj_ba2 b with(nolock), yz_act_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_actpatient 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) " +
|
|
|
"where " +
|
|
|
"a.inpatient_no=#{bah} and " +
|
|
@@ -150,56 +100,6 @@ public interface BasSelectOverviewDao extends BaseMapper<CaseFrontsheetSurgery>
|
|
|
"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_actpatient a with(nolock), batj_ba2 b with(nolock), yz_act_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_actpatient 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) " +
|
|
|
"where " +
|
|
|
"a.inpatient_no=#{bah} and " +
|
|
@@ -226,102 +126,15 @@ public interface BasSelectOverviewDao extends BaseMapper<CaseFrontsheetSurgery>
|
|
|
"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 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 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_actpatient a with(nolock), batj_ba2 b with(nolock), yz_act_order c with(nolock) " +
|
|
|
- "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 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_actpatient a with(nolock), batj_ba2 b with(nolock), yz_inact_order c with(nolock) " +
|
|
|
+ "from zy_inactpatient a with(nolock), batj_ba2 b with(nolock) " +
|
|
|
"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 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) " +
|
|
|
- "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 " +
|
|
|
+ "a.dis_date>=#{start} and " +
|
|
|
+ "a.dis_date<=#{end} and " +
|
|
|
+ "a.zk_ward = #{ward} and " +
|
|
|
"isnull(a.file_status, 0)=#{fileStatus} and " +
|
|
|
"charindex('$',a.inpatient_no)=0 ")
|
|
|
List<SheetOverview> selectPatientsForBasByWard(GetOutSheet param);
|
|
@@ -339,102 +152,15 @@ public interface BasSelectOverviewDao extends BaseMapper<CaseFrontsheetSurgery>
|
|
|
"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 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 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_actpatient a with(nolock), batj_ba2 b with(nolock), yz_act_order c with(nolock) " +
|
|
|
- "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 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_actpatient a with(nolock), batj_ba2 b with(nolock), yz_inact_order c with(nolock) " +
|
|
|
- "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 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) " +
|
|
|
+ "from zy_inactpatient a with(nolock), batj_ba2 b with(nolock) " +
|
|
|
"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 " +
|
|
|
+ "a.dis_date>=#{start} and " +
|
|
|
+ "a.dis_date<=#{end} and " +
|
|
|
+ "a.zk_ward = #{ward} and " +
|
|
|
"isnull(a.file_status, 0)>=1 and " +
|
|
|
"charindex('$',a.inpatient_no)=0 ")
|
|
|
List<SheetOverview> selectPatientsForBasByWard2(GetOutSheet param);
|
|
@@ -452,103 +178,19 @@ public interface BasSelectOverviewDao extends BaseMapper<CaseFrontsheetSurgery>
|
|
|
"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 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 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) " +
|
|
|
+ "from zy_inactpatient a with(nolock), batj_ba2 b with(nolock) " +
|
|
|
"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 " +
|
|
|
+ "a.dis_date>=#{start} and " +
|
|
|
+ "a.dis_date<=#{end} and " +
|
|
|
"isnull(a.file_status, 0)=#{fileStatus} and " +
|
|
|
"charindex('$',a.inpatient_no)=0 ")
|
|
|
List<SheetOverview> selectPatientsForBasByFileStatus(GetOutSheet 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 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), 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 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 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_actpatient a with(nolock), batj_ba2 b with(nolock), yz_act_order c with(nolock) " +
|
|
|
- "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), " +
|
|
@@ -560,45 +202,15 @@ public interface BasSelectOverviewDao extends BaseMapper<CaseFrontsheetSurgery>
|
|
|
"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_actpatient a with(nolock), batj_ba2 b with(nolock), yz_inact_order c with(nolock) " +
|
|
|
- "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 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) " +
|
|
|
+ "disDate=convert(varchar(10), a.dis_date, 21) " +
|
|
|
+ "from zy_inactpatient a with(nolock), batj_ba2 b with(nolock) " +
|
|
|
"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 " +
|
|
|
+ "a.dis_date>=#{start} and " +
|
|
|
+ "a.dis_date<=#{end} and " +
|
|
|
"isnull(a.file_status, 0)>=1 and " +
|
|
|
"charindex('$',a.inpatient_no)=0 ")
|
|
|
List<SheetOverview> selectPatientsForBasByFileStatus2(GetOutSheet param);
|