package com.cool.store.mapper;

import com.cool.store.dto.FranchiseReportDTO;
import com.cool.store.dto.IsCreateStoreDTO;
import com.cool.store.dto.LicenseSyncDTO;
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.dto.point.ShopPointDTO;
import com.cool.store.entity.PointInfoDO;
import com.cool.store.entity.ShopInfoDO;
import com.cool.store.request.*;
import com.cool.store.response.MiniShopsResponse;
import com.cool.store.response.PlatformBuildListResponse;
import com.cool.store.vo.shop.StageShopCountVO;
import com.github.pagehelper.Page;
import io.swagger.models.auth.In;
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);

    List<ShopInfoDO> getShopListByRegion(@Param("lineId") Long lineId,@Param("list") List<Long> regions,@Param("userId") String userId);

    /**
     * 店铺信息
     *
     * @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);

    List<PreparationDTO> ListByBranchShopRequest(@Param("request") BranchShopRequest request,@Param("userId") String userId);

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

    ShopInfoDO selectByStoreNum(@Param("storeNum") String storeNum);

    ShopInfoDO selectByStoreCode(@Param("storeCode") String storeCode);
    /**
     * @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> selectShopListByUser(@Param("userId") String userId,@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);


    List<LicenseSyncDTO> getShopAndStoreList(@Param("enterpriseId") String eid , @Param("shopIds") List<Long> shopIds);


    List<ShopPointDTO> getShopPointListByDevelopmentManager(@Param("request") PointLinePageRequest request);

    /**
     * selectAllDataOrByShopId
     * @param
     * @return
     */
    List<ShopInfoDO> selectAllDataOrByLineId(@Param("lineId") Long lineId);

    Boolean batchUpdate(List<ShopInfoDO> list);

    List<ShopInfoDO> selectByLines (@Param("list") List<Long> list,@Param("regionIds") List<Long> regionIds);

    List<ShopInfoDO> getShopIdBySuccessOpen(@Param("eid") String eid);

     List<MiniShopsResponse> getShopListSuccessOpen(@Param("eid") String eid,@Param("lineId") Long lineId);

    String getOpenName(@Param("eid") String eid,@Param("shopId")Long shopId);

    Integer updateShopCode(@Param("shopCode") String shopCode,@Param("shopId") Long shopId);

    List<String> getShopCodeList(@Param("lineId") Long lineId);

    List<Long> getShopIdList(@Param("lineId") Long lineId);

    MiniShopsResponse currentShopWhetherOpen(@Param("shopId")Long shopId,@Param("eid")String eid);

    List<ShopInfoDO> getListByTime();

    Integer updateShopCity(@Param("list") List<ShopInfoDO> list);

    List<FranchiseReportDTO> getShopFranchiseReportList(@Param("request") FranchiseReportRequest request);

    List<IsCreateStoreDTO> selectIsCreateStore();
    Integer updateManagerRegionId(@Param("list") List<ShopInfoDO> shopList);
    Integer getNumByShopCode(@Param("shopCode") String shopCode);

    Integer updateHqtShopId(@Param("shopId") Long shopId,@Param("hqtShopId") String hqtShopId);

    List<ShopInfoDO> getPushHqtShopList();

}
