package com.zt.plat.module.base.dal.mysql.base;

import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
import com.zt.plat.module.base.dal.dataobject.base.TaxDO;
import org.apache.ibatis.annotations.Mapper;
import com.zt.plat.module.base.controller.admin.base.vo.*;

/**
 * 税码信息 Mapper
 *
 * @author 后台管理-1
 */
@Mapper
public interface TaxMapper extends BaseMapperX<TaxDO> {

    default PageResult<TaxDO> selectPage(TaxPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<TaxDO>()
                .eqIfPresent(TaxDO::getType, reqVO.getType())
                .eqIfPresent(TaxDO::getCategory, reqVO.getCategory())
                .eqIfPresent(TaxDO::getTaxCoding, reqVO.getTaxCoding())
                .likeIfPresent(TaxDO::getRemark, reqVO.getRemark())
                .eqIfPresent(TaxDO::getTax, reqVO.getTax())
                .betweenIfPresent(TaxDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(TaxDO::getIsEnable, reqVO.getIsEnable())
                .likeIfPresent(TaxDO::getCustomerNumber, reqVO.getCustomerNumber())
                .likeIfPresent(TaxDO::getCustomerName, reqVO.getCustomerName())
                .orderByDesc(TaxDO::getId));
    }

}