package com.cool.store.mapper;

import com.cool.store.dto.Preparation.PreparationDTO;
import com.cool.store.dto.openPreparation.OpenPlanShopInfoDTO;
import com.cool.store.dto.point.LineCountDTO;
import com.cool.store.entity.PointInfoDO;
import com.cool.store.entity.ShopInfoDO;
import com.cool.store.request.PlanListRequest;
import com.cool.store.request.PreparationRequest;
import com.cool.store.request.platformBuildListRequest;
import com.cool.store.response.PlatformBuildListResponse;
import com.cool.store.vo.shop.StageShopCountVO;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

public interface ShopInfoMapper extends Mapper<ShopInfoDO> {


    /**
     * 批量新增
     *
     * @param shopInfoList
     * @return
     */
    Integer batchAddShop(@Param("shopInfoList") List<ShopInfoDO> shopInfoList);

    /**
     * 获取加盟商的店铺列表
     *
     * @param lineId
     * @return
     */
    List<ShopInfoDO> getShopList(@Param("lineId") Long lineId);

    /**
     * 店铺信息
     *
     * @param lineId
     * @param pointId
     * @return
     */
    ShopInfoDO getShopInfoByPointId(@Param("lineId") Long lineId, @Param("pointId") Long pointId);

    /**
     * 获取各个阶段店铺数量
     *
     * @param lineId
     * @return
     */
    StageShopCountVO getStageShopCount(@Param("lineId") Long lineId);

    /**
     * 解绑店铺
     *
     * @param shopId
     * @return
     */
    Integer unbindPoint(@Param("shopId") Long shopId);

    /**
     * 批量获取铺位
     *
     * @param shopIds
     * @return
     */
    List<ShopInfoDO> getShopListByIds(@Param("shopIds") List<Long> shopIds);

    /**
     * @Auther: wangshuo
     * @Date: 2024/4/25
     * @description: 根据idlist 获取storenum
     */
    List<OpenPlanShopInfoDTO> queryStoreNumeListByid(@Param("shopIdList") List<Long> shopIdList);

    List<LineCountDTO> getSelectedShopNum(@Param("lineIds") List<Long> lineIds);


    List<PreparationDTO> ListByCondition(@Param("request") PreparationRequest request);

    Long getRegionIdByid(@Param("shopId") Long shopId);

    ShopInfoDO selectByStoreNum(@Param("storeNum") String storeNum);
    /**
     * @Auther: wangshuo
     * @Date: 2024/5/3
     * @description:根据区域id查询所有处于XXX的店铺
     */
    List<ShopInfoDO> selectShopListByRegionId(@Param("regionIds") List<Long> regionIds,@Param("shopSubStage") Integer shopSubStage,@Param("subStageStatus")List<Integer> subStageStatus,@Param("keyWord")String keyWord);


    List<ShopInfoDO> selectByIdOrSelectAll(@Param("shopId") Long shopId);

    List<PlatformBuildListResponse> platformBuildList(@Param("list") List<Long> regionIds,@Param("request") platformBuildListRequest request);
}
