package com.ssj.dao.weixin.order.dao;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

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

/**
 * @author ZhangCaibao
 * @version 2017年5月8日 上午9:41:10 类说明
 */
public interface OrderQueryDao {

	Page<Map<String, Object>> findForPageList(Map<String, Object> searchParams,Pageable pageable);

	List<Map<String, Object>> countOrderDetailsNum();

	List<Map<String, Object>> countOrderDetailsPriceByDay();

	List<Map<String, Object>> countOrderDetailsPriceByCount();

    List<Map<String, Object>> countOrderDetailsByTop(String libId);

	List<Map<String, Object>> countOrderDetailsByUser(String libId);

	List<Map<String, Object>> countOrderDetailsByDayUser(String libId);
	
	Integer signSubscribCounter(String libId,Integer day,String compare);
	
	Integer signSubscribCount(String libId);
	
	Integer signSubscribByDayCounter(String libId,Date selectDate,Integer type);
	
	Integer signSubscribByMonthCounter(String libId,Date selectDate,Integer type);
	
	Integer signSubscribByActiveCounter(String libId,Date selectDate);
	
	List<Map<String, Object>> countActivityByDayUser(String libId,String startDate, String endDate, String type);
	
	List<Map<String, Object>> queryWeekGrOrderDetails(String userId);

	List<Map<String, Object>> queryOrderDetailsByIsbn(String isbn13);
	
	Integer countOrderDetailsByIsbn(String isbn13);
	
	Page<Map<String, Object>> findHotOrderDetailsPage(Map<String, Object> searchParams, Pageable pageable);
	
	Page<Map<String, Object>> findNewOrderDetailsPage(Map<String, Object> searchParams, Pageable pageable);
		
	Page<Map<String, Object>> findSearchBooksPage(Map<String, Object> searchParams, Pageable pageable);
	
	List<Map<String, Object>> findLibIdByUserId(String userId);
	
	List<Map<String, Object>> getOrder(Map<String, Object> searchParams);
	
	
    Page<Map<String, Object>> findForPageLessonServiceList(Map<String, Object> searchParams, Pageable pageable);
    
	Page<Map<String, Object>> findForPageLessonServiceByCourseList(Map<String, Object> searchParams, Pageable pageable);
	 
	Page<Map<String, Object>> findForPageLessonServiceByTeacherList(Map<String, Object> searchParams, Pageable pageable);
	
	
	//按时间段统计lesson_service_sales表，插入tb_pay_business_to_user
	List<Map<String, Object>> countLessonServiceSalesByGroup(Date startDate,Date endDate);


    List<Map<String, Object>> countStudentSumStudyingInSharedLib(String startTime, String endTime);
}
