|
|
@ -30,10 +30,9 @@ |
|
|
COUNT(DISTINCT p.id) AS total |
|
|
COUNT(DISTINCT p.id) AS total |
|
|
FROM |
|
|
FROM |
|
|
pms_patient p |
|
|
pms_patient p |
|
|
LEFT JOIN ums_user u ON p.create_by = u.user_name |
|
|
|
|
|
where p.del_flag = 0 |
|
|
where p.del_flag = 0 |
|
|
<if test="dto.deptId != null"> |
|
|
<if test="dto.deptId != null"> |
|
|
AND u.dept_id = #{dto.deptId} |
|
|
AND p.hospital_id = #{dto.deptId} |
|
|
</if> |
|
|
</if> |
|
|
<if test="dto.beginTime != null"> |
|
|
<if test="dto.beginTime != null"> |
|
|
AND p.create_time >= #{dto.beginTime} |
|
|
AND p.create_time >= #{dto.beginTime} |
|
|
@ -144,14 +143,14 @@ |
|
|
b.diagnosis_code as code, |
|
|
b.diagnosis_code as code, |
|
|
COUNT(b.id) AS value |
|
|
COUNT(b.id) AS value |
|
|
FROM |
|
|
FROM |
|
|
pms_patient_body b |
|
|
pms_patient_diagnosis b |
|
|
LEFT JOIN ums_user u ON b.create_by = u.user_name |
|
|
LEFT JOIN pms_patient p ON b.patient_id = p.id |
|
|
WHERE |
|
|
WHERE |
|
|
b.diagnosis_name IS NOT NULL |
|
|
b.diagnosis_name IS NOT NULL |
|
|
and diagnosis_name != '' |
|
|
and diagnosis_name != '' |
|
|
and b.del_flag = 0 |
|
|
and b.del_flag = 0 |
|
|
<if test="dto.deptId != null"> |
|
|
<if test="dto.deptId != null"> |
|
|
AND u.dept_id = #{dto.deptId} |
|
|
AND p.hospital_id = #{dto.deptId} |
|
|
</if> |
|
|
</if> |
|
|
<if test="dto.beginTime != null"> |
|
|
<if test="dto.beginTime != null"> |
|
|
AND b.create_time >= #{dto.beginTime} |
|
|
AND b.create_time >= #{dto.beginTime} |
|
|
@ -220,6 +219,7 @@ |
|
|
LEFT JOIN rms_report rr ON rr.evaluation_id = e.id |
|
|
LEFT JOIN rms_report rr ON rr.evaluation_id = e.id |
|
|
LEFT JOIN rms_report_scale_score rs ON rs.report_id = rr.id and r.scale_code = rs.scale_code |
|
|
LEFT JOIN rms_report_scale_score rs ON rs.report_id = rr.id and r.scale_code = rs.scale_code |
|
|
LEFT JOIN ums_user u ON r.create_by = u.user_name |
|
|
LEFT JOIN ums_user u ON r.create_by = u.user_name |
|
|
|
|
|
LEFT JOIN pms_patient p ON e.patient_id = p.id |
|
|
where e.del_flag = 0 |
|
|
where e.del_flag = 0 |
|
|
and r.scale_code in ( |
|
|
and r.scale_code in ( |
|
|
"DCYY-TP", |
|
|
"DCYY-TP", |
|
|
@ -236,7 +236,7 @@ |
|
|
"CAM" |
|
|
"CAM" |
|
|
) |
|
|
) |
|
|
<if test="dto.deptId != null"> |
|
|
<if test="dto.deptId != null"> |
|
|
AND u.dept_id = #{dto.deptId} |
|
|
AND p.hospital_id = #{dto.deptId} |
|
|
</if> |
|
|
</if> |
|
|
<if test="dto.beginTime != null"> |
|
|
<if test="dto.beginTime != null"> |
|
|
AND r.create_time >= #{dto.beginTime} |
|
|
AND r.create_time >= #{dto.beginTime} |
|
|
@ -249,16 +249,14 @@ |
|
|
|
|
|
|
|
|
<select id="qualificationStatistics" resultType="com.ccsens.system.domain.vo.HomeDpVo$QualificationStatistics"> |
|
|
<select id="qualificationStatistics" resultType="com.ccsens.system.domain.vo.HomeDpVo$QualificationStatistics"> |
|
|
SELECT |
|
|
SELECT |
|
|
s.dict_value AS qualification, |
|
|
p.educational_status AS qualification, |
|
|
COUNT( p.id ) AS num |
|
|
COUNT( p.id ) AS num |
|
|
FROM |
|
|
FROM |
|
|
sys_dict_data s |
|
|
pms_patient p |
|
|
LEFT JOIN pms_patient p ON p.educational_status = s.dict_value AND p.del_flag = 0 |
|
|
|
|
|
LEFT JOIN ums_user u ON p.create_by = u.user_name |
|
|
|
|
|
where |
|
|
where |
|
|
s.dict_type = 'sys_qualification' |
|
|
p.del_flag = 0 |
|
|
<if test="dto.deptId != null"> |
|
|
<if test="dto.deptId != null"> |
|
|
AND u.dept_id = #{dto.deptId} |
|
|
AND p.hospital_id = #{dto.deptId} |
|
|
</if> |
|
|
</if> |
|
|
<if test="dto.beginTime != null"> |
|
|
<if test="dto.beginTime != null"> |
|
|
AND p.create_time >= #{dto.beginTime} |
|
|
AND p.create_time >= #{dto.beginTime} |
|
|
@ -267,7 +265,7 @@ |
|
|
AND p.create_time <= #{dto.endTime} |
|
|
AND p.create_time <= #{dto.endTime} |
|
|
</if> |
|
|
</if> |
|
|
GROUP BY |
|
|
GROUP BY |
|
|
p.educational_status |
|
|
p.educational_status |
|
|
ORDER BY |
|
|
ORDER BY |
|
|
qualification desc |
|
|
qualification desc |
|
|
</select> |
|
|
</select> |
|
|
@ -361,10 +359,11 @@ |
|
|
LEFT JOIN ems_evaluation_scale_relevance ees on e.id = ees.evaluation_id AND ees.del_flag = 0 |
|
|
LEFT JOIN ems_evaluation_scale_relevance ees on e.id = ees.evaluation_id AND ees.del_flag = 0 |
|
|
LEFT JOIN qms_scale qs ON qs.code = ees.scale_code |
|
|
LEFT JOIN qms_scale qs ON qs.code = ees.scale_code |
|
|
LEFT JOIN ums_user u ON e.create_by = u.user_name AND u.del_flag = 0 |
|
|
LEFT JOIN ums_user u ON e.create_by = u.user_name AND u.del_flag = 0 |
|
|
|
|
|
LEFT JOIN pms_patient p ON e.patient_id = p.id |
|
|
WHERE |
|
|
WHERE |
|
|
e.del_flag = 0 |
|
|
e.del_flag = 0 |
|
|
<if test="dto.deptId != null"> |
|
|
<if test="dto.deptId != null"> |
|
|
AND u.dept_id = #{dto.deptId} |
|
|
AND p.hospital_id = #{dto.deptId} |
|
|
</if> |
|
|
</if> |
|
|
<if test="dto.beginTime != null"> |
|
|
<if test="dto.beginTime != null"> |
|
|
AND ees.create_time >= #{dto.beginTime} |
|
|
AND ees.create_time >= #{dto.beginTime} |
|
|
|