package com.iamberry.wechat.service.mapper;

import java.util.List;
import java.util.Map;

import com.iamberry.wechat.core.entity.drp.IncomeRecord;
import com.iamberry.wechat.core.entity.drp.ObjRecord;
import com.iamberry.wechat.core.entity.drp.PlaceLogs;

/**
 * 
 * @author 欧阳明
 * @description sql 分销代理现金收支记录 接口映射类
 * @date: 2016-4-18
 */
public interface PlaceLogsMapper {

	//获取单个分销信息
	public PlaceLogs getOnePlaceLogs(int id);
	//获取所有的金额记录  可支持条件查询
	public List<PlaceLogs> selectAll(PlaceLogs PlaceLogs);
	//插入数据
	public int insert(PlaceLogs PlaceLogs);
	//更新数据
	public int update(PlaceLogs PlaceLogs);
	//删除数据
	public int delete(PlaceLogs PlaceLogs);
    //获取信息结果集总数
	public int getAllCount(PlaceLogs PlaceLogs);
	
	//获取顶级分销商的所有用户
	public List<String> getUnInComeOrderUserTop(int placeId);
	
	//通过openid 获取被分销的客户的openid集合
	public List<String> getUnInComeOrderUserIds(int id);
	
	//通过openid 获取被分销的客户openid集合
	public List<String> getUnInComeOrderUserId2(int id);
	
	//通过openid 通过二级分销获取会员的openid集合
	public List<String> getUnInComeOrderUserId3(int id);
	
	//获取未入账分销订单
	public List<ObjRecord> getUnInComeRecord(Map map);
	
	//获取分销订单的记录
	public List<IncomeRecord>  getSearchInComeRecord(Map map);
	//获取分销订单的总数
	public int getSearchInComeRecordCount(Map map);
	
	//获取未入账分销订单-单级
	public List<ObjRecord> getUnInComeRecordSingle(Map map);
	
	//获取最近7天的订单收入记录-未入账
	public List<ObjRecord> getRecentIncome7Day(Map map);
	
	//获取最近6个月的订单收入记录
	public List<ObjRecord> getRecentIncome6Month(Map map);
		
	//获取今年的订单收入
	public List<ObjRecord> getRecentIncomeYear(Map map);
	
	/**
	 * 根据返利人id和单号模糊查询返利日志信息
	 * @param PlaceLogs
	 * @return
	 */
	public PlaceLogs selectPlaceLogInfo(PlaceLogs placeLogs);
	
	/**
	 * 修改了商户层返利日志表
	 * @param PlaceLogs
	 * @return
	 */
	public Integer updatePlaceLogs(PlaceLogs placeLogs);
	
}
