/*
 * Copyright (c) 2018-2999 广州亚米信息科技有限公司 All rights reserved.
 *
 * https://www.gz-yami.com/
 *
 * 未经允许，不可做商业用途！
 *
 * 版权所有，侵权必究！
 */

package com.yami.shop.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yami.shop.bean.app.dto.ProductDto;
import com.yami.shop.bean.dto.AreaDto;
import com.yami.shop.bean.dto.SearchProdDto;
import com.yami.shop.bean.model.Area;
import com.yami.shop.bean.model.ChannelProd;
import com.yami.shop.bean.model.UserShopBehavior;
import com.yami.shop.common.util.PageParam;
import org.springframework.web.bind.annotation.RequestParam;

import java.math.BigDecimal;
import java.util.List;

/**
 * @author lgh on 2018/10/26.
 */
public interface UserShopBehaviorService extends IService<UserShopBehavior> {

    /**
     * 根据用户id查询当前用户有几条记录
     * @param userId
     * @return
     */
    int findByUserIdCount(String userId);

    /**
     * 根据用户id查询最初的几条记录
     * @param userId 用户id
     * @param num 取前几条数据
     * @return
     */
    List<UserShopBehavior> findByUserId(String userId,Integer num, Long shopId, Long channelId);

    /**
     * 根据用户id和商品id查询当前用户是否有查询同一商品的痕迹
     * @param userId
     * @param prodId
     * @return
     */
    UserShopBehavior findByUserIdAndProd(String userId,Long shopId, Long prodId,Long channelId);

    ChannelProd findByProdId(Long prodId, Long shopId,Long channelId);

    List<ProductDto> findByProdIdAndShopIdAndPrice(Long prodId, Long shopId,Long channelId, BigDecimal increased, BigDecimal decreased);

    IPage<SearchProdDto> findByProdAndShop(PageParam<SearchProdDto> page, List<ProductDto> productDtos,String userId);

}
