package cn.com.ty.lift.ud.operation.mapper;


import cn.com.ty.lift.ud.operation.mapper.entity.UserLevelRuleEntity;
import cn.com.ty.lift.ud.operation.mapper.entity.UserRebateRuleEntity;
import  com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * 用户等级规则;-Repository
 * 
 * @author Xson
 * @date 2020-05-06
 */
public interface UserLevelRuleMapper extends BaseMapper<UserLevelRuleEntity> {


    /**
     * 查询所有
     */
    @Select("select * from user_level_rule")
    List<UserLevelRuleEntity> selectAll();

    /**
     * 根据名称查询
     * @param name
     */
    @Select("select * from user_level_rule where name = #{name}")
    List<UserLevelRuleEntity> selectByName(String name);


    /**
     * 根据编码查询app角色ID
     * @param personVip
     * @return
     */
    @Select("select * from user_level_rule where  role_code = #{personVip} ")
    UserLevelRuleEntity getByCode(String personVip);

    /**
     * 获取所有的vip角色
     * @return
     */
    @Select("select * from user_level_rule  where vip_flag = 1")
    List<UserLevelRuleEntity> getVipUserLevel();

    /**
     * 获取所有的vip角色
     * @return
     */
    @Select("select * from user_level_rule  where  vip_flag = 1 ")
    List<UserLevelRuleEntity> getNotSetRole();
}
