houzhongjian
2024-10-16 7da8f196dee8e3c526c009a4bc7f5983ece6bb97
提交 | 用户 | 时间
818a01 1 package com.iailab.module.system.dal.mysql.app;
H 2
3 import com.iailab.framework.mybatis.core.mapper.BaseMapperX;
4 import com.iailab.framework.mybatis.core.query.LambdaQueryWrapperX;
5 import com.iailab.module.system.controller.admin.permission.vo.menu.MenuListReqVO;
6 import com.iailab.module.system.dal.dataobject.app.AppMenuDO;
7 import com.iailab.module.system.dal.dataobject.dept.DeptDO;
8 import org.apache.ibatis.annotations.Mapper;
9
10 import java.util.Collection;
11 import java.util.List;
12
13 @Mapper
14 public interface AppMenuMapper extends BaseMapperX<AppMenuDO> {
15
16     default AppMenuDO selectByParentIdAndName(Long parentId, String name) {
17         return selectOne(AppMenuDO::getParentId, parentId, AppMenuDO::getName, name);
18     }
19
20     default Long selectCountByParentId(Long parentId) {
21         return selectCount(AppMenuDO::getParentId, parentId);
22     }
23
24     default List<AppMenuDO> selectListByParentId(Collection<Long> parentIds) {
25         return selectList(AppMenuDO::getParentId, parentIds);
26     }
27
28     default List<AppMenuDO> selectList(MenuListReqVO reqVO) {
29         return selectList(new LambdaQueryWrapperX<AppMenuDO>()
30                 .likeIfPresent(AppMenuDO::getName, reqVO.getName())
31                 .eqIfPresent(AppMenuDO::getStatus, reqVO.getStatus()));
32     }
33
34     default List<AppMenuDO> selectListByPermission(String permission) {
35         return selectList(AppMenuDO::getPermission, permission);
36     }
37 }