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

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.site.vo.ScenicSitePageReqVO;
import com.yc.ship.module.resource.dal.dataobject.site.ScenicSiteDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 站点 Mapper
 *
 * @author 管理员
 */
@Mapper
public interface ScenicSiteMapper extends BaseMapperX<ScenicSiteDO> {

    default PageResult<ScenicSiteDO> selectPage(ScenicSitePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ScenicSiteDO>()
                .likeIfPresent(ScenicSiteDO::getName, reqVO.getName())
                .eqIfPresent(ScenicSiteDO::getSiteType, reqVO.getSiteType())
                .eqIfPresent(ScenicSiteDO::getIsUse, reqVO.getIsUse())
                .eqIfPresent(ScenicSiteDO::getSortNum, reqVO.getSortNum())
                .eqIfPresent(ScenicSiteDO::getLongitude, reqVO.getLongitude())
                .eqIfPresent(ScenicSiteDO::getLatitude, reqVO.getLatitude())
                .betweenIfPresent(ScenicSiteDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ScenicSiteDO::getId));
    }
    

}
