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

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.digftp.DigFtpSourceDO;
import org.apache.ibatis.annotations.Mapper;
import com.trs.digital.module.manager.controller.admin.digftp.vo.*;

/**
 * STF资源管理 Mapper
 *
 * @author Wakaka
 */
@Mapper
public interface DigFtpSourceMapper extends BaseMapperX<DigFtpSourceDO> {

    default PageResult<DigFtpSourceDO> selectPage(DigFtpSourcePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<DigFtpSourceDO>()
                .eqIfPresent(DigFtpSourceDO::getId, reqVO.getId())
                .betweenIfPresent(DigFtpSourceDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(DigFtpSourceDO::getDocTitle, reqVO.getDocTitle())
                .eqIfPresent(DigFtpSourceDO::getDocContent, reqVO.getDocContent())
                .eqIfPresent(DigFtpSourceDO::getDocContentTranslate, reqVO.getDocContentTranslate())
                .likeIfPresent(DigFtpSourceDO::getFileName, reqVO.getFileName())
                .eqIfPresent(DigFtpSourceDO::getFilePath, reqVO.getFilePath())
                .eqIfPresent(DigFtpSourceDO::getFileType, reqVO.getFileType())
                .betweenIfPresent(DigFtpSourceDO::getFileCrtime, reqVO.getFileCrtime())
                .betweenIfPresent(DigFtpSourceDO::getFileUpdatetime, reqVO.getFileUpdatetime())
                .eqIfPresent(DigFtpSourceDO::getDocLable, reqVO.getDocLable())
                .likeIfPresent(DigFtpSourceDO::getSourcename, reqVO.getSourcename())
                .eqIfPresent(DigFtpSourceDO::getLanguage, reqVO.getLanguage())
                .orderByDesc(DigFtpSourceDO::getId));
    }

}