package cn.pluss.platform.mapper;

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

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;

import cn.pluss.platform.entity.MemberOrder;

@Mapper
public interface MemberOrderMapper extends BaseMapper<MemberOrder> {

    MemberOrder queryMemberOrder(MemberOrder memberOrder);

    List<MemberOrder> queryMemberOrderList(MemberOrder memberOrder);

    void saveMemberOrder(MemberOrder memberOrder);

    void updateMemberOrder(MemberOrder memberOrder);

    void deleteMemberOrder(MemberOrder memberOrder);

    List<MemberOrder> queryMemberOrderPage(Map map);

    Integer queryMemberOrderPageCount(Map map);

    void saveMemberOrderBatch(List<MemberOrder> memberOrderList);
    
    Double queryMemberOrderTotalOrderFeeByTime(Map map);

	Integer queryMemberOrderPageCountByTime(Map map);

	List<MemberOrder> queryMemberOrderPageByTime(Map queryMap);
	
	/**
	 * 
	 * sumMemberOrderMoney:(统计商家的会员消费金额  充值金额). <br/> 
	 * 
	 * @author Administrator 
	 * @param merchantCode 商家code
	 * @param orderType 0会员消费  1会员充值
	 * @return 
	 * @since JDK 1.8
	 */
	Double sumMemberOrderMoney(Map<String, Object> map);

	@MapKey("orderType")
	Map<String, Map<String, Object>> queryMemberOrderCountByTimeGroupData(Map<String, Object> map);
}

