| | |
| | | IgtOnHookPlanOrderItem selectByMemberIdAndBelongNum( @Param("memberId")Long memberId, @Param("recordNum")String recordNum); |
| | | |
| | | BigDecimal selectTotalProfitByMemberIdAndStateAndIsgoal(@Param("memberId")Long memberId |
| | | , @Param("state")int i, @Param("isGoal")int isGoal); |
| | | , @Param("state")int i); |
| | | |
| | | List<IgtOnHookPlanOrderItem> selectByIgtIdAndMemberId(@Param("orderId") Long orderId, @Param("memberId")Long memberId); |
| | | |
| | |
| | | * 否则,计算收益占本金的比例。符合条件允许提现 |
| | | */ |
| | | //获取用户的总收益 |
| | | BigDecimal totalProfitOut = igtOnHookPlanOrderItemdao.selectTotalProfitByMemberIdAndStateAndIsgoal(memberIdOut,1,2); |
| | | BigDecimal totalProfitOut = igtOnHookPlanOrderItemdao.selectTotalProfitByMemberIdAndStateAndIsgoal(memberIdOut,2); |
| | | if(balance.compareTo(totalProfitOut) > 0){ |
| | | BigDecimal totalAmount = dappWalletCoinEntityOut.getTotalAmount(); |
| | | //用户总收益率 |
| | |
| | | * 否则,计算收益占本金的比例。符合条件允许提现 |
| | | */ |
| | | //获取用户的总收益 |
| | | BigDecimal totalProfit = igtOnHookPlanOrderItemdao.selectTotalProfitByMemberIdAndStateAndIsgoal(memberId,1,2); |
| | | BigDecimal totalProfit = igtOnHookPlanOrderItemdao.selectTotalProfitByMemberIdAndStateAndIsgoal(memberId,2); |
| | | if(balance.compareTo(totalProfit) >= 0){ |
| | | BigDecimal totalAmount = dappWalletCoinEntity.getTotalAmount(); |
| | | //用户总收益率 |
| | |
| | | List<DappMemberEntity> dappMemberEntitiesNext = new ArrayList<>(); |
| | | if(CollUtil.isNotEmpty(dappMemberEntities)){ |
| | | for(DappMemberEntity dappMemberEntity : dappMemberEntities){ |
| | | if(ObjectUtil.isEmpty(dappMemberEntity)){ |
| | | continue; |
| | | } |
| | | Long memberEntityId = dappMemberEntity.getId(); |
| | | String refererId = dappMemberEntity.getRefererId(); |
| | | String inviteId = dappMemberEntity.getInviteId(); |
| | |
| | | inner join dapp_member b on a.member_id = b.id |
| | | where |
| | | a.total_amount <![CDATA[ >= ]]> 51 |
| | | and b.referer_id = #{inviteId} |
| | | and find_in_set(#{inviteId}, b.referer_ids) |
| | | and b.identity = #{identity} |
| | | |
| | | </select> |
| | |
| | | dapp_wallet_coin a |
| | | inner join dapp_member b on a.member_id = b.id |
| | | where a.total_amount <![CDATA[ >= ]]> 51 |
| | | and b.identity != 'LEVEL_TM' |
| | | </select> |
| | | |
| | | <update id="addTotalAndaddAvailableByMemberId"> |
| | |
| | | <select id="selectTotalProfitByMemberIdAndStateAndIsgoal" resultType="java.math.BigDecimal"> |
| | | SELECT |
| | | ifnull(sum(a.profit),0) |
| | | FROM igt_on_hook_plan_order_item a |
| | | FROM igt_on_hook_plan_order a |
| | | where a.member_id = #{memberId} |
| | | and a.is_goal = #{isGoal} |
| | | and a.state = #{state} |
| | | </select> |
| | | |