package com.slodon.b2b2c.dao.read.member;

import com.slodon.b2b2c.core.database.BaseReadMapper;
import com.slodon.b2b2c.member.example.MemberEnquiryExample;
import com.slodon.b2b2c.member.pojo.MemberEnquiry;
import com.slodon.b2b2c.system.pojo.Enquiry;
import com.slodon.b2b2c.vo.statistics.ScreenEnquiryDistribution;
import org.apache.ibatis.annotations.Param;

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

/**
 * @author cyan
 */
public interface MemberEnquiryReadMapper extends BaseReadMapper<MemberEnquiry, MemberEnquiryExample> {

    /**
     * 卖家端-询盘列表
     *
     * @param name
     * @param email
     * @param storeId
     * @param isStoreAdmin
     * @param vendorId
     * @param validStatus
     * @param webSite
     * @param phone
     * @param startRow
     * @param size
     * @return
     */
    List<MemberEnquiry> enquiryListPage(@Param("nameLike") String name,
                                        @Param("emailLike") String email,
                                        @Param("storeId") Long storeId,
                                        @Param("isStoreAdmin") String isStoreAdmin,
                                        @Param("vendorId") Long vendorId,
                                        @Param("validStatus") Integer validStatus,
                                        @Param("webSite") String webSite,
                                        @Param("phone") String phone,
                                        @Param("startRow") Integer startRow,
                                        @Param("size") Integer size);

    /**
     * 卖家端-询盘数量
     *
     * @param name
     * @param email
     * @param storeId
     * @param isStoreAdmin
     * @param vendorId
     * @param webSite
     * @param validStatus
     * @param phone
     * @return
     */
    Integer enquiryListPageCount(@Param("nameLike") String name,
                                 @Param("emailLike") String email,
                                 @Param("storeId") Long storeId,
                                 @Param("isStoreAdmin") String isStoreAdmin,
                                 @Param("vendorId") Long vendorId,
                                 @Param("validStatus") Integer validStatus,
                                 @Param("webSite") String webSite,
                                 @Param("phone") String phone);


    /**
     * 平台端-询盘列表
     *
     * @param name
     * @param email
     * @param isSupAdmin
     * @param sysAdminId
     * @param validStatus
     * @param webSite
     * @param storeId
     * @param phone
     * @param startRow
     * @param size
     * @return
     */
    List<MemberEnquiry> enquiryAdminListPage(@Param("nameLike") String name,
                                             @Param("emailLike") String email,
                                             @Param("isSupAdmin") String isSupAdmin,
                                             @Param("sysAdminId") Integer sysAdminId,
                                             @Param("validStatus") Integer validStatus,
                                             @Param("startRow") Integer startRow,
                                             @Param("size") Integer size,
                                             @Param("storeId") Long storeId,
                                             @Param("webSite") String webSite,
                                             @Param("phone") String phone);

    /**
     * 平台端-询盘数量
     *
     * @param name
     * @param email
     * @param isSupAdmin
     * @param sysAdminId
     * @param validStatus
     * @param webSite
     * @param storeId
     * @param phone
     * @return
     */
    Integer enquiryAdminListPageCount(@Param("nameLike") String name,
                                      @Param("emailLike") String email,
                                      @Param("isSupAdmin") String isSupAdmin,
                                      @Param("sysAdminId") Integer sysAdminId,
                                      @Param("validStatus") Integer validStatus,
                                      @Param("storeId") Long storeId,
                                      @Param("webSite") String webSite,
                                      @Param("phone") String phone);

    /**
     * 卖家端-询盘趋势-天数
     *
     * @param startTime
     * @param endTime
     * @param storeId
     * @return
     */
    List<MemberEnquiry> getSellerEnquiryTrendByTime(@Param("startTime") Date startTime,
                                                    @Param("endTime") Date endTime,
                                                    @Param("webSite") String webSite,
                                                    @Param("storeId") Long storeId);

    /**
     * 卖家端-询盘趋势-小时
     *
     * @param startTime
     * @param endTime
     * @param storeId
     * @return
     */
    List<MemberEnquiry> getSellerEnquiryTrendByHour(@Param("startTime") Date startTime,
                                              @Param("endTime") Date endTime,
                                              @Param("webSite")String webSite,
                                              @Param("storeId") Long storeId);

    /**
     * 平台端-询盘趋势-天数
     *
     * @param startTime
     * @param endTime
     * @param webSite
     * @return
     */
    List<MemberEnquiry> getAdminEnquiryTrendByTime(@Param("startTime") Date startTime,
                                                   @Param("endTime") Date endTime,
                                                   @Param("webSite") String webSite);

    /**
     * 平台端-询盘趋势-小时
     *
     * @param startTime
     * @param endTime
     * @param webSite
     * @return
     */
    List<MemberEnquiry> getAdminEnquiryTrendByHour(@Param("startTime") Date startTime,
                                                   @Param("endTime") Date endTime,
                                                   @Param("webSite") String webSite);

    /**
     * 询盘分布
     *
     * @param webSite
     * @return
     */
   List<ScreenEnquiryDistribution>getEnquiryDistribution(@Param("webSite")String webSite);
}
