|
@@ -66,7 +66,7 @@ public interface OutpatientCoordinationDao {
|
|
|
"(select rtrim(a.name) from a_employee_mi a WHERE a.code = t3.doctor_code) as doctor, \n" +
|
|
|
"t3.visit_dept_code as deptId, \n" +
|
|
|
"(select d.name from zd_unit_code d WHERE d.code = t3.visit_dept_code ) as dept, \n" +
|
|
|
- "(select rtrim(a.name) from a_employee_mi a WHERE a.code = t3.op_id) as czr, \n" +
|
|
|
+ "(select rtrim(a.name) from a_employee_mi a WHERE a.code = t2.op_id) as czr, \n" +
|
|
|
"(select d.code from a_employee_mi a, zd_unit_code d WHERE a.code = t1.staff_id and d.code = a.dept_code ) as deptCode, \n" +
|
|
|
"(select d.name from a_employee_mi a, zd_unit_code d WHERE a.code = t1.staff_id and d.code = a.dept_code ) as deptName, \n" +
|
|
|
"t1.pat_no as patNo, \n" +
|
|
@@ -79,11 +79,11 @@ public interface OutpatientCoordinationDao {
|
|
|
"(select pat_no, convert(varchar(100), setl_time, 112) rq1, setl_time, staff_id, times, psn_name, insuplc_admdvs \n" +
|
|
|
"from t_si_setlinfo where med_type='11' and insutype='310' and revoked=0 \n" +
|
|
|
"and convert(varchar(6), setl_time, 112) = #{month} ) t1, \n" +
|
|
|
- "(select distinct patient_id, CONVERT(varchar(100), request_day, 112) rq2 \n" +
|
|
|
+ "(select distinct patient_id, op_id, CONVERT(varchar(100), request_day, 112) rq2 \n" +
|
|
|
"from mzy_reqrec with(nolock) \n" +
|
|
|
"where cancel_mark=0 \n" +
|
|
|
"and convert(varchar(6), request_day, 112) = #{month} ) t2, \n" +
|
|
|
- "(select distinct patient_id, times, isnull(icd_text_new, icd_text) as icd_text, visit_dept_code, doctor_code, op_id from mz_visit_table) t3 \n" +
|
|
|
+ "(select distinct patient_id, times, isnull(icd_text_new, icd_text) as icd_text, visit_dept_code, doctor_code from mz_visit_table) t3 \n" +
|
|
|
"where t1.pat_no = t2.patient_id \n" +
|
|
|
"and t1.rq1 = t2.rq2 \n" +
|
|
|
"and t1.pat_no = t3.patient_id \n" +
|