/*
 * Copyright (c) 2018-2999 广州亚米信息科技有限公司 All rights reserved.
 *
 * https://www.gz-yami.com/
 *
 * 未经允许，不可做商业用途！
 *
 * 版权所有，侵权必究！
 */

package com.yami.shop.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yami.shop.bean.model.Channel;
import com.yami.shop.bean.vo.ChannelVO;
import com.yami.shop.bean.vo.IdNameVo;
import com.yami.shop.common.util.PageParam;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 渠道管理Mapper接口
 */
public interface ChannelMapper extends BaseMapper<Channel> {

    /**
     * 通过渠道名称查询渠道
     * @param channelName 渠道名称
     * @return 渠道信息
     */
    Channel selectByName(@Param("channelName") String channelName);

    IPage<ChannelVO> statisticsPage(@Param("pageParam")PageParam pageParam, @Param("channel")Channel channel);

    List<IdNameVo> queryMyChannel(Long userId);

    /**
     * 更新拆单规则
     * @param splitRule 拆单规则
     */
    void updateSplitRule(Integer splitRule);
}
