package com.csitc.module.system.dal.mysql.sms;

import com.csitc.framework.common.pojo.PageResult;
import com.csitc.framework.mybatis.core.mapper.BaseMapperX;
import com.csitc.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.csitc.module.system.controller.admin.sms.vo.channel.SmsChannelPageReqVO;
import com.csitc.module.system.dal.dataobject.sms.SmsChannelDO;
import org.apache.ibatis.annotations.Mapper;

@Mapper
public interface SmsChannelMapper extends BaseMapperX<SmsChannelDO> {

    default PageResult<SmsChannelDO> selectPage(SmsChannelPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<SmsChannelDO>()
                .likeIfPresent(SmsChannelDO::getSignature, reqVO.getSignature())
                .eqIfPresent(SmsChannelDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(SmsChannelDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(SmsChannelDO::getId));
    }

}
