package com.yc.ship.module.trade.dal.mysql.shipSaleRule;

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.trade.controller.admin.shipSaleRule.vo.ShipSaleRulePageReqVO;
import com.yc.ship.module.trade.dal.dataobject.shipSaleRule.ShipSaleRuleDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 时间规则配置 Mapper
 *
 * @author qsl
 */
@Mapper
public interface ShipSaleRuleMapper extends BaseMapperX<ShipSaleRuleDO> {

    default PageResult<ShipSaleRuleDO> selectPage(ShipSaleRulePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ShipSaleRuleDO>()
                .betweenIfPresent(ShipSaleRuleDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ShipSaleRuleDO::getId));
    }

}