package cn.iocoder.yudao.module.member.dal.mysql.appup;

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.member.controller.admin.appup.vo.AppUpPageReqVO;
import cn.iocoder.yudao.module.member.controller.app.appup.vo.AppAppUpPageReqVO;
import cn.iocoder.yudao.module.member.dal.dataobject.appup.AppUpDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * app更新 Mapper
 *
 * @author 管理员
 */
@Mapper
public interface AppUpMapper extends BaseMapperX<AppUpDO> {

    default PageResult<AppUpDO> selectPage(AppUpPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<AppUpDO>()
                .eqIfPresent(AppUpDO::getVersion, reqVO.getVersion())
                .eqIfPresent(AppUpDO::getType, reqVO.getType())
                .eqIfPresent(AppUpDO::getOldVersion, reqVO.getOldVersion())
                .eqIfPresent(AppUpDO::getRemarks, reqVO.getRemarks())
                .eqIfPresent(AppUpDO::getContent, reqVO.getContent())
                .eqIfPresent(AppUpDO::getFileUrl, reqVO.getFileUrl())
                .betweenIfPresent(AppUpDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(AppUpDO::getId));
    }

    default PageResult<AppUpDO> selectPage(AppAppUpPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<AppUpDO>()
                .eqIfPresent(AppUpDO::getVersion, reqVO.getVersion())
                .eqIfPresent(AppUpDO::getType, reqVO.getType())
                .eqIfPresent(AppUpDO::getOldVersion, reqVO.getOldVersion())
                .eqIfPresent(AppUpDO::getRemarks, reqVO.getRemarks())
                .eqIfPresent(AppUpDO::getContent, reqVO.getContent())
                .eqIfPresent(AppUpDO::getFileUrl, reqVO.getFileUrl())
                .betweenIfPresent(AppUpDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(AppUpDO::getId));
    }


}