package com.iamberry.wechat.face.member;

import java.util.List;

import com.iamberry.wechat.core.entity.Page;
import com.iamberry.wechat.core.entity.member.ApplyDto;
import com.iamberry.wechat.core.entity.member.Member;
import com.iamberry.wechat.core.entity.member.Withdraw;

/**
 * 
 * description: 微代理提现接口
 * 	    author： 张应真
 * 	createDate： 2016年4月18日
 */
public interface WithdrawService {
	
	

	
	/**
	 * 查询总条数，和总金额
	 * @return
	 */
	List<Withdraw> selectWithDrawAllSumMoney(Page page);
	
	
	/**
	 * 根据用户条件查找
	 * @return
	 */
	List<Withdraw> selectWithDraw(Page page);
	
	/**
	 * 获取所有提现记录数
	 * @return
	 */
	Integer getCount();
	/**
	 * 更新提现信息
	 * @param withdraw
	 */
	void updateWithdraw(Withdraw withdraw );
	
	/**
	 * 申请提现	<现金>
	 * 添加提现申请 修改用户可用金额 添加现金记录
	 * @param dto
	 * @return
	 */
	public boolean addApplyCashWithdraw(ApplyDto dto, Member member) throws Exception;

	/**
	 * 分页查询提现记录
	 * @param page
	 * @return
	 */
	public List<Withdraw> selectLogsByOpenid(Page page);
	
	/**
	 * 分页的总数据
	 */
	public Integer selectLogsCountByOpenid(Page page);

	/**
	 * 根据ID，查询提现记录
	 * @param id
	 * @return
	 */
	public Withdraw selectWithdrawLogsById(Integer id);
	
	/**
	 * 处理提现申请	<现金>
	 * @param wid
	 * @param status
	 * @return
	 * @throws Exception
	 */
	public boolean handleWithdrawCashStatus(Integer status, Withdraw withdraw) throws Exception;
	
	/**
	 * 根据用户openid，获取当月申请提现记录次数
	 * @param withdraw
	 * @return
	 */
	public int selectUseLogsCount(Withdraw withdraw);
}
