Helius
2022-07-22 823aabb391a0cbd2eddf7c58c03b76e71967b964
src/main/resources/mapper/dapp/DappIdoAssetsDao.xml
@@ -9,4 +9,24 @@
    <select id="selectListHasAssets" resultType="cc.mrbird.febs.dapp.entity.DappIdoAssetsEntity">
        select * from dapp_ido_assets where coin_amount > 0
    </select>
    <select id="selectAchieveListInPage" resultType="cc.mrbird.febs.dapp.entity.DappIdoAssetsEntity">
        select
            a.address,
            a.invite_id,
            (select count(1) from dapp_member x where a.invite_id=x.referer_id) addressCnt,
            count(1) teamAddressCnt,
            IFNULL(sum(c.coin_amount),0) coinAmount,
            IFNULL(sum(c.usdt_amount),0) usdtAmount
        from dapp_member a
            left join dapp_member b on find_in_set(a.invite_id, substring_index(b.referer_ids, ',', 10))
            left join dapp_ido_assets c on c.member_id=b.id
        <where>
            <if test="record.address != null and record.address != ''">
                and (a.address = #{record.address} or a.invite_id=#{record.address})
            </if>
        </where>
        group by a.address
        order by coinAmount desc
    </select>
</mapper>