|
@@ -56,11 +56,11 @@
|
|
|
case when d.sex=1 then '男' when d.sex=2 then '女' else '未知' end as patientSex,
|
|
|
d.id_no as patientIdNo,
|
|
|
ROUND(DATEDIFF(CURDATE(), d.birthday)/365.2422) as patientAge
|
|
|
- FROM tran_hospital_info a JOIN tran_hospital_dept b
|
|
|
+ FROM tran_hospital_info a LEFT JOIN tran_hospital_dept b
|
|
|
ON a.`code`=b.hospital_code
|
|
|
- JOIN tran_doctor_info c
|
|
|
+ LEFT JOIN tran_doctor_info c
|
|
|
ON b.hospital_code=c.hospital_code and b.`code`=c.hospital_dept_code
|
|
|
- JOIN tran_patient_info d
|
|
|
+ LEFT JOIN tran_patient_info d
|
|
|
ON c.hospital_code=d.hospital_code
|
|
|
WHERE a.is_deleted='N' AND b.is_deleted='N'
|
|
|
AND c.is_deleted='N' AND d.is_deleted='N'
|