package cn.ey.biz.module.system.dal.mapper.file;

import cn.ey.biz.common.pojo.PageResult;
import cn.ey.biz.framework.mybatis.core.mapper.BaseMapperX;
import cn.ey.biz.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.ey.biz.module.system.controller.admin.file.vo.file.FilePageReqVO;
import cn.ey.biz.module.system.dal.dataobject.file.FileDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 文件操作 Mapper
 *
 */
@Mapper
public interface FileMapper extends BaseMapperX<FileDO> {

    default PageResult<FileDO> selectPage(FilePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<FileDO>()
                .likeIfPresent(FileDO::getPath, reqVO.getPath())
                .likeIfPresent(FileDO::getType, reqVO.getType())
                .likeIfPresent(FileDO::getFileType,reqVO.getFileType())
                .betweenIfPresent(FileDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(FileDO::getCreateTime));
    }

}
