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

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


/**
 * 产品检票通道 Mapper
 *
 * @author 管理员
 */
@Mapper
public interface CheckChannelMapper extends BaseMapperX<CheckChannelDO> {

    default PageResult<CheckChannelDO> selectPage(CheckChannelPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<CheckChannelDO>()
                .eqIfPresent(CheckChannelDO::getProductId, reqVO.getProductId())
                .eqIfPresent(CheckChannelDO::getChannelId, reqVO.getChannelId())
                .eqIfPresent(CheckChannelDO::getCheckTimes, reqVO.getCheckTimes())
                .betweenIfPresent(CheckChannelDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(CheckChannelDO::getId));
    }

}