package com.ho.user.mapper;


import com.ho.common.tools.entity.SysPermission;
import com.ho.user.api.vo.req.QueryPermissionReqVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface SysPermissionMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(SysPermission record);

    int insertSelective(@Param("record") SysPermission record);

    SysPermission selectByPrimaryKey(Integer id);

    //查询单个记录
    SysPermission selectOneByCondition(SysPermission sysPermission);

    int updateByPrimaryKeySelective(SysPermission record);

    int updateByPrimaryKey(SysPermission record);

    //type是菜单类型
    //List<SysPermission> selectInfoByIds(@Param("ids") List<String> ids , @Param("type") Integer type);
    List<SysPermission> selectInfoByIds(@Param("query") QueryPermissionReqVo query,@Param("ids") List<Integer> ids );

    List<SysPermission> selectTopMenu();

    List<SysPermission> selectAll(@Param("query") QueryPermissionReqVo query,String enableStatus,String enableType);

    List<SysPermission> selectChild(Integer pid);
    //查询父id下的所有菜单
    List<SysPermission> selectChilds(List<Integer> pids);

    SysPermission selectByPerms(String perms);

    //通过pid 查询父级菜单
    SysPermission selectByPid(Integer pid);

    //其他id的perms数据
    SysPermission selectOtherByIdAndPerms(Integer id, String perms );


    List<SysPermission> selectByName(SysPermission selectByName);

    List<SysPermission> selectByScope();

    List<SysPermission> selectByIds(@Param("ids") List<Integer> perIds,@Param("lang") String lang);
}