package cn.iocoder.yudao.module.pay.dal.mysql.dividecompany;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.pay.dal.dataobject.dividecompany.DivideCompanyDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.pay.controller.admin.dividecompany.vo.*;

/**
 * 分账公司 Mapper
 *
 * @author 管理员
 */
@Mapper
public interface DivideCompanyMapper extends BaseMapperX<DivideCompanyDO> {

    default PageResult<DivideCompanyDO> selectPage(DivideCompanyPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<DivideCompanyDO>()
                .likeIfPresent(DivideCompanyDO::getName, reqVO.getName())
                .eqIfPresent(DivideCompanyDO::getType, reqVO.getType())
                .eqIfPresent(DivideCompanyDO::getAccount, reqVO.getAccount())
                .eqIfPresent(DivideCompanyDO::getProportion, reqVO.getProportion())
                .betweenIfPresent(DivideCompanyDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(DivideCompanyDO::getId));
    }

}