package cn.pluss.platform.mapper;

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

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import cn.pluss.platform.entity.MerchantStore;
import cn.pluss.platform.vo.StoreInfoVO;
import cn.pluss.platform.vo.StoreSignVO;
import org.apache.ibatis.annotations.Param;

/**
 * @author djh
 */
@Mapper
public interface MerchantStoreMapper extends BaseMapper<MerchantStore> {

    default List<MerchantStore> queryMerchantStoreList(MerchantStore merchantStore) {
        QueryWrapper<MerchantStore> qWrapper = new QueryWrapper<>(merchantStore);
        qWrapper.orderByDesc("id");
        return selectList(qWrapper);
    }

    default MerchantStore getStoreByMerchantCode(String merchantCode){
        QueryWrapper<MerchantStore> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("merchantCode",merchantCode);
        return selectOne(queryWrapper);
    }

    List<MerchantStore> queryMerchantNoStoreList(MerchantStore merchantStore);

    List<MerchantStore> queryMerchantStorePage(Map<String, String> map);

    Integer queryMerchantStorePageCount(Map<String, String> map);

    Integer queryMerchantStoreNoPageCount(Map<String, String> map);
    
    /**
     * 供商户推广-商户列表  接口 使用
     * @param map
     * @return
     */
    List<MerchantStore> queryMerchantStorePageApp(Map<String, String> map);
    
    /**
     * 供商户推广-商户列表  接口 使用
     * @param map
     * @return
     */
    Integer queryMerchantStorePageCountApp(Map<String, String> map);
    
    /**
     * 
     * queryNewStoreListPage:(查询后台门店信息展示列表). <br/> 
     *
     * @author Administrator 
     * @param map
     * @return 
     * @since JDK 1.8
     */
    List<List<?>> queryNewStoreListPage(Map<String, Object> map);

    /**
     * 
     * queryStoreSignList:(门店签约信息). <br/> 
     *
     * @author Administrator 
     * @param map
     * @return 
     * @since JDK 1.8
     */
    List<StoreSignVO> queryStoreSignList(Map<String, Object> map);

    void disableMerchantStore(Map<String, Object> params);

    void pesUpdateMerchantStore(Map<String,Object> params);

    StoreInfoVO selectStatus(Map<String, Object> params);

    void operatMarketMerchantStore(Map<String, Object> params);

    StoreInfoVO showMerchantStoreReceipt(Integer userId);

    /**
     * 后台商户管理列表分页查询
     * @param page
     * @param wrapper
     * @return
     */
    Page<StoreInfoVO> selectPage2(Page<MerchantStore> page, @Param(value = Constants.WRAPPER) Wrapper<MerchantStore> wrapper);
}

