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

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.resource.controller.admin.routepoint.vo.RoutePointPageReqVO;
import com.yc.ship.module.resource.dal.dataobject.routepoint.RoutePointDO;
import org.apache.ibatis.annotations.Mapper;


/**
 * 产品路线点位 Mapper
 *
 * @author 管理员
 */
@Mapper
public interface RoutePointMapper extends BaseMapperX<RoutePointDO> {

    default PageResult<RoutePointDO> selectPage(RoutePointPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<RoutePointDO>()
                .likeIfPresent(RoutePointDO::getName, reqVO.getName())
                .likeIfPresent(RoutePointDO::getShortName, reqVO.getShortName())
                .eqIfPresent(RoutePointDO::getLongitude, reqVO.getLongitude())
                .eqIfPresent(RoutePointDO::getLatitude, reqVO.getLatitude())
                .betweenIfPresent(RoutePointDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(RoutePointDO::getId));
    }

}