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

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

/**
 * 短信发送配置 Mapper
 *
 * @author 管理员
 */
@Mapper
public interface SmsSendLogMapper extends BaseMapperX<SmsSendLogDO> {

    default PageResult<SmsSendLogDO> selectPage(SmsSendLogPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<SmsSendLogDO>()
                .eqIfPresent(SmsSendLogDO::getOrderNo, reqVO.getOrderNo())
                .eqIfPresent(SmsSendLogDO::getSmsConfigId, reqVO.getSmsConfigId())
                .eqIfPresent(SmsSendLogDO::getSmsContent, reqVO.getSmsContent())
                .eqIfPresent(SmsSendLogDO::getMobile, reqVO.getMobile())
                .betweenIfPresent(SmsSendLogDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(SmsSendLogDO::getStatus, reqVO.getStatus())
                .orderByDesc(SmsSendLogDO::getId));
    }

}