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

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.storescheduling.vo.StoreSchedulingPageReqVO;
import com.yc.ship.module.otc.dal.dataobject.storescheduling.StoreSchedulingDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 班次管理 Mapper
 *
 * @author 管理员
 */
@Mapper
public interface StoreSchedulingMapper extends BaseMapperX<StoreSchedulingDO> {

    default PageResult<StoreSchedulingDO> selectPage(StoreSchedulingPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<StoreSchedulingDO>()
                .likeIfPresent(StoreSchedulingDO::getName, reqVO.getName())
                .betweenIfPresent(StoreSchedulingDO::getStartTime, reqVO.getStartTime())
                .betweenIfPresent(StoreSchedulingDO::getEndTime, reqVO.getEndTime())
                .betweenIfPresent(StoreSchedulingDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(StoreSchedulingDO::getId));
    }

}
