package com.iailab.module.system.dal.mysql.app;
|
|
import com.iailab.framework.mybatis.core.mapper.BaseMapperX;
|
import com.iailab.framework.mybatis.core.query.LambdaQueryWrapperX;
|
import com.iailab.module.system.controller.admin.permission.vo.menu.MenuListReqVO;
|
import com.iailab.module.system.dal.dataobject.app.AppMenuDO;
|
import com.iailab.module.system.dal.dataobject.dept.DeptDO;
|
import org.apache.ibatis.annotations.Mapper;
|
|
import java.util.Collection;
|
import java.util.List;
|
|
@Mapper
|
public interface AppMenuMapper extends BaseMapperX<AppMenuDO> {
|
|
default AppMenuDO selectByParentIdAndName(Long parentId, String name) {
|
return selectOne(AppMenuDO::getParentId, parentId, AppMenuDO::getName, name);
|
}
|
|
default Long selectCountByParentId(Long parentId) {
|
return selectCount(AppMenuDO::getParentId, parentId);
|
}
|
|
default List<AppMenuDO> selectListByParentId(Collection<Long> parentIds) {
|
return selectList(AppMenuDO::getParentId, parentIds);
|
}
|
|
default List<AppMenuDO> selectList(MenuListReqVO reqVO) {
|
return selectList(new LambdaQueryWrapperX<AppMenuDO>()
|
.likeIfPresent(AppMenuDO::getName, reqVO.getName())
|
.eqIfPresent(AppMenuDO::getStatus, reqVO.getStatus()));
|
}
|
|
default List<AppMenuDO> selectListByPermission(String permission) {
|
return selectList(AppMenuDO::getPermission, permission);
|
}
|
}
|