package com.iamberry.wechat.service.member.dao;

import java.util.List;

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

/**
 * 
 * description: 微代理提现接口
 * 	    author： 张应真
 * 	createDate： 2016年4月18日
 */
public interface WithdrawDao {
	
	
	/**
	 * 查询总条数，和总金额
	 * @return
	 */
	List<Withdraw> selectWithDrawAllSumMoney(Page page);
	
	/**
	 * 根据用户条件查找
	 * @return
	 */
	List<Withdraw> selectWithDraw(Page page);
	/**
	 * 获取所有提现记录总数
	 * @return
	 */
	Integer getCount();
	/**
	 * 用户提现更新
	 * @param withdraw
	 */
	void updateWithdraw(Withdraw withdraw );

	/**
	 * 添加一条申请记录
	 * @param withdraw
	 * @return
	 */
	public Integer insertApplyLogs(Withdraw withdraw);
	
	/**
	 * 分页查询提现记录
	 * @param page
	 * @return
	 */
	public List<Withdraw> selectLogsByOpenid(Page page);

	/**
	 * 分页的总数据
	 */
	public Integer selectLogsCountByOpenid(Page page);

	/**
	 * 根据ID，查询提现记录
	 * @param id
	 * @return
	 */
	public Withdraw selectWithdrawLogsById(Integer id);

	/**
	 * 修改提现记录
	 * @param withdraw
	 * @return
	 */
	public Integer updateWithdrawStatusById(Withdraw withdraw);

	
	/**
	 * 根据用户openid，获取当月申请提现记录次数
	 * @param withdraw
	 * @return
	 */
	public int selectUseLogsCount(Withdraw withdraw);
}
