package com.kiisoo.ic.store.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.kiisoo.ic.generalize.entity.CompanyStoreDO;
import com.kiisoo.ic.generalize.entity.ShopRegionDO;
import com.kiisoo.ic.store.entity.PoiStore;
import com.kiisoo.ic.system.entity.PrivilageUserDO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

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

/**
 * 账号  Mapper 接口
 *
 * @author jinchaofan
 * @since 2020-02-19
 */
@Repository
public interface PoiStoreDOMapper extends BaseMapper<PoiStore> {


    /**
     * 根据区域找到所有店铺
     *
     * @param regionId 区域id
     * @return
     */
    List<PoiStore> selectRegionShop(@Param("regionId") long regionId);

    PoiStore selectShopByName(@Param("name") String name);

    ShopRegionDO selectShopMsg(Long shopId);

    CompanyStoreDO selectCompanyStore(Long sellerId);

    List<PoiStore> selectShopByCompany(Long orgId);

    List<PoiStore> selectCustomerShopByCompany(Long orgId);

    List<PrivilageUserDO> selectSellerByShop(Long shopId);

    String selectStoreQrCode(@Param("shopId")Long shopId);
    List<PoiStore> selectShopByNameOrCode (@Param("name") String name);

    List<PoiStore> selectShopByCustomerIds(@Param("customerIds")List<Long> customerIds);

    /**
     * 查询全部的店铺
     * @return
     */
    List<CompanyStoreDO> selectAllCompanyStore();


    List<PoiStore> selectShopByCustomerIdAndStore(@Param("customerIds")List<Long> customerIds, @Param("storeId") Long storeId, @Param("code") String code);

    /**
     * 查省
     */
    String selectProvinceName(@Param("cityId")Long cityId);

    /**
     * 查询零售公司下的店铺
     *
     * @param orgId 零售公司id
     * @return 门店ID集合
     * @author dexiang.jiang
     * @date 2020/05/17 12:07
     */
    List<Long> selectShopIdByCustomerId(@Param("orgId")Long orgId);

}
