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 { 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 selectListByParentId(Collection parentIds) { return selectList(AppMenuDO::getParentId, parentIds); } default List selectList(MenuListReqVO reqVO) { return selectList(new LambdaQueryWrapperX() .likeIfPresent(AppMenuDO::getName, reqVO.getName()) .eqIfPresent(AppMenuDO::getStatus, reqVO.getStatus())); } default List selectListByPermission(String permission) { return selectList(AppMenuDO::getPermission, permission); } }