package com.yc.ship.module.resource.dal.mysql.ship;

import java.util.*;

import com.yc.ship.framework.common.pojo.PageResult;
import com.yc.ship.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.yc.ship.framework.mybatis.core.mapper.BaseMapperX;
import com.yc.ship.module.resource.dal.dataobject.ship.ResourceShipDO;
import org.apache.ibatis.annotations.Mapper;
import com.yc.ship.module.resource.controller.admin.ship.vo.*;

/**
 * 资源管理-游轮管理 Mapper
 *
 * @author fycloud
 */
@Mapper
public interface ResourceShipMapper extends BaseMapperX<ResourceShipDO> {

    default PageResult<ResourceShipDO> selectPage(ResourceShipPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ResourceShipDO>()
                .likeIfPresent(ResourceShipDO::getName, reqVO.getName())
                .eqIfPresent(ResourceShipDO::getCode, reqVO.getCode())
                .eqIfPresent(ResourceShipDO::getSupplierId, reqVO.getSupplierId())
                .eqIfPresent(ResourceShipDO::getShipTypeId, reqVO.getShipTypeId())
                .eqIfPresent(ResourceShipDO::getStatus, reqVO.getStatus())
                .orderByDesc(ResourceShipDO::getId));
    }

}