package com.yc.ship.module.product.dal.mysql.spuship;

import com.yc.ship.framework.common.pojo.PageResult;
import com.yc.ship.framework.mybatis.core.mapper.BaseMapperX;
import com.yc.ship.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.yc.ship.module.product.controller.admin.spuship.vo.SpuShipPageReqVO;
import com.yc.ship.module.product.dal.dataobject.spuship.SpuShipDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 产品游船 Mapper
 *
 * @author lsq
 */
@Mapper
public interface SpuShipMapper extends BaseMapperX<SpuShipDO> {

    default PageResult<SpuShipDO> selectPage(SpuShipPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<SpuShipDO>()
                .eqIfPresent(SpuShipDO::getShipId, reqVO.getShipId())
                .betweenIfPresent(SpuShipDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(SpuShipDO::getId));
    }

}