| | |
| | | <select id="getUserIntegralStatistics" |
| | | resultType="com.panzhihua.common.model.vos.community.integral.ComActIntegralUserVO"> |
| | | SELECT |
| | | SUM(t.amount) AS amount, |
| | | SUM(IF(t.service_type IN(4,5,6),t.amount,0)) AS actAmount, |
| | | SUM(IF(t.service_type = 4,t.amount,0)) AS residentAmount, |
| | | SUM(IF(t.service_type = 5,t.amount,0)) AS partyMemberAmount, |
| | | SUM(IF(t.service_type = 6,t.amount,0)) AS volunteerAmount, |
| | | SUM(IF(t.service_type = 9,t.amount,0)) AS unitPartyMemberAmount |
| | | COALESCE(SUM(t.amount),0) AS amount, |
| | | COALESCE(SUM(IF(t.service_type IN(4,5,6),t.amount,0)),0) AS actAmount, |
| | | COALESCE(SUM(IF(t.service_type = 4,t.amount,0)),0) AS residentAmount, |
| | | COALESCE(SUM(IF(t.service_type = 5,t.amount,0)),0) AS partyMemberAmount, |
| | | COALESCE(SUM(IF(t.service_type = 6,t.amount,0)),0) AS volunteerAmount, |
| | | COALESCE(SUM(IF(t.service_type = 9,t.amount,0)),0) AS unitPartyMemberAmount |
| | | <if test="communityId != null"> |
| | | ,t1.community_id, |
| | | t1.`name` AS communityName |