package com.ssm.mapper.system;


import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.ssm.model.system.SysMenu;
import com.ssm.model.system.SysMenuExample;

public interface SysMenuMapper {
    int countByExample(SysMenuExample example);

    int deleteByExample(SysMenuExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(SysMenu record);

    int insertSelective(SysMenu record);

    List<SysMenu> selectByExampleWithBLOBs(SysMenuExample example);

    SysMenu selectByPrimaryKey(Integer menuid);

    int updateByExampleSelective(@Param("record") SysMenu record, @Param("example") SysMenuExample example);

    int updateByExampleWithBLOBs(@Param("record") SysMenu record, @Param("example") SysMenuExample example);

    int updateByExample(@Param("record") SysMenu record, @Param("example") SysMenuExample example);

    int updateByPrimaryKeySelective(SysMenu record);

    int updateByPrimaryKeyWithBLOBs(SysMenu record);

	List<SysMenu> selectSysMenuWithBLOBsByPid(@Param("parentid")Integer parentid);

	List<SysMenu> selectBySysMenuWithBLOBs(SysMenu menu);

	Integer selectCountByParentid(@Param("parentid")Integer parentid);

	Integer selectMaxmenuIdByParentid(@Param("parentid")Integer parentid);

	List<SysMenu> selectAllpageMenus();

	SysMenu selectByMenuId(Integer menuid);

	List<SysMenu> selectFirstMenu();

	List<SysMenu> selectFirstMenuByParentId(int parentId);


	List<SysMenu> selectSysUserMenus(@Param("userid")Integer userid);

	List<SysMenu> selectMenusByPage(SysMenu menu);

	List<SysMenu> selectMenusByRoleId(Integer roleId);
	
	List<SysMenu> selectMenusLevelLT2ByRoleId(Integer roleId);

	List<SysMenu> selectButtonByRoleId(@Param("roleId")Integer roleId);

	List<SysMenu> selectPageMenusByRole(@Param("roleId")Integer roleId);

	List<SysMenu> selectChildMenusByPageMenuId(@Param("menuId")Integer menuId);

	List<SysMenu> selectButtonMenusByRole(@Param("roleId")Integer roleId);
	
	List<SysMenu> selectPageMenusByRoleId(@Param("roleId")Integer roleId);
	
	List<SysMenu> selectButtonMenusByRoleId(@Param("roleId")Integer roleId);

	List<SysMenu> selectBySysMenuWithBLOBs2(SysMenu menu);
	
	Integer selectMaxOrder();
	
	Integer selectMaxOrderUnderParent(@Param("parentId") Integer parentId);
	
	Integer selectMaxOrderIdUnderParent(@Param("parentId") Integer parentId);
	
	int updateOrderBy(@Param("orderBy") Integer orderBy);
	
	int updateOrderByCount(@Param("addNum") Integer addNum, @Param("orderBy") Integer orderBy);
	
	Integer countSonMenu(@Param("menuId") Integer menuId);
	
	Integer selectPrevOrder(@Param("level") Integer level, @Param("orderBy")Integer orderBy, @Param("parentId")Integer parentId);
	
	SysMenu selectMenuByOrderAndParent(@Param("orderBy")Integer orderBy, @Param("parentId")Integer parentId);
	
	List<SysMenu> selectMenuByOrderBy(@Param("orderBy")Integer orderBy);
	
	Integer selectNextOrder(@Param("level") Integer level, @Param("orderBy")Integer orderBy, @Param("parentId")Integer parentId);
	
	Integer selectNextLevel(@Param("level") Integer level, @Param("orderBy")Integer orderBy);
	
	Integer countAdd(@Param("from") Integer from, @Param("to")Integer to);
	
	List<SysMenu> addOrderBy(@Param("to") Integer to, @Param("from")Integer from);
	
	List<SysMenu> deleteOrderBy(@Param("from") Integer from, @Param("next")Integer next);
	
	SysMenu selectMenuByUrl(@Param("url") String url);
	
	Integer selectReByMenuIdAndRoleId(@Param("menuId") Integer menuId, @Param("roleId") Integer roleId);
}