|
|
@ -138,7 +138,7 @@ |
|
|
|
|
|
|
|
<!-- 根据userId,查询参与活动记录 --> |
|
|
|
<select id="selectAllByUserId" resultType="com.epmet.dto.result.work.UserHistoricalActInfoDTO" parameterType="java.lang.String"> |
|
|
|
SELECT |
|
|
|
SELECT |
|
|
|
acr.ACT_ID AS actId, |
|
|
|
ACR.USER_ID AS userId, |
|
|
|
ai.TITLE AS title, |
|
|
@ -148,17 +148,27 @@ |
|
|
|
acr.REWARD_FLAG AS rewardFlag, |
|
|
|
acr.DENY_REWARD_REASON AS denyRewardReason, |
|
|
|
acr.PROCESS_FLAG AS processFlag, |
|
|
|
(select CREATED_TIME |
|
|
|
from act_sign_in_rec ar |
|
|
|
where ar.ACT_ID=acr.ACT_ID |
|
|
|
and ar.USER_ID=acr.USER_ID |
|
|
|
order by ar.CREATED_TIME asc limit 1) as signInTime |
|
|
|
( |
|
|
|
SELECT |
|
|
|
CREATED_TIME |
|
|
|
FROM |
|
|
|
act_sign_in_rec ar |
|
|
|
WHERE |
|
|
|
ar.ACT_ID = acr.ACT_ID |
|
|
|
AND ar.USER_ID = acr.USER_ID |
|
|
|
ORDER BY |
|
|
|
ar.CREATED_TIME ASC |
|
|
|
LIMIT 1 |
|
|
|
) AS signInTime, |
|
|
|
ai.ACT_STATUS AS actStatus, |
|
|
|
acr.STATUS AS userActStatus, |
|
|
|
( CASE acr.SIGN_IN_FLAG WHEN 'signed_in' THEN 1 ELSE 0 END ) AS signInFlag |
|
|
|
FROM |
|
|
|
act_user_relation acr |
|
|
|
LEFT JOIN act_info ai ON ( acr.ACT_ID = ai.id ) |
|
|
|
WHERE |
|
|
|
acr.DEL_FLAG = '0' |
|
|
|
AND acr.USER_ID = #{userId} |
|
|
|
AND acr.USER_ID =#{userId} |
|
|
|
ORDER BY |
|
|
|
acr.CREATED_TIME DESC |
|
|
|
</select> |
|
|
|