| | |
| | | ) AS participateVolunteerActivityDuration, |
| | | ( |
| | | SELECT |
| | | IFNULL( sum( caa3.duration ), 0 ) |
| | | FROM |
| | | com_act_act_sign AS caas3 |
| | | LEFT JOIN com_act_activity AS caa3 ON caa3.id = caas3.activity_id |
| | | WHERE |
| | | caas3.`status` = 1 |
| | | AND caa3.type = 3 |
| | | AND caas3.user_id IN ( SELECT t1.user_id FROM com_pb_member t left join sys_user t1 on t.id_card=t1.id_card WHERE audit_result = 1 AND t.community_id = #{communityId} AND t1.type=1 |
| | | <if test="orgIds != null and orgIds.size > 0"> |
| | | AND org_id in |
| | | <foreach collection="orgIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | ) |
| | | AND caas3.create_at BETWEEN #{startTime} |
| | | AND #{endTime} |
| | | ) AS participatePartyActivityDuration, |
| | | ( |
| | | SELECT |
| | | IFNULL( sum( caa4.duration ), 0 ) |
| | | FROM |
| | | com_act_act_sign AS caas4 |
| | | LEFT JOIN com_act_activity AS caa4 ON caa4.id = caas4.activity_id |
| | | WHERE |
| | | caas4.`status` = 1 |
| | | AND caas4.user_id IN ( SELECT t1.user_id FROM com_pb_member t left join sys_user t1 on t.id_card=t1.id_card WHERE audit_result = 1 AND t.community_id = #{communityId} AND t1.type=1 |
| | | <if test="orgIds != null and orgIds.size > 0"> |
| | | AND org_id in |
| | | <foreach collection="orgIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | ) |
| | | AND caas4.create_at BETWEEN #{startTime} |
| | | AND #{endTime} |
| | | ) AS participateActivityDuration, |
| | | ( |
| | | SELECT |
| | | count( caas2.id ) |
| | | FROM |
| | | com_act_act_sign as caas2 |
| | |
| | | ) |
| | | AND caas2.create_at BETWEEN #{startTime} |
| | | AND #{endTime} |
| | | ) AS participatePartyActivityNum |
| | | ) AS participatePartyActivityNum, |
| | | ( |
| | | SELECT |
| | | count( caas5.id ) |
| | | FROM |
| | | com_act_act_sign as caas5 |
| | | left join com_act_activity as caa5 on caa5.id = caas5.activity_id |
| | | WHERE |
| | | caas5.`status` = 1 |
| | | AND caas5.user_id IN ( SELECT t1.user_id FROM com_pb_member t left join sys_user t1 on t.id_card=t1.id_card WHERE audit_result = 1 AND t.community_id = #{communityId} AND t1.type=1 |
| | | <if test="orgIds != null and orgIds.size > 0"> |
| | | AND org_id in |
| | | <foreach collection="orgIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | ) |
| | | AND caas5.create_at BETWEEN #{startTime} |
| | | AND #{endTime} |
| | | ) AS participateActivityNum |
| | | FROM |
| | | com_act_act_sign as caas1 |
| | | left join com_act_activity as caa1 on caa1.id = caas1.activity_id |