package com.cool.store.mapper;

import com.cool.store.dto.point.LineCountDTO;
import com.cool.store.entity.PointInfoDO;
import com.cool.store.request.AllPointPageRequest;
import com.cool.store.request.PointPageRequest;
import com.cool.store.request.RecommendPointPageRequest;
import com.cool.store.vo.point.PointHomePageDataVO;
import com.cool.store.vo.point.PointPageVO;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;

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

public interface PointInfoMapper extends Mapper<PointInfoDO> {

    /**
     * 获取我的数据
     * @param userId
     * @return
     */
    PointHomePageDataVO getMyPointData(@Param("userId") String userId);

    /**
     * 获取我的铺位分页
     * @param request
     * @return
     */
    Page<PointInfoDO> getMyPointPage(@Param("request") PointPageRequest request);

    /**
     * 获取线索选择门店数
     * @param lineIds
     * @return
     */
    List<LineCountDTO> getSelectedShopNum(@Param("lineIds") List<Long> lineIds);

    /**
     * 获取铺位详情
     * @param pointIds
     * @return
     */
    List<PointInfoDO> getPointListByIds(@Param("pointIds") List<Long> pointIds);

    /**
     * 获取推荐铺位分页
     * @param request
     * @return
     */
    Page<PointInfoDO> getRecommendPointList(@Param("request") RecommendPointPageRequest request);

    /**
     * 更新铺位的拓展经理
     * @param lineId
     * @param developmentManager
     * @return
     */
    Integer updateSelectedDevelopmentManager(@Param("lineId") Long lineId, @Param("developmentManager")String developmentManager);

    /**
     * 获取团队铺位
     * @param request
     * @return
     */
    Page<PointInfoDO> getTeamPointPage(@Param("request") AllPointPageRequest request);

    /**
     * 回收铺位
     * @param pointId
     * @return
     */
    Integer recyclePoint(@Param("pointId") Long pointId);

    /**
     * 根据shopId与lineId查找铺位信息
     * @param lineId
     * @param shopId
     * @return
     */
    PointInfoDO getDataByShopIdAndLineId(@Param("lineId") Long lineId,
                                         @Param("shopId") Long shopId);

    /**
     * 完善铺位信息
     * @param request
     * @return
     */
    Integer perfectPointInfo(@Param("request") PointInfoDO request);
}