package cn.iocoder.yudao.module.member.dal.mysql.invoiceinformation;


import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.member.controller.admin.invoiceinformation.vo.InvoiceInformationPageReqVO;
import cn.iocoder.yudao.module.member.dal.dataobject.invoiceinformation.InvoiceInformationDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 用户发票信息 Mapper
 *
 * @author 管理员
 */
@Mapper
public interface InvoiceInformationMapper extends BaseMapperX<InvoiceInformationDO> {

    default PageResult<InvoiceInformationDO> selectPage(InvoiceInformationPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<InvoiceInformationDO>()
                .likeIfPresent(InvoiceInformationDO::getName, reqVO.getName())
                .eqIfPresent(InvoiceInformationDO::getTaxNum, reqVO.getTaxNum())
                .eqIfPresent(InvoiceInformationDO::getUnitAddress, reqVO.getUnitAddress())
                .eqIfPresent(InvoiceInformationDO::getUserId, reqVO.getUserId())
                .eqIfPresent(InvoiceInformationDO::getPhoneNum, reqVO.getPhoneNum())
                .eqIfPresent(InvoiceInformationDO::getAccountBank, reqVO.getAccountBank())
                .eqIfPresent(InvoiceInformationDO::getBankNum, reqVO.getBankNum())
                .betweenIfPresent(InvoiceInformationDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(InvoiceInformationDO::getId));
    }

}