xiaoyong931011
2023-08-22 09d498d50765b58b048bdf0a81e4ff1765439bef
src/main/resources/mapper/dapp/DappWalletMineDao.xml
@@ -18,4 +18,37 @@
            </if>
        </where>
    </select>
    <update id="updateBalance">
        update dapp_wallet_mine
        set total_amount = total_amount + #{totalAmount},
            available_amount = available_amount + #{availableAmount}
        where member_id=#{memberId}
    </update>
    <update id="updateWithLock">
        update dapp_wallet_mine
        set total_amount=#{record.totalAmount},
            available_amount=#{record.availableAmount},
            frozen_amount=#{record.frozenAmount},
            version=version+1
        where id=#{record.id} and version=#{record.version}
    </update>
    <select id="selectAmountThanZero" resultType="cc.mrbird.febs.dapp.entity.DappWalletMineEntity">
        select * from dapp_wallet_mine where available_amount > 0
    </select>
    <update id="addTotalAndaddAvailableById">
        update dapp_wallet_mine
        set total_amount = total_amount + #{amount},
            available_amount = available_amount + #{amount}
        where member_id=#{memberId}
    </update>
    <select id="selectTotal" resultType="java.math.BigDecimal">
        select IFNULL(sum(IFNULL(total_amount,0)),0)
        from dapp_wallet_mine
    </select>
</mapper>