| | |
| | | count( cpam.id ) AS partyActivityCount, |
| | | IFNULL(( SELECT integral_available_party FROM com_act_integral_user WHERE user_id = #{userId} AND community_id = #{communityId} ), 0 ) AS partyActivityIntegral, |
| | | IFNULL(( SELECT integral_available_volunteer FROM com_act_integral_user WHERE user_id = #{userId} AND community_id = #{communityId} ), 0 ) AS volunteerActivityIntegral, |
| | | ( SELECT count( caas.id ) FROM com_act_act_sign AS caas |
| | | ( SELECT count( caas.id ) FROM com_act_act_regist AS caas |
| | | LEFT JOIN com_act_activity AS caa ON caa.id = caas.activity_id |
| | | WHERE caas.user_id = #{userId} and caas.status = 1 and caa.type = 1 and caa.community_id = #{communityId} |
| | | WHERE caas.user_id = #{userId} and caas.type = 1 and caa.type = 1 and caa.community_id = #{communityId} |
| | | ) AS volunteerActivityCount, |
| | | IFNULL(( |
| | | SELECT |
| | | sum( caa.duration ) |
| | | sum( caa.award ) |
| | | FROM |
| | | com_act_act_sign AS caas |
| | | com_act_act_regist AS caas |
| | | LEFT JOIN com_act_activity AS caa ON caa.id = caas.activity_id |
| | | WHERE |
| | | caas.user_id = #{userId} and caas.status = 1 and caa.type = 1 and caa.community_id = #{communityId} |
| | | caas.user_id = #{userId} and caas.type = 1 and caa.type = 1 and caa.community_id = #{communityId} |
| | | ), |
| | | 0 |
| | | ) AS volunteerActivityDuration, |
| | |
| | | SELECT |
| | | sum( caa.duration ) |
| | | FROM |
| | | com_act_act_sign AS caas |
| | | com_act_act_regist AS caas |
| | | LEFT JOIN com_act_activity AS caa ON caa.id = caas.activity_id |
| | | WHERE |
| | | caas.user_id = #{userId} and caas.status = 1 and caa.type = 3 and caa.community_id = #{communityId} |
| | | caas.user_id = #{userId} and caas.type = 3 and caas.end_time is not null and caa.type = 3 and caa.community_id = #{communityId} |
| | | ), |
| | | 0 |
| | | ) AS partyActivityDuration, |
| | | ( SELECT count( id ) FROM com_act_micro_wish WHERE sponsor_id = #{userId} AND `status` = 6 AND community_id = #{communityId} ) AS wishCount, |
| | | ( SELECT count( id ) FROM com_act_easy_photo WHERE sponsor_id = #{userId} AND `status` = 4 AND community_id = #{communityId} ) AS easyCount |
| | | FROM |
| | | com_act_act_sign AS cpam |
| | | com_act_act_regist AS cpam |
| | | LEFT JOIN com_act_activity AS caa ON caa.id = cpam.activity_id |
| | | WHERE |
| | | cpam.user_id = #{userId} and caa.type = 3 |
| | | cpam.user_id = #{userId} and caa.type = 3 and cpam.ent_time is not null |
| | | </select> |
| | | |
| | | <select id="getOrgDataStatistics" resultType="com.panzhihua.common.model.vos.partybuilding.ComDataStatisticsOrgVo"> |