|
@ -363,7 +363,9 @@ |
|
|
group by th.id |
|
|
group by th.id |
|
|
</select> |
|
|
</select> |
|
|
<select id="adjacentTasks" resultType="com.ccsens.tcm.bean.vo.StatisticVo$RecentAnalysisVO"> |
|
|
<select id="adjacentTasks" resultType="com.ccsens.tcm.bean.vo.StatisticVo$RecentAnalysisVO"> |
|
|
select ( |
|
|
select |
|
|
|
|
|
tpr.id, |
|
|
|
|
|
( |
|
|
CASE |
|
|
CASE |
|
|
WHEN ( DATEDIFF( now( ), tpr.contents ) >= 11 AND DATEDIFF( now( ), tpr.contents ) <= 17 ) THEN |
|
|
WHEN ( DATEDIFF( now( ), tpr.contents ) >= 11 AND DATEDIFF( now( ), tpr.contents ) <= 17 ) THEN |
|
|
DATE_FORMAT( FROM_UNIXTIME( UNIX_TIMESTAMP( tpr.contents ) + 14 * 24 * 60 * 60 ), '%Y-%m-%d' ) |
|
|
DATE_FORMAT( FROM_UNIXTIME( UNIX_TIMESTAMP( tpr.contents ) + 14 * 24 * 60 * 60 ), '%Y-%m-%d' ) |
|
@ -392,7 +394,7 @@ |
|
|
) as task from t_patient_record tpr |
|
|
) as task from t_patient_record tpr |
|
|
left join t_patient_information tpi on tpi.id=tpr.patient_id and tpi.rec_status=0 |
|
|
left join t_patient_information tpi on tpi.id=tpr.patient_id and tpi.rec_status=0 |
|
|
where tpr.rec_status=0 |
|
|
where tpr.rec_status=0 |
|
|
and tpr.test_questions_id=#{testQuestionsId} |
|
|
and tpr.test_questions_id=#{param.testQuestionsId} |
|
|
and ( |
|
|
and ( |
|
|
( DATEDIFF( now( ), tpr.contents ) >= 11 AND DATEDIFF( now( ), tpr.contents ) <= 17 ) |
|
|
( DATEDIFF( now( ), tpr.contents ) >= 11 AND DATEDIFF( now( ), tpr.contents ) <= 17 ) |
|
|
OR ( DATEDIFF( now( ), tpr.contents ) >= 87 AND DATEDIFF( now( ), tpr.contents ) <= 93 ) |
|
|
OR ( DATEDIFF( now( ), tpr.contents ) >= 87 AND DATEDIFF( now( ), tpr.contents ) <= 93 ) |
|
@ -410,13 +412,22 @@ |
|
|
</collection> |
|
|
</collection> |
|
|
</resultMap> |
|
|
</resultMap> |
|
|
<select id="selPatientProgress" resultMap="selPatientProgress1"> |
|
|
<select id="selPatientProgress" resultMap="selPatientProgress1"> |
|
|
select tpi.id,tpi.hospitalization,tpr.collect_time collectTime |
|
|
SELECT |
|
|
from t_patient_record tpr |
|
|
tpi.id, |
|
|
left join t_patient_information tpi on tpi.rec_status=0 and tpi.id=tpr.patient_id |
|
|
tpi.hospitalization, |
|
|
where tpr.rec_status=0 |
|
|
tpr.collect_time collectTime |
|
|
and tpr.user_id=#{userId} |
|
|
FROM |
|
|
and tpr.created_at > DATE_SUB(now(), INTERVAL 1 YEAR) |
|
|
t_patient_record tpr |
|
|
group by tpr.patient_id,tpr.collect_time |
|
|
, t_patient_information tpi |
|
|
|
|
|
WHERE |
|
|
|
|
|
tpr.rec_status = 0 |
|
|
|
|
|
and tpi.rec_status = 0 |
|
|
|
|
|
AND tpi.id = tpr.patient_id |
|
|
|
|
|
AND tpi.input_status IN ( 0, 1, 3 ) |
|
|
|
|
|
AND tpr.user_id = #{userId} |
|
|
|
|
|
AND tpr.created_at > DATE_SUB( now( ), INTERVAL 1 YEAR ) |
|
|
|
|
|
GROUP BY |
|
|
|
|
|
tpr.patient_id,tpr.collect_time |
|
|
</select> |
|
|
</select> |
|
|
<select id="stringLists" resultType="java.lang.String"> |
|
|
<select id="stringLists" resultType="java.lang.String"> |
|
|
select distinct tpr.contents from t_patient_record tpr |
|
|
select distinct tpr.contents from t_patient_record tpr |
|
|