package com.cool.store.mapper;

import com.cool.store.dto.MiniShopDTO;
import com.cool.store.dto.PCPointListDTO;
import com.cool.store.dto.PointInfoDTO;
import com.cool.store.dto.point.LineCountDTO;
import com.cool.store.dto.point.PointStatisticsDTO;
import com.cool.store.entity.PointInfoDO;
import com.cool.store.request.*;
import com.cool.store.vo.point.MiniPointPageVO;
import com.cool.store.vo.point.PointHomePageDataVO;
import com.cool.store.vo.point.PointMapVO;
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<PCPointListDTO> getMyPointPage(@Param("eid") String eid,@Param("request") PointPageRequest request);

    /**
     * 获取我的铺位
     * @param request
     * @return
     */
    Long getMyPointCount(@Param("eid") String eid, @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<PCPointListDTO> getRecommendPointList(@Param("request") RecommendPointPageRequest request);

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

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

    /**
     * 获取团队铺位数量
     * @param request
     * @return
     */
    Long getTeamPointCount(@Param("eid")String eid, @Param("request") AllPointPageRequest request);

    /**
     * 获取所有的铺位 地图
     * @param eid
     * @param request
     * @return
     */
    List<PointMapVO> getAllPointList(@Param("eid")String eid, @Param("request") PointMapRequest request);

    /**
     * 获取铺位统计数据
     * @param eid
     * @param request
     * @return
     */
    PointStatisticsDTO getTeamCount(@Param("eid")String eid, @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);

    /**
     * @Auther: wangshuo
     * @Date: 2025/3/31
     * @description:获取铺位部分数据
     */
    List<MiniPointPageVO> MiniPointPageVO(@Param("enterpriseId") String enterpriseId , @Param("request") MiniPointRequest request);

    /**
     * @Auther: wangshuo
     * @Date: 2025/4/2
     * @description:根据机会点code获取铺位信息
     */
    List<MiniPointPageVO> getPointByOpportunityPointCode(@Param("code") String code);

    /**
     * @Auther: wangshuo
     * @Date: 2025/4/2
     * @description:根据机会点code获取门店信息
     */
    List<MiniShopDTO> getShopByOpportunityPointCode(@Param("enterpriseId") String enterpriseId, @Param("code") String code);
    /**
     * @Auther: wangshuo
     * @Date: 2025/4/3
     * @description:获取全部可推荐铺位
     */
    List<MiniPointPageVO> getRecommendOrMyList(@Param("request") MiniPointRequest request);

    List<PointInfoDTO> getPointAndDetailByIds(@Param("pointIds") List<Long> pointIds);

    Integer updateAddress(List<PointInfoDO> list);
}