List<Map> publishInfos = memberShareMapper.shareToCouponCountGroupByPublishId(memberShare.getActivityId());
<select id="shareToCouponCountGroupByPublishId" parameterType="java.lang.Long" resultType="map"> select count(msc.coupon_publish_id) COUPONCOUNT, msc.coupon_publish_id COUPONPUBLISHID from member_share_coupon msc, MEMBER_SHARE_ACTIVITY msa where activity_id = #{activityId} and for_share_to_user = 'Y' and msc.IS_DELETE = 'N' and msc.ACTIVITY_ID = msa.ID ' group by coupon_publish_id </select>