package cn.iocoder.yudao.module.server.dal.mysql.materialshareuser;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.server.dal.dataobject.materialshareuser.MaterialShareUserDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.server.controller.admin.materialshareuser.vo.*;

/**
 * 资料共享用户 Mapper
 *
 * @author TRS
 */
@Mapper
public interface MaterialShareUserMapper extends BaseMapperX<MaterialShareUserDO> {

    default PageResult<MaterialShareUserDO> selectPage(MaterialShareUserPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<MaterialShareUserDO>()
                .eqIfPresent(MaterialShareUserDO::getMaterialId, reqVO.getMaterialId())
                .eqIfPresent(MaterialShareUserDO::getUserId, reqVO.getUserId())
                .betweenIfPresent(MaterialShareUserDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(MaterialShareUserDO::getId));
    }

}