医院废弃物信息化管理平台
“mitao”
2025-12-24 3763145f34d7706923d55edc32f5cfbc8bc08b92
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package cn.besteam.modules.system.mapper;
 
import cn.besteam.modules.system.entity.SysPermission;
import cn.besteam.modules.system.vo.TreeModel;
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;
 
/**
 * @Description: 菜单权限
 * @author: besteam
 * @date: 2020-04-17
 * @version: V1.0
 */
public interface SysPermissionMapper extends BaseMapper<SysPermission> {
 
    /**
     * 通过父菜单ID查询子菜单
     *
     * @param parentId
     * @return
     */
    public List<TreeModel> queryListByParentId(@Param("parentId") Integer parentId);
 
    /**
     * 根据用户查询用户权限
     */
    public List<SysPermission> queryByUser(@Param("username") String username);
 
    /**
     * 修改菜单状态字段: 是否子节点
     */
    @Update("update sys_permission set is_leaf=#{leaf} where id = #{id}")
    public int setMenuLeaf(@Param("id") Integer id, @Param("leaf") int leaf);
 
    /**
     * 获取模糊匹配规则的数据权限URL
     */
    @Select("SELECT url FROM sys_permission WHERE del_flag = 0 and menu_type = 2 and url like '%*%'")
    public List<String> queryPermissionUrlWithStar();
 
}