|
|
@ -49,6 +49,12 @@ |
|
|
|
<if test="dto.endTime != null"> |
|
|
|
AND create_time <= #{dto.endTime} |
|
|
|
</if> |
|
|
|
<if test="dto.startTime != null"> |
|
|
|
AND create_time >= #{dto.startTime} |
|
|
|
</if> |
|
|
|
<if test="dto.endTime != null"> |
|
|
|
AND create_time <= #{dto.endTime} |
|
|
|
</if> |
|
|
|
) AS age_data; |
|
|
|
</select> |
|
|
|
|
|
|
@ -97,6 +103,12 @@ |
|
|
|
<if test="tenantId != null"> |
|
|
|
AND tenant_id = #{tenantId} |
|
|
|
</if> |
|
|
|
<if test="dto.startTime != null"> |
|
|
|
AND create_time >= #{dto.startTime} |
|
|
|
</if> |
|
|
|
<if test="dto.endTime != null"> |
|
|
|
AND create_time <= #{dto.endTime} |
|
|
|
</if> |
|
|
|
</where> |
|
|
|
</select> |
|
|
|
|
|
|
@ -116,6 +128,12 @@ |
|
|
|
<if test="tenantId != null"> |
|
|
|
AND t.tenant_id = #{tenantId} |
|
|
|
</if> |
|
|
|
<if test="dto.startTime != null"> |
|
|
|
AND t.create_time >= #{dto.startTime} |
|
|
|
</if> |
|
|
|
<if test="dto.endTime != null"> |
|
|
|
AND t.create_time <= #{dto.endTime} |
|
|
|
</if> |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="queryTxStatistics" resultType="java.lang.String"> |
|
|
@ -130,6 +148,12 @@ |
|
|
|
<if test="tenantId != null"> |
|
|
|
AND tenant_id = #{tenantId} |
|
|
|
</if> |
|
|
|
<if test="dto.startTime != null"> |
|
|
|
AND t.create_time >= #{dto.startTime} |
|
|
|
</if> |
|
|
|
<if test="dto.endTime != null"> |
|
|
|
AND t.create_time <= #{dto.endTime} |
|
|
|
</if> |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="queryTotalPatient" resultType="java.lang.Integer"> |
|
|
@ -142,6 +166,12 @@ |
|
|
|
<if test="tenantId != null"> |
|
|
|
AND tenant_id = #{tenantId} |
|
|
|
</if> |
|
|
|
<if test="dto.startTime != null"> |
|
|
|
AND create_time >= #{dto.startTime} |
|
|
|
</if> |
|
|
|
<if test="dto.endTime != null"> |
|
|
|
AND create_time <= #{dto.endTime} |
|
|
|
</if> |
|
|
|
</where> |
|
|
|
</select> |
|
|
|
|
|
|
@ -168,6 +198,12 @@ |
|
|
|
<if test="tenantId != null"> |
|
|
|
AND tenant_id = #{tenantId} |
|
|
|
</if> |
|
|
|
<if test="dto.startTime != null"> |
|
|
|
AND create_time >= #{dto.startTime} |
|
|
|
</if> |
|
|
|
<if test="dto.endTime != null"> |
|
|
|
AND create_time <= #{dto.endTime} |
|
|
|
</if> |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="queryZytzStatistics" resultType="com.acupuncture.system.domain.vo.StatisticsVo$TreamentVo$ZytzVo"> |
|
|
@ -192,6 +228,12 @@ |
|
|
|
<if test="tenantId != null"> |
|
|
|
AND tenant_id = #{tenantId} |
|
|
|
</if> |
|
|
|
<if test="dto.startTime != null"> |
|
|
|
AND t.create_time >= #{dto.startTime} |
|
|
|
</if> |
|
|
|
<if test="dto.endTime != null"> |
|
|
|
AND t.create_time <= #{dto.endTime} |
|
|
|
</if> |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="queryZllxtjStatistics" resultType="com.acupuncture.system.domain.vo.StatisticsVo$ZlTypeVo$Zllxtj"> |
|
|
@ -208,6 +250,12 @@ |
|
|
|
<if test="tenantId != null"> |
|
|
|
AND tenant_id = #{tenantId} |
|
|
|
</if> |
|
|
|
<if test="dto.startTime != null"> |
|
|
|
AND t.create_time >= #{dto.startTime} |
|
|
|
</if> |
|
|
|
<if test="dto.endTime != null"> |
|
|
|
AND t.create_time <= #{dto.endTime} |
|
|
|
</if> |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="queryFpzStatistics" resultType="com.acupuncture.system.domain.vo.StatisticsVo$ZlTypeVo$BzfffbVo$Fpz"> |
|
|
@ -228,6 +276,12 @@ |
|
|
|
<if test="tenantId != null"> |
|
|
|
AND t.tenant_id = #{tenantId} |
|
|
|
</if> |
|
|
|
<if test="dto.startTime != null"> |
|
|
|
AND t.create_time >= #{dto.startTime} |
|
|
|
</if> |
|
|
|
<if test="dto.endTime != null"> |
|
|
|
AND t.create_time <= #{dto.endTime} |
|
|
|
</if> |
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
@ -248,15 +302,18 @@ |
|
|
|
<if test="tenantId != null"> |
|
|
|
AND tenant_id = #{tenantId} |
|
|
|
</if> |
|
|
|
<if test="dto.startTime != null"> |
|
|
|
AND t.create_time >= #{dto.startTime} |
|
|
|
</if> |
|
|
|
<if test="dto.endTime != null"> |
|
|
|
AND t.create_time <= #{dto.endTime} |
|
|
|
</if> |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="queryZlfyStatistics" resultType="com.acupuncture.system.domain.vo.StatisticsVo$ZlTypeVo$ZlfyVo"> |
|
|
|
<select id="queryZlfyStatistics" resultType="com.acupuncture.system.domain.vo.StatisticsVo$ZlTypeVo$ZlfyResultVo"> |
|
|
|
SELECT |
|
|
|
SUM(CASE WHEN answer < 300 THEN 1 ELSE 0 END) AS score1, |
|
|
|
SUM(CASE WHEN answer BETWEEN 300 AND 900 THEN 1 ELSE 0 END) AS score2, |
|
|
|
SUM(CASE WHEN answer BETWEEN 901 AND 2000 THEN 1 ELSE 0 END) AS score3, |
|
|
|
SUM(CASE WHEN answer BETWEEN 2001 AND 5000 THEN 1 ELSE 0 END) AS score4, |
|
|
|
SUM(CASE WHEN answer > 5000 THEN 1 ELSE 0 END) AS score5 |
|
|
|
t.id, |
|
|
|
r.answer |
|
|
|
FROM |
|
|
|
pms_treatment t |
|
|
|
LEFT JOIN pms_treatment_record r ON t.id = r.treatment_id |
|
|
@ -264,10 +321,15 @@ |
|
|
|
question_code = 'ZLFA_ZTFY' |
|
|
|
AND t.del_flag = 0 |
|
|
|
and r.del_flag = 0 |
|
|
|
AND answer REGEXP '^[0-9]+$' |
|
|
|
<if test="tenantId != null"> |
|
|
|
AND tenant_id = #{tenantId} |
|
|
|
</if> |
|
|
|
<if test="dto.startTime != null"> |
|
|
|
AND t.create_time >= #{dto.startTime} |
|
|
|
</if> |
|
|
|
<if test="dto.endTime != null"> |
|
|
|
AND t.create_time <= #{dto.endTime} |
|
|
|
</if> |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="querySftjStatistics" resultType="com.acupuncture.system.domain.vo.StatisticsVo$SftjVo"> |
|
|
@ -279,6 +341,12 @@ |
|
|
|
WHERE |
|
|
|
status = 2 |
|
|
|
AND del_flag = 0 |
|
|
|
<if test="dto.startTime != null"> |
|
|
|
AND create_time >= #{dto.startTime} |
|
|
|
</if> |
|
|
|
<if test="dto.endTime != null"> |
|
|
|
AND create_time <= #{dto.endTime} |
|
|
|
</if> |
|
|
|
GROUP BY |
|
|
|
lost_reason |
|
|
|
ORDER BY |
|
|
@ -302,6 +370,12 @@ |
|
|
|
<if test="tenantId != null"> |
|
|
|
AND t.tenant_id = #{tenantId} |
|
|
|
</if> |
|
|
|
<if test="dto.startTime != null"> |
|
|
|
AND t.create_time >= #{dto.startTime} |
|
|
|
</if> |
|
|
|
<if test="dto.endTime != null"> |
|
|
|
AND t.create_time <= #{dto.endTime} |
|
|
|
</if> |
|
|
|
group by queue_id |
|
|
|
|
|
|
|
</select> |
|
|
@ -323,6 +397,12 @@ |
|
|
|
<if test="tenantId != null"> |
|
|
|
AND tenant_id = #{tenantId} |
|
|
|
</if> |
|
|
|
<if test="dto.startTime != null"> |
|
|
|
AND t.create_time >= #{dto.startTime} |
|
|
|
</if> |
|
|
|
<if test="dto.endTime != null"> |
|
|
|
AND t.create_time <= #{dto.endTime} |
|
|
|
</if> |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="querySmfbStatistics" resultType="com.acupuncture.system.domain.vo.StatisticsVo$TreamentVo$SmfbVo"> |
|
|
@ -340,6 +420,12 @@ |
|
|
|
<if test="tenantId != null"> |
|
|
|
AND tenant_id = #{tenantId} |
|
|
|
</if> |
|
|
|
<if test="dto.startTime != null"> |
|
|
|
AND t.create_time >= #{dto.startTime} |
|
|
|
</if> |
|
|
|
<if test="dto.endTime != null"> |
|
|
|
AND t.create_time <= #{dto.endTime} |
|
|
|
</if> |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="queryJlfbStatistics" resultType="com.acupuncture.system.domain.vo.StatisticsVo$TreamentVo$JlfbVo"> |
|
|
@ -356,6 +442,12 @@ |
|
|
|
<if test="tenantId != null"> |
|
|
|
AND tenant_id = #{tenantId} |
|
|
|
</if> |
|
|
|
<if test="dto.startTime != null"> |
|
|
|
AND t.create_time >= #{dto.startTime} |
|
|
|
</if> |
|
|
|
<if test="dto.endTime != null"> |
|
|
|
AND t.create_time <= #{dto.endTime} |
|
|
|
</if> |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="querySmzStatistics" resultType="com.acupuncture.system.domain.vo.StatisticsVo$ZlTypeVo$BzfffbVo$Smz"> |
|
|
@ -373,5 +465,11 @@ |
|
|
|
<if test="tenantId != null"> |
|
|
|
AND t.tenant_id = #{tenantId} |
|
|
|
</if> |
|
|
|
<if test="dto.startTime != null"> |
|
|
|
AND t.create_time >= #{dto.startTime} |
|
|
|
</if> |
|
|
|
<if test="dto.endTime != null"> |
|
|
|
AND t.create_time <= #{dto.endTime} |
|
|
|
</if> |
|
|
|
</select> |
|
|
|
</mapper> |
|
|
|