package com.cico.nest.lcdp.boot.core.system.dal.mysql.mail;

import com.cico.nest.lcdp.boot.core.system.controller.admin.mail.vo.account.MailAccountPageReqVO;
import com.cico.nest.lcdp.boot.core.system.dal.dataobject.mail.MailAccountDO;
import com.cico.nest.lcdp.framework.common.pojo.PageResult;
import com.cico.nest.lcdp.framework.mybatis.core.mapper.BaseMapperX;
import com.cico.nest.lcdp.framework.mybatis.core.query.LambdaQueryWrapperX;
import org.apache.ibatis.annotations.Mapper;

@Mapper
public interface MailAccountMapper extends BaseMapperX<MailAccountDO> {

    default PageResult<MailAccountDO> selectPage(MailAccountPageReqVO pageReqVO) {
        return selectPage(pageReqVO, new LambdaQueryWrapperX<MailAccountDO>()
                .likeIfPresent(MailAccountDO::getMail, pageReqVO.getMail())
                .likeIfPresent(MailAccountDO::getUsername , pageReqVO.getUsername()));
    }

}
