|
@ -468,7 +468,7 @@ public class FollowUpService {
|
|
|
"f.doctor_code doctorCode,f.doctor_name doctorName,pl.disease_name businessTypeName,pl.disease businessType,ip.id itemPlanId, " +
|
|
|
"h.dept_code deptCode,h.dept_name deptName,f.`status`,date_format(f.followup_date, '%Y-%m-%d %H:%i:%s') followupDate,'诊后康复' businessSource," +
|
|
|
"date_format(f.followup_plan_date, '%Y-%m-%d %H:%i:%s') followupPlanDate,date_format(pl.create_time, '%Y-%m-%d %H:%i:%s') turnDownDate," +
|
|
|
"if(i.from_source=2,i.doctor_name,pl.plan_doctor_name) planDoctorName,if(i.from_source=2,i.dept_name,h2.dept_name) turnDownDeptName, " +
|
|
|
"if(i.from_source=2,i.doctor_name,pl.plan_doctor_name) planDoctorName,if(i.from_source=2,i.dept_name,(SELECT GROUP_CONCAT(dept_name) FROM base_doctor_hospital WHERE doctor_code=pl.plan_doctor AND del = 1)) turnDownDeptName, " +
|
|
|
"f.followup_form_type followupFormType,d.dict_value followupFormTypeValue, d2.dict_value followupTypeValue ";
|
|
|
String countSql = "select count(DISTINCT f.id) ";
|
|
|
String filter = " from wlyy_followup f " +
|
|
@ -477,7 +477,7 @@ public class FollowUpService {
|
|
|
"LEFT JOIN wlyy_rehabilitation_patient_info i on pl.patient_info_code = i.code " +
|
|
|
"INNER JOIN base_patient p on p.id = f.patient_code " +
|
|
|
"LEFT JOIN base_doctor_hospital h on f.doctor_code=h.doctor_code and h.del=1 " +
|
|
|
"LEFT JOIN base_doctor_hospital h2 on pl.plan_doctor=h2.doctor_code and h2.del=1 " +
|
|
|
//"LEFT JOIN base_doctor_hospital h2 on pl.plan_doctor=h2.doctor_code and h2.del=1 " +
|
|
|
"LEFT JOIN wlyy_hospital_sys_dict d ON d.dict_name='followup_form_type' AND d.dict_code=f.followup_form_type " +
|
|
|
"LEFT JOIN wlyy_hospital_sys_dict d2 ON d2.dict_name='FOLLOWUP_WAY_DICT' AND d2.dict_code=f.followup_type " +
|
|
|
"WHERE 1=1 ";
|
|
@ -559,14 +559,14 @@ public class FollowUpService {
|
|
|
"f.doctor_code doctorCode,f.doctor_name doctorName,pl.disease_name businessTypeName,pl.disease businessType, " +
|
|
|
"h.dept_code deptCode,h.dept_name deptName,f.`status`,if(f.`status`=1,date_format(f.followup_date, '%Y-%m-%d %H:%i:%s'),'') followupDate," +
|
|
|
"'诊后康复' businessSource,date_format(f.followup_plan_date, '%Y-%m-%d %H:%i:%s') followupPlanDate," +
|
|
|
"date_format(pl.create_time, '%Y-%m-%d %H:%i:%s') turnDownDate,pl.plan_doctor_name planDoctorName,h2.dept_name turnDownDeptName, " +
|
|
|
"date_format(pl.create_time, '%Y-%m-%d %H:%i:%s') turnDownDate,pl.plan_doctor_name planDoctorName,(SELECT GROUP_CONCAT(dept_name) FROM base_doctor_hospital WHERE doctor_code=pl.plan_doctor AND del = 1) turnDownDeptName, " +
|
|
|
"f.followup_form_type followupFormType,d.dict_value followupFormTypeValue, d2.dict_value followupTypeValue ";
|
|
|
String filter = " from wlyy_followup f " +
|
|
|
"INNER JOIN base_service_item_plan ip on f.id = ip.relation_code and ip.relation_type='6' " +
|
|
|
"LEFT JOIN wlyy_patient_rehabilitation_plan pl on pl.id = ip.plan_id " +
|
|
|
"INNER JOIN base_patient p on p.id = f.patient_code " +
|
|
|
"LEFT JOIN base_doctor_hospital h on f.doctor_code=h.doctor_code and h.del=1 " +
|
|
|
"LEFT JOIN base_doctor_hospital h2 on pl.plan_doctor=h2.doctor_code and h2.del=1 " +
|
|
|
// "LEFT JOIN base_doctor_hospital h2 on pl.plan_doctor=h2.doctor_code and h2.del=1 " +
|
|
|
"LEFT JOIN wlyy_hospital_sys_dict d ON d.dict_name='followup_form_type' AND d.dict_code=f.followup_form_type " +
|
|
|
"LEFT JOIN wlyy_hospital_sys_dict d2 ON d2.dict_name='FOLLOWUP_WAY_DICT' AND d2.dict_code=f.followup_type " +
|
|
|
"WHERE 1=1 ";
|
|
@ -590,7 +590,7 @@ public class FollowUpService {
|
|
|
filter += " and f.status='"+followupStatus+"' ";
|
|
|
}
|
|
|
if(StringUtils.isNotBlank(doctorName)){
|
|
|
sql += " and f.doctor_name like '%"+doctorName+"%' ";
|
|
|
filter += " and f.doctor_name like '%"+doctorName+"%' ";
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(startDate)){
|
|
|
filter += " and f.followup_date>='"+startDate+"' ";
|