689d66b1f2d88a00d683c82419c7dee313524aa2.svn-base 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. package org.jeecg.modules.system.mapper;
  2. import java.util.List;
  3. import org.apache.ibatis.annotations.Param;
  4. import org.apache.ibatis.annotations.Select;
  5. import org.apache.ibatis.annotations.Update;
  6. import org.jeecg.modules.system.entity.SysPermission;
  7. import org.jeecg.modules.system.model.TreeModel;
  8. import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  9. /**
  10. * <p>
  11. * 菜单权限表 Mapper 接口
  12. * </p>
  13. *
  14. * @Author scott
  15. * @since 2018-12-21
  16. */
  17. public interface SysPermissionMapper extends BaseMapper<SysPermission> {
  18. /**
  19. * 通过父菜单ID查询子菜单
  20. * @param parentId
  21. * @return
  22. */
  23. public List<TreeModel> queryListByParentId(@Param("parentId") String parentId);
  24. /**
  25. * 根据用户查询用户权限
  26. */
  27. public List<SysPermission> queryByUser(@Param("username") String username);
  28. /**
  29. * 修改菜单状态字段: 是否子节点
  30. */
  31. @Update("update sys_permission set is_leaf=#{leaf} where id = #{id}")
  32. public int setMenuLeaf(@Param("id") String id,@Param("leaf") int leaf);
  33. /**
  34. * 获取模糊匹配规则的数据权限URL
  35. */
  36. @Select("SELECT url FROM sys_permission WHERE del_flag = 0 and menu_type = 2 and url like '%*%'")
  37. public List<String> queryPermissionUrlWithStar();
  38. /**
  39. * 根据用户账号查询菜单权限
  40. * @param sysPermission
  41. * @param username
  42. * @return
  43. */
  44. public int queryCountByUsername(@Param("username") String username, @Param("permission") SysPermission sysPermission);
  45. }