package cn.iocoder.yudao.module.system.dal.mysql.permission;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.system.controller.admin.permission.vo.menu.MenuTenantRelatePageReqVO;
import cn.iocoder.yudao.module.system.dal.dataobject.permission.MenuTenantRelateDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 菜单租户关系 Mapper
 *
 * @author zhaopq
 */
@Mapper
public interface MenuTenantRelateMapper extends BaseMapperX<MenuTenantRelateDO> {

    default PageResult<MenuTenantRelateDO> selectPage(MenuTenantRelatePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<MenuTenantRelateDO>()
                .eqIfPresent(MenuTenantRelateDO::getMenuId, reqVO.getMenuId())
                .eqIfPresent(MenuTenantRelateDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(MenuTenantRelateDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(MenuTenantRelateDO::getId));
    }

}