package com.yc.ship.module.otc.dal.mysql.link;

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.otc.controller.admin.link.vo.LinkPageReqVO;
import com.yc.ship.module.otc.dal.dataobject.link.LinkDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 链接管理 Mapper
 *
 * @author 管理员
 */
@Mapper
public interface LinkMapper extends BaseMapperX<LinkDO> {

    default PageResult<LinkDO> selectPage(LinkPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<LinkDO>()
                .likeIfPresent(LinkDO::getLinkName, reqVO.getLinkName())
                .eqIfPresent(LinkDO::getContent, reqVO.getContent())
                .betweenIfPresent(LinkDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(LinkDO::getId));
    }

}
