package cn.wisenergy.mapper;

import cn.wisenergy.model.app.MemberPercent;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

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

/**
 * @author 86187
 */
public interface MemberPercentMapper extends BaseMapper<MemberPercent> {
    /**
     * 保存
     * @param memberPercent 入参
     * @return 1
     */
    int add(MemberPercent memberPercent);

    /**
     * 编辑
     *
     * @param memberPercent 入参
     * @return 1
     */
    int edit(MemberPercent memberPercent);

    /**
     * 删除
     *
     * @param id 主键id
     * @return 1
     */
    int delById(@Param("id") Integer id);

    /**
     *  获取等级 某个类型的比列
     * @param userLevel 会员等级
     * @param type 类型
     * @return 返佣比例
     */
    MemberPercent getByLevelAndType(@Param("userLevel") Integer userLevel, @Param("type") Integer type);


    /**
     * 统计条数
     * @return 条数
     */
    int count();

    /**
     * 获取会员优惠比列
     * @param map 参数条件
     * @return 列表
     */
    List<MemberPercent> getList(Map<String,Object> map);
}