| | |
| | | |
| | | Long selectByIsgoalAndOrderId(@Param("isGoal")int i, @Param("orderId")Long orderId); |
| | | |
| | | IgtOnHookPlanOrderItem selectByCreateTimeAndIsgoaAndOrderId(@Param("endTime")Date endTime, @Param("isGoal")int i, @Param("orderId")Long orderId); |
| | | IgtOnHookPlanOrderItem selectByCreateTimeAndIsgoaAndOrderId(@Param("id")Long id, @Param("isGoal")int i, @Param("orderId")Long orderId); |
| | | |
| | | IgtOnHookPlanOrderItem selectOneByIgtIdAndMemberId(@Param("orderId") Long orderId, @Param("memberId")Long memberId); |
| | | |
| | |
| | | |
| | | if(2 == igtOnHookPlanOrderItem.getIsGoal()){ |
| | | //返还两次中奖之间的本金 |
| | | Date endTime = igtOnHookPlanOrderItem.getCreateTime(); |
| | | BigDecimal totalAmount = BigDecimal.ZERO; |
| | | //返回上次中奖的记录 |
| | | IgtOnHookPlanOrderItem igtOld = igtOnHookPlanOrderItemDao.selectByCreateTimeAndIsgoaAndOrderId(endTime,2,igtOnHookPlanOrder.getId()); |
| | | IgtOnHookPlanOrderItem igtOld = igtOnHookPlanOrderItemDao.selectByCreateTimeAndIsgoaAndOrderId(igtOnHookPlanOrderItem.getId(),2,igtOnHookPlanOrder.getId()); |
| | | if(ObjectUtil.isNotEmpty(igtOld)){ |
| | | totalAmount = igtOnHookPlanOrderItemDao.selectTotalAmountByIDAndOrderId(igtOld.getId(), |
| | | igtOnHookPlanOrderItem.getId(),igtOnHookPlanOrderItem.getOrderId()); |
| | |
| | | FROM igt_on_hook_plan_order_item a |
| | | where a.order_id = #{orderId} |
| | | and a.is_goal = #{isGoal} |
| | | and a.create_time < #{endTime} |
| | | and a.id < #{id} |
| | | order by a.id desc |
| | | limit 1 |
| | | </select> |