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

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.smsProduct.vo.SmsProductPageReqVO;
import com.yc.ship.module.trade.dal.dataobject.smsProduct.SmsProductDO;
import org.apache.ibatis.annotations.Mapper;


/**
 * 短信发送配置关联 Mapper
 *
 * @author 管理员
 */
@Mapper
public interface SmsProductMapper extends BaseMapperX<SmsProductDO> {

    default PageResult<SmsProductDO> selectPage(SmsProductPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<SmsProductDO>()
                .eqIfPresent(SmsProductDO::getSmsSendId, reqVO.getSmsSendId())
                .eqIfPresent(SmsProductDO::getProductId, reqVO.getProductId())
                .eqIfPresent(SmsProductDO::getSmsTemplateId, reqVO.getSmsTemplateId())
                .betweenIfPresent(SmsProductDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(SmsProductDO::getId));
    }

}