SUM( CASE WHEN eu.STATE = '10' THEN 1 ELSE 0 END ) AS NUMBER_GROUP_MEMBER,
SUM( CASE WHEN eu.PARTY_MEMBER = '1' AND eu.STATE = '10' THEN 1 ELSE 0 END ) AS NUMBER_GROUP_PARTY_MEMBER,
SUM( CASE WHEN eu.USER_ID = #{userId} AND eu.STATE = '0' THEN 1 WHEN eu.USER_ID = #{userId} AND eu.STATE = '10' THEN 2 ELSE 0 END ) AS GROUP_MEMBER_FLAG,
eg.STATE AS GROUP_STATE
FROM
epdc_group eg
LEFT JOIN epdc_user_group eu ON eg.id = eu.GROUP_ID
AND eu.DEL_FLAG = '0'
epdc_group eg
LEFT JOIN epdc_user_group eu ON eg.id = eu.GROUP_ID AND eu.DEL_FLAG = '0'