package cn.iocoder.yudao.module.basic.dal.mysql.goodsverify;

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.basic.dal.dataobject.goodsverify.GoodsVerifyDO;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.basic.controller.admin.goodsverify.vo.*;
import org.apache.ibatis.annotations.Param;

/**
 * 商品认证 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface GoodsVerifyMapper extends BaseMapperX<GoodsVerifyDO> {

    default PageResult<GoodsVerifyDO> selectPage(GoodsVerifyPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<GoodsVerifyDO>()
                .likeIfPresent(GoodsVerifyDO::getGoodsName, reqVO.getGoodsName())
                .eqIfPresent(GoodsVerifyDO::getGoodsId, reqVO.getGoodsId())
                .likeIfPresent(GoodsVerifyDO::getVerifyName, reqVO.getVerifyName())
                .eqIfPresent(GoodsVerifyDO::getVerifyAgencies, reqVO.getVerifyAgencies())
                .betweenIfPresent(GoodsVerifyDO::getVerifyStartTime, reqVO.getVerifyStartTime())
                .betweenIfPresent(GoodsVerifyDO::getVerifyEndTime, reqVO.getVerifyEndTime())
                .eqIfPresent(GoodsVerifyDO::getVerifyDataUrl, reqVO.getVerifyDataUrl())
                .eqIfPresent(GoodsVerifyDO::getVerifyIsForver, reqVO.getVerifyIsForver())
                .betweenIfPresent(GoodsVerifyDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(GoodsVerifyDO::getBelongBusinessId, reqVO.getBelongBusinessId())
                .likeIfPresent(GoodsVerifyDO::getBelongBusinessName, reqVO.getBelongBusinessName())
                .orderByDesc(GoodsVerifyDO::getId));
    }

    IPage<GoodsVerifyDO> selectPageByInfo(IPage<GoodsVerifyDO> page, @Param(Constants.WRAPPER) Wrapper<GoodsVerifyDO> queryWrapper);
}
