package com.trs.digital.module.manager.dal.mysql.oracle;

import java.util.*;

import com.trs.digital.framework.common.pojo.PageResult;
import com.trs.digital.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.trs.digital.framework.mybatis.core.mapper.BaseMapperX;
import com.trs.digital.module.manager.dal.dataobject.oracle.OracleResourceDO;
import org.apache.ibatis.annotations.Mapper;
import com.trs.digital.module.manager.controller.admin.oracle.vo.*;

/**
 * oracle资源库管理 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface OracleResourceMapper extends BaseMapperX<OracleResourceDO> {

    default PageResult<OracleResourceDO> selectPage(OracleResourcePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<OracleResourceDO>()
                .eqIfPresent(OracleResourceDO::getId, reqVO.getId())
                .eqIfPresent(OracleResourceDO::getRemark, reqVO.getRemark())
                .eqIfPresent(OracleResourceDO::getCreator, reqVO.getCreator())
                .betweenIfPresent(OracleResourceDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(OracleResourceDO::getDocTitle, reqVO.getDocTitle())
                .eqIfPresent(OracleResourceDO::getDocContent, reqVO.getDocContent())
                .eqIfPresent(OracleResourceDO::getDocContentTranslate, reqVO.getDocContentTranslate())
                .eqIfPresent(OracleResourceDO::getDocEditer, reqVO.getDocEditer())
                .likeIfPresent(OracleResourceDO::getFileName, reqVO.getFileName())
                .eqIfPresent(OracleResourceDO::getFilePath, reqVO.getFilePath())
                .eqIfPresent(OracleResourceDO::getFileType, reqVO.getFileType())
                .betweenIfPresent(OracleResourceDO::getFileCrtime, reqVO.getFileCrtime())
                .betweenIfPresent(OracleResourceDO::getFileUpdatetime, reqVO.getFileUpdatetime())
                .eqIfPresent(OracleResourceDO::getDocLable, reqVO.getDocLable())
                .eqIfPresent(OracleResourceDO::getSourcename, reqVO.getSourcename())
                .eqIfPresent(OracleResourceDO::getLanguage, reqVO.getLanguage())
                .eqIfPresent(OracleResourceDO::getFileYear, reqVO.getFileYear())
                .eqIfPresent(OracleResourceDO::getDocid, reqVO.getDocid())
                .orderByDesc(OracleResourceDO::getId));
    }

}