package cn.iocoder.yudao.module.system.dal.mysql.oa;

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.system.controller.admin.oa.IotOaCompanyPageReqVO;
import cn.iocoder.yudao.module.system.dal.dataobject.oa.IotOaCompanyDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * oa公司 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface IotOaCompanyMapper extends BaseMapperX<IotOaCompanyDO> {

    default PageResult<IotOaCompanyDO> selectPage(IotOaCompanyPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<IotOaCompanyDO>()
                .eqIfPresent(IotOaCompanyDO::getSubcompanydesc, reqVO.getSubcompanydesc())
                .eqIfPresent(IotOaCompanyDO::getSubcompanycode, reqVO.getSubcompanycode())
                .eqIfPresent(IotOaCompanyDO::getSupsubcomid, reqVO.getSupsubcomid())
                .eqIfPresent(IotOaCompanyDO::getOaId, reqVO.getOaId())
                .likeIfPresent(IotOaCompanyDO::getSubcompanyname, reqVO.getSubcompanyname())
                .eqIfPresent(IotOaCompanyDO::getShoworder, reqVO.getShoworder())
                .betweenIfPresent(IotOaCompanyDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(IotOaCompanyDO::getId));
    }

}
